|
NCEPLIBS-g2
3.4.9
|
Subroutines to write and get a field and free memmory from grib_mod::gribfield. More...
Go to the source code of this file.
Functions/Subroutines | |
| subroutine | gf_free (gfld) |
| Free memory that was used to store array values in derived type grib_mod::gribfield. More... | |
| subroutine | gf_getfld (cgrib, lcgrib, ifldnum, unpack, expand, gfld, ierr) |
| Return the Grid Definition, and Product Definition for a given data field. More... | |
| subroutine | putgb2 (lugb, gfld, iret) |
| Pack a field into a grib2 message and write that message to a file. More... | |
Subroutines to write and get a field and free memmory from grib_mod::gribfield.
Definition in file g2gf.F90.
| subroutine gf_free | ( | type(gribfield) | gfld | ) |
Free memory that was used to store array values in derived type grib_mod::gribfield.
| gfld | derived type grib_mod::gribfield. |
Definition at line 584 of file g2gf.F90.
Referenced by getgb2i2(), getgb2p(), and gf_getfld().
| 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 | ||
| ) |
Return the Grid Definition, and Product Definition for a given data field.
All of the information returned is stored in a derived type variable, gfld. Gfld is of type grib_mod::gribfield, which is defined in gribmod.F90; 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 210 of file g2gf.F90.
References g2_gbytec(), gf_free(), gf_unpack1(), gf_unpack2(), gf_unpack3(), gf_unpack4(), gf_unpack5(), gf_unpack6(), and gf_unpack7().
| subroutine putgb2 | ( | integer, intent(in) | lugb, |
| type(gribfield), intent(in) | gfld, | ||
| integer, intent(out) | iret | ||
| ) |
Pack a field into a grib2 message and write that message to a file.
The information to be packed into the grib field is stored in a derived type variable, gfld. gfld is of type grib_mod::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. Each component of the gribfield type is described in the input argument list section below.
| [in] | lugb | integer unit of the unblocked grib data file. File must be opened with baopen() or baopenw() before calling this routine. |
| [in] | gfld | derived type grib_mod::gribfield. |
| [out] | iret | integer return code
|
Definition at line 34 of file g2gf.F90.
References addfield(), addgrid(), addlocal(), gribcreate(), and gribend().