From 060d0c5a68d4dcbb243e85ff1bc8f19e3c16ac52 Mon Sep 17 00:00:00 2001 From: AlysonStahl-NOAA <166434581+AlysonStahl-NOAA@users.noreply.github.com> Date: Thu, 5 Dec 2024 10:05:16 -0800 Subject: [PATCH] pds 4.76 --- src/grib2.h.in | 2 +- src/pdstemplates.c | 4 ++++ tests/tst_pdstemplates.c | 9 +++++---- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/grib2.h.in b/src/grib2.h.in index 8749f0b9..cff84f99 100644 --- a/src/grib2.h.in +++ b/src/grib2.h.in @@ -291,7 +291,7 @@ g2int g2_gribend(unsigned char *cgrib); /* Constants to help with templates. */ #define G2C_MAX_GDS_TEMPLATE 31 /**< Maximum number of grid templates. */ #define G2C_MAX_GDS_TEMPLATE_MAPLEN 28 /**< Maximum grid template map length. */ -#define G2C_MAX_PDS_TEMPLATE 59 /**< Maximum number of PDS templates. */ +#define G2C_MAX_PDS_TEMPLATE 60 /**< Maximum number of PDS templates. */ #define G2C_MAX_PDS_TEMPLATE_MAPLEN 45 /**< Maximum template map length. */ #define G2C_MAX_DRS_TEMPLATE 10 /**< Maximum number of DRS templates. */ #define G2C_MAX_DRS_TEMPLATE_MAPLEN 18 /**< Maximum DRS template map length. */ diff --git a/src/pdstemplates.c b/src/pdstemplates.c index 33625765..2b43e12f 100644 --- a/src/pdstemplates.c +++ b/src/pdstemplates.c @@ -280,6 +280,10 @@ static const struct pdstemplate templatespds[G2C_MAX_PDS_TEMPLATE] = 4.73: Post-processing Individual Ensemble Forecast, Control and Perturbed, at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval */ {73, 34, 1, {1, 1, 2, 2, 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}}, + /** PDT 4.76 (12/04/2024) + 4.76: Analysis or forecast at a horizontal level or in a horizontal layer at a point in + time for atmospheric chemical constituents with source or sink */ + {76, 17, 0, {1, 1, 2, 1, 1, 1, 1, 2, 1, 1, -4, 1, -1, -4, 1, -1, -4}}, }; /** diff --git a/tests/tst_pdstemplates.c b/tests/tst_pdstemplates.c index 4dbdf027..df0c473b 100644 --- a/tests/tst_pdstemplates.c +++ b/tests/tst_pdstemplates.c @@ -433,21 +433,21 @@ main() printf("ok!\n"); printf("Testing all getpdstemplate() calls with extensions...\n"); { -#define NUM_TEST 59 +#define NUM_TEST 60 int number[NUM_TEST] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 20, 30, 31, 40, 41, 42, 43, 254, 1000, 1001, 1002, 1100, 1101, 32, 44, 45, 46, 47, 48, 50, 52, 51, 91, 33, 34, 53, 54, 57, 60, 61, 35, 49, 55, 58, 59, 62, 63, 67, 68, 70, - 71, 72, 73}; + 71, 72, 73, 76}; int expected_maplen[NUM_TEST] = { 15, 18, 17, 31, 30, 22, 16, 15, 29, 36, 30, 32, 31, 45, 44, 18, 19, 5, 5, 16, 19, 30, 33, 3, 9, 16, 15, 15, 22, 10, 21, 24, 35, 38, 26, 21, 15, 16, 36, 18, 32, 19, 22, 7, 24, 38, 6, 29, 21, 7, 24, 35, 38, 7, 7, 19, 21, 32, - 34}; + 34, 17}; int expected_needext[NUM_TEST] = { 0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 0, 0, 1, - 0, 1, 1, 1, 1, 0, 0, 1, 1}; + 0, 1, 1, 1, 1, 0, 0, 1, 1, 0}; int expected_map[NUM_TEST][48] = { {1, 1, 1, 1, 1, 2, 1, 1, -4, 1, -1, -4, 1, -1, -4}, /* 0 */ {1, 1, 1, 1, 1, 2, 1, 1, -4, 1, -1, -4, 1, -1, -4, 1, 1, 1}, /* 1 */ @@ -508,6 +508,7 @@ main() {1, 1, 2, 2, 1, 1, 1, 1, 2, 1, 1, -4, 1, -1, -4, 1, -1, -4, 1, 1, 1}, /* 71 */ {1, 1, 2, 2, 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}, /* 72 */ {1, 1, 2, 2, 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}, /* 73 */ + {1, 1, 2, 1, 1, 1, 1, 2, 1, 1, -4, 1, -1, -4, 1, -1, -4}, /* 76 */ }; int t; int ext_t = 0;