From cb446e5b193ac0c2564e5cc1906d6d1fbb1062da Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Wed, 14 Jul 2021 17:43:25 +0100 Subject: [PATCH] Testing: check each local def number appears in the table --- definitions/grib2/grib2LocalSectionNumber.98.table | 1 + tests/grib_local.sh | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/definitions/grib2/grib2LocalSectionNumber.98.table b/definitions/grib2/grib2LocalSectionNumber.98.table index c40763096..d57063c98 100644 --- a/definitions/grib2/grib2LocalSectionNumber.98.table +++ b/definitions/grib2/grib2LocalSectionNumber.98.table @@ -23,3 +23,4 @@ 42 42 Lead Centre for Wave Forecast Verification 192 192 Multiple ECMWF local definitions 300 300 Multi-dimensional parameters +500 500 Observation diagnostics diff --git a/tests/grib_local.sh b/tests/grib_local.sh index 6c5ceda98..ae23a316d 100755 --- a/tests/grib_local.sh +++ b/tests/grib_local.sh @@ -16,6 +16,15 @@ REDIRECT=/dev/null cd ${data_dir} rm -f local.log +# Check all GRIB2 local def files and definitions/grib2/grib2LocalSectionNumber.98.table +# Each number should appear in the table +g2lds=${ECCODES_DEFINITION_PATH}/grib2/local.98.*.def +for g2ld in $g2lds; do + dnum=`echo $g2ld | cut -d. -f3` + grep -q "^$dnum" ${ECCODES_DEFINITION_PATH}/grib2/grib2LocalSectionNumber.98.table +done + + ${tools_dir}/grib_set -s edition=2,setLocalDefinition=1 reduced_gaussian_model_level.grib1 loc.grib2 ${tools_dir}/grib_set -s setLocalDefinition=1 reduced_gaussian_model_level.grib1 loc.grib1