NCEPLIBS-g2
3.5.0
|
Handles Data Representation Templates used in Section 5. More...
Data Types | |
type | drstemplate |
This type holds information about a DRS template. More... | |
Functions/Subroutines | |
subroutine | extdrstemplate (number, list, nummap, map) |
Generate the remaining octet map for a given Data Representation Template, if required. More... | |
integer function | getdrsindex (number) |
Return the index of specified Data Representation Template in array templates. More... | |
subroutine | getdrstemplate (number, nummap, map, needext, iret) |
Return DRS template information for a specified Data Representation Template. More... | |
Variables | |
integer | j |
loop iterator More... | |
integer, parameter | maxlen = 200 |
maximum number of octets in mapdrs More... | |
integer, parameter | maxtemp = 9 |
maximum number of entries in the template More... | |
type(drstemplate), dimension(maxtemp) | templates |
template in type of drstemplate More... | |
Handles Data Representation Templates used in Section 5.
(See https://www.nco.ncep.noaa.gov/pmb/docs/grib2/grib2_doc/grib2_sect5.shtml.)
Each Template has three parts:
This module also contains two subroutines. Subroutine getdrstemplate() returns the octet map for a specified Template number, and subroutine extdrstemplate() will calculate the extended octet map of an appropriate template given values for the "static" part of the template.
type drstemplates::drstemplate |
This type holds information about a DRS template.
Definition at line 41 of file drstemplates.F90.
Data Fields | ||
---|---|---|
integer, dimension(maxlen) | mapdrs | Number of octets in which to pack each value. |
integer | mapdrslen | The number of entries in the template. |
logical | needext | Does template need to be extended? |
integer | template_num | Template number. |
subroutine drstemplates::extdrstemplate | ( | 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 Data Representation 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.
Currently no templates have been implemented which require an extension.
[in] | number | NN, indicating the number of the Data Representation Template 5.NN that is being requested. |
[in] | list | The list of values for each entry in the Data Representation Template 5.NN. |
[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 201 of file drstemplates.F90.
References getdrsindex(), and templates.
Referenced by gf_unpack5(), and unpack5().
integer function drstemplates::getdrsindex | ( | integer, intent(in) | number | ) |
Return the index of specified Data Representation Template in array templates.
[in] | number | the Data Representation Template number. |
Definition at line 121 of file drstemplates.F90.
References j, maxtemp, and templates.
Referenced by extdrstemplate(), and getdrstemplate().
subroutine drstemplates::getdrstemplate | ( | integer, intent(in) | number, |
integer, intent(out) | nummap, | ||
integer, dimension(*), intent(out) | map, | ||
logical, intent(out) | needext, | ||
integer, intent(out) | iret | ||
) |
Return DRS template information for a specified Data Representation 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 Data Representation Template 5.NN 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 DRS. |
[out] | needext | Logical variable indicating whether the Data Representation Template has to be extended. |
[out] | iret | Error return code.
|
Definition at line 156 of file drstemplates.F90.
References getdrsindex(), and templates.
Referenced by addfield(), gf_unpack5(), and unpack5().
integer drstemplates::j |
loop iterator
Definition at line 38 of file drstemplates.F90.
Referenced by dec_png(), enc_png(), getdrsindex(), and int_dec_jpeg2000().
integer, parameter drstemplates::maxlen = 200 |
maximum number of octets in mapdrs
Definition at line 36 of file drstemplates.F90.
integer, parameter drstemplates::maxtemp = 9 |
maximum number of entries in the template
Definition at line 37 of file drstemplates.F90.
Referenced by getdrsindex().
type(drstemplate), dimension(maxtemp) drstemplates::templates |
template in type of drstemplate
Simple Packing Complex Packing Complex Packing - Spatial Diff Simple Packing - Spectral Data Complex Packing - Spectral Data JPEG2000 Encoding PNG Encoding JPEG2000 Encoding PNG Encoding
Definition at line 48 of file drstemplates.F90.
Referenced by extdrstemplate(), getdrsindex(), and getdrstemplate().