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)
Initialize a new GRIB2 message and pack GRIB2 Section 0 (Indicator Section) and Section 1 (Identifica...
void sbit(unsigned char *out, g2int *in, g2int iskip, g2int nbits)
Store arbitrary size values into a packed bit string, taking the low order bits from each value in th...