NCEPLIBS-g2  3.4.5
getgb2rp.f File Reference

This subroutine find and extracts the index for the requested field from a grib file. More...

Go to the source code of this file.

Functions/Subroutines

subroutine getgb2rp (LUGB, CINDEX, EXTRACT, GRIBM, LENG, IRET)
 This subroutine find and extracts a grib message from a file given the index for the requested field. More...
 

Detailed Description

This subroutine find and extracts the index for the requested field from a grib file.

Author
Stephen Gilbert
Date
2003-12-31

Definition in file getgb2rp.f.

Function/Subroutine Documentation

◆ getgb2rp()

subroutine getgb2rp ( integer, intent(in)  LUGB,
character(len=1), dimension(*), intent(in)  CINDEX,
logical, intent(in)  EXTRACT,
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 given the index for the requested field.

The grib message returned can contain only the requested field (extract=.true.). or the complete grib message originally containing the desired field can be returned (extract=.false.) even if other fields were included in the grib message. If the grib field is not found, then the return code will be nonzero.

Parameters
[in]LUGBinteger unit of the unblocked grib data file. file must be opened with baopen or baopenr before calling this routine.
[in]CINDEXindex record of the grib field (see docblock of subroutine ixgb2() for description of an index record.)
[in]EXTRACTlogical value indicating whether to return a grib2 message with just the requested field, or the entire grib2 message containing the requested field.
  • .true. = return grib2 message containing only the requested field.
  • .false. = return entire grib2 message containing the requested field.
[out]GRIBMreturned grib message.
[out]LENGlength of returned grib message in bytes.
[out]IRETinteger return code
  • 0 all ok
  • 97 error reading grib file
Author
Stephen Gilbert
Date
2003-12-31

Definition at line 36 of file getgb2rp.f.