NCEPLIBS-g2c 2.0.0
Loading...
Searching...
No Matches
pdstemplates.c
Go to the documentation of this file.
1
41#include "grib2_int.h"
42
46struct pdstemplate
47{
48 g2int template_num;
49 g2int mappdslen;
50 g2int needext;
52};
53
57static const struct pdstemplate templatespds[G2C_MAX_PDS_TEMPLATE] =
58 {
61 {0, 15, 0, {1, 1, 1, 1, 1, 2, 1, 1, -4, 1, -1, -4, 1, -1, -4}},
64 {1, 18, 0, {1, 1, 1, 1, 1, 2, 1, 1, -4, 1, -1, -4, 1, -1, -4, 1, 1, 1}},
67 {2, 17, 0, {1, 1, 1, 1, 1, 2, 1, 1, -4, 1, -1, -4, 1, -1, -4, 1, 1}},
70 {3, 31, 1, {1, 1, 1, 1, 1, 2, 1, 1, -4, 1, -1, -4, 1, -1, -4, 1, 1, 1, 1, 1, 1, 1, -4, -4, 4, 4, 1, -1, 4, -1, 4}},
73 {4, 30, 1, {1, 1, 1, 1, 1, 2, 1, 1, -4, 1, -1, -4, 1, -1, -4, 1, 1, 1, 1, 1, 1, 1, -4, 4, 4, 1, -1, 4, -1, 4}},
76 {5, 22, 0, {1, 1, 1, 1, 1, 2, 1, 1, -4, 1, -1, -4, 1, -1, -4, 1, 1, 1, -1, -4, -1, -4}},
79 {6, 16, 0, {1, 1, 1, 1, 1, 2, 1, 1, -4, 1, -1, -4, 1, -1, -4, 1}},
82 {7, 15, 0, {1, 1, 1, 1, 1, 2, 1, 1, -4, 1, -1, -4, 1, -1, -4}},
85 {8, 29, 1, {1, 1, 1, 1, 1, 2, 1, 1, -4, 1, -1, -4, 1, -1, -4, 2, 1, 1, 1, 1, 1, 1, 4, 1, 1, 1, 4, 1, 4}},
88 {9, 36, 1, {1, 1, 1, 1, 1, 2, 1, 1, -4, 1, -1, -4, 1, -1, -4, 1, 1, 1, -1, -4, -1, -4, 2, 1, 1, 1, 1, 1, 1, 4, 1, 1, 1, 4, 1, 4}},
91 {10, 30, 1, {1, 1, 1, 1, 1, 2, 1, 1, -4, 1, -1, -4, 1, -1, -4, 1, 2, 1, 1, 1, 1, 1, 1, 4, 1, 1, 1, 4, 1, 4}},
94 {11, 32, 1, {1, 1, 1, 1, 1, 2, 1, 1, -4, 1, -1, -4, 1, -1, -4, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 4, 1, 1, 1, 4, 1, 4}},
97 {12, 31, 1, {1, 1, 1, 1, 1, 2, 1, 1, -4, 1, -1, -4, 1, -1, -4, 1, 1, 2, 1, 1, 1, 1, 1, 1, 4, 1, 1, 1, 4, 1, 4}},
100 {13, 45, 1, {1, 1, 1, 1, 1, 2, 1, 1, -4, 1, -1, -4, 1, -1, -4, 1, 1, 1, 1, 1, 1, 1, -4, -4, 4, 4, 1, -1, 4, -1, 4, 2, 1, 1, 1, 1, 1, 1, 4, 1, 1, 1, 4, 1, 4}},
103 {14, 44, 1, {1, 1, 1, 1, 1, 2, 1, 1, -4, 1, -1, -4, 1, -1, -4, 1, 1, 1, 1, 1, 1, 1, -4, 4, 4, 1, -1, 4, -1, 4, 2, 1, 1, 1, 1, 1, 1, 4, 1, 1, 1, 4, 1, 4}},
106 {15, 18, 0, {1, 1, 1, 1, 1, 2, 1, 1, -4, 1, -1, -4, 1, -1, -4, 1, 1, 1}},
108 {20, 19, 0, {1, 1, 1, 1, 1, -4, 4, 2, 4, 2, 1, 1, 1, 1, 1, 2, 1, 3, 2}},
110 {30, 5, 1, {1, 1, 1, 1, 1}},
112 {31, 5, 1, {1, 1, 1, 1, 1}},
115 {40, 16, 0, {1, 1, 2, 1, 1, 1, 2, 1, 1, -4, 1, -1, -4, 1, -1, -4}},
118 {41, 19, 0, {1, 1, 2, 1, 1, 1, 2, 1, 1, -4, 1, -1, -4, 1, -1, -4, 1, 1, 1}},
122 {42, 30, 1, {1, 1, 2, 1, 1, 1, 2, 1, 1, -4, 1, -1, -4, 1, -1, -4, 2, 1, 1, 1, 1, 1, 1, 4, 1, 1, 1, 4, 1, 4}},
126 {43, 33, 1, {1, 1, 2, 1, 1, 1, 2, 1, 1, -4, 1, -1, -4, 1, -1, -4, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 4, 1, 1, 1, 4, 1, 4}},
128 {254, 3, 0, {1, 1, 4}},
131 {1000, 9, 0, {1, 1, 1, 1, 1, 2, 1, 1, -4}},
134 {1001, 16, 0, {1, 1, 1, 1, 1, 2, 1, 1, -4, 4, 1, 1, 1, 4, 1, 4}},
137 {1002, 15, 0, {1, 1, 1, 1, 1, 2, 1, 1, -4, 1, 1, 1, 4, 4, 2}},
140 {1100, 15, 0, {1, 1, 1, 1, 1, 2, 1, 1, -4, 1, -1, -4, 1, -1, -4}},
143 {1101, 22, 0, {1, 1, 1, 1, 1, 2, 1, 1, -4, 1, -1, -4, 1, -1, -4, 4, 1, 1, 1, 4, 1, 4}},
145 {32, 10, 1, {1, 1, 1, 1, 1, 2, 1, 1, -4, 1}},
148 {44, 21, 0, {1, 1, 2, 1, -1, -4, -1, -4, 1, 1, 1, 2, 1, 1, -2, 1, -1, -4, 1, -1, -4}},
152 {45, 24, 0, {1, 1, 2, 1, -1, -4, -1, -4, 1, 1, 1, 2, 1, 1, -4, 1, -1, -4, 1, -1, -4, 1, 1, 1}},
156 {46, 35, 1, {1, 1, 2, 1, -1, -4, -1, -4, 1, 1, 1, 2, 1, 1, -4, 1, -1, -4, 1, -1, -4, 2, 1, 1, 1, 1, 1, 1, 4, 1, 1, 1, 4, 1, 4}},
160 {47, 38, 1, {1, 1, 1, 2, 1, -1, -4, -1, -4, 1, 1, 2, 1, 1, -4, 1, -1, -4, 1, -1, -4, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 4, 1, 1, 1, 4, 1, 4}},
164 {48, 26, 0, {1, 1, 2, 1, -1, -4, -1, -4, 1, -1, -4, -1, -4, 1, 1, 1, 2, 1, 1, -4, 1, -1, -4, 1, -1, -4}},
165
169 {50, 21, 0, {1, 1, 1, 1, 1, 2, 1, 1, -4, 1, -1, -4, 1, -1, -4, 1, 1, 4, 4, 4, 4}},
170
174 {52, 15, 0, {1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, -4, 1, -1, -4}},
175
178 {51, 16, 1, {1, 1, 1, 1, 1, 2, 1, 1, -4, 1, -1, -4, 1, -1, -4, 1}},
179
183 {91, 36, 1, {1, 1, 1, 1, 1, 2, 1, 1, -4, 1, -1, -4, 1, -1, -4, 1, 1, 1, -1, -4, -1, -4, 2, 1, 1, 1, 1, 1, 1, 4, 1, 1, 1, 4, 1, 4}},
188 {33, 18, 1, {1, 1, 1, 1, 1, 2, 1, 1, -4, 1, 2, 2, 2, -1, -4, 1, 1, 1}},
193 {34, 32, 1, {1, 1, 1, 1, 1, 2, 1, 1, -4, 1, 2, 2, 2, -1, -4, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 4, 1, 1, 1, 4, 1, 4}},
198 {53, 19, 1, {1, 1, 1, 1, 4, 2, 1, 1, 1, 2, 1, 1, -4, 1, -1, -4, 1, -1, -4}},
203 {54, 22, 1, {1, 1, 1, 1, 4, 2, 1, 1, 1, 2, 1, 1, -4, 1, -1, -4, 1, -1, -4, 1, 1, 1}},
209 {57, 7, 1, {1, 1, 2, 2, 2, 2, 1}},
214 {60, 24, 0, {1, 1, 1, 1, 1, 2, 1, 1, -4, 1, -1, -4, 1, -1, -4, 1, 1, 1, 2, 1, 1, 1, 1, 1}},
219 {61, 38, 1, {1, 1, 1, 1, 1, 2, 1, 1, -4, 1, -1, -4, 1, -1, -4, 1, 1, 1, 2, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 4, 1, 1, 1, 4, 1, 4}},
225 {35, 6, 1, {1, 1, 1, 1, 1, 1}}
226
227};
228
241static g2int
243{
244 g2int j, getpdsindex = -1;
245
246 for (j = 0; j < G2C_MAX_PDS_TEMPLATE; j++)
247 {
248 if (number == templatespds[j].template_num)
249 {
250 getpdsindex = j;
251 return getpdsindex;
252 }
253 }
254
255 return getpdsindex;
256}
257
276gtemplate *
278{
279 g2int index;
280 gtemplate *new;
281
282 index = getpdsindex(number);
283
284 if (index != -1)
285 {
286 new = malloc(sizeof(gtemplate));
287 new->type = 4;
288 new->num = templatespds[index].template_num;
289 new->maplen = templatespds[index].mappdslen;
290 new->needext = templatespds[index].needext;
291 new->map = (g2int *)templatespds[index].mappds;
292 new->extlen = 0;
293 new->ext = NULL;
294 return new;
295 }
296 else
297 {
298 printf("getpdstemplate: PDS Template 4.%d not defined.\n", (int)number);
299 return NULL;
300 }
301
302 return NULL;
303}
304
325gtemplate *
327{
328 gtemplate *new;
329 g2int index, i, j, k, l;
330
331 index = getpdsindex(number);
332 if (index == -1)
333 return NULL;
334
335 new = getpdstemplate(number);
336
337 if (!new->needext)
338 return new;
339
340 if (number == 3)
341 {
342 new->extlen = list[26];
343 new->ext = malloc(sizeof(g2int) * new->extlen);
344 for (i = 0; i < new->extlen; i++)
345 {
346 new->ext[i] = 1;
347 }
348 }
349 else if (number == 4)
350 {
351 new->extlen = list[25];
352 new->ext = malloc(sizeof(g2int) * new->extlen);
353 for (i = 0; i < new->extlen; i++)
354 {
355 new->ext[i] = 1;
356 }
357 }
358 else if (number == 8)
359 {
360 if (list[21] > 1)
361 {
362 new->extlen = (list[21] - 1) * 6;
363 new->ext = malloc(sizeof(g2int) * new->extlen);
364 for (j = 2; j <= list[21]; j++)
365 {
366 l = (j - 2) * 6;
367 for (k = 0; k < 6; k++)
368 {
369 new->ext[l + k] = new->map[23 + k];
370 }
371 }
372 }
373 }
374 else if (number == 9)
375 {
376 if (list[28] > 1)
377 {
378 new->extlen = (list[28] - 1) * 6;
379 new->ext = malloc(sizeof(g2int) * new->extlen);
380 for (j = 2; j <= list[28]; j++)
381 {
382 l = (j - 2) * 6;
383 for (k = 0; k < 6; k++)
384 {
385 new->ext[l + k] = new->map[30 + k];
386 }
387 }
388 }
389 }
390 else if (number == 10)
391 {
392 if (list[22] > 1)
393 {
394 new->extlen = (list[22] - 1) * 6;
395 new->ext = (g2int *)malloc(sizeof(g2int) * new->extlen);
396 for (j = 2; j <= list[22]; j++)
397 {
398 l = (j - 2) * 6;
399 for (k = 0; k < 6; k++)
400 {
401 new->ext[l + k] = new->map[24 + k];
402 }
403 }
404 }
405 }
406 else if (number == 11)
407 {
408 if (list[24] > 1)
409 {
410 new->extlen = (list[24] - 1) * 6;
411 new->ext = malloc(sizeof(g2int) * new->extlen);
412 for (j = 2; j <= list[24]; j++)
413 {
414 l = (j - 2) * 6;
415 for (k = 0; k < 6; k++)
416 {
417 new->ext[l + k] = new->map[26 + k];
418 }
419 }
420 }
421 }
422 else if (number == 12)
423 {
424 if (list[23] > 1)
425 {
426 new->extlen = (list[23] - 1) * 6;
427 new->ext = malloc(sizeof(g2int) * new->extlen);
428 for (j = 2; j <= list[23]; j++)
429 {
430 l = (j - 2) * 6;
431 for (k = 0; k < 6; k++)
432 {
433 new->ext[l + k] = new->map[25 + k];
434 }
435 }
436 }
437 }
438 else if (number == 13)
439 {
440 new->extlen = ((list[37] - 1) * 6) + list[26];
441 new->ext = malloc(sizeof(g2int) * new->extlen);
442 if (list[37] > 1)
443 {
444 for (j = 2; j <= list[37]; j++)
445 {
446 l = (j - 2) * 6;
447 for (k = 0; k < 6; k++)
448 {
449 new->ext[l + k] = new->map[39 + k];
450 }
451 }
452 }
453 l = (list[37] - 1) * 6;
454 if (l < 0)
455 l = 0;
456 for (i = 0; i < list[26]; i++)
457 {
458 new->ext[l + i] = 1;
459 }
460 }
461 else if (number == 14)
462 {
463 new->extlen = ((list[36] - 1) * 6) + list[25];
464 new->ext = malloc(sizeof(g2int) * new->extlen);
465 if (list[36] > 1)
466 {
467 for (j = 2; j <= list[36]; j++)
468 {
469 l = (j - 2) * 6;
470 for (k = 0; k < 6; k++)
471 {
472 new->ext[l + k] = new->map[38 + k];
473 }
474 }
475 }
476 l = (list[36] - 1) * 6;
477 if (l < 0)
478 l = 0;
479 for (i = 0; i < list[25]; i++)
480 {
481 new->ext[l + i] = 1;
482 }
483 }
484 else if (number == 30)
485 {
486 new->extlen = list[4] * 5;
487 new->ext = malloc(sizeof(g2int) * new->extlen);
488 for (i = 0; i < list[4]; i++)
489 {
490 l = i * 5;
491 new->ext[l] = 2;
492 new->ext[l + 1] = 2;
493 new->ext[l + 2] = 1;
494 new->ext[l + 3] = 1;
495 new->ext[l + 4] = 4;
496 }
497 }
498 else if (number == 31)
499 {
500 new->extlen = list[4] * 5;
501 new->ext = malloc(sizeof(g2int) * new->extlen);
502 for (i = 0; i < list[4]; i++)
503 {
504 l = i * 5;
505 new->ext[l] = 2;
506 new->ext[l + 1] = 2;
507 new->ext[l + 2] = 2;
508 new->ext[l + 3] = 1;
509 new->ext[l + 4] = 4;
510 }
511 }
512 else if (number == 42)
513 {
514 if (list[22] > 1)
515 {
516 new->extlen = (list[22] - 1) * 6;
517 new->ext = malloc(sizeof(g2int) * new->extlen);
518 for (j = 2; j <= list[22]; j++)
519 {
520 l = (j - 2) * 6;
521 for (k = 0; k < 6; k++)
522 {
523 new->ext[l + k] = new->map[24 + k];
524 }
525 }
526 }
527 }
528 else if (number == 43)
529 {
530 if (list[25] > 1)
531 {
532 new->extlen = (list[25] - 1) * 6;
533 new->ext = malloc(sizeof(g2int) * new->extlen);
534 for (j = 2; j <= list[25]; j++)
535 {
536 l = (j - 2) * 6;
537 for (k = 0; k < 6; k++)
538 {
539 new->ext[l + k] = new->map[27 + k];
540 }
541 }
542 }
543 }
544 else if (number == 32)
545 {
546 new->extlen = list[9] * 5;
547 new->ext = malloc(sizeof(g2int) * new->extlen);
548 for (i = 0; i < list[9]; i++)
549 {
550 l = i * 5;
551 new->ext[l] = 2;
552 new->ext[l + 1] = 2;
553 new->ext[l + 2] = 2;
554 new->ext[l + 3] = -1;
555 new->ext[l + 4] = -4;
556 }
557 }
558 else if (number == 46)
559 {
560 if (list[27] > 1)
561 {
562 new->extlen = (list[27] - 1) * 6;
563 new->ext = malloc(sizeof(g2int) * new->extlen);
564 for (j = 2; j <= list[27]; j++)
565 {
566 l = (j - 2) * 6;
567 for (k = 0; k < 6; k++)
568 {
569 new->ext[l + k] = new->map[29 + k];
570 }
571 }
572 }
573 }
574 else if (number == 47)
575 {
576 if (list[30] > 1)
577 {
578 new->extlen = (list[30] - 1) * 6;
579 new->ext = malloc(sizeof(g2int) * new->extlen);
580 for (j = 2; j <= list[30]; j++)
581 {
582 l = (j - 2) * 6;
583 for (k = 0; k < 6; k++)
584 {
585 new->ext[l + k] = new->map[32 + k];
586 }
587 }
588 }
589 }
590 else if (number == 51)
591 {
592 new->extlen = list[15] * 6;
593 new->ext = malloc(sizeof(g2int) * new->extlen);
594 for (i = 0; i < list[15]; i++)
595 {
596 l = i * 6;
597 new->ext[l] = 1;
598 new->ext[l + 1] = 1;
599 new->ext[l + 2] = -1;
600 new->ext[l + 3] = -4;
601 new->ext[l + 4] = -1;
602 new->ext[l + 5] = -4;
603 }
604 }
605 else if (number == 33)
606 {
607 new->extlen = list[9];
608 new->ext = malloc(sizeof(g2int) * new->extlen);
609 for (i = 0; i < new->extlen; i++)
610 {
611 new->ext[i] = 1;
612 }
613 }
614 else if (number == 34)
615 {
616 new->extlen = ((list[24] - 1) * 6) + list[9];
617 new->ext = malloc(sizeof(g2int) * new->extlen);
618 if (list[24] > 1)
619 {
620 for (j = 2; j <= list[24]; j++)
621 {
622 l = (j - 2) * 6;
623 for (k = 0; k < 6; k++)
624 {
625 new->ext[l + k] = new->map[26 + k];
626 }
627 }
628 }
629 l = (list[24] - 1) * 6;
630 if (l < 0)
631 l = 0;
632 for (i = 0; i < list[9]; i++)
633 {
634 new->ext[l + i] = 1;
635 }
636 }
637 else if (number == 53)
638 {
639 new->extlen = list[3];
640 new->ext = malloc(sizeof(g2int) * new->extlen);
641 for (i = 0; i < new->extlen; i++)
642 {
643 new->ext[i] = 1;
644 }
645 }
646 else if (number == 54)
647 {
648 new->extlen = list[3];
649 new->ext = malloc(sizeof(g2int) * new->extlen);
650 for (i = 0; i < new->extlen; i++)
651 {
652 new->ext[i] = 1;
653 }
654 }
655 else if (number == 91)
656 {
657 new->extlen = ((list[28] - 1) * 6) + list[15];
658 new->ext = malloc(sizeof(g2int) * new->extlen);
659 if (list[28] > 1)
660 {
661 for (j = 2; j <= list[28]; j++)
662 {
663 l = (j - 2) * 6;
664 for (k = 0; k < 6; k++)
665 {
666 new->ext[l + k] = new->map[30 + k];
667 }
668 }
669 }
670 l = (list[29] - 1) * 6;
671 if (l < 0)
672 l = 0;
673 for (i = 0; i < list[15]; i++)
674 {
675 new->ext[l + i] = 1;
676 }
677 }
678 /* PDT 4.57 (10/07/2015) */
679 else if (number == 57)
680 {
681 new->extlen = list[6] * 15;
682 new->ext = malloc(sizeof(g2int) * new->extlen);
683 for (i = 0; i < list[6]; i++)
684 {
685 l = i * 15;
686 new->ext[l] = 1;
687 new->ext[l + 1] = -4;
688 new->ext[l + 2] = 1;
689 new->ext[l + 3] = 1;
690 new->ext[l + 4] = 1;
691 new->ext[l + 5] = 2;
692 new->ext[l + 6] = 1;
693 new->ext[l + 7] = 1;
694 new->ext[l + 8] = -4;
695 new->ext[l + 9] = 1;
696 new->ext[l + 10] = -1;
697 new->ext[l + 11] = -4;
698 new->ext[l + 12] = 1;
699 new->ext[l + 13] = -1;
700 new->ext[l + 14] = -4;
701 }
702 }
703 /* PDT 4.61 (10/07/2015) */
704 else if (number == 61)
705 {
706 if (list[30] > 1)
707 {
708 new->extlen = (list[30] - 1) * 6;
709 new->ext = malloc(sizeof(g2int) * new->extlen);
710 for (j = 2; j <= list[30]; j++)
711 {
712 l = (j - 2) * 6;
713 for (k = 0; k < 6; k++)
714 {
715 new->ext[l + k] = new->map[32 + k];
716 }
717 }
718 }
719 }
720 /* PDT 4.35 (10/07/2015) */
721 else if (number == 35)
722 {
723 new->extlen = list[5] * 5;
724 new->ext = malloc(sizeof(g2int) * new->extlen);
725 for (i = 0; i < list[5]; i++)
726 {
727 l = i * 5;
728 new->ext[l] = 2;
729 new->ext[l + 1] = 2;
730 new->ext[l + 2] = 2;
731 new->ext[l + 3] = 1;
732 new->ext[l + 4] = 4;
733 }
734 }
735 return new;
736}
737
755int
756g2c_get_pds_template_extension(int pds_template_num, int *template,
757 int *extlen, int *ext)
758{
759 int j, t;
760
761 /* Check input. */
762 if (!template)
763 return G2C_EINVAL;
764
765 /* Look through the array of templates to find a matching one. */
766 for (j = 0; j < G2C_MAX_PDS_TEMPLATE; j++)
767 {
768 if (pds_template_num == templatespds[j].template_num)
769 {
770 /* Is there an extension to this template? */
771 if (templatespds[j].needext)
772 {
773 gtemplate *gt;
774 g2int *template8;
775 int e;
776
777 /* Copy template to g2int for extpdstemplate() function. */
778 if (!(template8 = malloc(sizeof(g2int) * templatespds[j].mappdslen)))
779 return G2C_ENOMEM;
780 for (t = 0; t < templatespds[j].mappdslen; t++)
781 template8[t] = template[t];
782 if (!(gt = extpdstemplate(pds_template_num, template8)))
783 return G2C_ENOTEMPLATE;
784 free(template8);
785 if (extlen)
786 *extlen = gt->extlen;
787 if (ext)
788 for (e = 0; e < gt->extlen; e++)
789 ext[e] = gt->ext[e];
790 free(gt->ext);
791 free(gt);
792 }
793 else
794 {
795 if (extlen)
796 *extlen = 0;
797 }
798
799 /* Done. */
800 return G2C_NOERROR;
801 }
802 }
803
804 /* If we didn't find a template, return an error. */
805 return G2C_ENOTEMPLATE;
806}
807
830int
831g2c_get_pds_template(int pds_template_num, int *maplen, int *map, int *needext)
832{
833 int j, m;
834
835 /* Look through the array of templates to find a matching one. */
836 for (j = 0; j < G2C_MAX_PDS_TEMPLATE; j++)
837 {
838 if (pds_template_num == templatespds[j].template_num)
839 {
840 /* Copy maplen and map if the caller wants them. */
841 if (maplen)
842 *maplen = templatespds[j].mappdslen;
843 if (map)
844 for (m = 0; m < templatespds[j].mappdslen; m++)
845 map[m] = templatespds[j].mappds[m];
846 if (needext)
847 *needext = templatespds[j].needext;
848
849 /* Done. */
850 return G2C_NOERROR;
851 }
852 }
853
854 /* If we didn't find a template, return an error. */
855 return G2C_ENOTEMPLATE;
856}
#define G2C_MAX_PDS_TEMPLATE
Maximum number of PDS templates.
Definition grib2.h:294
#define G2C_ENOTEMPLATE
Template not found.
Definition grib2.h:497
#define G2C_ENOMEM
Out of memory.
Definition grib2.h:485
#define G2C_EINVAL
Invalid input.
Definition grib2.h:481
#define G2C_MAX_PDS_TEMPLATE_MAPLEN
Maximum template map length.
Definition grib2.h:295
int64_t g2int
Long integer type.
Definition grib2.h:32
#define G2C_NOERROR
No error.
Definition grib2.h:476
Header file with internal function prototypes NCEPLIBS-g2c library.
g2int * ext
Number of octets of each entry in the extension part of the template.
Definition grib2_int.h:302
g2int extlen
Number of entries in the template extension.
Definition grib2_int.h:298
Struct for GRIB template, returned by getgridtemplate().
Definition grib2_int.h:278
static g2int getpdsindex(g2int number)
This function returns the index of specified Product Definition Template in array templates.
int g2c_get_pds_template(int pds_template_num, int *maplen, int *map, int *needext)
Get PDS template information.
int g2c_get_pds_template_extension(int pds_template_num, int *template, int *extlen, int *ext)
Get pds template extension information.
gtemplate * extpdstemplate(g2int number, g2int *list)
This subroutine generates the remaining octet map for a given Product Definition Template,...
static const struct pdstemplate templatespds[G2C_MAX_PDS_TEMPLATE]
Data for struct for PDS template.
gtemplate * getpdstemplate(g2int number)
This subroutine returns PDS template information for a specified Product Definition Template.