NCEPLIBS-g2
3.5.0
|
This Fortran module contains info on all the available GRIB2 Grid Definition Templates used in [Section 3 - the Grid Definition Section (GDS)](https://www.nco.ncep.noaa.gov/pmb/docs/grib2/grib2_doc/grib2_sect3.shtml). More...
Data Types | |
type | gridtemplate |
Functions/Subroutines | |
subroutine | extgridtemplate (number, list, nummap, map) |
Generate the remaining octet map for a given Grid Definition Template, if required. More... | |
integer function | getgdtlen (number) |
This function returns the initial length (number of entries) in the static part of specified Grid Definition Template. More... | |
integer function | getgridindex (number) |
Return the index of specified Grid Definition Template. More... | |
subroutine | getgridtemplate (number, nummap, map, needext, iret) |
Get the grid template information for a specified Grid Definition Template. More... | |
Variables | |
integer, parameter | maxlen = 200 |
maximum number of octets in mapgrid More... | |
integer, parameter | maxtemp = 31 |
maximum number of entries in the template More... | |
type(gridtemplate), dimension(maxtemp) | templates |
a gridtemplate type More... | |
This Fortran module contains info on all the available GRIB2 Grid Definition Templates used in [Section 3 - the Grid Definition Section (GDS)](https://www.nco.ncep.noaa.gov/pmb/docs/grib2/grib2_doc/grib2_sect3.shtml).
Each Template has three parts:
This module also contains two subroutines:
Array mapgrid contains the number of bytes 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/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 bytes value in mapgrid indicates that this possibility should be considered. The number of bytes used to store the data value in this case would be the absolute value of the negative value in mapgrid.
type gridtemplates::gridtemplate |
Definition at line 45 of file gridtemplates.F90.
Data Fields | ||
---|---|---|
integer, dimension(maxlen) | mapgrid | |
integer | mapgridlen | |
logical | needext | |
integer | template_num |
subroutine gridtemplates::extgridtemplate | ( | integer, intent(in) | number, |
integer, dimension(*), intent(in) | list, | ||
integer, intent(out) | nummap, | ||
integer, dimension(*), intent(out) | map | ||
) |
Generate 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.
[in] | number | NN, indicating the number of the Grid Definition Template 3.NN that is being requested. |
[in] | list | The list of values for each entry in the Grid Definition Template. |
[out] | nummap | Number of entries in the Template. |
[out] | map | An array containing the number of octets that each template entry occupies when packed up into the GDS. |
Definition at line 332 of file gridtemplates.F90.
References getgridindex(), and templates.
Referenced by addgrid(), gf_unpack3(), and unpack3().
integer function gridtemplates::getgdtlen | ( | integer, intent(in) | number | ) |
This function returns the initial length (number of entries) in the static part of specified Grid Definition Template.
[in] | number | NN, indicating the number of the Grid Definition Template that is being requested. |
Definition at line 400 of file gridtemplates.F90.
References getgridindex(), and templates.
integer function gridtemplates::getgridindex | ( | integer, intent(in) | number | ) |
Return the index of specified Grid Definition Template.
[in] | number | NN, indicating the number of the Grid Definition Template 3.NN that is being requested. |
Definition at line 255 of file gridtemplates.F90.
References maxtemp, and templates.
Referenced by extgridtemplate(), getgdtlen(), and getgridtemplate().
subroutine gridtemplates::getgridtemplate | ( | integer, intent(in) | number, |
integer, intent(out) | nummap, | ||
integer, dimension(*), intent(out) | map, | ||
logical, intent(out) | needext, | ||
integer, intent(out) | iret | ||
) |
Get the grid template information for a specified Grid Definition Template.
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.
[in] | number | NN, indicating the number of the Grid Definition Template that is being requested. |
[out] | nummap | Number of entries in the Template. |
[out] | map | An array containing the number of octets that each template entry occupies when packed up into the GDS. |
[out] | needext | Logical variable indicating whether the Grid Defintion Template has to be extended. |
[out] | iret | Error return code.
|
Definition at line 291 of file gridtemplates.F90.
References getgridindex(), and templates.
Referenced by addgrid(), gf_unpack3(), and unpack3().
integer, parameter gridtemplates::maxlen = 200 |
maximum number of octets in mapgrid
Definition at line 42 of file gridtemplates.F90.
integer, parameter gridtemplates::maxtemp = 31 |
maximum number of entries in the template
Definition at line 43 of file gridtemplates.F90.
Referenced by getgridindex().
type(gridtemplate), dimension(maxtemp) gridtemplates::templates |
a gridtemplate type
Definition at line 52 of file gridtemplates.F90.
Referenced by extgridtemplate(), getgdtlen(), getgridindex(), and getgridtemplate().