Skip to content

Commit

Permalink
3.63
Browse files Browse the repository at this point in the history
  • Loading branch information
AlysonStahl-NOAA committed Jan 6, 2025
1 parent 02e9812 commit 7736a3c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/grib2.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -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 36 /**< Maximum number of grid templates. */
#define G2C_MAX_GDS_TEMPLATE 37 /**< 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. */
Expand Down
2 changes: 2 additions & 0 deletions src/gridtemplates.c
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,8 @@ static const struct gridtemplate templatesgrid[G2C_MAX_GDS_TEMPLATE] =
{61, 23, 0, {1, 4, 4, 1, 8, 8, 8, 8, 8, 8, 1, 1, 4, 1, 4, 1, 4, -4, 4, -4, -4, 4, 4}},
/* 3.62: Spectral Polar Stereographic with modelling subdomains definition */
{62, 23, 0, {1, 4, 4, 1, 8, 8, 8, 8, 8, 8, 1, 1, 4, 1, 4, 1, 4, -4, 4, 1, -4, 4, 1}},
/* 3.63: Spectral Lambert Conformal with modelling subdomains definition */
{63, 26, 0, {1, 4, 4, 1, 8, 8, 8, 8, 8, 8, 1, 1, 4, 1, 4, 1, 4, -4, 4, -4, 4, 1, -4, -4, -4, 4}},
};

/**
Expand Down
11 changes: 6 additions & 5 deletions tests/tst_get_grid_template.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include "grib2_int.h"

/* Number of grid templates to test. */
#define NUM_TESTS 36
#define NUM_TESTS 37

/* Number of grid templates with extensions. */
#define NUM_EXT_TESTS 5
Expand All @@ -20,16 +20,16 @@ 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, 23, 33, 61, 62};
204, 32768, 32769, 1000, 1100, 1200, 13, 23, 33, 61, 62, 63};
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, 22, 26, 23, 23};
19, 21, 20, 28, 16, 23, 22, 26, 23, 23, 26};
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};
0, 0, 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};
0, 0, 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 */
Expand Down Expand Up @@ -67,6 +67,7 @@ main()
{1, 1, 4, 1, 4, 1, 4, 4, 4, -4, 4, 1, -4, 4, 4, 4, 1, 1, -4, -4, -4, 4, 4, 4, 4, 4}, /* 33 */
{1, 4, 4, 1, 8, 8, 8, 8, 8, 8, 1, 1, 4, 1, 4, 1, 4, -4, 4, -4, -4, 4, 4}, /* 61 */
{1, 4, 4, 1, 8, 8, 8, 8, 8, 8, 1, 1, 4, 1, 4, 1, 4, -4, 4, 1, -4, 4, 1}, /* 62 */
{1, 4, 4, 1, 8, 8, 8, 8, 8, 8, 1, 1, 4, 1, 4, 1, 4, -4, 4, -4, 4, 1, -4, -4, -4, 4}, /* 63 */
};
int expected_ext[NUM_EXT_TESTS][8] = {
{4, 4, -4, -4},
Expand Down

0 comments on commit 7736a3c

Please sign in to comment.