From c76bd5d80608da4edd342ed7014072cb5668cc8a Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Mon, 14 Feb 2022 16:34:50 +0000 Subject: [PATCH 1/8] ECC-1348: CMake: Option Adaptive Entropy Coding (AEC) should be turned on by default --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5200bd5ea..5adc81a7e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -117,7 +117,7 @@ ecbuild_add_option( FEATURE NETCDF find_package( AEC ) ecbuild_add_option( FEATURE AEC DESCRIPTION "Support for Adaptive Entropy Coding" - DEFAULT OFF + DEFAULT ON CONDITION AEC_FOUND ) ecbuild_find_python( VERSION 2.6 NO_LIBS ) From ad0c049edd0a6fc699b33a11ae1865b7beb056fe Mon Sep 17 00:00:00 2001 From: Tiago Quintino Date: Mon, 14 Feb 2022 23:09:29 +0000 Subject: [PATCH 2/8] ECC-1348 make check more severe --- CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5adc81a7e..4e22033cb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -115,6 +115,9 @@ ecbuild_add_option( FEATURE NETCDF NO_TPL ) find_package( AEC ) +if(NOT DEFINED ENABLE_AEC AND NOT AEC_FOUND) + ecbuild_critical("AEC support is highly recommended from ecCodes >= 2.25.0\nTo force build without it use -DENABLE_AEC=OFF") +endif() ecbuild_add_option( FEATURE AEC DESCRIPTION "Support for Adaptive Entropy Coding" DEFAULT ON From 25e616796f1ad3bd9f16e18ffaa088c0438fdac6 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Tue, 15 Feb 2022 12:31:22 +0000 Subject: [PATCH 3/8] ECC-1348: Load module --- bamboo/CLANG-env.sh | 1 + bamboo/GCC-env.sh | 2 ++ bamboo/INTEL-env.sh | 1 + 3 files changed, 4 insertions(+) diff --git a/bamboo/CLANG-env.sh b/bamboo/CLANG-env.sh index cb1b33378..6d1a280e6 100644 --- a/bamboo/CLANG-env.sh +++ b/bamboo/CLANG-env.sh @@ -16,5 +16,6 @@ module unload libemos module unload metview module load cmake/3.16.5 +module load aec module switch gnu clang diff --git a/bamboo/GCC-env.sh b/bamboo/GCC-env.sh index 877bc0faa..353a931b9 100644 --- a/bamboo/GCC-env.sh +++ b/bamboo/GCC-env.sh @@ -15,3 +15,5 @@ module unload libemos module unload metview module load cmake/3.16.5 +module load aec + diff --git a/bamboo/INTEL-env.sh b/bamboo/INTEL-env.sh index 73c9c9700..ef61e0ea3 100644 --- a/bamboo/INTEL-env.sh +++ b/bamboo/INTEL-env.sh @@ -16,5 +16,6 @@ module unload netcdf4 module list module load cmake/3.16.5 +module load aec module switch gnu intel/17.0.3 From e7754f0d6466c20f5f4809c7851dae57ed513ae1 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Tue, 15 Feb 2022 12:37:44 +0000 Subject: [PATCH 4/8] ECC-1348: AppVeyor, disable for Windows --- .appveyor.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.appveyor.yml b/.appveyor.yml index 533e8b3f9..638dece5e 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -74,6 +74,7 @@ build_script: -D ENABLE_FORTRAN=0 ^ -D ENABLE_NETCDF=1 ^ -D ENABLE_JPG=1 ^ + -D ENABLE_AEC=0 ^ -D IEEE_LE=1 ^ -D ENABLE_MEMFS=1 ^ -D ENABLE_EXTRA_TESTS=ON ^ From c7675865d5c2473b734a245a38471cd486164aa4 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Tue, 15 Feb 2022 15:49:39 +0000 Subject: [PATCH 5/8] IEEE Packing: grid simple matrix --- definitions/grib1/data.grid_simple_matrix.def | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/definitions/grib1/data.grid_simple_matrix.def b/definitions/grib1/data.grid_simple_matrix.def index 95aaf4de4..432ee33d6 100644 --- a/definitions/grib1/data.grid_simple_matrix.def +++ b/definitions/grib1/data.grid_simple_matrix.def @@ -75,8 +75,8 @@ if(matrixOfValues == 0) decimalScaleFactor, optimizeScaleFactor, halfByte, - packingType, - grid_ieee + packingType + #grid_ieee ) : read_only; alias data.packedValues = codedValues; meta values data_apply_bitmap(codedValues,bitmap,missingValue,binaryScaleFactor) : dump; From 5c208acd2b6f5f865ee6a9e07e4de144c801a38b Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Tue, 15 Feb 2022 17:50:57 +0000 Subject: [PATCH 6/8] Github workflow: Add libaec --- .github/workflows/ci.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c9664d466..18cde1be8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,5 +27,7 @@ jobs: codecov_upload: true build_package_inputs: | self_coverage: true - dependencies: ecmwf/ecbuild + dependencies: | + ecmwf/ecbuild + MathisRosenhauer/libaec dependency_branch: develop From 26fa49a2b7ee5bcc473c63464a3cb97bc7b62e23 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Tue, 15 Feb 2022 17:56:42 +0000 Subject: [PATCH 7/8] Github workflow: Add libaec (take 2) --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 18cde1be8..b30c8ede5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -29,5 +29,5 @@ jobs: self_coverage: true dependencies: | ecmwf/ecbuild - MathisRosenhauer/libaec + libaec dependency_branch: develop From 0983c3649300e59444d1114e00ee31844f232f4f Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Wed, 16 Feb 2022 11:49:40 +0000 Subject: [PATCH 8/8] Testing: catch case of localTablesVersion key in WMO defs --- tests/grib_check_param_concepts.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/grib_check_param_concepts.c b/tests/grib_check_param_concepts.c index f6f3e1434..4be3c1b9b 100644 --- a/tests/grib_check_param_concepts.c +++ b/tests/grib_check_param_concepts.c @@ -59,10 +59,14 @@ static int scale_factor_missing(const char* value) */ static int grib_check_param_concepts(const char* key, const char* filename) { + int isLocal = 0; grib_concept_value* concept_value = grib_parse_concept_file(NULL, filename); if (!concept_value) return GRIB_IO_PROBLEM; + if (strstr(filename, "/localConcepts/")) { + isLocal = 1; + } while (concept_value) { grib_concept_condition* concept_condition = concept_value->conditions; /* Convention: @@ -98,6 +102,11 @@ static int grib_check_param_concepts(const char* key, const char* filename) key, concept_value->name, expression->cclass->name); Assert(0); } + if (!isLocal && strcmp(condition_name, "localTablesVersion") == 0) { + fprintf(stderr, "%s %s: Cannot have localTablesVersion key in WMO file %s!\n", + key, concept_value->name, filename); + return GRIB_INVALID_KEY_VALUE; + } if (strcmp(condition_name, "typeOfFirstFixedSurface") == 0) { type1Missing = type_of_surface_missing(condition_name, condition_value); }