.TH "g2_info.c" 3 "Tue May 3 2022" "Version 1.6.4" "NCEPLIBS-g2c" \" -*- nroff -*- .ad l .nh .SH NAME g2_info.c \- Search 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\&. .SH SYNOPSIS .br .PP \fC#include \fP .br \fC#include \fP .br \fC#include 'grib2\&.h'\fP .br .SS "Functions" .in +1c .ti -1c .RI "\fBg2int\fP \fBg2_info\fP (unsigned char *cgrib, \fBg2int\fP *listsec0, \fBg2int\fP *listsec1, \fBg2int\fP *numfields, \fBg2int\fP *numlocal)" .br .RI "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\&. " .in -1c .SH "Detailed Description" .PP Search 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\&. .PP \fBAuthor\fP .RS 4 Stephen Gilbeert .RE .PP \fBDate\fP .RS 4 2002-10-28 .RE .PP .PP Definition in file \fBg2_info\&.c\fP\&. .SH "Function Documentation" .PP .SS "\fBg2int\fP g2_info (unsigned char * cgrib, \fBg2int\fP * listsec0, \fBg2int\fP * listsec1, \fBg2int\fP * numfields, \fBg2int\fP * numlocal)" .PP 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\&. .PP \fBParameters\fP .RS 4 \fIcgrib\fP Character pointer to the GRIB2 message\&. .br \fIlistsec0\fP pointer to an array containing information decoded from GRIB Indicator Section 0\&. Must be allocated with >= 3 elements\&. .IP "\(bu" 2 listsec0[0] Discipline-GRIB Master Table Number (see Code Table 0\&.0)\&. .IP "\(bu" 2 listsec0[1] GRIB Edition Number (currently 2)\&. .IP "\(bu" 2 listsec0[2] Length of GRIB message\&. .PP .br \fIlistsec1\fP Pointer to an array containing information read from GRIB Identification Section 1\&. Must be allocated with >= 13 elements\&. .IP "\(bu" 2 listsec1[0] Id of orginating centre (Common Code Table C-1) .IP "\(bu" 2 listsec1[1] Id of orginating sub-centre (local table) .IP "\(bu" 2 listsec1[2] GRIB Master Tables Version Number (Code Table 1\&.0) .IP "\(bu" 2 listsec1[3] GRIB Local Tables Version Number .IP "\(bu" 2 listsec1[4] Significance of Reference Time (Code Table 1\&.1) .IP "\(bu" 2 listsec1[5] Reference Time - Year (4 digits) .IP "\(bu" 2 listsec1[6] Reference Time - Month .IP "\(bu" 2 listsec1[7] Reference Time - Day .IP "\(bu" 2 listsec1[8] Reference Time - Hour .IP "\(bu" 2 listsec1[9] Reference Time - Minute .IP "\(bu" 2 listsec1[10] Reference Time - Second .IP "\(bu" 2 listsec1[11] Production status of data (Code Table 1\&.2) .IP "\(bu" 2 listsec1[12] Type of processed data (Code Table 1\&.3) .PP .br \fInumfields\fP The number of gridded fields found in the GRIB message\&. That is, the number of occurences of Sections 4 - 7\&. .br \fInumlocal\fP The number of Local Use Sections ( Section 2 ) found in the GRIB message\&. .RE .PP \fBReturns\fP .RS 4 0 foe success, otherwise: .IP "\(bu" 2 1 Beginning characters 'GRIB' not found\&. .IP "\(bu" 2 2 GRIB message is not Edition 2\&. .IP "\(bu" 2 3 Could not find Section 1, where expected\&. .IP "\(bu" 2 4 End string '7777' found, but not where expected\&. .IP "\(bu" 2 5 End string '7777' not found at end of message\&. .IP "\(bu" 2 6 Invalid section number found\&. .PP .RE .PP \fBAuthor\fP .RS 4 Stephen Gilbeert .RE .PP \fBDate\fP .RS 4 2002-10-28 .RE .PP .PP Definition at line 59 of file g2_info\&.c\&. .PP References gbit()\&. .SH "Author" .PP Generated automatically by Doxygen for NCEPLIBS-g2c from the source code\&.