NCEPLIBS-g2c  1.8.0
g2_unpack1.c File Reference

Unpack Section 1 (Identification Section) as defined in GRIB Edition 2. More...

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

Go to the source code of this file.

Functions

g2int g2_unpack1 (unsigned char *cgrib, g2int *iofst, g2int **ids, g2int *idslen)
 This subroutine unpacks Section 1 - Identification Section as defined in GRIB Edition 2. More...
 

Detailed Description

Unpack Section 1 (Identification Section) as defined in GRIB Edition 2.

Author
Stephen Gilbert
Date
2002-10-29

Definition in file g2_unpack1.c.

Function Documentation

◆ g2_unpack1()

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

This subroutine unpacks Section 1 - Identification Section as defined in GRIB Edition 2.

Parameters
cgribchar array containing Section 1 of the GRIB2 message.
iofstBit offset for the beginning of Section 1 in cgrib.
idsPointer 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).
idslenNumber of elements in ids.
Returns
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().