NCEPLIBS-g2  3.4.5
gb_info.f File Reference

This subroutine searches the number of gridded fields and the number of Local Use Sections through a GRIB2 message. More...

Go to the source code of this file.

Functions/Subroutines

subroutine gb_info (cgrib, lcgrib, listsec0, listsec1, numfields, numlocal, maxlocal, ierr)
 This subroutine searches through a GRIB2 message and returns the number of gridded fields found in the message and the number (and maximum size) of Local Use Sections. More...
 

Detailed Description

This subroutine searches the number of gridded fields and the number of Local Use Sections through a GRIB2 message.

Author
Stephen Gilbert
Date
2000-05-25

Definition in file gb_info.f.

Function/Subroutine Documentation

◆ gb_info()

subroutine gb_info ( character(len=1), dimension(lcgrib), intent(in)  cgrib,
integer, intent(in)  lcgrib,
integer, dimension(3), intent(out)  listsec0,
integer, dimension(13), intent(out)  listsec1,
integer, intent(out)  numfields,
integer, intent(out)  numlocal,
integer, intent(out)  maxlocal,
integer, intent(out)  ierr 
)

This subroutine searches through a GRIB2 message and returns the number of gridded fields found in the message and the number (and maximum size) of Local Use Sections.

Also various checks are performed to see if the message is a valid GRIB2 message.

Parameters
[in]cgribCharacter array that contains the GRIB2 message.
[in]lcgribLength (in bytes) of GRIB message in array cgrib.
[out]listsec0Contains information decoded from GRIB Indicator Section 0. Must be dimensioned >= 2.
  • listsec0(1)=Discipline-GRIB Master Table Number (see Code Table 0.0)
  • listsec0(2)=GRIB Edition Number (currently 2)
  • listsec0(3)=Length of GRIB message
[out]listsec1Contains information read from GRIB Identification Section 1. Must be dimensioned >= 13.
  • listsec1(1)=Id of orginating centre (Common Code Table C-1)
  • listsec1(2)=Id of orginating sub-centre (local table)
  • listsec1(3)=GRIB Master Tables Version Number (Code Table 1.0)
  • listsec1(4)=GRIB Local Tables Version Number
  • listsec1(5)=Significance of Reference Time (Code Table 1.1)
  • listsec1(6)=Reference Time - Year (4 digits)
  • listsec1(7)=Reference Time - Month
  • listsec1(8)=Reference Time - Day
  • listsec1(9)=Reference Time - Hour
  • listsec1(10)=Reference Time - Minute
  • listsec1(11)=Reference Time - Second
  • listsec1(12)=Production status of data (Code Table 1.2)
  • listsec1(13)=Type of processed data (Code Table 1.3)
[out]numfieldsThe number of gridded fieldse found in the GRIB message.
[out]numlocalThe number of Local Use Sections (Section 2) found in the GRIB message.
[out]maxlocalThe size of the largest Local Use Section (Section 2). Can be used to ensure that the return array passed to subroutine getlocal is dimensioned large enough.
[out]ierrError return code.
  • 0 no error.
  • 1 Beginning characters "GRIB" not found.
  • 2 GRIB message is not Edition 2.
  • 3 Could not find Section 1, where expected.
  • 4 End string "7777" found, but not where expected.
  • 5 End string "7777" not found at end of message.
  • 6 Invalid section number found.
Author
Stephen Gilbert
Date
2000-05-25

Definition at line 55 of file gb_info.f.