70 g2int zero = 0, one = 1;
78 g2int mapsec1[
MAPSEC1LEN] = {2, 2, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1};
79 g2int i, lensec1, iofst, ibeg, nbits, len;
84 printf(
"g2_create: can only code GRIB edition 2.");
94 sbit(cgrib, &zero, 32, 16);
95 sbit(cgrib, listsec0 + 0, 48, 8);
96 sbit(cgrib, listsec0 + 1, 56, 8);
101 sbit(cgrib, &one, iofst, 8);
109 nbits = mapsec1[i] * 8;
110 sbit(cgrib, listsec1 + i, iofst, nbits);
111 iofst = iofst + nbits;
116 lensec1 = (iofst - ibeg) / 8;
117 sbit(cgrib, &lensec1, ibeg, 32);
120 sbit(cgrib, &zero, 64, 32);
122 sbit(cgrib, &len, 96, 32);
g2int g2_create(unsigned char *cgrib, g2int *listsec0, g2int *listsec1)
This routine initializes a new GRIB2 message and packs GRIB2 Section 0 (Indicator Section) and Sectio...
#define LENSEC0
Length of GRIB Section 0.
#define MAPSEC1LEN
Length of Map Section 1.
void sbit(unsigned char *out, g2int *in, g2int iskip, g2int nbits)
Store bits - put arbitrary size values into a packed bit string, taking the low order bits from each ...
#define G2_CREATE_GRIB_VERSION
Wrong GRIB version for g2_create(), must be 2.
int64_t g2int
Long integer type.
Header file with internal function prototypes NCEPLIBS-g2c library.