|
NCEPLIBS-g2
3.4.5
|
This subroutine find and extracts a grib message from a file. More...
Go to the source code of this file.
Functions/Subroutines | |
| subroutine | getgb2p (LUGB, LUGI, J, JDISC, JIDS, JPDTN, JPDT, JGDTN, JGDT, EXTRACT, K, GRIBM, LENG, IRET) |
| This subroutine find and extracts a grib message from a file. More... | |
This subroutine find and extracts a grib message from a file.
Definition in file getgb2p.f.
| subroutine getgb2p | ( | integer, intent(in) | LUGB, |
| integer, intent(in) | LUGI, | ||
| integer, intent(in) | J, | ||
| integer, intent(in) | JDISC, | ||
| integer, dimension(*) | JIDS, | ||
| integer, intent(in) | JPDTN, | ||
| integer, dimension(*) | JPDT, | ||
| integer, intent(in) | JGDTN, | ||
| integer, dimension(*) | JGDT, | ||
| logical, intent(in) | EXTRACT, | ||
| integer, intent(out) | K, | ||
| character(len=1), dimension(:), pointer | GRIBM, | ||
| integer, intent(out) | LENG, | ||
| integer, intent(out) | IRET | ||
| ) |
This subroutine find and extracts a grib message from a file.
It reads a grib index file (or optionally the grib file itself) to get the index buffer (i.e. table of contents) for the grib file. find in the index buffer a reference to the grib field requested. the grib field request specifies the number of fields to skip and the unpacked identification section, grid definition template and product defintion section parameters. (a requested parameter of -9999 means to allow any value of this parameter to be found.) if the requested grib field is found, then it is read from the grib file and unpacked. If the grib field is not found, then the return code will be nonzero.
PROGRAM HISTORY LOG:
| [in] | LUGB | integer unit of the unblocked grib data file. file must be opened with baopen or baopenr before calling this routine. |
| [in] | LUGI | integer unit of the unblocked grib index file. if nonzero, file must be opened with baopen baopenr before calling this routine. (=0 to get index buffer from the grib file) |
| [in] | J | integer number of fields to skip (=0 to search from beginning) |
| [in] | JDISC | grib2 discipline number of requested field (if = -1, accept any discipline see code table 0.0) |
| [in] | JIDS | integer array of values in the identification section (=-9999 for wildcard) |
| [in] | JPDTN | integer product definition template number (n) (if = -1, don't bother matching pdt - accept any) |
| [in] | JPDT | integer array of values defining the product definition template 4.n of the field for which to search (=-9999 for wildcard) |
| [in] | JGDTN | integer grid definition template number (m) (if = -1, don't bother matching gdt - accept any ) |
| [in] | JGDT | integer array of values defining the grid definition template 3.m of the field for which to search (=-9999 for wildcard) |
| [in] | EXTRACT | logical value indicating whether to return a grib2 message with just the requested field, or the entire grib2 message containing the requested field. |
| [out] | K | integer field number unpacked. |
| [out] | GRIBM | returned grib message. |
| [out] | LENG | length of returned grib message in bytes. |
| [out] | IRET | integer return code |