diff --git a/src/drstemplates.c b/src/drstemplates.c index 4cc7e3b7..6ec0da53 100644 --- a/src/drstemplates.c +++ b/src/drstemplates.c @@ -30,6 +30,7 @@ * 2009-01-14 | Vuong | Changed structure name template to gtemplate * 2022-10-18 | Hartnett | Added g2c_get_drs_template(). * 2023-09-08 | Engle | Added template 5.42. + * 2025-01-06 | Stahl | Added template 5.53 * * @author Stephen Gilbert @date 2001-06-28 */ @@ -106,6 +107,10 @@ static const struct drstemplate templatesdrs[G2C_MAX_DRS_TEMPLATE] = * encoding](https://www.nco.ncep.noaa.gov/pmb/docs/grib2/grib2_doc/grib2_temp5-42.shtml) */ {42, 8, 0, {4, -2, -2, 1, 1, 1, 1, 2}}, + /** [5.53: Spectral data for limited area models - Complex packing + * encoding](https://www.nco.ncep.noaa.gov/pmb/docs/grib2/grib2_doc/grib2_temp5-53.shtml) */ + {53, 11, 0, {4, -2, -2, 1, 1, 1, -4, 2, 2, 4, 1}}, + /** 5.40000: Grid point data - JPEG2000 encoding * * This is a local template number, from a time before WMO standardized use of JPEG2000 diff --git a/src/grib2.h.in b/src/grib2.h.in index 926313f6..4b4663a1 100644 --- a/src/grib2.h.in +++ b/src/grib2.h.in @@ -293,7 +293,7 @@ g2int g2_gribend(unsigned char *cgrib); #define G2C_MAX_GDS_TEMPLATE_MAPLEN 28 /**< Maximum grid template map length. */ #define G2C_MAX_PDS_TEMPLATE 102 /**< Maximum number of PDS templates. */ #define G2C_MAX_PDS_TEMPLATE_MAPLEN 50 /**< Maximum template map length. */ -#define G2C_MAX_DRS_TEMPLATE 10 /**< Maximum number of DRS templates. */ +#define G2C_MAX_DRS_TEMPLATE 11 /**< Maximum number of DRS templates. */ #define G2C_MAX_DRS_TEMPLATE_MAPLEN 18 /**< Maximum DRS template map length. */ /* File handling functions. */ diff --git a/tests/tst_drstemplates.c b/tests/tst_drstemplates.c index 2609f115..a6f3e052 100644 --- a/tests/tst_drstemplates.c +++ b/tests/tst_drstemplates.c @@ -82,9 +82,9 @@ main() printf("ok!\n"); printf("Testing all getdrstemplate() calls...\n"); { -#define NUM_TEST 9 - int number[NUM_TEST] = {0, 2, 3, 50, 51, 40, 41, 40000, 40010}; - int expected_maplen[NUM_TEST] = {5, 16, 18, 5, 10, 7, 5, 7, 5}; +#define NUM_TEST 10 + int number[NUM_TEST] = {0, 2, 3, 50, 51, 40, 41, 40000, 40010, 53}; + int expected_maplen[NUM_TEST] = {5, 16, 18, 5, 10, 7, 5, 7, 5, 11}; int expected_map[NUM_TEST][18] = { {4, -2, -2, 1, 1}, /* 0 */ {4, -2, -2, 1, 1, 1, 1, 4, 4, 4, 1, 1, 4, 1, 4, 1}, /* 2 */ @@ -94,7 +94,8 @@ main() {4, -2, -2, 1, 1, 1, 1}, /* 40 */ {4, -2, -2, 1, 1}, /* 41 */ {4, -2, -2, 1, 1, 1, 1}, /* 40000 */ - {4, -2, -2, 1, 1} /* 40010 */ + {4, -2, -2, 1, 1}, /* 40010 */ + {4, -2, -2, 1, 1, 1, -4, 2, 2, 4, 1}, /* 53*/ }; int t;