2014-08-07 11:03:53 +00:00
|
|
|
#!/bin/sh
|
2020-01-28 14:32:34 +00:00
|
|
|
# (C) Copyright 2005- ECMWF.
|
2014-08-07 11:03:53 +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.
|
|
|
|
#
|
|
|
|
|
2015-10-23 14:34:57 +00:00
|
|
|
set -x
|
2022-04-03 22:02:48 +00:00
|
|
|
. ./include.ctest.sh
|
2014-08-07 11:03:53 +00:00
|
|
|
|
|
|
|
REDIRECT=/dev/null
|
|
|
|
|
2014-09-01 12:20:22 +00:00
|
|
|
cat > bufrdc_num_ref.filter<<EOF
|
2014-08-07 11:03:53 +00:00
|
|
|
print "[numericValues!1%23.14e]";
|
|
|
|
EOF
|
|
|
|
|
2016-02-09 16:42:03 +00:00
|
|
|
bufr_files=`cat ${data_dir}/bufr/bufr_data_files.txt`
|
|
|
|
|
2015-03-13 17:51:03 +00:00
|
|
|
for bf in ${bufr_files}
|
2014-08-07 11:03:53 +00:00
|
|
|
do
|
2015-03-13 17:51:03 +00:00
|
|
|
file=${data_dir}/bufr/$bf
|
2014-08-07 14:02:31 +00:00
|
|
|
# Test numeric data: compare output of filter (res) with reference file (ref)
|
|
|
|
res_num=$file.num.test
|
|
|
|
ref_num=$file.num.ref
|
2014-09-01 12:20:22 +00:00
|
|
|
diff_num=$file.num.diff
|
2014-08-07 11:03:53 +00:00
|
|
|
|
2017-11-08 11:09:58 +00:00
|
|
|
rm -f $res_num
|
2014-08-07 11:03:53 +00:00
|
|
|
|
2017-02-03 14:21:24 +00:00
|
|
|
${tools_dir}/codes_bufr_filter bufrdc_num_ref.filter $file 2> $REDIRECT > $res_num
|
2014-08-07 11:03:53 +00:00
|
|
|
|
2016-02-09 16:42:03 +00:00
|
|
|
# Exclude the BUFR file uegabe.bufr because its reference file is incorrect
|
|
|
|
if [ "$bf" = "uegabe.bufr" ]; then
|
2017-11-08 11:09:58 +00:00
|
|
|
rm -f $res_num
|
2016-02-09 16:42:03 +00:00
|
|
|
continue
|
|
|
|
fi
|
|
|
|
|
2015-03-20 19:10:26 +00:00
|
|
|
if [ -f "$ref_num" ]; then
|
|
|
|
# Cannot use plain diff. We need to compare FLOAT NUMBERS with a tolerance
|
2019-07-29 14:46:07 +00:00
|
|
|
perl number_compare.pl $ref_num $res_num # >$REDIRECT 2> $REDIRECT
|
2015-03-20 19:10:26 +00:00
|
|
|
#numdiff $ref_num $res_num >$REDIRECT 2> $REDIRECT
|
|
|
|
fi
|
2014-10-22 10:51:06 +00:00
|
|
|
|
2017-11-08 11:09:58 +00:00
|
|
|
rm -f $res_num
|
2014-08-07 11:03:53 +00:00
|
|
|
done
|
|
|
|
|
2014-09-18 16:07:03 +00:00
|
|
|
rm -f bufrdc_num_ref.filter
|