.TH "g2_getfld.c" 3 "Tue May 3 2022" "Version 1.6.4" "NCEPLIBS-g2c" \" -*- nroff -*- .ad l .nh .SH NAME g2_getfld.c \- Return all the metadata, template values, Bit-map (if applicable), and the unpacked data for a given data field\&. .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_getfld\fP (unsigned char *cgrib, \fBg2int\fP ifldnum, \fBg2int\fP unpack, \fBg2int\fP expand, \fBgribfield\fP **gfld)" .br .RI "This subroutine returns all the metadata, template values, Bit-map (if applicable), and the unpacked data for a given data field\&. " .ti -1c .RI "\fBg2int\fP \fBg2_unpack1\fP (unsigned char *, \fBg2int\fP *, \fBg2int\fP **, \fBg2int\fP *)" .br .RI "This subroutine unpacks Section 1 (Identification Section) as defined in GRIB Edition 2\&. " .ti -1c .RI "\fBg2int\fP \fBg2_unpack2\fP (unsigned char *, \fBg2int\fP *, \fBg2int\fP *, unsigned char **)" .br .RI "This subroutine unpacks Section 2 (Local Use Section) as defined in GRIB Edition 2\&. " .ti -1c .RI "\fBg2int\fP \fBg2_unpack3\fP (unsigned char *, \fBg2int\fP *, \fBg2int\fP **, \fBg2int\fP **, \fBg2int\fP *, \fBg2int\fP **, \fBg2int\fP *)" .br .RI "This routine unpacks Section 3 (Grid Definition Section) as defined in GRIB Edition 2\&. " .ti -1c .RI "\fBg2int\fP \fBg2_unpack4\fP (unsigned char *, \fBg2int\fP *, \fBg2int\fP *, \fBg2int\fP **, \fBg2int\fP *, \fBg2float\fP **, \fBg2int\fP *)" .br .RI "This subroutine unpacks Section 4 (Product Definition Section) as defined in GRIB Edition 2\&. " .ti -1c .RI "\fBg2int\fP \fBg2_unpack5\fP (unsigned char *, \fBg2int\fP *, \fBg2int\fP *, \fBg2int\fP *, \fBg2int\fP **, \fBg2int\fP *)" .br .RI "This subroutine unpacks Section 5 (Data Representation Section) as defined in GRIB Edition 2\&. " .ti -1c .RI "\fBg2int\fP \fBg2_unpack6\fP (unsigned char *, \fBg2int\fP *, \fBg2int\fP, \fBg2int\fP *, \fBg2int\fP **)" .br .RI "This subroutine unpacks Section 6 (Bit-Map Section) as defined in GRIB Edition 2\&. " .ti -1c .RI "\fBg2int\fP \fBg2_unpack7\fP (unsigned char *, \fBg2int\fP *, \fBg2int\fP, \fBg2int\fP *, \fBg2int\fP, \fBg2int\fP *, \fBg2int\fP, \fBg2float\fP **)" .br .RI "This subroutine unpacks Section 7 (Data Section) as defined in GRIB Edition 2\&. " .in -1c .SH "Detailed Description" .PP Return all the metadata, template values, Bit-map (if applicable), and the unpacked data for a given data field\&. .PP \fBAuthor\fP .RS 4 Stephen Gilbert .RE .PP \fBDate\fP .RS 4 2002-10-28 .RE .PP .PP Definition in file \fBg2_getfld\&.c\fP\&. .SH "Function Documentation" .PP .SS "\fBg2int\fP g2_getfld (unsigned char * cgrib, \fBg2int\fP ifldnum, \fBg2int\fP unpack, \fBg2int\fP expand, \fBgribfield\fP ** gfld)" .PP This subroutine returns all the metadata, template values, Bit-map (if applicable), and the unpacked data for a given data field\&. All of the information returned is stored in a gribfield structure, which is defined in file \fBgrib2\&.h\fP\&. Users of this routine will need to include \fBgrib2\&.h\fP in their source code that calls this routine\&. .PP 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\&. .PP PROGRAM HISTORY LOG: .IP "\(bu" 2 2002-10-28 Gilbert .IP "\(bu" 2 2013-08-08 Vuong Free up memory in array igds - free(igds) .PP .PP \fBParameters\fP .RS 4 \fIcgrib\fP Character pointer to the GRIB2 message\&. .br \fIifldnum\fP Specifies which field in the GRIB2 message to return\&. .br \fIunpack\fP Boolean value indicating whether to unpack bitmap/data field\&. .IP "\(bu" 2 1 unpack bitmap (if present) and data values\&. .IP "\(bu" 2 0 do not unpack bitmap and data values\&. .PP .br \fIexpand\fP Boolean value indicating whether the data points should be expanded to the correspond grid, if a bit-map is present\&. This argument is ignored if unpack == 0 OR if the returned field does not contain a bit-map\&. .IP "\(bu" 2 1 if possible, expand data field to grid, inserting zero values at gridpoints that are bitmapped out\&. (SEE REMARKS2) .IP "\(bu" 2 0 do not expand data field, leaving it an array of consecutive data points for each '1' in the bitmap\&. .PP .br \fIgfld\fP pointer to structure gribfield containing all decoded data for the data field\&. .RE .PP .PP .nf gfld->version = GRIB edition number ( currently 2 ) gfld->discipline = Message Discipline ( see Code Table 0\&.0 ) gfld->idsect = Contains the entries in the Identification Section ( Section 1 ) This element is a pointer to an array that holds the data\&. gfld->idsect[0] = Identification of originating Centre ( see Common Code Table C-1 ) 7 - US National Weather Service gfld->idsect[1] = Identification of originating Sub-centre gfld->idsect[2] = GRIB Master Tables Version Number ( see Code Table 1\&.0 ) 0 - Experimental 1 - Initial operational version number gfld->idsect[3] = GRIB Local Tables Version Number ( see Code Table 1\&.1 ) 0 - Local tables not used 1-254 - Number of local tables version used gfld->idsect[4] = Significance of Reference Time (Code Table 1\&.2) 0 - Analysis 1 - Start of forecast 2 - Verifying time of forecast 3 - Observation time gfld->idsect[5] = Year ( 4 digits ) gfld->idsect[6] = Month gfld->idsect[7) = Day gfld->idsect[8] = Hour gfld->idsect[9] = Minute gfld->idsect[10] = Second gfld->idsect[11] = Production status of processed data ( see Code Table 1\&.3 ) 0 - Operational products 1 - Operational test products 2 - Research products 3 - Re-analysis products gfld->idsect[12] = Type of processed data ( see Code Table 1\&.4 ) 0 - Analysis products 1 - Forecast products 2 - Analysis and forecast products 3 - Control forecast products 4 - Perturbed forecast products 5 - Control and perturbed forecast products 6 - Processed satellite observations 7 - Processed radar observations gfld->idsectlen = Number of elements in gfld->idsect[]\&. gfld->local = Pointer to character array containing contents of Local Section 2, if included gfld->locallen = length of array gfld->local[] gfld->ifldnum = field number within GRIB message gfld->griddef = Source of grid definition (see Code Table 3\&.0) 0 - Specified in Code table 3\&.1 1 - Predetermined grid Defined by originating centre gfld->ngrdpts = Number of grid points in the defined grid\&. gfld->numoct_opt = Number of octets needed for each additional grid points definition\&. Used to define number of points in each row ( or column ) for non-regular grids\&. = 0, if using regular grid\&. gfld->interp_opt = Interpretation of list for optional points definition\&. (Code Table 3\&.11) gfld->igdtnum = Grid Definition Template Number (Code Table 3\&.1) gfld->igdtmpl = Contains the data values for the specified Grid Definition Template ( NN=gfld->igdtnum )\&. Each element of this integer array contains an entry (in the order specified) of Grid Defintion Template 3\&.NN This element is a pointer to an array that holds the data\&. gfld->igdtlen = Number of elements in gfld->igdtmpl[]\&. i\&.e\&. number of entries in Grid Defintion Template 3\&.NN ( NN=gfld->igdtnum )\&. gfld->list_opt = (Used if gfld->numoct_opt \&.ne\&. 0) This array contains the number of grid points contained in each row ( or column )\&. (part of Section 3) This element is a pointer to an array that holds the data\&. This pointer is nullified if gfld->numoct_opt=0\&. gfld->num_opt = (Used if gfld->numoct_opt \&.ne\&. 0) The number of entries in array ideflist\&. i\&.e\&. number of rows ( or columns ) for which optional grid points are defined\&. This value is set to zero, if gfld->numoct_opt=0\&. gfdl->ipdtnum = Product Definition Template Number(see Code Table 4\&.0) gfld->ipdtmpl = Contains the data values for the specified Product Definition Template ( N=gfdl->ipdtnum )\&. Each element of this integer array contains an entry (in the order specified) of Product Defintion Template 4\&.N\&. This element is a pointer to an array that holds the data\&. gfld->ipdtlen = Number of elements in gfld->ipdtmpl[]\&. i\&.e\&. number of entries in Product Defintion Template 4\&.N ( N=gfdl->ipdtnum )\&. gfld->coord_list = Real array containing floating point values intended to document the vertical discretisation associated to model data on hybrid coordinate vertical levels\&. (part of Section 4) This element is a pointer to an array that holds the data\&. gfld->num_coord = number of values in array gfld->coord_list[]\&. gfld->ndpts = Number of data points unpacked and returned\&. gfld->idrtnum = Data Representation Template Number ( see Code Table 5\&.0) gfld->idrtmpl = Contains the data values for the specified Data Representation Template ( N=gfld->idrtnum )\&. Each element of this integer array contains an entry (in the order specified) of Product Defintion Template 5\&.N\&. This element is a pointer to an array that holds the data\&. gfld->idrtlen = Number of elements in gfld->idrtmpl[]\&. i\&.e\&. number of entries in Data Representation Template 5\&.N ( N=gfld->idrtnum )\&. gfld->unpacked = logical value indicating whether the bitmap and data values were unpacked\&. If false, gfld->bmap and gfld->fld pointers are nullified\&. gfld->expanded = Logical value indicating whether the data field was expanded to the grid in the case where a bit-map is present\&. If true, the data points in gfld->fld match the grid points and zeros were inserted at grid points where data was bit-mapped out\&. If false, the data values in gfld->fld were not expanded to the grid and are just a consecutive array of data points corresponding to each value of '1' in gfld->bmap\&. gfld->ibmap = Bitmap indicator ( see Code Table 6\&.0 ) 0 = bitmap applies and is included in Section 6\&. 1-253 = Predefined bitmap applies 254 = Previously defined bitmap applies to this field 255 = Bit map does not apply to this product\&. gfld->bmap = integer array containing decoded bitmap, if gfld->ibmap=0 or gfld->ibap=254\&. Otherwise nullified This element is a pointer to an array that holds the data\&. gfld->fld = Array of gfld->ndpts unpacked data points\&. This element is a pointer to an array that holds the data\&. .fi .PP .PP \fBReturns\fP .RS 4 .IP "\(bu" 2 0 no error .IP "\(bu" 2 1 Beginning characters 'GRIB' not found\&. .IP "\(bu" 2 2 GRIB message is not Edition 2\&. .IP "\(bu" 2 3 The data field request number was not positive\&. .IP "\(bu" 2 4 End string '7777' found, but not where expected\&. .IP "\(bu" 2 6 GRIB message did not contain the requested number of data fields\&. .IP "\(bu" 2 7 End string '7777' not found at end of message\&. .IP "\(bu" 2 8 Unrecognized Section encountered\&. .IP "\(bu" 2 9 Data Representation Template 5\&.NN not yet implemented\&. .IP "\(bu" 2 15 Error unpacking Section 1\&. .IP "\(bu" 2 16 Error unpacking Section 2\&. .IP "\(bu" 2 10 Error unpacking Section 3\&. .IP "\(bu" 2 11 Error unpacking Section 4\&. .IP "\(bu" 2 12 Error unpacking Section 5\&. .IP "\(bu" 2 13 Error unpacking Section 6\&. .IP "\(bu" 2 14 Error unpacking Section 7\&. .IP "\(bu" 2 17 Previous bitmap specified, yet none exists\&. .PP .RE .PP \fBNote\fP .RS 4 Struct gribfield is allocated by this routine and it also contains pointers to many arrays of data that were allocated during decoding\&. Users are encouraged to free up this memory, when it is no longer needed, by an explicit call to routine g2_free\&. .PP .nf EXAMPLE: .fi .PP .PP .nf #include "grib2\&.h" gribfield *gfld; ret=g2_getfld(cgrib,1,1,1,&gfld); \&.\&.\&. g2_free(gfld); .fi .PP .RE .PP Routine g2_info can be used to first determine how many data fields exist in a given GRIB message\&. .PP \fBNote\fP .RS 4 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 would be set to 0 (false), regardless of the value of input argument expand\&. .RE .PP \fBAuthor\fP .RS 4 Stephen Gilbert .RE .PP \fBDate\fP .RS 4 2002-10-28 .RE .PP .PP Definition at line 237 of file g2_getfld\&.c\&. .PP References g2_unpack1(), g2_unpack2(), g2_unpack3(), g2_unpack4(), g2_unpack5(), g2_unpack6(), g2_unpack7(), and gbit()\&. .SS "\fBg2int\fP g2_unpack1 (unsigned char * cgrib, \fBg2int\fP * iofst, \fBg2int\fP ** ids, \fBg2int\fP * idslen)" .PP This subroutine unpacks Section 1 (Identification Section) as defined in GRIB Edition 2\&. .PP \fBParameters\fP .RS 4 \fIcgrib\fP char array containing Section 1 of the GRIB2 message\&. .br \fIiofst\fP Bit offset for the beginning of Section 1 in cgrib\&. .br \fIids\fP address of pointer to integer array containing information read from Section 1, the Identification section\&. .IP "\(bu" 2 ids[0] Identification of originating Centre (see Common Code Table C-1)\&. .IP "\(bu" 2 ids[1] Identification of originating Sub-centre\&. .IP "\(bu" 2 ids[2] GRIB Master Tables Version Number (see Code Table 1\&.0)\&. .IP "\(bu" 2 ids[3] GRIB Local Tables Version Number (see Code Table 1\&.1)\&. .IP "\(bu" 2 ids[4] Significance of Reference Time (Code Table 1\&.2) .IP "\(bu" 2 ids[5] Year ( 4 digits ) .IP "\(bu" 2 ids[6] Month .IP "\(bu" 2 ids[7] Day .IP "\(bu" 2 ids[8] Hour .IP "\(bu" 2 ids[9] Minute .IP "\(bu" 2 ids[10] Second .IP "\(bu" 2 ids[11] Production status of processed data (see Code Table 1\&.3)\&. .IP "\(bu" 2 ids[12] Type of processed data (see Code Table 1\&.4)\&. .PP .br \fIidslen\fP Number of elements in ids\&. .RE .PP \fBReturns\fP .RS 4 .IP "\(bu" 2 0 no error .IP "\(bu" 2 2 Array passed is not section 1 .IP "\(bu" 2 6 memory allocation error .PP .RE .PP \fBAuthor\fP .RS 4 Stephen Gilbert .RE .PP \fBDate\fP .RS 4 2002-10-29 .RE .PP .PP Definition at line 44 of file g2_unpack1\&.c\&. .PP References gbit()\&. .PP Referenced by g2_getfld()\&. .SS "\fBg2int\fP g2_unpack2 (unsigned char * cgrib, \fBg2int\fP * iofst, \fBg2int\fP * lencsec2, unsigned char ** csec2)" .PP This subroutine unpacks Section 2 (Local Use Section) as defined in GRIB Edition 2\&. PROGRAM HISTORY LOG: .IP "\(bu" 2 2002-10-31 Gilbert .IP "\(bu" 2 2008-12-23 Wesley - Initialize lencsec2 Length of Local Use data .IP "\(bu" 2 2010-08-05 Vuong - If section 2 has zero length, ierr=0 .PP .PP \fBParameters\fP .RS 4 \fIcgrib\fP char array containing Section 2 of the GRIB2 message\&. .br \fIiofst\fP Bit offset for the beginning of Section 2 in cgrib\&. The modified version will be returned\&. .br \fIlencsec2\fP Length (in octets) of Local Use data\&. .br \fIcsec2\fP Pointer to a char array containing local use data\&. .RE .PP \fBReturns\fP .RS 4 .IP "\(bu" 2 0 no error .IP "\(bu" 2 2 Array passed is not section 2 .IP "\(bu" 2 6 memory allocation error .PP .RE .PP \fBAuthor\fP .RS 4 Stephen Gilbert .RE .PP \fBDate\fP .RS 4 2002-10-31 .RE .PP .PP Definition at line 34 of file g2_unpack2\&.c\&. .PP References gbit()\&. .PP Referenced by g2_getfld()\&. .SS "\fBg2int\fP g2_unpack3 (unsigned char * cgrib, \fBg2int\fP * iofst, \fBg2int\fP ** igds, \fBg2int\fP ** igdstmpl, \fBg2int\fP * mapgridlen, \fBg2int\fP ** ideflist, \fBg2int\fP * idefnum)" .PP This routine unpacks Section 3 (Grid Definition Section) as defined in GRIB Edition 2\&. PROGRAM HISTORY LOG: .IP "\(bu" 2 2002-10-31 Gilbert .IP "\(bu" 2 2009-01-14 Vuong Changed structure name template to gtemplate .PP .PP \fBParameters\fP .RS 4 \fIcgrib\fP Char array ontaining Section 3 of the GRIB2 message\&. .br \fIiofst\fP Bit offset for the beginning of Section 3 in cgrib\&. .br \fIigds\fP Contains information read from the appropriate GRIB Grid Definition Section 3 for the field being returned\&. .IP "\(bu" 2 igds[0] Source of grid definition (see Code Table 3\&.0) .IP "\(bu" 2 igds[1] Number of grid points in the defined grid\&. .IP "\(bu" 2 igds[2] Number of octets needed for each additional grid points definition\&. Used to define number of points in each row (or column) for non-regular grids\&. = 0, if using regular grid\&. .IP "\(bu" 2 igds[3] Interpretation of list for optional points definition\&. (Code Table 3\&.11) .IP "\(bu" 2 igds[4] Grid Definition Template Number (Code Table 3\&.1)\&. .PP .br \fIigdstmpl\fP - Pointer to integer array containing the data values for the specified Grid Definition Template (NN=igds[4])\&. Each element of this integer array contains an entry (in the order specified) of Grid Defintion Template 3\&.NN .br \fImapgridlen-\fP Number of elements in igdstmpl[]\&. i\&.e\&. number of entries in Grid Defintion Template 3\&.NN (NN=igds[4])\&. .br \fIideflist\fP (Used if igds[2] \&.ne\&. 0) Pointer to integer array containing the number of grid points contained in each row ( or column )\&. (part of Section 3)\&. .br \fIidefnum\fP (Used if igds[2] \&.ne\&. 0) The number of entries in array ideflist\&. i\&.e\&. number of rows (or columns) for which optional grid points are defined\&. .RE .PP \fBReturns\fP .RS 4 .IP "\(bu" 2 0 no error .IP "\(bu" 2 2 Not Section 3 .IP "\(bu" 2 5 'GRIB' message contains an undefined Grid Definition Template\&. .IP "\(bu" 2 6 memory allocation error .PP .RE .PP \fBAuthor\fP .RS 4 Stephen Gilbert .RE .PP \fBDate\fP .RS 4 2002-10-31 .RE .PP .PP Definition at line 53 of file g2_unpack3\&.c\&. .PP References gtemplate::ext, extgridtemplate(), gtemplate::extlen, gbit(), gbits(), getgridtemplate(), gtemplate::map, gtemplate::maplen, and gtemplate::needext\&. .PP Referenced by g2_getfld()\&. .SS "\fBg2int\fP g2_unpack4 (unsigned char * cgrib, \fBg2int\fP * iofst, \fBg2int\fP * ipdsnum, \fBg2int\fP ** ipdstmpl, \fBg2int\fP * mappdslen, \fBg2float\fP ** coordlist, \fBg2int\fP * numcoord)" .PP This subroutine unpacks Section 4 (Product Definition Section) as defined in GRIB Edition 2\&. PROGRAM HISTORY LOG: .IP "\(bu" 2 2002-10-31 Gilbert .IP "\(bu" 2 2009-01-14 Vuong Changed structure name template to gtemplate .PP .PP \fBParameters\fP .RS 4 \fIcgrib\fP Char array containing Section 4 of the GRIB2 message\&. .br \fIiofst\fP Bit offset of the beginning of Section 4 in cgrib\&. Returned with updated bit offset\&. .br \fIipdsnum\fP Product Definition Template Number (see Code Table 4\&.0)\&. .br \fIipdstmpl\fP Pointer to integer array containing the data values for the specified Product Definition Template (N=ipdsnum)\&. Each element of this integer array contains an entry (in the order specified) of Product Defintion Template 4\&.N\&. .br \fImappdslen\fP Number of elements in ipdstmpl\&. i\&.e\&. number of entries in Product Defintion Template 4\&.N (N=ipdsnum)\&. .br \fIcoordlist\fP Pointer to real array containing floating point values intended to document the vertical discretisation associated to model data on hybrid coordinate vertical levels\&. (part of Section 4)\&. .br \fInumcoord\fP number of values in array coordlist\&. .RE .PP \fBReturns\fP .RS 4 .IP "\(bu" 2 0 no error .IP "\(bu" 2 2 Not section 4 .IP "\(bu" 2 5 'GRIB' message contains an undefined Product Definition Template\&. .IP "\(bu" 2 6 memory allocation error .PP .RE .PP \fBAuthor\fP .RS 4 Stephen Gilbert .RE .PP \fBDate\fP .RS 4 2002-10-31 .RE .PP .PP Definition at line 42 of file g2_unpack4\&.c\&. .PP References gtemplate::ext, gtemplate::extlen, extpdstemplate(), gbit(), gbits(), getpdstemplate(), gtemplate::map, gtemplate::maplen, gtemplate::needext, and rdieee()\&. .PP Referenced by g2_getfld()\&. .SS "\fBg2int\fP g2_unpack5 (unsigned char * cgrib, \fBg2int\fP * iofst, \fBg2int\fP * ndpts, \fBg2int\fP * idrsnum, \fBg2int\fP ** idrstmpl, \fBg2int\fP * mapdrslen)" .PP This subroutine unpacks Section 5 (Data Representation Section) as defined in GRIB Edition 2\&. PROGRAM HISTORY LOG: .IP "\(bu" 2 2002-10-31 Gilbert .IP "\(bu" 2 2009-01-14 Vuong Changed structure name template to gtemplate .PP .PP \fBParameters\fP .RS 4 \fIcgrib\fP char array containing Section 5 of the GRIB2 message\&. .br \fIiofst\fP Bit offset for the beginning of Section 5 in cgrib\&. Returned with bit offset at the end of Section 5\&. .br \fIndpts\fP Number of data points unpacked and returned\&. .br \fIidrsnum\fP Data Representation Template Number (see Code Table 5\&.0)\&. .br \fIidrstmpl\fP Pointer to an integer array containing the data values for the specified Data Representation Template (N=idrsnum)\&. Each element of this integer array contains an entry (in the order specified) of Data Representation Template 5\&.N\&. .br \fImapdrslen-\fP Number of elements in idrstmpl\&. i\&.e\&. number of entries in Data Representation Template 5\&.N (N=idrsnum)\&. .RE .PP \fBReturns\fP .RS 4 .IP "\(bu" 2 0 no error .IP "\(bu" 2 2 Not Section 5 .IP "\(bu" 2 6 memory allocation error .IP "\(bu" 2 7 'GRIB' message contains an undefined Data Representation Template\&. .PP .RE .PP \fBAuthor\fP .RS 4 Stephen Gilbert .RE .PP \fBDate\fP .RS 4 2002-10-31 .RE .PP .PP Definition at line 40 of file g2_unpack5\&.c\&. .PP References gtemplate::ext, extdrstemplate(), gtemplate::extlen, gbit(), getdrstemplate(), gtemplate::map, gtemplate::maplen, and gtemplate::needext\&. .PP Referenced by g2_getfld()\&. .SS "\fBg2int\fP g2_unpack6 (unsigned char * cgrib, \fBg2int\fP * iofst, \fBg2int\fP ngpts, \fBg2int\fP * ibmap, \fBg2int\fP ** bmap)" .PP This subroutine unpacks Section 6 (Bit-Map Section) as defined in GRIB Edition 2\&. .PP \fBParameters\fP .RS 4 \fIcgrib\fP char array containing Section 6 of the GRIB2 message\&. .br \fIiofst\fP Bit offset of the beginning of Section 6 in cgrib\&. .br \fIngpts\fP Number of grid points specified in the bit-map .br \fIibmap\fP Bitmap indicator (see Code Table 6\&.0) .IP "\(bu" 2 0 bitmap applies and is included in Section 6\&. .IP "\(bu" 2 1-253 Predefined bitmap applies .IP "\(bu" 2 254 Previously defined bitmap applies to this field .IP "\(bu" 2 255 Bit map does not apply to this product\&. .PP .br \fIbmap\fP Pointer to an integer array containing decoded bitmap\&. (if ibmap=0) .RE .PP \fBReturns\fP .RS 4 .IP "\(bu" 2 0 no error .IP "\(bu" 2 2 Not Section 6 .IP "\(bu" 2 4 Unrecognized pre-defined bit-map\&. .IP "\(bu" 2 6 memory allocation error .PP .RE .PP \fBAuthor\fP .RS 4 Stephen Gilbert .RE .PP \fBDate\fP .RS 4 2002-10-31 .RE .PP .PP Definition at line 33 of file g2_unpack6\&.c\&. .PP References gbit(), and gbits()\&. .PP Referenced by g2_getfld()\&. .SS "\fBg2int\fP g2_unpack7 (unsigned char * cgrib, \fBg2int\fP * iofst, \fBg2int\fP igdsnum, \fBg2int\fP * igdstmpl, \fBg2int\fP idrsnum, \fBg2int\fP * idrstmpl, \fBg2int\fP ndpts, \fBg2float\fP ** fld)" .PP This subroutine unpacks Section 7 (Data Section) as defined in GRIB Edition 2\&. PROGRAM HISTORY LOG: .IP "\(bu" 2 2002-10-31 Gilbert .IP "\(bu" 2 2002-12-20 Gilbert - Added GDT info to arguments and added 5\&.51 processing\&. .IP "\(bu" 2 2003-08-29 Gilbert - Added support for new templates using PNG and JPEG2000 algorithms/templates\&. .IP "\(bu" 2 2004-11-29 Gilbert - JPEG2000 now allowed to use WMO Template no\&. 5\&.40 PNG now allowed to use WMO Template no\&. 5\&.41 .IP "\(bu" 2 2004-12-16 Taylor - Added check on comunpack return code\&. .IP "\(bu" 2 2008-12-23 Wesley - Initialize Number of data points unpacked .PP .PP \fBParameters\fP .RS 4 \fIcgrib\fP char array containing Section 7 of the GRIB2 message .br \fIiofst\fP Bit offset of the beginning of Section 7 in cgrib\&. .br \fIigdsnum\fP Grid Definition Template Number (see Code Table 3\&.0) (Only used for DRS Template 5\&.51) .br \fIigdstmpl\fP Pointer to an integer array containing the data values for the specified Grid Definition Template (N=igdsnum)\&. Each element of this integer array contains an entry (in the order specified) of Grid Definition Template 3\&.N\&. (Only used for DRS Template 5\&.51)\&. .br \fIidrsnum\fP Data Representation Template Number (see Code Table 5\&.0) .br \fIidrstmpl\fP Pointer to an integer array containing the data values for the specified Data Representation Template (N=idrsnum)\&. Each element of this integer array contains an entry (in the order specified) of Data Representation Template 5\&.N .br \fIndpts\fP Number of data points unpacked and returned\&. .br \fIfld\fP Pointer to a float array containing the unpacked data field\&. .RE .PP \fBReturns\fP .RS 4 .IP "\(bu" 2 0 no error .IP "\(bu" 2 2 Not section 7 .IP "\(bu" 2 4 Unrecognized Data Representation Template .IP "\(bu" 2 5 need one of GDT 3\&.50 through 3\&.53 to decode DRT 5\&.51 .IP "\(bu" 2 6 memory allocation error .IP "\(bu" 2 7 corrupt section 7\&. .PP .RE .PP \fBAuthor\fP .RS 4 Stephen Gilbert .RE .PP \fBDate\fP .RS 4 2002-10-31 .RE .PP .PP Definition at line 66 of file g2_unpack7\&.c\&. .PP References comunpack(), gbit(), jpcunpack(), pngunpack(), rdieee(), simunpack(), and specunpack()\&. .PP Referenced by g2_getfld()\&. .SH "Author" .PP Generated automatically by Doxygen for NCEPLIBS-g2c from the source code\&.