From 84f23bf5020134ec9bf3fe43cf5c1eb8efe7fc73 Mon Sep 17 00:00:00 2001 From: shahramn Date: Thu, 7 Mar 2024 16:58:23 +0000 Subject: [PATCH] ECC-1782: Repacking sample GRIB2.tmpl fails when ECCODES_GRIB_DATA_QUALITY_CHECKS=1 --- samples/GRIB2.tmpl | Bin 179 -> 179 bytes tests/codes_ecc-1698.sh | 4 ++-- tests/grib_data_quality_checks.sh | 17 ++++++++++++++--- tests/grib_decimalPrecision.sh | 8 +++++--- tests/grib_ecc-1271.sh | 2 +- 5 files changed, 22 insertions(+), 9 deletions(-) diff --git a/samples/GRIB2.tmpl b/samples/GRIB2.tmpl index 5c7b111ce7bff3a14a194351d67418d3aa6342ce..e2f890a57d52dea5ea01d64c3285a1babd51bab1 100644 GIT binary patch delta 32 gcmdnYxS4UnEJ^2%28ISM1_)qd`wwKWvYP_|0EIXPbN~PV delta 32 gcmdnYxS4UnEJ^zY28ISM1_)qd`wwKWvYP_|0C $tempDir/param_limits.def < 4 -${tools_dir}/grib_set -s paramId=260509,step=12,scaleValuesBy=1000 $sample_g2 $tempGrib2 +# The GRIB2 sample has max values of 273. We need to use 1 for this test +${tools_dir}/grib_set -s paramId=260509,step=12,values=1,scaleValuesBy=1000 $sample_g2 $tempGrib2 # Step of 0 doesn't satisfy the condition so will use 400 +# The GRIB2 sample has max values of 273. We need to use 1 for this test set +e -${tools_dir}/grib_set -s paramId=260509,scaleValuesBy=1000 $sample_g2 $tempGrib2 +${tools_dir}/grib_set -s paramId=260509,values=1,scaleValuesBy=1000 $sample_g2 $tempGrib2 status=$? set -e [ $status -ne 0 ] diff --git a/tests/grib_decimalPrecision.sh b/tests/grib_decimalPrecision.sh index 66a4c6253..afe13ad74 100755 --- a/tests/grib_decimalPrecision.sh +++ b/tests/grib_decimalPrecision.sh @@ -10,6 +10,9 @@ . ./include.ctest.sh +label="grib_decimalPrecision_test" + +temp=temp.$label.grib REDIRECT=/dev/null files="regular_latlon_surface.grib2 \ @@ -29,7 +32,6 @@ for file in $files; do done # ECC-458: spectral_complex packing -temp=temp.grib_decimalPrecision.grib infile=${data_dir}/spectral_complex.grib1 # Catch errors re negative values export ECCODES_FAIL_IF_LOG_MESSAGE=1 @@ -42,7 +44,7 @@ sample2=$ECCODES_SAMPLES_PATH/GRIB2.tmpl ${tools_dir}/grib_set -s decimalScaleFactor=3 $sample1 $temp grib_check_key_equals $temp min,max,const,decimalScaleFactor,referenceValue '47485.4 47485.4 1 3 47485.4' ${tools_dir}/grib_set -s decimalScaleFactor=3 $sample2 $temp -grib_check_key_equals $temp min,max,const,decimalScaleFactor,referenceValue '1 1 1 3 1' - +grib_check_key_equals $temp min,max,const,decimalScaleFactor,referenceValue '273 273 1 3 273' +# Clean up rm -f $temp diff --git a/tests/grib_ecc-1271.sh b/tests/grib_ecc-1271.sh index 04a25d828..8e9f7ed13 100755 --- a/tests/grib_ecc-1271.sh +++ b/tests/grib_ecc-1271.sh @@ -23,6 +23,6 @@ $sample_grib2 $temp grib_check_key_equals $temp Ni,Nj "16 31" grib_check_key_equals $temp centreLatitudeInDegrees,centreLongitudeInDegrees "0 30" -grib_check_key_equals $temp minimum,maximum "1 1" +grib_check_key_equals $temp minimum,maximum "273 273" rm -f $temp