NCEPLIBS-g2c
1.8.0
|
Returns grid template information for a specified Grid Definition Template for Section 3 - the Grid Definition Section (GDS). More...
#include "grib2_int.h"
Go to the source code of this file.
Functions | |
gtemplate * | extgridtemplate (g2int number, g2int *template) |
This subroutine generates the remaining octet map for a given Grid Definition Template, if required. More... | |
int | g2c_get_grid_template (int grid_template_num, int *maplen, int *map, int *needext) |
Get grid template information. More... | |
int | g2c_get_grid_template_extension (int grid_template_num, int *template, int *extlen, int *ext) |
Get grid template extension information. More... | |
static g2int | getgridindex (g2int number) |
This function returns the index of specified Grid Definition Template in array templates for [Section 3 - the Grid Definition Section (GDS)](https://www.nco.ncep.noaa.gov/pmb/docs/grib2/grib2_doc/grib2_sect3.shtml). More... | |
gtemplate * | getgridtemplate (g2int number) |
This subroutine returns grid template information for a specified Grid Definition Template for [Section 3 - the Grid Definition Section (GDS)](https://www.nco.ncep.noaa.gov/pmb/docs/grib2/grib2_doc/grib2_sect3.shtml). More... | |
Variables | |
static const struct gridtemplate | templatesgrid [G2C_MAX_GDS_TEMPLATE] |
Templates grid. More... | |
Returns grid template information for a specified Grid Definition Template for Section 3 - the Grid Definition Section (GDS).
Each Template has three parts:
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).
Date | Programmer | Comments |
---|---|---|
2001-06-28 | Gilbert | Initial |
2007-08-16 | Vuong | Added GDT 3.204 Curvilinear Orthogonal Grid |
2008-07-08 | Vuong | Added GDT 3.32768 Rotate Lat/Lon E-grid (Arakawa) |
2009-01-14 | Vuong | Changed structure name template to gtemplate |
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 |
2022-10-16 | Hartnett | Added g2c_get_grid_template(). |
Definition in file gridtemplates.c.
This subroutine generates the remaining octet map for a given Grid Definition Template, if required.
Some Templates can vary depending on data values given in an earlier part of the Template, and it is necessary to know some of the earlier entry values to generate the full octet map of the Template.
This function allocates memory for the extension. The pointer ext in the gtemplate struct must be freed to prevent memory leaks.
number | The number of the Grid Definition Template that is being requested. |
template | The grid definition template array. |
Definition at line 226 of file gridtemplates.c.
References getgridindex(), and getgridtemplate().
Referenced by g2_addgrid(), g2_unpack3(), and g2c_get_grid_template_extension().
int g2c_get_grid_template | ( | int | grid_template_num, |
int * | maplen, | ||
int * | map, | ||
int * | needext | ||
) |
Get grid template information.
The grid template consists of a template map, its length, and, for some templates, an extra extension map, and its length. If an extension is needed, use g2c_get_grid_template_extension() to get it.
grid_template_num | The grid template number. |
maplen | Pointer that gets the length of the map. Ignored if NULL. |
map | Pointer that gets the map as an array of int. Memory must be allocated by caller. Ignored if NULL. |
needext | Pointer that a non-zero value if an extension to this template is needed. Ignored if NULL. |
Definition at line 376 of file gridtemplates.c.
References G2C_ENOTEMPLATE, G2C_MAX_GDS_TEMPLATE, G2C_NOERROR, and templatesgrid.
Referenced by g2c_rw_section3_metadata().
int g2c_get_grid_template_extension | ( | int | grid_template_num, |
int * | template, | ||
int * | extlen, | ||
int * | ext | ||
) |
Get grid template extension information.
grid_template_num | The grid template number. |
template | Pointer to array that contains the template values. |
extlen | Pointer that gets the length of the extension. Ignored if NULL. |
ext | Pointer that gets template extension array, if there is one. Memory must be allocated by the caller. Ignored if NULL. |
Definition at line 301 of file gridtemplates.c.
References gtemplate::ext, extgridtemplate(), gtemplate::extlen, G2C_EINVAL, G2C_ENOMEM, G2C_ENOTEMPLATE, G2C_MAX_GDS_TEMPLATE, G2C_NOERROR, and templatesgrid.
This function returns the index of specified Grid Definition Template in array templates for [Section 3 - the Grid Definition Section (GDS)](https://www.nco.ncep.noaa.gov/pmb/docs/grib2/grib2_doc/grib2_sect3.shtml).
number | The number of the Grid Definition Template being requested. |
Definition at line 140 of file gridtemplates.c.
References G2C_MAX_GDS_TEMPLATE, and templatesgrid.
Referenced by extgridtemplate(), and getgridtemplate().
This subroutine returns grid template information for a specified Grid Definition Template for [Section 3 - the Grid Definition Section (GDS)](https://www.nco.ncep.noaa.gov/pmb/docs/grib2/grib2_doc/grib2_sect3.shtml).
The number of entries in the template is returned along with a map of the number of octets occupied by each entry. Also, a flag is returned to indicate whether the template would need to be extended.
This function allocates storage for the template. The returned pointer must be freed by the caller.
number | The number of the Grid Definition Template that is being requested. |
Definition at line 178 of file gridtemplates.c.
References getgridindex(), and templatesgrid.
Referenced by extgridtemplate(), g2_addgrid(), and g2_unpack3().
|
static |
Templates grid.
Definition at line 1 of file gridtemplates.c.
Referenced by g2c_get_grid_template(), g2c_get_grid_template_extension(), getgridindex(), and getgridtemplate().