|
NCEPLIBS-g2
3.4.5
|
Contains subroutine which packs up Sections 4 through 7 for a given field and adds them to a GRIB2 message. More...
Go to the source code of this file.
Functions/Subroutines | |
| subroutine | addfield (cgrib, lcgrib, ipdsnum, ipdstmpl, ipdstmplen, coordlist, numcoord, idrsnum, idrstmpl, idrstmplen, fld, ngrdpts, ibmap, bmap, ierr) |
| This subroutine packs up Sections 4 through 7 for a given field and adds them to a GRIB2 message. More... | |
Contains subroutine which packs up Sections 4 through 7 for a given field and adds them to a GRIB2 message.
Definition in file addfield.f.
| subroutine addfield | ( | character(len=1), dimension(lcgrib), intent(inout) | cgrib, |
| integer, intent(in) | lcgrib, | ||
| integer, intent(in) | ipdsnum, | ||
| integer, dimension(*), intent(in) | ipdstmpl, | ||
| integer, intent(in) | ipdstmplen, | ||
| real, dimension(numcoord), intent(in) | coordlist, | ||
| integer, intent(in) | numcoord, | ||
| integer, intent(in) | idrsnum, | ||
| integer, dimension(*), intent(inout) | idrstmpl, | ||
| integer, intent(in) | idrstmplen, | ||
| real, dimension(ngrdpts), intent(in), target | fld, | ||
| integer, intent(in) | ngrdpts, | ||
| integer, intent(in) | ibmap, | ||
| logical*1, dimension(ngrdpts), intent(in) | bmap, | ||
| integer, intent(out) | ierr | ||
| ) |
This subroutine packs up Sections 4 through 7 for a given field and adds them to a GRIB2 message.
They are Product Definition Section, Data Representation Section, Bit-Map Section and Data Section, respectively.
This routine is used with routines "gribcreate", "addlocal", "addgrid", and "gribend" to create a complete GRIB2 message. Subroutine gribcreate must be called first to initialize a new GRIB2 message. Also, subroutine addgrid must be called after gribcreate and before this routine to add the appropriate grid description to the GRIB2 message. Also, a call to gribend is required to complete GRIB2 message after all fields have been added.
PROGRAM HISTORY LOG:
| [in,out] | cgrib | Character array to contain the GRIB2 message. |
| [in] | lcgrib | Maximum length (bytes) of array cgrib. |
| [in] | ipdsnum | Product Definition Template Number ( see Code Table 4.0). |
| [in] | ipdstmpl | Contains the data values for the specified Product Definition Template (N=ipdsnum). Each element of this integer array contains an entry (in the order specified) of Product Defintion Template 4.N |
| [in] | ipdstmplen | Max dimension of ipdstmpl coordlist Array containg floating point values intended to document the vertical discretisation associated to model data on hybrid coordinate vertical levels. |
| [out] | coordlist | Array containg floating point values intended to document the vertical discretisation associated to model data on hybrid coordinate vertical levels. (part of Section 4) The dimension of this array can be obtained in advance from maxvals(5), which is returned from subroutine gribinfo. |
| [in] | numcoord | - number of values in array coordlist. |
| [in] | idrsnum | - Data Representation Template Number ( see Code Table 5.0 ) |
| [in] | idrstmpl | Contains the data values for the specified Data Representation Template (N=idrsnum). Each element of this integer array contains an entry (in the order specified) of Data Representation Template 5.N. Note that some values in this template (eg. reference values, number of bits, etc...) may be changed by the data packing algorithms. Use this to specify scaling factors and order of spatial differencing, if desired. |
| [in] | idrstmplen | Max dimension of idrstmpl. |
| [in] | fld | Array of data points to pack. |
| [out] | ngrdpts | Number of data points in grid. i.e. size of fld and bmap. |
| [out] | ibmap | Bitmap indicator (see Code Table 6.0).
|
| [out] | bmap | Logical*1 array containing bitmap to be added. (if ibmap=0 or ibmap=254) |
| [out] | ierr | Error return code.
|
Definition at line 91 of file addfield.f.