Scroll to navigation

g2_unpack1.c(3) Library Functions Manual g2_unpack1.c(3)

NAME

g2_unpack1.c - Unpack Section 1 (Identification Section) of a GRIB2 message.

SYNOPSIS

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

Functions


g2int g2_unpack1 (unsigned char *cgrib, g2int *iofst, g2int **ids, g2int *idslen)
Unpacks Section 1 - Identification Section of a GRIB2 message.

Detailed Description

Unpack Section 1 (Identification Section) of a GRIB2 message.

Author

Stephen Gilbert

Date

2002-10-29

Definition in file g2_unpack1.c.

Function Documentation

g2int g2_unpack1 (unsigned char * cgrib, g2int * iofst, g2int ** ids, g2int * idslen)

Unpacks Section 1 - Identification Section of a GRIB2 message.

Parameters

cgrib char array containing Section 1 of the GRIB2 message.
iofst Bit offset for the beginning of Section 1 in cgrib.
ids Pointer that gets an array which contians the information read from Section 1, the Identification section. This array is allocated by this function, and must be freed by caller (using g2_free()).
  • ids[0] Identification of originating Centre (see Table 0).
  • ids[1] Identification of originating Sub-centre (see Table C).
  • ids[2] GRIB Master Tables Version Number (see Table 1.0).
  • ids[3] GRIB Local Tables Version Number (see Table 1.1).
  • ids[4] Significance of Reference Time (see Table 1.2).
  • ids[5] Year (4 digits)
  • ids[6] Month
  • ids[7] Day
  • ids[8] Hour
  • ids[9] Minute
  • ids[10] Second
  • ids[11] Production status of processed data (see Table 1.3).
  • ids[12] Type of processed data (see Table 1.4).

idslen Number of elements in ids.

Returns

  • G2_NO_ERROR No error.
  • G2_UNPACK_BAD_SEC Array passed is not section 1.
  • G2_UNPACK_NO_MEM memory allocation error.

Author

Stephen Gilbert

Date

2002-10-29

Definition at line 55 of file g2_unpack1.c.

References G2_NO_ERROR, G2_UNPACK_BAD_SEC, G2_UNPACK_NO_MEM, and gbit().

Referenced by g2_getfld().

Author

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

Version 2.0.0 NCEPLIBS-g2c