eccodes/tests/bufr_ecc-1187.sh

47 lines
1.3 KiB
Bash
Raw Permalink Normal View History

2020-12-24 21:09:00 +00:00
#!/bin/sh
# (C) Copyright 2005- 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.ctest.sh
2020-12-24 21:09:00 +00:00
# ---------------------------------------------------------
# This is the test for the JIRA issue ECC-1187
# BUFR: codes_set_missing()
# ---------------------------------------------------------
2022-06-01 15:02:34 +00:00
label="bufr_ecc-1187_test"
2020-12-24 21:09:00 +00:00
tempOut=temp.${label}.out
tempRules=temp.${label}.filter
# Try each key type:
# radiosondeType => LONG
# radiosondeSerialNumber => STRING
# #1#pressure => DOUBLE
input=${data_dir}/bufr/PraticaTemp.bufr
cat > $tempRules <<EOF
set unpack=1;
set radiosondeType=MISSING;
set radiosondeSerialNumber=MISSING;
set #1#pressure=MISSING;
set pack=1;
transient m1 = missing(radiosondeType);
transient m2 = missing(radiosondeSerialNumber);
transient m3 = missing(#1#pressure);
assert ( m1 == 1 );
assert ( m2 == 1 );
assert ( m3 == 1 );
write;
EOF
${tools_dir}/codes_bufr_filter -o $tempOut $tempRules $input
# ${tools_dir}/bufr_dump -p $tempOut
# Clean up
rm -f $tempRules $tempOut