diff --git a/src/grib2.h.in b/src/grib2.h.in index f778e230..300e196c 100644 --- a/src/grib2.h.in +++ b/src/grib2.h.in @@ -289,7 +289,7 @@ g2int g2_gribend(unsigned char *cgrib); #define G2C_SECTION1_LEN 13 /**< Length of section 1 array. */ /* Constants to help with templates. */ -#define G2C_MAX_GDS_TEMPLATE 32 /**< Maximum number of grid templates. */ +#define G2C_MAX_GDS_TEMPLATE 33 /**< Maximum number of grid templates. */ #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. */ diff --git a/src/gridtemplates.c b/src/gridtemplates.c index 2144c54b..86d709c2 100644 --- a/src/gridtemplates.c +++ b/src/gridtemplates.c @@ -123,6 +123,8 @@ static const struct gridtemplate templatesgrid[G2C_MAX_GDS_TEMPLATE] = /* 3.13: Mercator with modelling subdomains definition */ {13, 23, 0, {1, 1, 4, 1, 4, 1, 4, 4, 4, -4, 4, 1, -4, -4, 4, 1, 4, 4, 4, 4, 4, 4, 4}} + /* 3.23: Polar stereographic projection with modelling subdomains definition */ + {23, 22, 0, {1, 1, 4, 1, 4, 1, 4, 4, 4, -4, 4, 1, -4, 4, 4, 4, 1, 1, 4, 4, 4, 4}}, }; /** diff --git a/tests/tst_get_grid_template.c b/tests/tst_get_grid_template.c index 3a479bc6..de58bee1 100644 --- a/tests/tst_get_grid_template.c +++ b/tests/tst_get_grid_template.c @@ -7,7 +7,7 @@ #include "grib2_int.h" /* Number of grid templates to test. */ -#define NUM_TESTS 32 +#define NUM_TESTS 33 /* Number of grid templates with extensions. */ #define NUM_EXT_TESTS 5 @@ -20,14 +20,14 @@ main() { int template_number[NUM_TESTS] = { 0, 1, 2, 3, 4, 5, 12, 101, 140, 10, 20, 30, 31, 40, 41, 42, 43, 50, 51, 52, 53, 90, 100, 110, 120, - 204, 32768, 32769, 1000, 1100, 1200, 13}; + 204, 32768, 32769, 1000, 1100, 1200, 13, 23}; int expected_maplen[NUM_TESTS] = { 19, 22, 22, 25, 13, 16, 22, 4, 17, 19, 18, 22, 22, 19, 22, 22, 25, 5, 8, 8, 11, 21, 11, 16, 7, 19, - 19, 21, 20, 28, 16, 23}; + 19, 21, 20, 28, 16, 23. 22}; int expected_needsext[NUM_TESTS] = { - 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,0, 1, 0, 0, 0, 1, 0, 1, 0}; + 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,0, 1, 0, 0, 0, 1, 0, 1, 0, 0}; int expected_extlen[NUM_TESTS] = { - 0, 0, 0, 0, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 2, 0, 2, 0}; + 0, 0, 0, 0, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 2, 0, 2, 0, 0}; int expected_map[NUM_TESTS][28] = { {1, 1, 4, 1, 4, 1, 4, 4, 4, 4, 4, -4, 4, 1, -4, 4, 4, 4, 1, 0, 0, 0}, /* 0 */ {1, 1, 4, 1, 4, 1, 4, 4, 4, 4, 4, -4, 4, 1, -4, 4, 4, 4, 1, -4, 4, 4, 0, 0, 0}, /* 1 */ @@ -61,6 +61,7 @@ main() {1, 1, 4, 1, 4, 1, 4, 4, 4, 4, -4, 4, 1, -4, 4, 1, 4, 1, -4, 1, 1, -4, 2, 1, 1, 1, 1, 1}, /* 1100 */ {4, 1, -4, 1, 1, -4, 2, 1, 1, 1, 1, 1, 2, 1, 1, 2}, /* 1200 */ {1, 1, 4, 1, 4, 1, 4, 4, 4, -4, 4, 1, -4, -4, 4, 1, 4, 4, 4, 4, 4, 4, 4}, /* 13 */ + {1, 1, 4, 1, 4, 1, 4, 4, 4, -4, 4, 1, -4, 4, 4, 4, 1, 1, 4, 4, 4, 4}, /* 23 */ }; int expected_ext[NUM_EXT_TESTS][8] = { {4, 4, -4, -4},