eccodes/tests/bufrdc_ref.sh

42 lines
1.1 KiB
Bash
Raw Normal View History

#!/bin/sh
2015-01-05 15:45:46 +00:00
# Copyright 2005-2015 ECMWF.
#
# 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
2014-09-01 12:20:22 +00:00
cat > bufrdc_num_ref.filter<<EOF
set subsetNumber=0;
print "[numericValues!1%23.14e]";
EOF
bufr_files=`cat ${data_dir}/bufr/bufr_data_files.txt`
for bf in ${bufr_files}
do
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 14:02:31 +00:00
rm -f $res_num | true
2014-09-01 12:20:22 +00:00
${tools_dir}bufr_filter bufrdc_num_ref.filter $file 2> $REDIRECT > $res_num
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
perl number_compare.pl $ref_num $res_num >$REDIRECT 2> $REDIRECT
#numdiff $ref_num $res_num >$REDIRECT 2> $REDIRECT
fi
done
2014-09-18 16:07:03 +00:00
rm -f bufrdc_num_ref.filter