NCEPLIBS-g2  3.4.8
getgb2s.F90 File Reference

Find information about a GRIB field from the index. More...

Go to the source code of this file.

Functions/Subroutines

subroutine getgb2s (CBUF, NLEN, NNUM, J, JDISC, JIDS, JPDTN, JPDT, JGDTN, JGDT, K, GFLD, LPOS, IRET)
 Find information about a GRIB field from the index and fill a grib_mod::gribfield. More...
 

Detailed Description

Find information about a GRIB field from the index.

file and fill a grib_mod::gribfield.

Author
Stephen Gilbert
Date
2002-01-15

Definition in file getgb2s.F90.

Function/Subroutine Documentation

◆ getgb2s()

subroutine getgb2s ( character(len = 1), dimension(nlen), intent(in)  CBUF,
integer, intent(in)  NLEN,
integer, intent(in)  NNUM,
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,
integer, intent(out)  K,
type(gribfield), intent(out)  GFLD,
integer, intent(out)  LPOS,
integer, intent(out)  IRET 
)

Find information about a GRIB field from the index and fill a grib_mod::gribfield.

For a description of the index record see getg2i().

Users of this routine will need to include the line "use grib_mod" in their calling routine.

The unpacked bitmap and bitmap data field are the only components of the grib_mod::gribfield type not set by this routine.

Note
This subprogram is intended for private use by getgb2() routines only. Note that derived type grib_mod::gribfield contains pointers to many arrays of data. The memory for these arrays is allocated when the values in the arrays are set. Users must free this memory, when it is no longer needed, by a call to subroutine gf_free().
Parameters
[in]cbufBuffer (of size nlen bytes) containing index data.
[in]nlenTotal length of all index records.
[in]nnumNumber of index records.
[in]jNumber of fields to skip (0 to search from beginning).
[in]jdiscGRIB2 discipline number of requested field. See GRIB2 - TABLE 0.0 - DISCIPLINE. Use -1 to accept any discipline.
[in]jidsArray of values in the identification section. (Set to -9999 for wildcard.)
[in]jpdtnProduct Definition Template (PDT) number (n) (if = -1, don't bother matching PDT - accept any).
[in]jpdtArray of values defining the Product Definition Template of the field for which to search (=-9999 for wildcard).
[in]jgdtnGrid Definition Template (GDT) number (if = -1, don't bother matching GDT - accept any).
[in]jgdtarray of values defining the Grid Definition Template of the field for which to search (=-9999 for wildcard).
[out]kField number unpacked.
[out]gfldDerived type grib_mod::gribfield.
[out]lposStarting position of the found index record within the complete index buffer, CBUF. = 0, if request not found.
[out]iretinteger return code:
  • 0 No error.
  • 97 Error reading GRIB file.
  • other gf_getfld GRIB2 unpacker return code.
Author
Stephen Gilbert
Date
2002-01-15

Definition at line 78 of file getgb2s.F90.

References g2_gbytec(), gf_unpack1(), gf_unpack3(), gf_unpack4(), and gf_unpack5().

Referenced by getgb2(), and getgb2p().