Skip to content

Commit ce79133

Browse files
committed
ECC-1806: Further tests
1 parent a39eb88 commit ce79133

File tree

2 files changed

+43
-13
lines changed

2 files changed

+43
-13
lines changed

definitions/grib1/section.1.def

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,18 @@ meta md5Product md5(offsetSection1,section1Length,gridDefinition,section1Flags,d
328328

329329
# ECC-1806
330330
concept_nofail paramIdForConversion(zero) {
331-
262000 = { gribTablesVersionNo=174;indicatorOfParameter=98; centre=98; } # 174098 -> 262000
332-
262104 = { gribTablesVersionNo=151;indicatorOfParameter=163;centre=98; } # 151163 -> 262104
333-
262124 = { gribTablesVersionNo=151;indicatorOfParameter=145;centre=98; } # 151145 -> 262124
331+
228004 = { gribTablesVersionNo=128; indicatorOfParameter=55; centre=98; } # 55 -> 228004
332+
235168 = { gribTablesVersionNo=128; indicatorOfParameter=56; centre=98; } # 56 -> 235168
333+
235135 = { gribTablesVersionNo=130; indicatorOfParameter=232; centre=98; } # 130232 -> 235135
334+
262104 = { gribTablesVersionNo=151; indicatorOfParameter=163; centre=98; } # 151163 -> 262104
335+
262124 = { gribTablesVersionNo=151; indicatorOfParameter=145; centre=98; } # 151145 -> 262124
336+
235033 = { gribTablesVersionNo=172; indicatorOfParameter=146; centre=98; } # 172146 -> 235033
337+
235034 = { gribTablesVersionNo=172; indicatorOfParameter=147; centre=98; } # 172147 -> 235034
338+
235035 = { gribTablesVersionNo=172; indicatorOfParameter=169; centre=98; } # 172169 -> 235035
339+
235036 = { gribTablesVersionNo=172; indicatorOfParameter=175; centre=98; } # 172175 -> 235036
340+
235037 = { gribTablesVersionNo=172; indicatorOfParameter=176; centre=98; } # 172176 -> 235037
341+
235038 = { gribTablesVersionNo=172; indicatorOfParameter=177; centre=98; } # 172177 -> 235038
342+
235039 = { gribTablesVersionNo=172; indicatorOfParameter=178; centre=98; } # 172178 -> 235039
343+
235040 = { gribTablesVersionNo=172; indicatorOfParameter=179; centre=98; } # 172179 -> 235040
344+
262000 = { gribTablesVersionNo=174; indicatorOfParameter=98; centre=98; } # 174098 -> 262000
334345
} : long_type;

tests/grib_ecc-1806.sh

Lines changed: 29 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,9 @@
1313
REDIRECT=/dev/null
1414

1515
label="grib_ecc-1806_test"
16-
tempGribA=temp.$label.1.grib
17-
tempGribB=temp.$label.2.grib
18-
tempFilt=temp.$label.filt
16+
tempGrib1=temp.$label.1.grib
17+
tempGrib2=temp.$label.2.grib
1918
tempLog=temp.$label.log
20-
tempRef=temp.$label.ref
2119

2220
sample_grib1=$ECCODES_SAMPLES_PATH/GRIB1.tmpl
2321
sample_grib2=$ECCODES_SAMPLES_PATH/GRIB2.tmpl
@@ -27,21 +25,42 @@ test_conversion()
2725
param1=$1 # old paramId in GRIB1
2826
param2=$2 # new paramId in GRIB2
2927
short=$3 # new shortName
30-
${tools_dir}/grib_set -s paramId=$param1,edition=2 $sample_grib1 $tempGribA
31-
grib_check_key_equals $tempGribA paramId,shortName "$param2 $short"
3228

33-
# The old paramId has been removed from GRIB2
29+
${tools_dir}/grib_set -s paramId=$param1 $sample_grib1 $tempGrib1
30+
3431
set +e
35-
${tools_dir}/grib_set -s paramId=$param1 $sample_grib2 $tempGribA 2>$REDIRECT
32+
${tools_dir}/grib_set -s edition=2 $tempGrib1 $tempGrib2 2>$REDIRECT
3633
status=$?
3734
set -e
38-
[ $status -ne 0 ]
35+
if [ $status -ne 0 ]; then
36+
${tools_dir}/grib_set -s stepType=avg,edition=2 $tempGrib1 $tempGrib2
37+
fi
38+
grib_check_key_equals $tempGrib2 paramId,shortName "$param2 $short"
3939

40+
# Check the old paramId has been removed from GRIB2
41+
set +e
42+
${tools_dir}/grib_set -s paramId=$param1 $sample_grib2 $tempGrib2 >$tempLog 2>&1
43+
status=$?
44+
set -e
45+
[ $status -ne 0 ]
46+
grep -q "no match for paramId" $tempLog
4047
}
4148

4249
test_conversion 174098 262000 sithick
4350
test_conversion 151163 262104 t20d
4451
test_conversion 151145 262124 zos
52+
test_conversion 130232 235135 mw
53+
test_conversion 172146 235033 msshf
54+
test_conversion 172147 235034 mslhf
55+
test_conversion 55 228004 mean2t
56+
test_conversion 56 235168 m2d
57+
test_conversion 172169 235035 msdwswrf
58+
test_conversion 172175 235036 msdwlwrf
59+
test_conversion 172176 235037 msnswrf
60+
test_conversion 172177 235038 msnlwrf
61+
test_conversion 172178 235039 mtnswrf
62+
test_conversion 172179 235040 mtnlwrf
63+
4564

4665
# Clean up
47-
rm -f $tempGribA $tempGribB $tempFilt $tempLog $tempRef
66+
rm -f $tempGrib1 $tempGrib2 $tempLog

0 commit comments

Comments
 (0)