45 g2int needext, i, j, nbits, isecnum;
46 g2int lensec, isign, newlen;
52 gbit(cgrib, &lensec, *iofst, 32);
54 gbit(cgrib, &isecnum, *iofst, 8);
64 gbit(cgrib, ndpts, *iofst, 32);
66 gbit(cgrib, idrsnum, *iofst, 16);
75 *mapdrslen = mapdrs->
maplen;
82 lidrstmpl = calloc(*mapdrslen,
sizeof(
g2int));
93 *idrstmpl = lidrstmpl;
95 for (i = 0; i < mapdrs->
maplen; i++)
97 nbits = abs(mapdrs->
map[i]) * 8;
98 if (mapdrs->
map[i] >= 0)
100 gbit(cgrib, lidrstmpl + i, *iofst, nbits);
104 gbit(cgrib, &isign, *iofst, 1);
105 gbit(cgrib, lidrstmpl + i, *iofst + 1, nbits - 1);
107 lidrstmpl[i] = -1 * lidrstmpl[i];
109 *iofst = *iofst + nbits;
121 lidrstmpl = realloc(lidrstmpl, newlen *
sizeof(
g2int));
122 *idrstmpl = lidrstmpl;
126 for (i = *mapdrslen; i < newlen; i++)
128 nbits = abs(mapdrs->
ext[j]) * 8;
129 if (mapdrs->
ext[j] >= 0)
131 gbit(cgrib, lidrstmpl + i, *iofst, nbits);
135 gbit(cgrib, &isign, *iofst, 1);
136 gbit(cgrib, lidrstmpl + i, *iofst + 1, nbits - 1);
138 lidrstmpl[i] = -1 * lidrstmpl[i];
140 *iofst = *iofst + nbits;