g2intg2_unpack7(unsignedchar*cgrib,g2int*iofst,g2intigdsnum,g2int*igdstmpl,g2intidrsnum,g2int*idrstmpl,g2intndpts,float**fld)
This subroutine unpacks Section 7 (Data Section) of a GRIB2 message. This function is maintained for
backward compatibility. Users may wish to use the newer g2c_unpack7() function instead.
Parameterscgrib char array containing Section 7 of the GRIB2 message
iofst Pointer to a bit offset of the beginning of Section 7 in cgrib. This is updated by this
function to reflect the data read in this function. After this function is successfully called, the
value pointed to by iofst will be the number of bits to the end of section 7 in cbuf.
igdsnum Grid Definition Template Number (see Code Table 3.0). (Only used for DRS Template 5.51.)
igdstmpl 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).
idrsnum Data Representation Template Number (see Code Table 5.0).
idrstmpl 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
ndpts Number of data points to be unpacked and returned.
fld Pointer to a float pointer which gets a pointer to an array allocated by this function to hold
the unpacked data. This memory must be freed by the caller.
Returns
• G2_NO_ERROR No error.
• G2_UNPACK_BAD_SEC Array passed had incorrect section number.
• G2_UNPACK7_BAD_DRT Unrecognized Data Representation Template.
• G2_UNPACK7_WRONG_GDT need one of GDT 3.50 through 3.53 to decode DRT 5.51
• G2_UNPACK_NO_MEM Memory allocation error.
• G2_UNPACK7_CORRUPT_SEC Corrupt section 7.
Author
Stephen Gilbert
Date
2002-10-31
Definition at line 214 of file g2_unpack7.c.
References g2c_unpack7_int().
Referenced by g2_getfld().
intg2c_unpack7(unsignedchar*cgrib,intigdsnum,intgds_tmpl_len,longlongint*gdstmpl,intidrsnum,intdrs_tmpl_len,longlongint*drstmpl,intndpts,float*fld)
This subroutine unpacks Section 7 (Data Section) of a GRIB2 message. This function is the newer version
of g2_unpack7().
Parameterscgrib char array containing Section 7 of the GRIB2 message
igdsnum Grid Definition Template Number (see Code Table 3.0). (Only used for DRS Template 5.51.) May
be zero for other templates.
gds_tmpl_len Number of elements in the GDS template.
gdstmpl 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). May be NULL.
idrsnum Data Representation Template Number (see Code Table 5.0).
drs_tmpl_len Number of elements in the DRS template.
drstmpl 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
ndpts Number of data points to be unpacked and returned.
fld Pointer which the data. Memory must be allocated in advance by caller.
Returns
• G2_NO_ERROR No error.
• G2_UNPACK_BAD_SEC Array passed had incorrect section number.
• G2_UNPACK7_BAD_DRT Unrecognized Data Representation Template.
• G2_UNPACK7_WRONG_GDT need one of GDT 3.50 through 3.53 to decode DRT 5.51
• G2_UNPACK_NO_MEM Memory allocation error.
• G2_UNPACK7_CORRUPT_SEC Corrupt section 7.
Author
Stephen Gilbert
Date
2002-10-31
Definition at line 259 of file g2_unpack7.c.
References G2C_EINVAL, G2C_ENOMEM, g2c_unpack7_int(), and LOG.
Referenced by g2c_get_prod().
staticg2intg2c_unpack7_int(unsignedchar*cgrib,g2int*iofst,g2intigdsnum,g2int*igdstmpl,g2intidrsnum,g2int*idrstmpl,g2intndpts,intv1,float**fld)[static]
Unpacks Section 7 (Data Section) of a GRIB2 message. This function is the internal function called by
both g2_unpack7() and g2c_unpack7().
Parameterscgrib char array containing Section 7 of the GRIB2 message
iofst Pointer to a bit offset of the beginning of Section 7 in cgrib. This is updated by this
function to reflect the data read in this function. After this function is successfully called, the
value pointed to by iofst will be the number of bits to the end of section 7 in cbuf.
igdsnum Grid Definition Template Number (see Code Table 3.0). (Only used for DRS Template 5.51. May
be 0 for other templates.)
igdstmpl 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, may be NULL for other templates).
idrsnum Data Representation Template Number (see Code Table 5.0).
idrstmpl 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
ndpts Number of data points to be unpacked and returned.
v1 If non-zero, then act like the V1 G2C API. This includes:
• printing error messages to stderr in the event of error.
• returning V1 error codes.
fld Pointer to a float pointer which gets a pointer to an array allocated by this function to hold
the unpacked data. This memory must be freed by the caller.
Returns
• G2_NO_ERROR No error.
• G2_UNPACK_BAD_SEC Array passed had incorrect section number.
• G2_UNPACK7_BAD_DRT Unrecognized Data Representation Template.
• G2_UNPACK7_WRONG_GDT need one of GDT 3.50 through 3.53 to decode DRT 5.51
• G2_UNPACK_NO_MEM Memory allocation error.
• G2_UNPACK7_CORRUPT_SEC Corrupt section 7.
Author
Stephen Gilbert
Date
2002-10-31
Definition at line 67 of file g2_unpack7.c.
References aecunpack(), comunpack(), G2_NO_ERROR, G2_UNPACK7_BAD_DRT, G2_UNPACK7_CORRUPT_SEC,
G2_UNPACK7_WRONG_GDT, G2_UNPACK_BAD_SEC, G2_UNPACK_NO_MEM, gbit(), jpcunpack(), LOG, pngunpack(),
rdieee(), simunpack(), and specunpack().
Referenced by g2_unpack7(), and g2c_unpack7().