NCEPLIBS-g2  3.4.5
pdstemplates Module Reference

This Fortran Module contains info on all the available GRIB2 Product Definition Templates used in Section 4 (PDS). More...

Data Types

type  pdstemplate
 

Functions/Subroutines

subroutine extpdstemplate (number, list, nummap, map)
 This subroutine generates the remaining octet map for a given Product Definition Template, if required. More...
 
integer function getpdsindex (number)
 This function returns the index of specified Product Definition Template 4.NN (NN=number) in array templates. More...
 
subroutine getpdstemplate (number, nummap, map, needext, iret)
 This subroutine returns PDS template information for a specified Product Definition Template 4.NN. More...
 
integer function getpdtlen (number)
 This function returns the initial length (number of entries) in the "static" part of specified Product Definition Template 4.number. More...
 

Variables

integer, parameter maxlen =200
 MAXLEN max length of entries. More...
 
integer, parameter maxtemp =43
 MAXTEMP maximum number of templates. More...
 
type(pdstemplate), dimension(maxtemptemplates
 template in type of pdstemplate More...
 

Detailed Description

This Fortran Module contains info on all the available GRIB2 Product Definition Templates used in Section 4 (PDS).

Each Template has three parts: The number of entries in the template (mapgridlen); A map of the template (mapgrid), which contains the number of octets in which to pack each of the template values; and 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. (Template 4.3 as an example)

This module also contains two subroutines. getpdstemplate() returns the octet map for a specified Template number, and extpdstemplate() will calculate the extended octet map of an appropriate template given values for the "static" part of the template. See docblocks below for the arguments and usage of these routines.

PROGRAM HISTORY LOG:

  • 2000-05-11 Stephen Gilbert
  • 2001-12-04 Stephen Gilbert Added Templates 4.12, 4.12, 4.14, 4.1000, 4.1001, 4.1002, 4.1100 and 4.1101
  • 2009-05-21 Boi Vuong Allow negative scale factors and limits for Templates 4.5 and 4.9
  • 2009-12-14 Boi Vuong Added Templates (Satellite Product) 4.31 Added Templates (ICAO WAFS) 4.15
  • 2010-08-03 Boi Vuong Added Templates 4.40,4.41,4.42,.4.43
  • 2010-12-08 Boi Vuong Corrected Product Definition Template 4.42 and 4.43
  • 2012-02-07 Boi Vuong Added Templates 4.44,4.45,4.46,4.47,4.48,4.50,4.51,4.91,4.32 and 4.52
  • 2013-07-29 Boi Vuong Corrected 4.91 and added Templates 4.33,4.34,4.53,4.54
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().
Author
Stephen Gilbert
Date
2000-05-11

Data Type Documentation

◆ pdstemplates::pdstemplate

type pdstemplates::pdstemplate

Definition at line 59 of file pdstemplates.f.

Data Fields
integer, dimension(maxlen) mappds
integer mappdslen
logical needext
integer template_num

Function/Subroutine Documentation

◆ extpdstemplate()

subroutine pdstemplates::extpdstemplate ( integer, intent(in)  number,
integer, dimension(*), intent(in)  list,
integer, intent(out)  nummap,
integer, dimension(*), intent(out)  map 
)

This subroutine generates the remaining octet map for a given Product 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.

PROGRAM HISTORY LOG:

  • 2000-05-11 Stephen Gilbert
  • 2010-08-03 Boi Vuong Added Templates 4.40,4.41,4.42,.4.43
  • 2010-12-08 Boi Vuong Corrected Product Definition Template 4.42 and 4.43
  • 2013-07-29 Boi Vuong Added Templates 4.48,4.50,4.33,4.34,4.53,4.54
Parameters
[in]numberNN, indicating the number of the Product Definition Template 4.NN that is being requested.
[in]listAn array containing the number of octets that each the Product Definition Template 4.NN.
[out]nummapNumber of entries in the Template.
[out]mapAn array containing the number of octets that each template entry occupies when packed up into the PDS.
Author
Stephen Gilbert
Date
2000-05-11

Definition at line 459 of file pdstemplates.f.

◆ getpdsindex()

integer function pdstemplates::getpdsindex ( integer, intent(in)  number)

This function returns the index of specified Product Definition Template 4.NN (NN=number) in array templates.

Parameters
[in]numberNN, indicating the number of the Product Definition Template 4.NN that is being requested.
Returns
  • Index of PDT 4.NN in array templates, if template exists.
  • -1, otherwise.
Author
Stephen Gilbert
Date
2001-06-28

Definition at line 371 of file pdstemplates.f.

◆ getpdstemplate()

subroutine pdstemplates::getpdstemplate ( integer, intent(in)  number,
integer, intent(out)  nummap,
integer, dimension(*), intent(out)  map,
logical, intent(out)  needext,
integer, intent(out)  iret 
)

This subroutine returns PDS template information for a specified Product Definition Template 4.NN.

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.

PROGRAM HISTORY LOG:

  • 2000-05-11 Stephen Gilbert
  • 2010-08-03 Boi Vuong Added Templates 4.40,4.41,4.42,.4.43
  • 2010-12-08 Boi Vuong Corrected Product Definition Template 4.42 and 4.43
  • 2013-07-29 Boi Vuong Added Templates 4.48,4.50,4.33,4.34,4.53,4.54
Parameters
[in]numberNN, indicating the number of the Product Definition Template 4.NN that is being requested.
[out]nummapNumber of entries in the Template.
[out]mapAn array containing the number of octets that each template entry occupies when packed up into the PDS.
[out]needextLogical variable indicating whether the Product Defintion Template has to be extended.
[out]iretError return code.
  • 0 no error.
  • 1 Undefine Product Template number.
Author
Stephen Gilbert
Date
2000-05-11

Definition at line 412 of file pdstemplates.f.

◆ getpdtlen()

integer function pdstemplates::getpdtlen ( integer, intent(in)  number)

This function returns the initial length (number of entries) in the "static" part of specified Product Definition Template 4.number.

Parameters
[in]numberNN, indicating the number of the Product Definition Template 4.NN that is being requested.
Returns
  • Number of entries in the "static" part of PDT 4.number..
  • 0, if requested template is not found.
Author
Stephen Gilbert
Date
2004-05-11

Definition at line 690 of file pdstemplates.f.

Variable Documentation

◆ maxlen

integer, parameter pdstemplates::maxlen =200

MAXLEN max length of entries.

Definition at line 56 of file pdstemplates.f.

◆ maxtemp

integer, parameter pdstemplates::maxtemp =43

MAXTEMP maximum number of templates.

Definition at line 57 of file pdstemplates.f.

◆ templates

type(pdstemplate), dimension(maxtemp) pdstemplates::templates

template in type of pdstemplate

Definition at line 66 of file pdstemplates.f.