mirror of https://github.com/ecmwf/eccodes.git
Add message telling user the name of the newly created BUFR file
This commit is contained in:
parent
7ecaccd39c
commit
152f855dc0
|
@ -810,7 +810,7 @@ static void footer(grib_dumper* d, grib_handle* h)
|
|||
|
||||
/*fprintf(self->dumper.out," fout = fopen(\"outfile.bufr\", \"w\");");*/
|
||||
fprintf(self->dumper.out," if (!fout) {\n");
|
||||
fprintf(self->dumper.out," fprintf(stderr, \"Failed to open output file.\\n\");\n");
|
||||
fprintf(self->dumper.out," fprintf(stderr, \"Failed to open (create) output file.\\n\");\n");
|
||||
fprintf(self->dumper.out," return 1;\n");
|
||||
fprintf(self->dumper.out," }\n");
|
||||
fprintf(self->dumper.out," CODES_CHECK(codes_get_message(h,&buffer,&size),0);\n");
|
||||
|
@ -824,6 +824,7 @@ static void footer(grib_dumper* d, grib_handle* h)
|
|||
fprintf(self->dumper.out," }\n");
|
||||
fprintf(self->dumper.out," \n");
|
||||
fprintf(self->dumper.out," codes_handle_delete(h);\n");
|
||||
fprintf(self->dumper.out," printf(\"Created output BUFR file 'outfile.bufr'.\\n\");\n");
|
||||
fprintf(self->dumper.out," free(ivalues); ivalues = NULL;\n");
|
||||
fprintf(self->dumper.out," free(rvalues); rvalues = NULL;\n");
|
||||
fprintf(self->dumper.out," free(svalues); svalues = NULL;\n\n");
|
||||
|
|
|
@ -816,6 +816,7 @@ static void footer(grib_dumper* d, grib_handle* h)
|
|||
fprintf(self->dumper.out," call codes_write(ibufr,outfile)\n");
|
||||
fprintf(self->dumper.out," call codes_close_file(outfile)\n");
|
||||
fprintf(self->dumper.out," call codes_release(ibufr)\n");
|
||||
fprintf(self->dumper.out," print *, \"Created output BUFR file 'outfile.bufr'\"\n");
|
||||
fprintf(self->dumper.out," if(allocated(ivalues)) deallocate(ivalues)\n");
|
||||
fprintf(self->dumper.out," if(allocated(rvalues)) deallocate(rvalues)\n");
|
||||
fprintf(self->dumper.out," if(allocated(svalues)) deallocate(svalues)\n");
|
||||
|
|
|
@ -784,6 +784,7 @@ static void footer(grib_dumper* d, grib_handle* h)
|
|||
fprintf(self->dumper.out," outfile = open('outfile.bufr', 'a')\n");
|
||||
|
||||
fprintf(self->dumper.out," codes_write(ibufr, outfile)\n");
|
||||
fprintf(self->dumper.out," print \"Created output BUFR file 'outfile.bufr'.\"\n");
|
||||
/*fprintf(self->dumper.out," codes_close_file(outfile)\n");*/
|
||||
fprintf(self->dumper.out," codes_release(ibufr)\n");
|
||||
}
|
||||
|
|
|
@ -0,0 +1,62 @@
|
|||
#!/bin/sh
|
||||
# Copyright 2005-2016 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
|
||||
|
||||
# ---------------------------------------------------------
|
||||
# This is the test for the JIRA issue ECC-393
|
||||
# It tests bufr_compare with a blacklist with rank
|
||||
# ---------------------------------------------------------
|
||||
cd ${data_dir}/bufr
|
||||
label="ecc_393_test"
|
||||
|
||||
tempRules=temp.${label}.filter
|
||||
tempOut=temp.${label}.bufr
|
||||
tempText=temp.${label}.txt
|
||||
tempRef=temp.${label}.ref
|
||||
BufrFile=aaen_55.bufr
|
||||
|
||||
cat > $tempRules <<EOF
|
||||
set unpack=1;
|
||||
set #3#channelQualityFlagsForAtovs=1;
|
||||
set #5#channelQualityFlagsForAtovs=2;
|
||||
set pack=1;
|
||||
write;
|
||||
EOF
|
||||
|
||||
${tools_dir}bufr_filter -o $tempOut $tempRules $BufrFile
|
||||
|
||||
# There are two differences. So this should fail
|
||||
set +e
|
||||
${tools_dir}bufr_compare $tempOut $BufrFile
|
||||
status=$?
|
||||
set -e
|
||||
[ $status -eq 1 ]
|
||||
|
||||
# Blacklist all the channelQualityFlagsForAtovs keys
|
||||
${tools_dir}bufr_compare -b channelQualityFlagsForAtovs $tempOut $BufrFile
|
||||
|
||||
# Blacklist both the channelQualityFlagsForAtovs keys individually
|
||||
${tools_dir}bufr_compare -b '#3#channelQualityFlagsForAtovs,#5#channelQualityFlagsForAtovs' $tempOut $BufrFile
|
||||
|
||||
# Blacklist only one of the channelQualityFlagsForAtovs keys. Will fail
|
||||
set +e
|
||||
${tools_dir}bufr_compare -b '#5#channelQualityFlagsForAtovs' $tempOut $BufrFile >$tempText
|
||||
status=$?
|
||||
set -e
|
||||
[ $status -eq 1 ]
|
||||
|
||||
cat > $tempRef <<EOF
|
||||
== 1 == DIFFERENCE == long [#3#channelQualityFlagsForAtovs]: [1] != [0]
|
||||
EOF
|
||||
diff $tempRef $tempText
|
||||
|
||||
# Clean
|
||||
rm -rf $tempOut $tempRules $tempRef $tempText
|
Loading…
Reference in New Issue