NCEPLIBS-g2c  1.6.4
gridtemplates.h File Reference

This header file contains info on all the available GRIB2 Grid Definition Templates used in Section 3 (GDS). More...

#include "grib2.h"

Go to the source code of this file.

Data Structures

struct  gridtemplate
 Struct for grid template. More...
 

Macros

#define MAXGRIDMAPLEN   200
 Maximum template map length. More...
 
#define MAXGRIDTEMP   31
 Maximum number of templates. More...
 

Variables

const struct gridtemplate templatesgrid [MAXGRIDTEMP]
 Templates grid. More...
 

Detailed Description

This header file contains info on all the available GRIB2 Grid Definition Templates used in Section 3 (GDS).

Each Template has three parts:

  1. The number of entries in the template (mapgridlen).
  2. A map of the template (mapgrid), 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 3.120 as an example).

Note
Array mapgrid contains the number of octets in which the corresponding template values will be stored. A negative value in mapgrid 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 mapgrid 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 mapgrid.

Program History Log

Date Programmer Comments
2001-10-26 Gilbert Initial
2007-08-16 Vuong Added GDT 3.204 Curvilinear Orthogonal Grid
2008-07-08 Vuong Added GDT 3.32768 Rot Lat/Lon E-grid (Arakawa)
2010-05-11 Vuong Added GDT 3.32769 Rotate Lat/Lon Non-E Staggered grid (Arakawa)
2013-08-06 Vuong Added GDT 3.4, 3.5, 3.12, 3.101, 3.140
Author
Stephen Gilbert
Date
2001-10-26

Definition in file gridtemplates.h.


Data Type Documentation

◆ gridtemplate

struct gridtemplate

Struct for grid template.

Definition at line 49 of file gridtemplates.h.

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

Macro Definition Documentation

◆ MAXGRIDMAPLEN

#define MAXGRIDMAPLEN   200

Maximum template map length.

Definition at line 44 of file gridtemplates.h.

◆ MAXGRIDTEMP

#define MAXGRIDTEMP   31

Maximum number of templates.

Definition at line 43 of file gridtemplates.h.

Variable Documentation

◆ templatesgrid

const struct gridtemplate templatesgrid[MAXGRIDTEMP]

Templates grid.

Definition at line 1 of file gridtemplates.h.

Referenced by getgridindex(), and getgridtemplate().