|
NCEPLIBS-g2
3.4.8
|
Contains subroutines returns the Grid Definition, and Product Definition for a given data field. More...
Go to the source code of this file.
Functions/Subroutines | |
| subroutine | gf_getfld (cgrib, lcgrib, ifldnum, unpack, expand, gfld, ierr) |
| This subroutine returns the Grid Definition, Product Definition, Bit-map (if applicable), and the unpacked data for a given data field. More... | |
Contains subroutines returns the Grid Definition, and Product Definition for a given data field.
Definition in file gf_getfld.F90.
| subroutine gf_getfld | ( | character(len = 1), dimension(lcgrib), intent(in) | cgrib, |
| integer, intent(in) | lcgrib, | ||
| integer, intent(in) | ifldnum, | ||
| logical, intent(in) | unpack, | ||
| logical, intent(in) | expand, | ||
| type(gribfield), intent(out) | gfld, | ||
| integer, intent(out) | ierr | ||
| ) |
This subroutine returns the Grid Definition, Product Definition, Bit-map (if applicable), and the unpacked data for a given data field.
All of the information returned is stored in a derived type variable, gfld. Gfld is of type gribfield, which is defined in module grib_mod, so users of this routine will need to include the line "USE GRIB_MOD" in their calling routine.
Since there can be multiple data fields packed into a GRIB2 message, the calling routine indicates which field is being requested with the ifldnum argument.
| [in] | cgrib | Character array that contains the GRIB2 message. |
| [in] | lcgrib | Length (in bytes) of GRIB message array cgrib. |
| [in] | ifldnum | Specifies which field in the GRIB2 message to return. |
| [in] | unpack | Logical value indicating whether to unpack bitmap/data. .true. = unpack bitmap and data values; .false. = do not unpack bitmap and data values. |
| [in] | expand | Boolean value indicating whether the data points should be expanded to the correspond grid, if a bit-map is present.
|
| [out] | gfld | derived type grib_mod::gribfield. |
| [out] | ierr | Error return code.
|
It may not always be possible to expand a bit-mapped data field. If a pre-defined bit-map is used and not included in the GRIB2 message itself, this routine would not have the necessary information to expand the data. In this case, gfld%expanded would be set to 0 (false), regardless of the value of input argument expand.
Definition at line 67 of file gf_getfld.F90.
References g2_gbytec(), gf_free(), gf_unpack1(), gf_unpack2(), gf_unpack3(), gf_unpack4(), gf_unpack5(), gf_unpack6(), and gf_unpack7().