47 g2int *mappdslen,
float **coordlist,
g2int *numcoord)
50 g2int needext, i, j, nbits, isecnum;
51 g2int lensec, isign, newlen;
60 gbit(cgrib, &lensec, *iofst, 32);
62 gbit(cgrib, &isecnum, *iofst, 8);
72 gbit(cgrib, numcoord, *iofst, 16);
74 gbit(cgrib, ipdsnum, *iofst, 16);
83 *mappdslen = mappds->
maplen;
90 lipdstmpl = calloc(*mappdslen,
sizeof(
g2int));
99 *ipdstmpl = lipdstmpl;
101 for (i = 0; i < mappds->
maplen; i++)
103 nbits = abs(mappds->
map[i]) * 8;
104 if (mappds->
map[i] >= 0)
106 gbit(cgrib, lipdstmpl + i, *iofst, nbits);
110 gbit(cgrib, &isign, *iofst, 1);
111 gbit(cgrib, lipdstmpl + i, *iofst + 1, nbits - 1);
112 if (isign == 1) lipdstmpl[i] = -1 * lipdstmpl[i];
114 *iofst = *iofst + nbits;
126 lipdstmpl = realloc(lipdstmpl, newlen *
sizeof(
g2int));
127 *ipdstmpl = lipdstmpl;
130 for (i = *mappdslen; i < newlen; i++)
132 nbits = abs(mappds->
ext[j]) * 8;
133 if (mappds->
ext[j] >= 0)
135 gbit(cgrib, lipdstmpl + i, *iofst, nbits);
139 gbit(cgrib, &isign, *iofst, 1);
140 gbit(cgrib, lipdstmpl + i, *iofst+1, nbits-1);
142 lipdstmpl[i] = -1 * lipdstmpl[i];
144 *iofst = *iofst + nbits;
159 coordieee = calloc(*numcoord,
sizeof(
g2int));
160 lcoordlist = calloc(*numcoord,
sizeof(
float));
161 if (coordieee == 0 || lcoordlist == 0)
173 *coordlist = lcoordlist;
175 gbits(cgrib, coordieee, *iofst, 32, 0, *numcoord);
176 rdieee(coordieee, *coordlist, *numcoord);
178 *iofst = *iofst + (32 * (*numcoord));