Testing: grib_to_netcdf options

This commit is contained in:
shahramn 2024-05-18 17:25:22 +01:00
parent ff790c4822
commit a2761b997a
1 changed files with 28 additions and 0 deletions

View File

@ -110,6 +110,14 @@ ${tools_dir}/grib_to_netcdf -o $tempNetcdf $tempGrib
${tools_dir}/grib_set -s productDefinitionTemplateNumber=31 $sample2 $tempGrib
${tools_dir}/grib_to_netcdf -o $tempNetcdf $tempGrib
ECCODES_DEBUG=-1 ${tools_dir}/grib_to_netcdf -o $tempNetcdf $tempGrib
# The -u option
input=${data_dir}/sample.grib2
${tools_dir}/grib_to_netcdf -u time -o $tempNetcdf $input
echo "Test different resolutions ..."
# ------------------------------------
# This should fail as messages have different resolutions
@ -170,6 +178,26 @@ set -e
grep -q "Wrong message length" $tempText
# Non-GRIB input
input=$data_dir/bufr/aaen_55.bufr
set +e
${tools_dir}/grib_to_netcdf -o $tempNetcdf $input > $tempText 2>&1
status=$?
set -e
[ $status -ne 0 ]
grep -q "Input does not contain any field" $tempText
# Bad reference date
input=$data_dir/sample.grib2
set +e
${tools_dir}/grib_to_netcdf -Rxxx -o $tempNetcdf $input > $tempText 2>&1
status=$?
set -e
[ $status -ne 0 ]
grep -q "Invalid reference date" $tempText
# Validity time check
export GRIB_TO_NETCDF_CHECKVALIDTIME=0
${tools_dir}/grib_to_netcdf -o $tempNetcdf $tempGrib