93 printf(
"getpdstemplate: PDS Template 4.%d not defined.\n", (
int)number);
124 g2int index, i, j, k, l;
137 new->extlen = list[26];
138 new->ext = malloc(
sizeof(
g2int) * new->extlen);
139 for (i = 0; i <
new->extlen; i++)
144 else if (number == 4)
146 new->extlen = list[25];
147 new->ext = malloc(
sizeof(
g2int) * new->extlen);
148 for (i = 0; i <
new->extlen; i++)
153 else if (number == 8)
157 new->extlen = (list[21] - 1) * 6;
158 new->ext = malloc(
sizeof(
g2int) * new->extlen);
159 for (j = 2; j <= list[21]; j++)
162 for (k = 0; k < 6; k++)
164 new->ext[l+k] =
new->map[23 + k];
169 else if (number == 9)
173 new->extlen = (list[28] - 1) * 6;
174 new->ext = malloc(
sizeof(
g2int) * new->extlen);
175 for (j = 2; j <= list[28]; j++)
178 for (k = 0; k < 6; k++)
180 new->ext[l + k] =
new->map[30 + k];
185 else if (number == 10)
189 new->extlen = (list[22] - 1) * 6;
190 new->ext = (
g2int *)malloc(
sizeof(
g2int)*
new->extlen);
191 for (j = 2; j <= list[22]; j++)
194 for (k = 0; k < 6; k++)
196 new->ext[l + k] =
new->map[24 + k];
201 else if (number == 11)
205 new->extlen = (list[24] - 1) * 6;
206 new->ext = malloc(
sizeof(
g2int) * new->extlen);
207 for (j = 2; j <= list[24]; j++)
210 for (k = 0; k < 6; k++)
212 new->ext[l + k] =
new->map[26 + k];
217 else if (number == 12)
221 new->extlen = (list[23] - 1) * 6;
222 new->ext = malloc(
sizeof(
g2int) * new->extlen);
223 for (j = 2; j <= list[23]; j++)
226 for (k = 0; k < 6; k++)
228 new->ext[l + k] =
new->map[25 + k];
233 else if (number == 13)
235 new->extlen = ((list[37] - 1) * 6) + list[26];
236 new->ext = malloc(
sizeof(
g2int) * new->extlen);
239 for (j = 2; j <= list[37]; j++)
242 for (k = 0; k < 6; k++)
244 new->ext[l + k] =
new->map[39 + k];
248 l = (list[37] - 1) * 6;
251 for (i = 0; i < list[26]; i++)
256 else if (number == 14)
258 new->extlen = ((list[36] - 1) * 6) + list[25];
259 new->ext = malloc(
sizeof(
g2int) * new->extlen);
262 for (j = 2; j <= list[36]; j++)
265 for (k = 0; k < 6; k++)
267 new->ext[l + k] =
new->map[38 + k];
271 l = (list[36] - 1) * 6;
274 for (i = 0; i < list[25]; i++)
279 else if (number == 30)
281 new->extlen = list[4] * 5;
282 new->ext = malloc(
sizeof(
g2int) * new->extlen);
283 for (i = 0;i < list[4]; i++)
293 else if (number == 31)
295 new->extlen = list[4] * 5;
296 new->ext = malloc(
sizeof(
g2int) * new->extlen);
297 for (i = 0; i < list[4]; i++)
307 else if (number == 42)
311 new->extlen = (list[22] - 1) * 6;
312 new->ext = malloc(
sizeof(
g2int) * new->extlen);
313 for (j = 2; j <= list[22]; j++)
316 for (k = 0; k < 6; k++)
318 new->ext[l + k] =
new->map[24 + k];
323 else if (number == 43)
327 new->extlen = (list[25] - 1) * 6;
328 new->ext = malloc(
sizeof(
g2int) * new->extlen);
329 for (j = 2; j <= list[25]; j++)
332 for (k = 0; k < 6; k++)
334 new->ext[l + k] =
new->map[27 + k];
339 else if (number == 32)
341 new->extlen = list[9] * 10;
342 new->ext = malloc(
sizeof(
g2int) * new->extlen);
343 for (i = 0; i < list[9]; i++)
349 new->ext[l + 3] = -1;
350 new->ext[l + 4] = -4;
353 else if (number == 46)
357 new->extlen = (list[27] - 1) * 6;
358 new->ext = malloc(
sizeof(
g2int) * new->extlen);
359 for (j = 2; j <= list[27]; j++)
362 for (k = 0; k < 6; k++)
364 new->ext[l + k] =
new->map[29 + k];
369 else if (number == 47)
373 new->extlen = (list[30] - 1) * 6;
374 new->ext = malloc(
sizeof(
g2int) * new->extlen);
375 for (j = 2; j <= list[30]; j++)
378 for (k = 0; k < 6; k++)
380 new->ext[l + k] =
new->map[32 + k];
384 else if (number == 51)
386 new->extlen = list[15]*11;
387 new->ext = malloc(
sizeof(
g2int) * new->extlen);
388 for (i = 0; i < list[15]; i++)
399 else if (number == 33)
401 new->extlen = list[9];
402 new->ext = malloc(
sizeof(
g2int) * new->extlen);
403 for (i = 0; i <
new->extlen; i++)
408 else if (number == 34)
410 new->extlen = ((list[24] - 1) * 6)+list[9];
411 new->ext = malloc(
sizeof(
g2int) * new->extlen);
414 for (j = 2; j <= list[24]; j++)
417 for (k = 0; k < 6; k++)
419 new->ext[l + k] =
new->map[26 + k];
423 l = (list[24] - 1) * 6;
426 for (i = 0; i < list[9]; i++)
431 else if (number == 53)
433 new->extlen = list[3];
434 new->ext = malloc(
sizeof(
g2int) * new->extlen);
435 for (i = 0; i <
new->extlen; i++)
440 else if (number == 54)
442 new->extlen = list[3];
443 new->ext = malloc(
sizeof(
g2int) * new->extlen);
444 for (i = 0;i<
new->extlen;i++)
449 else if (number == 91)
451 new->extlen = ((list[28] - 1) * 6)+list[15];
452 new->ext = malloc(
sizeof(
g2int) * new->extlen);
455 for (j = 2; j <= list[28]; j++)
458 for (k = 0; k < 6; k++)
460 new->ext[l + k] =
new->map[30 + k];
464 l = (list[29] - 1) * 6;
467 for (i = 0; i < list[15]; i++)
473 else if (number == 57)
475 new->extlen = list[6] * 15;
476 new->ext = malloc(
sizeof(
g2int) * new->extlen);
477 for (i = 0; i < list[6]; i++)
498 else if (number == 61)
502 new->extlen = (list[30] - 1) * 6;
503 new->ext = malloc(
sizeof(
g2int) * new->extlen);
504 for (j = 2; j <= list[30]; j++)
507 for (k = 0; k < 6; k++)
509 new->ext[l + k] =
new->map[32 + k];
Header file for NCEPLIBS-g2c library.
int64_t g2int
Long integer type.
Struct for GRIB template.
gtemplate * extpdstemplate(g2int number, g2int *list)
This subroutine generates the remaining octet map for a given Product Definition Template,...
g2int getpdsindex(g2int number)
This function returns the index of specified Product Definition Template in array templates.
gtemplate * getpdstemplate(g2int number)
This subroutine returns PDS template information for a specified Product Definition Template.
This include file contains info on all the available GRIB2 Product Definition Templates used in [Sect...
#define MAXPDSTEMP
Maximum number of templates.
g2int needext
Does template need extension?
const struct pdstemplate templatespds[MAXPDSTEMP]
Date for struct for PDS template.
g2int template_num
Template number.
g2int mappdslen
The number of entries in the template.