diff --git a/definitions/grib2/section.1.def b/definitions/grib2/section.1.def index af38f69bb..26f25e334 100644 --- a/definitions/grib2/section.1.def +++ b/definitions/grib2/section.1.def @@ -29,11 +29,6 @@ transient masterDir="grib2/tables/[tablesVersion]"; if (tablesVersion > tablesVersionLatest) { transient masterDir="grib2/tables/[tablesVersionLatest]"; } -when (tablesVersion!=255) { - set masterDir="grib2/tables/[tablesVersion]"; -} else { - set masterDir="grib2/tables/4"; -} codetable[1] localTablesVersion 'grib2/tables/local/[centreForLocal]/1.1.table' ; alias versionNumberOfGribLocalTables=localTablesVersion; diff --git a/definitions/grib2/tables/0/1.0.table b/definitions/grib2/tables/0/1.0.table index 3c5223d3b..2190905a4 100644 --- a/definitions/grib2/tables/0/1.0.table +++ b/definitions/grib2/tables/0/1.0.table @@ -2,4 +2,4 @@ 1 1 Initial operational version number 2 2 Previous operational version number 3 3 Current operational version number implemented on 2 November 2005 -255 255 Master tables not used. Local table entries and local templates may use the entire range of the table, not just those sections marked Reserved for local used. +255 255 Missing diff --git a/definitions/grib2/tables/1.0.table b/definitions/grib2/tables/1.0.table index 1038dc72d..a9a0a11c0 100644 --- a/definitions/grib2/tables/1.0.table +++ b/definitions/grib2/tables/1.0.table @@ -36,4 +36,4 @@ 34 34 Version implemented on 18 November 2024 35 35 Pre-operational to be implemented by next amendment # 36-254 Future versions -255 255 Master tables not used. Local table entries and local templates may use the entire range of the table, not just those sections marked Reserved for local used. +255 255 Missing diff --git a/definitions/grib2/tables/1/1.0.table b/definitions/grib2/tables/1/1.0.table index 3c5223d3b..2190905a4 100644 --- a/definitions/grib2/tables/1/1.0.table +++ b/definitions/grib2/tables/1/1.0.table @@ -2,4 +2,4 @@ 1 1 Initial operational version number 2 2 Previous operational version number 3 3 Current operational version number implemented on 2 November 2005 -255 255 Master tables not used. Local table entries and local templates may use the entire range of the table, not just those sections marked Reserved for local used. +255 255 Missing diff --git a/definitions/grib2/tables/10/1.0.table b/definitions/grib2/tables/10/1.0.table index babcdd77d..7e37d0ffc 100644 --- a/definitions/grib2/tables/10/1.0.table +++ b/definitions/grib2/tables/10/1.0.table @@ -12,4 +12,4 @@ 10 10 Version implemented on 7 November 2012 11 11 Pre-operational to be implemented by next amendment # 12-254 Future versions -255 255 Master tables not used. Local table entries and local templates may use the entire range of the table, not just those sections marked Reserved for local used. +255 255 Missing diff --git a/definitions/grib2/tables/11/1.0.table b/definitions/grib2/tables/11/1.0.table index babcdd77d..7e37d0ffc 100644 --- a/definitions/grib2/tables/11/1.0.table +++ b/definitions/grib2/tables/11/1.0.table @@ -12,4 +12,4 @@ 10 10 Version implemented on 7 November 2012 11 11 Pre-operational to be implemented by next amendment # 12-254 Future versions -255 255 Master tables not used. Local table entries and local templates may use the entire range of the table, not just those sections marked Reserved for local used. +255 255 Missing diff --git a/definitions/grib2/tables/18/1.0.table b/definitions/grib2/tables/18/1.0.table index 0e6f26f8e..179f944e4 100644 --- a/definitions/grib2/tables/18/1.0.table +++ b/definitions/grib2/tables/18/1.0.table @@ -20,4 +20,4 @@ 18 18 Version implemented on 2 November 2016 19 19 Pre-operational to be implemented by next amendment # 20-254 Future versions -255 255 Master tables not used. Local table entries and local templates may use the entire range of the table, not just those sections marked Reserved for local used. +255 255 Missing diff --git a/definitions/grib2/tables/19/1.0.table b/definitions/grib2/tables/19/1.0.table index 06710c183..869de989e 100644 --- a/definitions/grib2/tables/19/1.0.table +++ b/definitions/grib2/tables/19/1.0.table @@ -21,4 +21,4 @@ 19 19 Version implemented on 3 May 2017 20 20 Pre-operational to be implemented by next amendment # 21-254 Future versions -255 255 Master tables not used. Local table entries and local templates may use the entire range of the table, not just those sections marked Reserved for local used. +255 255 Missing diff --git a/definitions/grib2/tables/2/1.0.table b/definitions/grib2/tables/2/1.0.table index a34f44ee1..b40e40dfc 100644 --- a/definitions/grib2/tables/2/1.0.table +++ b/definitions/grib2/tables/2/1.0.table @@ -4,4 +4,4 @@ 2 2 Previous operational version number 3 3 Current operational version number implemented on 2 November 2005 # 4-254 Future operational version numbers -255 255 Master tables not used. Local table entries and local templates may use the entire range of the table, not just those sections marked Reserved for local used. +255 255 Missing diff --git a/definitions/grib2/tables/20/1.0.table b/definitions/grib2/tables/20/1.0.table index 60530c280..604a3f048 100644 --- a/definitions/grib2/tables/20/1.0.table +++ b/definitions/grib2/tables/20/1.0.table @@ -22,4 +22,4 @@ 20 20 Version implemented on 8 November 2017 21 21 Pre-operational to be implemented by next amendment # 22-254 Future versions -255 255 Master tables not used. Local table entries and local templates may use the entire range of the table, not just those sections marked Reserved for local used. +255 255 Missing diff --git a/definitions/grib2/tables/21/1.0.table b/definitions/grib2/tables/21/1.0.table index 1a7c7870f..77dcd386d 100644 --- a/definitions/grib2/tables/21/1.0.table +++ b/definitions/grib2/tables/21/1.0.table @@ -23,4 +23,4 @@ 21 21 Version implemented on 2 May 2018 22 22 Pre-operational to be implemented by next amendment # 23-254 Future versions -255 255 Master tables not used. Local table entries and local templates may use the entire range of the table, not just those sections marked Reserved for local used. +255 255 Missing diff --git a/definitions/grib2/tables/22/1.0.table b/definitions/grib2/tables/22/1.0.table index d65b24f9e..5dda64d11 100644 --- a/definitions/grib2/tables/22/1.0.table +++ b/definitions/grib2/tables/22/1.0.table @@ -24,4 +24,4 @@ 22 22 Version implemented on 7 November 2018 23 23 Version implemented on 15 May 2019 # 24-254 Future versions -255 255 Master tables not used. Local table entries and local templates may use the entire range of the table, not just those sections marked Reserved for local used. +255 255 Missing diff --git a/definitions/grib2/tables/23/1.0.table b/definitions/grib2/tables/23/1.0.table index d65b24f9e..5dda64d11 100644 --- a/definitions/grib2/tables/23/1.0.table +++ b/definitions/grib2/tables/23/1.0.table @@ -24,4 +24,4 @@ 22 22 Version implemented on 7 November 2018 23 23 Version implemented on 15 May 2019 # 24-254 Future versions -255 255 Master tables not used. Local table entries and local templates may use the entire range of the table, not just those sections marked Reserved for local used. +255 255 Missing diff --git a/definitions/grib2/tables/24/1.0.table b/definitions/grib2/tables/24/1.0.table index d577b64fc..ee039010e 100644 --- a/definitions/grib2/tables/24/1.0.table +++ b/definitions/grib2/tables/24/1.0.table @@ -25,4 +25,4 @@ 23 23 Version implemented on 15 May 2019 24 24 Version implemented on 6 November 2019 # 25-254 Future versions -255 255 Master tables not used. Local table entries and local templates may use the entire range of the table, not just those sections marked Reserved for local used. +255 255 Missing diff --git a/definitions/grib2/tables/25/1.0.table b/definitions/grib2/tables/25/1.0.table index 294d163eb..a4638c462 100644 --- a/definitions/grib2/tables/25/1.0.table +++ b/definitions/grib2/tables/25/1.0.table @@ -26,4 +26,4 @@ 24 24 Version implemented on 6 November 2019 25 25 Version implemented on 6 May 2020 # 26-254 Future versions -255 255 Master tables not used. Local table entries and local templates may use the entire range of the table, not just those sections marked Reserved for local used. +255 255 Missing diff --git a/definitions/grib2/tables/26/1.0.table b/definitions/grib2/tables/26/1.0.table index 789ef85f7..3aad23690 100644 --- a/definitions/grib2/tables/26/1.0.table +++ b/definitions/grib2/tables/26/1.0.table @@ -27,4 +27,4 @@ 25 25 Version implemented on 6 May 2020 26 26 Version implemented on 16 November 2020 # 27-254 Future versions -255 255 Master tables not used. Local table entries and local templates may use the entire range of the table, not just those sections marked Reserved for local used. +255 255 Missing diff --git a/definitions/grib2/tables/27/1.0.table b/definitions/grib2/tables/27/1.0.table index 3dd474a1f..bbcf84da9 100644 --- a/definitions/grib2/tables/27/1.0.table +++ b/definitions/grib2/tables/27/1.0.table @@ -29,4 +29,4 @@ 27 27 Version implemented on 15 June 2021 28 28 Pre-operational to be implemented by next amendment # 29-254 Future versions -255 255 Master tables not used. Local table entries and local templates may use the entire range of the table, not just those sections marked Reserved for local used. +255 255 Missing diff --git a/definitions/grib2/tables/28/1.0.table b/definitions/grib2/tables/28/1.0.table index 7f683b60d..e746934bb 100644 --- a/definitions/grib2/tables/28/1.0.table +++ b/definitions/grib2/tables/28/1.0.table @@ -30,4 +30,4 @@ 28 28 Version implemented on 15 November 2021 29 29 Pre-operational to be implemented by next amendment # 30-254 Future versions -255 255 Master tables not used. Local table entries and local templates may use the entire range of the table, not just those sections marked Reserved for local used. +255 255 Missing diff --git a/definitions/grib2/tables/3/1.0.table b/definitions/grib2/tables/3/1.0.table index a34f44ee1..b40e40dfc 100644 --- a/definitions/grib2/tables/3/1.0.table +++ b/definitions/grib2/tables/3/1.0.table @@ -4,4 +4,4 @@ 2 2 Previous operational version number 3 3 Current operational version number implemented on 2 November 2005 # 4-254 Future operational version numbers -255 255 Master tables not used. Local table entries and local templates may use the entire range of the table, not just those sections marked Reserved for local used. +255 255 Missing diff --git a/definitions/grib2/tables/4/1.0.table b/definitions/grib2/tables/4/1.0.table index a34f44ee1..b40e40dfc 100644 --- a/definitions/grib2/tables/4/1.0.table +++ b/definitions/grib2/tables/4/1.0.table @@ -4,4 +4,4 @@ 2 2 Previous operational version number 3 3 Current operational version number implemented on 2 November 2005 # 4-254 Future operational version numbers -255 255 Master tables not used. Local table entries and local templates may use the entire range of the table, not just those sections marked Reserved for local used. +255 255 Missing diff --git a/definitions/grib2/tables/5/1.0.table b/definitions/grib2/tables/5/1.0.table index e1a71a030..a64c3dd04 100644 --- a/definitions/grib2/tables/5/1.0.table +++ b/definitions/grib2/tables/5/1.0.table @@ -7,4 +7,4 @@ 5 5 Version implemented on 4 November 2009 6 6 Pre-operational to be implemented by next amendment # 7-254 Future versions -255 255 Master tables not used. Local table entries and local templates may use the entire range of the table, not just those sections marked Reserved for local used. +255 255 Missing diff --git a/definitions/grib2/tables/6/1.0.table b/definitions/grib2/tables/6/1.0.table index 54a50efa2..6bd065e12 100644 --- a/definitions/grib2/tables/6/1.0.table +++ b/definitions/grib2/tables/6/1.0.table @@ -8,5 +8,5 @@ 6 6 Version implemented on 15 September 2010 7 7 Pre-operational to be implemented by next amendment # 8-254 Future versions -255 255 Master tables not used. Local table entries and local templates may use the entire range of the table, not just those sections marked Reserved for local used. +255 255 Missing diff --git a/definitions/grib2/tables/7/1.0.table b/definitions/grib2/tables/7/1.0.table index 7ccb0e2a9..279292002 100644 --- a/definitions/grib2/tables/7/1.0.table +++ b/definitions/grib2/tables/7/1.0.table @@ -9,4 +9,4 @@ 7 7 Version implemented on 4 May 2011 8 8 Pre-operational to be implemented by next amendment # 9-254 Future versions -255 255 Master tables not used. Local table entries and local templates may use the entire range of the table, not just those sections marked Reserved for local used. +255 255 Missing diff --git a/definitions/grib2/tables/8/1.0.table b/definitions/grib2/tables/8/1.0.table index 9f43a852b..a3e9034b7 100644 --- a/definitions/grib2/tables/8/1.0.table +++ b/definitions/grib2/tables/8/1.0.table @@ -10,4 +10,4 @@ 8 8 Version implemented on 2 November 2011 9 9 Pre-operational to be implemented by next amendment # 10-254 Future versions -255 255 Master tables not used. Local table entries and local templates may use the entire range of the table, not just those sections marked Reserved for local used. +255 255 Missing diff --git a/definitions/grib2/tables/9/1.0.table b/definitions/grib2/tables/9/1.0.table index 4b1406c7e..5dc717176 100644 --- a/definitions/grib2/tables/9/1.0.table +++ b/definitions/grib2/tables/9/1.0.table @@ -11,4 +11,4 @@ 9 9 Version implemented on 2 May 2012 10 10 Pre-operational to be implemented by next amendment # 11-254 Future versions -255 255 Master tables not used. Local table entries and local templates may use the entire range of the table, not just those sections marked Reserved for local used. +255 255 Missing diff --git a/definitions/grib3/tables/0/1.0.table b/definitions/grib3/tables/0/1.0.table index a34f44ee1..b40e40dfc 100644 --- a/definitions/grib3/tables/0/1.0.table +++ b/definitions/grib3/tables/0/1.0.table @@ -4,4 +4,4 @@ 2 2 Previous operational version number 3 3 Current operational version number implemented on 2 November 2005 # 4-254 Future operational version numbers -255 255 Master tables not used. Local table entries and local templates may use the entire range of the table, not just those sections marked Reserved for local used. +255 255 Missing diff --git a/src/accessor/grib_accessor_class_message_is_valid.cc b/src/accessor/grib_accessor_class_message_is_valid.cc index a467c88f0..9a0bdbea7 100644 --- a/src/accessor/grib_accessor_class_message_is_valid.cc +++ b/src/accessor/grib_accessor_class_message_is_valid.cc @@ -73,9 +73,7 @@ static int check_grid_pl_array(grib_handle* h) } pl = (long*)grib_context_malloc_clear(c, sizeof(long) * plsize); - if (!pl) { - return GRIB_OUT_OF_MEMORY; - } + if (!pl) return GRIB_OUT_OF_MEMORY; if ((ret = grib_get_long_array(h, "pl", pl, &plsize)) != GRIB_SUCCESS) return ret; @@ -90,10 +88,26 @@ static int check_grid_pl_array(grib_handle* h) return GRIB_SUCCESS; } +static int check_geoiterator(grib_handle* h) +{ + //printf("DEBUG %s \n", __func__); + int err = 0; + grib_iterator* iter = grib_iterator_new(h, 0, &err); + if (err == GRIB_NOT_IMPLEMENTED || err == GRIB_SUCCESS) { + grib_iterator_delete(iter); + return GRIB_SUCCESS; // GRIB_NOT_IMPLEMENTED is OK e.g., for spectral fields + } + + grib_context_log(h->context, GRIB_LOG_ERROR, "%s", grib_get_error_message(err)); + grib_iterator_delete(iter); + return err; +} + typedef int (*proj_func)(grib_handle*); static proj_func check_functions[] = { check_field_values, - check_grid_pl_array + check_grid_pl_array, + check_geoiterator }; int grib_accessor_message_is_valid_t::unpack_long(long* val, size_t* len) diff --git a/tests/grib_check_message_validity.sh b/tests/grib_check_message_validity.sh index 73496c491..828ade584 100755 --- a/tests/grib_check_message_validity.sh +++ b/tests/grib_check_message_validity.sh @@ -17,6 +17,13 @@ tempFilt=temp.$label.filt sample=$ECCODES_SAMPLES_PATH/reduced_gg_pl_32_grib2.tmpl grib_check_key_equals $sample isMessageValid 1 +# Check regular lat/lon +# ------------------------------ +${tools_dir}/grib_set -s Nj=0 $data_dir/sample.grib2 $tempGrib +grib_check_key_equals $tempGrib isMessageValid 0 2>$tempText +grep -q "Regular grid Geoiterator" $tempText + + # Check reduced Gaussian grid Ni # ------------------------------ cat >$tempFilt<