1 #ifndef _gridtemplates_H
2 #define _gridtemplates_H
3 #include "grib2.h"
4 
5 //   PRGMMR: Gilbert         ORG: W/NP11    DATE: 2001-10-26
6 //
7 // ABSTRACT: This Fortran Module contains info on all the available
8 //   GRIB2 Grid Definition Templates used in Section 3 (GDS).
9 //   The information decribing each template is stored in the
10 //   gridtemplate structure defined below.
11 //
12 //   Each Template has three parts: The number of entries in the template
13 //   (mapgridlen);  A map of the template (mapgrid), which contains the
14 //   number of octets in which to pack each of the template values; and
15 //   a logical value (needext) that indicates whether the Template needs
16 //   to be extended.  In some cases the number of entries in a template
17 //   can vary depending upon values specified in the "static" part of
18 //   the template.  ( See Template 3.120 as an example )
19 //
20 //   NOTE:  Array mapgrid contains the number of octets in which the
21 //   corresponding template values will be stored.  A negative value in
22 //   mapgrid is used to indicate that the corresponding template entry can
23 //   contain negative values.  This information is used later when packing
24 //   (or unpacking) the template data values.  Negative data values in GRIB
25 //   are stored with the left most bit set to one, and a negative number
26 //   of octets value in mapgrid[] indicates that this possibility should
27 //   be considered.  The number of octets used to store the data value
28 //   in this case would be the absolute value of the negative value in
29 //   mapgrid[].
30 //
31 //
32 ////////////////////////////////////////////////////////////////////
33 
34       #define MAXGRIDTEMP 23              // maximum number of templates
35       #define MAXGRIDMAPLEN 200           // maximum template map length
36 
37       struct gridtemplate
38       {
39           g2int template_num;
40           g2int mapgridlen;
41           g2int needext;
42           g2int mapgrid[MAXGRIDMAPLEN];
43       };
44 
45 
46 const struct gridtemplate *get_templatesgrid();
47 g2int getgridindex(g2int number);
48 
49 #endif  /*  _gridtemplates_H  */
50