2017-05-22 15:44:16 +00:00
|
|
|
#!/bin/sh
|
2020-01-28 14:32:34 +00:00
|
|
|
# (C) Copyright 2005- ECMWF.
|
2017-05-22 15:44:16 +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.
|
|
|
|
#
|
|
|
|
|
2022-04-03 22:02:48 +00:00
|
|
|
. ./include.ctest.sh
|
2017-05-22 15:44:16 +00:00
|
|
|
|
|
|
|
# ---------------------------------------------------------
|
|
|
|
# This is the test for the JIRA issue ECC-313.
|
|
|
|
# It tests decoding a BUFR file which uses the operator 203YYY.
|
|
|
|
# ---------------------------------------------------------
|
2022-06-01 15:02:34 +00:00
|
|
|
label="bufr_ecc-313_test"
|
2017-05-22 15:44:16 +00:00
|
|
|
tempRules=temp.${label}.filter
|
|
|
|
tempOut=temp.${label}.txt
|
|
|
|
tempRef=temp.${label}.ref
|
|
|
|
|
|
|
|
input=${data_dir}/bufr/israel_observations_2017041010.bufr
|
|
|
|
|
|
|
|
# Check we can dump
|
|
|
|
${tools_dir}/bufr_dump $input >/dev/null
|
|
|
|
|
|
|
|
# Check values which have their reference redefined
|
|
|
|
# These are the unexpandedDescriptors:
|
|
|
|
# 203014 7030 7031 203255 307080
|
|
|
|
# 7030 = heightOfStationGroundAboveMeanSeaLevel
|
|
|
|
# 7031 = heightOfBarometerAboveMeanSeaLevel
|
|
|
|
cat > $tempRules <<EOF
|
|
|
|
set unpack=1;
|
|
|
|
print "h1=[heightOfStationGroundAboveMeanSeaLevel]";
|
|
|
|
print "h2=[heightOfBarometerAboveMeanSeaLevel]";
|
2018-04-10 16:17:48 +00:00
|
|
|
print "rv=[inputOverriddenReferenceValues]";
|
2018-04-10 14:54:32 +00:00
|
|
|
print "rf1=[#1#heightOfStationGroundAboveMeanSeaLevel->reference]";
|
2017-05-22 15:44:16 +00:00
|
|
|
EOF
|
|
|
|
|
2017-08-29 16:49:30 +00:00
|
|
|
${tools_dir}/codes_bufr_filter $tempRules $input > $tempOut
|
2017-05-22 15:44:16 +00:00
|
|
|
|
|
|
|
cat > $tempRef << EOF
|
|
|
|
h1=10 60 215 564 685 5 5 555
|
|
|
|
375 170 279 355 110 31 -330 -200
|
|
|
|
135 280 115 -120 22 300 -415 15
|
|
|
|
265 25 370 335 180 405 140 -255
|
|
|
|
5 80 5 245 475 65 770 830
|
|
|
|
-135 820 810 770 75 365 -200 460
|
|
|
|
490 495 -200 60 945 20 845 180
|
|
|
|
95 400 275 350 115 30 100 330
|
|
|
|
50 10 950 475 -185 -388 700 5
|
|
|
|
145 10 -65 0 70 936 -200 175
|
|
|
|
360 710
|
|
|
|
h2=11 -1e+100 -1e+100 -1e+100 -1e+100 -1e+100 -1e+100 -1e+100
|
|
|
|
-1e+100 -1e+100 280 -1e+100 -1e+100 31 -1e+100 -1e+100
|
|
|
|
-1e+100 -1e+100 -1e+100 -1e+100 22 -1e+100 -1e+100 -1e+100
|
|
|
|
-1e+100 -1e+100 -1e+100 -1e+100 -1e+100 -1e+100 -1e+100 -1e+100
|
|
|
|
-1e+100 -1e+100 -1e+100 -1e+100 -1e+100 -1e+100 -1e+100 -1e+100
|
|
|
|
-1e+100 -1e+100 810 -1e+100 -1e+100 -1e+100 -1e+100 -1e+100
|
|
|
|
-1e+100 -1e+100 -1e+100 -1e+100 -1e+100 -1e+100 -1e+100 -1e+100
|
|
|
|
-1e+100 -1e+100 -1e+100 -1e+100 -1e+100 -1e+100 -1e+100 -1e+100
|
|
|
|
-1e+100 -1e+100 -1e+100 -1e+100 -1e+100 -387 -1e+100 -1e+100
|
|
|
|
-1e+100 -1e+100 -1e+100 -1e+100 -1e+100 938 -1e+100 -1e+100
|
|
|
|
-1e+100 -1e+100
|
2018-04-06 12:52:39 +00:00
|
|
|
rv=-5000 -5000
|
2018-04-10 14:54:32 +00:00
|
|
|
rf1=-5000
|
2017-05-22 15:44:16 +00:00
|
|
|
EOF
|
2018-04-10 14:54:32 +00:00
|
|
|
echo "Expected output:"
|
|
|
|
cat $tempRef
|
2017-05-22 15:44:16 +00:00
|
|
|
diff $tempRef $tempOut
|
|
|
|
|
|
|
|
rm -f $tempRules $tempRef $tempOut
|