2013-03-25 12:04:10 +00:00
|
|
|
#!/bin/sh
|
2015-12-31 12:44:51 +00:00
|
|
|
# Copyright 2005-2016 ECMWF.
|
2013-03-25 12:04:10 +00:00
|
|
|
#
|
|
|
|
# This software is licensed under the terms of the Apache Licence Version 2.0
|
|
|
|
# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
|
|
|
|
#
|
|
|
|
# In applying this licence, ECMWF does not waive the privileges and immunities granted to it by
|
|
|
|
# virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction.
|
|
|
|
#
|
|
|
|
|
|
|
|
. ./include.sh
|
|
|
|
|
|
|
|
REDIRECT=/dev/null
|
|
|
|
|
|
|
|
#set -eax
|
|
|
|
|
|
|
|
dir="${data_dir}/tigge/"
|
|
|
|
|
|
|
|
# check tigge global
|
2014-03-31 12:57:06 +00:00
|
|
|
for file in ${dir}/tigge_*.grib
|
2013-03-25 12:04:10 +00:00
|
|
|
do
|
2014-03-31 12:57:06 +00:00
|
|
|
${tigge_dir}tigge_check ${file} 2> $REDIRECT > $REDIRECT
|
2013-03-25 12:04:10 +00:00
|
|
|
done
|
|
|
|
|
|
|
|
# check tigge-lam
|
2014-03-31 12:57:06 +00:00
|
|
|
for file in ${dir}/tiggelam_*.grib
|
2013-03-25 12:04:10 +00:00
|
|
|
do
|
2014-03-31 12:57:06 +00:00
|
|
|
${tigge_dir}tigge_check -l ${file} 2> $REDIRECT > $REDIRECT
|
2013-03-25 12:04:10 +00:00
|
|
|
done
|
|
|
|
|
|
|
|
|
|
|
|
# Now test non-TIGGE files too. We now expect tigge_check to fail!
|
|
|
|
# All the grib files in the samples are non-TIGGE
|
2015-01-23 22:47:51 +00:00
|
|
|
for file in ${ECCODES_SAMPLES_PATH}/*.tmpl
|
2013-03-25 12:04:10 +00:00
|
|
|
do
|
2014-06-18 16:14:01 +00:00
|
|
|
set +e
|
2014-03-31 12:57:06 +00:00
|
|
|
${tigge_dir}tigge_check ${file} 2> $REDIRECT > $REDIRECT
|
2014-06-18 16:14:01 +00:00
|
|
|
status=$?
|
|
|
|
set -e
|
|
|
|
if [ $status -eq 0 ]; then
|
2014-03-31 12:57:06 +00:00
|
|
|
# should have failed and returned a non-zero exit code
|
|
|
|
exit 1
|
|
|
|
fi
|
2013-03-25 12:04:10 +00:00
|
|
|
done
|
|
|
|
|
2014-06-18 16:14:01 +00:00
|
|
|
# GRIB-531
|
2014-08-15 10:54:12 +00:00
|
|
|
TEMP=temp.$$.tigge
|
2014-06-18 16:14:01 +00:00
|
|
|
${tools_dir}grib_get -nparameter ${data_dir}/tigge_pf_ecmwf.grib2 > $TEMP
|
|
|
|
diff ${data_dir}/tigge_pf_ecmwf.grib2.ref $TEMP
|
|
|
|
|
2014-08-15 10:54:12 +00:00
|
|
|
# GRIB-205. Changing productionStatusOfProcessedData should not change
|
|
|
|
# anything else
|
|
|
|
input=${dir}/tigge_ecmf_sfc_sd.grib
|
|
|
|
${tools_dir}grib_set -s productionStatusOfProcessedData=5 $input $TEMP
|
|
|
|
${tools_dir}grib_compare -bproductionStatusOfProcessedData $input $TEMP
|
|
|
|
|
2014-06-18 16:14:01 +00:00
|
|
|
rm -f $TEMP
|