Scroll to navigation

g2_unpack4.c(3) NCEPLIBS-g2c g2_unpack4.c(3)

NAME

g2_unpack4.c - Unpack Section 4 (Product Definition Section) as defined in GRIB Edition 2.

SYNOPSIS

#include <stdio.h>
#include <stdlib.h>
#include 'grib2.h'

Functions


g2int g2_unpack4 (unsigned char *cgrib, g2int *iofst, g2int *ipdsnum, g2int **ipdstmpl, g2int *mappdslen, g2float **coordlist, g2int *numcoord)
This subroutine unpacks Section 4 (Product Definition Section) as defined in GRIB Edition 2.

Detailed Description

Unpack Section 4 (Product Definition Section) as defined in GRIB Edition 2.

Author

Stephen Gilbert

Date

2002-10-31

Definition in file g2_unpack4.c.

Function Documentation

g2int g2_unpack4 (unsigned char * cgrib, g2int * iofst, g2int * ipdsnum, g2int ** ipdstmpl, g2int * mappdslen, g2float ** coordlist, g2int * numcoord)

This subroutine unpacks Section 4 (Product Definition Section) as defined in GRIB Edition 2. PROGRAM HISTORY LOG:

  • 2002-10-31 Gilbert
  • 2009-01-14 Vuong Changed structure name template to gtemplate

Parameters

cgrib Char array containing Section 4 of the GRIB2 message.
iofst Bit offset of the beginning of Section 4 in cgrib. Returned with updated bit offset.
ipdsnum Product Definition Template Number (see Code Table 4.0).
ipdstmpl 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.
mappdslen Number of elements in ipdstmpl. i.e. number of entries in Product Defintion Template 4.N (N=ipdsnum).
coordlist 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).
numcoord number of values in array coordlist.

Returns

  • 0 no error
  • 2 Not section 4
  • 5 'GRIB' message contains an undefined Product Definition Template.
  • 6 memory allocation error

Author

Stephen Gilbert

Date

2002-10-31

Definition at line 42 of file g2_unpack4.c.

References gtemplate::ext, gtemplate::extlen, extpdstemplate(), gbit(), gbits(), getpdstemplate(), gtemplate::map, gtemplate::maplen, gtemplate::needext, and rdieee().

Referenced by g2_getfld().

Author

Generated automatically by Doxygen for NCEPLIBS-g2c from the source code.

Tue May 3 2022 Version 1.6.4