66 g2int zero = 0, one = 1;
74 g2int mapsec1[
MAPSEC1LEN] = {2, 2, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1};
75 g2int i, lensec1, iofst, ibeg, nbits, len;
80 printf(
"g2_create: can only code GRIB edition 2.");
91 sbit(cgrib, &zero, 32, 16);
92 sbit(cgrib, listsec0 + 0, 48, 8);
93 sbit(cgrib, listsec0 + 1, 56, 8);
98 sbit(cgrib, &one, iofst, 8);
106 nbits = mapsec1[i] * 8;
107 sbit(cgrib, listsec1 + i, iofst, nbits);
108 iofst = iofst + nbits;
113 lensec1 = (iofst - ibeg) / 8;
114 sbit(cgrib, &lensec1, ibeg, 32);
117 sbit(cgrib, &zero, 64, 32);
119 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 sections 0 (Indicator Section) and 1 (Id...
#define LENSEC0
Length of GRIB Section 0.
#define MAPSEC1LEN
Length of Map Section 1.
void sbit(unsigned char *out, g2int *in, g2int iskip, g2int nbyte)
Store bits - put arbitrary size values into a packed bit string, taking the low order bits from each ...
Header file for NCEPLIBS-g2c library.
int64_t g2int
Long integer type.