2015-02-05 16:29:49 +00:00
|
|
|
#!/bin/sh
|
2020-01-28 14:32:34 +00:00
|
|
|
# (C) Copyright 2005- ECMWF.
|
2015-02-05 16:29:49 +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-04 12:35:10 +00:00
|
|
|
. ./include.ctest.sh
|
2015-02-05 16:29:49 +00:00
|
|
|
|
2015-02-06 09:32:42 +00:00
|
|
|
#Define a common label for all the tmp files
|
|
|
|
label="bufr_subset_test_c"
|
|
|
|
|
|
|
|
#Prepare tmp file
|
|
|
|
fTmp=${label}.tmp.txt
|
2020-05-14 17:29:45 +00:00
|
|
|
rm -f $fTmp
|
2015-02-06 09:32:42 +00:00
|
|
|
|
2015-10-28 11:46:53 +00:00
|
|
|
#Prepare ref file
|
|
|
|
fRef=${label}.ref
|
|
|
|
cat > $fRef <<EOF
|
|
|
|
message: 0
|
|
|
|
numberOfSubsets: 12
|
2015-10-28 16:07:41 +00:00
|
|
|
subsetNumber=1 blockNumber=1 stationNumber=27 stationOrSiteName="TROMSO-HOLT" airTemperature=276.45
|
|
|
|
subsetNumber=2 blockNumber=1 stationNumber=84 stationOrSiteName="PASVIK" airTemperature=266.55
|
|
|
|
subsetNumber=3 blockNumber=1 stationNumber=270 stationOrSiteName="KVITHAMAR" airTemperature=275.25
|
|
|
|
subsetNumber=4 blockNumber=1 stationNumber=272 stationOrSiteName="FROSTA" airTemperature=276.25
|
|
|
|
subsetNumber=5 blockNumber=1 stationNumber=308 stationOrSiteName="FURUNESET" airTemperature=276.85
|
|
|
|
subsetNumber=6 blockNumber=1 stationNumber=371 stationOrSiteName="LOKEN I VOLBU" airTemperature=265.35
|
|
|
|
subsetNumber=7 blockNumber=1 stationNumber=381 stationOrSiteName="APELSVOLL" airTemperature=270.15
|
|
|
|
subsetNumber=8 blockNumber=1 stationNumber=382 stationOrSiteName="KISE" airTemperature=270.45
|
|
|
|
subsetNumber=9 blockNumber=1 stationNumber=387 stationOrSiteName="FAVANG" airTemperature=267.55
|
|
|
|
subsetNumber=10 blockNumber=1 stationNumber=413 stationOrSiteName="SAERHEIM" airTemperature=277.45
|
|
|
|
subsetNumber=11 blockNumber=1 stationNumber=464 stationOrSiteName="LANDVIK" airTemperature=275.95
|
|
|
|
subsetNumber=12 blockNumber=1 stationNumber=485 stationOrSiteName="SANDE-GALLEBERG" airTemperature=275.45
|
2015-10-28 11:46:53 +00:00
|
|
|
EOF
|
|
|
|
|
2020-05-14 17:29:45 +00:00
|
|
|
# We check "synop_multi_subset.bufr". The path is
|
|
|
|
# hard coded in the example
|
2015-02-06 09:32:42 +00:00
|
|
|
|
2020-05-14 17:29:45 +00:00
|
|
|
# Write the values into a file and compare with reference
|
|
|
|
${examples_dir}/c_bufr_subset > $fTmp
|
2015-02-05 16:29:49 +00:00
|
|
|
|
2020-05-14 17:29:45 +00:00
|
|
|
# We compare output to the reference by ignoring the whitespaces
|
|
|
|
diff -w $fRef $fTmp
|
2015-02-05 16:29:49 +00:00
|
|
|
|
2020-05-14 17:29:45 +00:00
|
|
|
# Clean up
|
2015-10-28 11:46:53 +00:00
|
|
|
rm -f $fTmp $fRef
|