mirror of https://github.com/ecmwf/eccodes.git
Testing: Accessors 'sum' and 'suppressed'
This commit is contained in:
parent
d7111f0185
commit
d2e0ac5768
|
@ -237,6 +237,19 @@ grib_check_key_equals $tempGrib scaleFactorOfFirstFixedSurface MISSING
|
||||||
grib_check_key_equals $tempGrib scaledValueOfFirstFixedSurface MISSING
|
grib_check_key_equals $tempGrib scaledValueOfFirstFixedSurface MISSING
|
||||||
|
|
||||||
|
|
||||||
|
echo "Test for the sum accessor"
|
||||||
|
# -------------------------------
|
||||||
|
input="${samp_dir}/reduced_gg_pl_32_grib2.tmpl"
|
||||||
|
cat >$tempFilt <<EOF
|
||||||
|
meta sum_of_pl_array sum(pl);
|
||||||
|
# Default is double
|
||||||
|
print "sum_of_pl_array =[sum_of_pl_array]";
|
||||||
|
print "sum_of_pl_array as ints=[sum_of_pl_array:i]";
|
||||||
|
print "sum_of_pl_array as strs=[sum_of_pl_array:s]";
|
||||||
|
EOF
|
||||||
|
${tools_dir}/grib_filter $tempFilt $input > $tempOut
|
||||||
|
|
||||||
|
|
||||||
echo "Test from_scale_factor_scaled_value"
|
echo "Test from_scale_factor_scaled_value"
|
||||||
# -----------------------------------------
|
# -----------------------------------------
|
||||||
input="${samp_dir}/reduced_gg_pl_32_grib2.tmpl"
|
input="${samp_dir}/reduced_gg_pl_32_grib2.tmpl"
|
||||||
|
|
|
@ -39,6 +39,29 @@ EOF
|
||||||
|
|
||||||
diff $tempRef $tempErr
|
diff $tempRef $tempErr
|
||||||
|
|
||||||
|
# Try decoding as int and double too
|
||||||
|
cat > $tempFilt <<EOF
|
||||||
|
meta a_deprecated_key suppressed(typeOfOriginalFieldValues);
|
||||||
|
print "[a_deprecated_key:i]";
|
||||||
|
EOF
|
||||||
|
set +e
|
||||||
|
${tools_dir}/grib_filter $tempFilt $sample2 2>$tempErr
|
||||||
|
status=$?
|
||||||
|
set -e
|
||||||
|
[ $status -ne 0 ]
|
||||||
|
grep -q "is unavailable" $tempErr
|
||||||
|
|
||||||
|
|
||||||
|
cat > $tempFilt <<EOF
|
||||||
|
meta a_deprecated_key suppressed(typeOfOriginalFieldValues);
|
||||||
|
print "[a_deprecated_key:d]";
|
||||||
|
EOF
|
||||||
|
set +e
|
||||||
|
${tools_dir}/grib_filter $tempFilt $sample2 2>$tempErr
|
||||||
|
status=$?
|
||||||
|
set -e
|
||||||
|
[ $status -ne 0 ]
|
||||||
|
grep -q "is unavailable" $tempErr
|
||||||
|
|
||||||
# Clean up
|
# Clean up
|
||||||
rm -f $tempFilt $tempErr $tempRef
|
rm -f $tempFilt $tempErr $tempRef
|
||||||
|
|
Loading…
Reference in New Issue