2014-12-06 10:28:58 +00:00
|
|
|
#!/bin/sh
|
2020-01-28 14:32:34 +00:00
|
|
|
# (C) Copyright 2005- ECMWF.
|
2014-12-06 10:28:58 +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.
|
|
|
|
#
|
|
|
|
|
|
|
|
set -x
|
2022-04-03 22:02:48 +00:00
|
|
|
. ./include.ctest.sh
|
2014-12-06 10:28:58 +00:00
|
|
|
|
|
|
|
REDIRECT=/dev/null
|
|
|
|
|
|
|
|
cat > bufrdc_num_ref.filter<<EOF
|
|
|
|
set subsetNumber=0;
|
|
|
|
print "[numericValues!1%23.14e]";
|
|
|
|
EOF
|
|
|
|
|
|
|
|
for file in ${data_dir}/bufr/*.bufr
|
|
|
|
do
|
|
|
|
# Test numeric data: compare output of filter (res) with reference file (ref)
|
|
|
|
res_num=$file.num.test
|
|
|
|
ref_num=$file.num.ref
|
|
|
|
diff_num=$file.num.diff
|
|
|
|
|
2017-11-30 17:49:46 +00:00
|
|
|
rm -f $res_num
|
2014-12-06 10:28:58 +00:00
|
|
|
|
|
|
|
set +e
|
2017-02-03 14:21:24 +00:00
|
|
|
${tools_dir}/codes_bufr_filter bufrdc_num_ref.filter $file 2> $REDIRECT > $res_num
|
2014-12-06 10:28:58 +00:00
|
|
|
if [ $? != 0 ]
|
|
|
|
then
|
|
|
|
mv $file $file.no
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Cannot use plain diff. We need to compare FLOAT NUMBERS with a tolerance
|
2014-12-08 16:38:33 +00:00
|
|
|
perl number_compare.pl $ref_num $res_num > $diff_num 2> $diff_num
|
|
|
|
#numdiff $ref_num $res_num > $diff_num 2> $diff_num
|
2014-12-06 10:28:58 +00:00
|
|
|
if [ $? != 0 ]
|
|
|
|
then
|
|
|
|
mv $file $file.no
|
|
|
|
else
|
|
|
|
rm -f $res_num $diff_num
|
|
|
|
fi
|
|
|
|
|
|
|
|
#rm -f $res_num $diff_num
|
|
|
|
|
|
|
|
done
|
|
|
|
|
|
|
|
#rm -f bufrdc_num_ref.filter
|