NCEPLIBS-g2c  1.6.4
pdstemplates.h File Reference

This include file contains info on all the available GRIB2 Product Definition Templates used in [Section 4 - the Product Definition Section (PDS)](https://www.nco.ncep.noaa.gov/pmb/docs/grib2/grib2_doc/grib2_sect4.shtml). More...

#include "grib2.h"

Go to the source code of this file.

Data Structures

struct  pdstemplate
 Struct for PDS template. More...
 

Macros

#define MAXPDSMAPLEN   200
 Maximum template map length. More...
 
#define MAXPDSTEMP   47
 Maximum number of templates. More...
 

Variables

const struct pdstemplate templatespds [MAXPDSTEMP]
 Date for struct for PDS template. More...
 

Detailed Description

This include file contains info on all the available GRIB2 Product Definition Templates used in [Section 4 - the Product Definition Section (PDS)](https://www.nco.ncep.noaa.gov/pmb/docs/grib2/grib2_doc/grib2_sect4.shtml).

Each Template has three parts:

  1. The number of entries in the template (mappdslen).
  2. A map of the template (mappds), which contains the number of octets in which to pack each of the template values.
  3. A logical value (needext) that indicates whether the Template needs to be extended. In some cases the number of entries in a template can vary depending upon values specified in the "static" part of the template. (See Template 4.3 as an example).
Note
Array mappds contains the number of octets in which the corresponding template values will be stored. A negative value in mappds is used to indicate that the corresponding template entry can contain negative values. This information is used later when packing (or unpacking) the template data values. Negative data values in GRIB are stored with the left most bit set to one, and a negative number of octets value in mappds[] indicates that this possibility should be considered. The number of octets used to store the data value in this case would be the absolute value of the negative value in mappds.

Program History Log

Date Programmer Comments
2005-12-08 Gilbert Allow negative scale factors, limits for 4.5 and 4.9
2009-12-15 Vuong Added Product Definition Templates 4.31, 4.15
2010-08-03 Vuong Added Product Definition Template 4.40,4.41,4.42,4.43
2010-12-08 Vuong Corrected Definition Template 4.42,4.43
2010-12-08 Vuong Corrected Definition Template 4.42,4.43
2012-03-29 Vuong Added Templates 4.44,4.45,4.46,4.47,4.48,4.50,4.51,4.91,4.32 and 4.52
2013-08-05 Vuong Corrected 4.91 and added Templates 4.33,4.34,4.53,4.54
2015-10-07 Vuong Added Templates 4.57, 4.60, 4.61 and allow a forecast time to be negative
Author
Stephen Gilbert
Date
2005-12-08

Definition in file pdstemplates.h.


Data Type Documentation

◆ pdstemplate

struct pdstemplate

Struct for PDS template.

Definition at line 53 of file pdstemplates.h.

Data Fields
g2int mappds[MAXPDSMAPLEN] Number of bytes for each template value.
g2int mappdslen The number of entries in the template.
g2int needext Does template need extension?
g2int template_num Template number.

Macro Definition Documentation

◆ MAXPDSMAPLEN

#define MAXPDSMAPLEN   200

Maximum template map length.

Definition at line 48 of file pdstemplates.h.

◆ MAXPDSTEMP

#define MAXPDSTEMP   47

Maximum number of templates.

Definition at line 47 of file pdstemplates.h.

Variable Documentation

◆ templatespds

const struct pdstemplate templatespds[MAXPDSTEMP]

Date for struct for PDS template.

Definition at line 1 of file pdstemplates.h.

Referenced by getpdsindex(), and getpdstemplate().