mirror of https://github.com/ecmwf/eccodes.git
Testing: clean up
This commit is contained in:
parent
f89f5c0f5d
commit
0d95c9be2c
|
@ -34,7 +34,7 @@ cat syno_multi.bufr temp_101.bufr > $fBufrInput
|
|||
# Test: copy synop messages
|
||||
#----------------------------------------------------
|
||||
|
||||
rm -f $fBufrTmp | true
|
||||
rm -f $fBufrTmp
|
||||
|
||||
echo "Test: copy synop messages " >> $fLog
|
||||
${tools_dir}/bufr_copy -w dataCategory=0 $fBufrInput $fBufrTmp >> $fLog
|
||||
|
@ -48,7 +48,7 @@ done
|
|||
# Test: copy non-synop messages
|
||||
#----------------------------------------------------
|
||||
|
||||
rm -f $fBufrTmp | true
|
||||
rm -f $fBufrTmp
|
||||
|
||||
echo "Test: copy non-synop messages " >> $fLog
|
||||
${tools_dir}/bufr_copy -w dataCategory!=0 $fBufrInput $fBufrTmp >> $fLog
|
||||
|
@ -60,8 +60,8 @@ ${tools_dir}/bufr_copy -w dataCategory!=0 $fBufrInput $fBufrTmp >> $fLog
|
|||
# Test: use the square brackets to insert the value of a key
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
rm -f ${fBufrTmp} | true
|
||||
rm -f ${fBufrTmp}_*.bufr | true
|
||||
rm -f ${fBufrTmp}
|
||||
rm -f ${fBufrTmp}_*.bufr
|
||||
|
||||
echo "Test: use the square brackets to insert the value of a key " >> $fLog
|
||||
${tools_dir}/bufr_copy $fBufrInput ${fBufrTmp}_[dataCategory].bufr >> $fLog
|
||||
|
@ -69,11 +69,9 @@ ${tools_dir}/bufr_copy $fBufrInput ${fBufrTmp}_[dataCategory].bufr >> $fLog
|
|||
[ -s ${fBufrTmp}_0.bufr ]
|
||||
[ -s ${fBufrTmp}_2.bufr ]
|
||||
|
||||
rm -f ${fBufrTmp}_*.bufr | true
|
||||
rm -f ${fBufrTmp}_*.bufr
|
||||
|
||||
#Clean up
|
||||
rm -f $fLog
|
||||
rm -f $fBufrTmp | true
|
||||
rm -f $fBufrInput | true
|
||||
|
||||
|
||||
rm -f $fBufrTmp
|
||||
rm -f $fBufrInput
|
||||
|
|
|
@ -55,7 +55,7 @@ unset ECCODES_LOG_STREAM
|
|||
#echo "Test: malformed bufr file " >> $fLog
|
||||
|
||||
|
||||
#rm -f $fJsonTmp | true
|
||||
#rm -f $fJsonTmp
|
||||
|
||||
#fBufr=${data_dir}/bufr/"bad.bufr"
|
||||
# See ECC-276
|
||||
|
@ -72,7 +72,7 @@ unset ECCODES_LOG_STREAM
|
|||
# FIND another way to test this operator
|
||||
#echo "Test: operator 207003 " >> $fLog
|
||||
|
||||
#rm -f $fJsonTmp | true
|
||||
#rm -f $fJsonTmp
|
||||
|
||||
#fBufr=${data_dir}/bufr/"207003.bufr"
|
||||
#fJsonRef=${data_dir}/bufr/"207003.bufr.json.ref"
|
||||
|
@ -83,6 +83,6 @@ unset ECCODES_LOG_STREAM
|
|||
#
|
||||
#Clean up
|
||||
#rm -f $fLog
|
||||
#rm -f $fJsonTmp | true
|
||||
#rm -f $fJsonTmp
|
||||
|
||||
rm -f $fLog
|
||||
|
|
|
@ -76,7 +76,7 @@ if (statid == 1003) {
|
|||
}
|
||||
EOF
|
||||
|
||||
rm -f $fBufrTmp | true
|
||||
rm -f $fBufrTmp
|
||||
|
||||
f="syno_multi.bufr"
|
||||
echo "Test: filter SYNOP message according to conditions" >> $fLog
|
||||
|
@ -616,7 +616,7 @@ set year=2001;
|
|||
set airTemperatureAt2M=234.5;
|
||||
EOF
|
||||
|
||||
rm -f $fBufrTmp | true
|
||||
rm -f $fBufrTmp
|
||||
|
||||
f="syno_1.bufr"
|
||||
echo "Test: setting keys" >> $fLog
|
||||
|
@ -634,7 +634,7 @@ EOF
|
|||
#Clean up
|
||||
rm -f ${dSplit}/*
|
||||
rm -f $fLog $fRules
|
||||
rm -f $fBufrTmp | true
|
||||
rm -f $fBufrTmp
|
||||
|
||||
#-----------------------------------------------------------
|
||||
# Test: set unexpandedDescriptors no create new data
|
||||
|
|
|
@ -30,7 +30,7 @@ fBufrTmp=${label}".bufr.tmp"
|
|||
# Test: setting header for single message file
|
||||
#----------------------------------------------------
|
||||
|
||||
rm -f $fBufrTmp | true
|
||||
rm -f $fBufrTmp
|
||||
|
||||
f="syno_1.bufr"
|
||||
echo "Test: setting header for single message file" >> $fLog
|
||||
|
@ -44,7 +44,7 @@ centre=`${tools_dir}/bufr_get -p bufrHeaderCentre $fBufrTmp`
|
|||
# Test: setting header for multi-message file
|
||||
#----------------------------------------------------
|
||||
|
||||
rm -f $fBufrTmp | true
|
||||
rm -f $fBufrTmp
|
||||
|
||||
f="syno_multi.bufr"
|
||||
echo "Test: setting header for multi-message file" >> $fLog
|
||||
|
@ -63,7 +63,7 @@ done
|
|||
|
||||
#TODO: when ECC-37 is fixed we need to enable it.
|
||||
|
||||
rm -f $fBufrTmp | true
|
||||
rm -f $fBufrTmp
|
||||
|
||||
f="syno_1.bufr"
|
||||
echo "Test: setting data values" >> $fLog
|
||||
|
@ -80,7 +80,7 @@ echo "file: $f" >> $fLog
|
|||
|
||||
#TODO: when ECC-37 is fixed we need to enable it.
|
||||
|
||||
rm -f $fBufrTmp | true
|
||||
rm -f $fBufrTmp
|
||||
|
||||
f="syno_multi.bufr"
|
||||
echo "Test: setting data values for multi-message file" >> $fLog
|
||||
|
@ -163,4 +163,4 @@ set -e
|
|||
|
||||
#Clean up
|
||||
rm -f $fLog
|
||||
rm -f $fBufrTmp | true
|
||||
rm -f $fBufrTmp
|
||||
|
|
|
@ -23,7 +23,7 @@ packing2="
|
|||
grid_simple_matrix"
|
||||
|
||||
temp=temp.grib_
|
||||
rm -f $temp || true
|
||||
rm -f $temp
|
||||
|
||||
# --- test changing the packing
|
||||
# arg 1 : input grib file
|
||||
|
@ -51,7 +51,7 @@ function test_packing() {
|
|||
shift
|
||||
done
|
||||
|
||||
rm -f $temp || true
|
||||
rm -f $temp
|
||||
}
|
||||
|
||||
test_packing $grib1 $packing1
|
||||
|
|
|
@ -32,7 +32,7 @@ for f in $files
|
|||
do
|
||||
file=${data_dir}/$f
|
||||
output=${file}.grib1_
|
||||
rm -f ${output} || true
|
||||
rm -f ${output}
|
||||
${tools_dir}/grib_set -s editionNumber=1 ${file}.grib2 ${output} 2> $REDIRECT > $REDIRECT
|
||||
|
||||
grib1Statistics=`${tools_dir}/grib_get -fp numberOfValues,numberOfPoints,max,min,average,numberOfMissing ${output}`
|
||||
|
@ -50,7 +50,7 @@ done
|
|||
# First create a grib2 file with NV () > 255 which should not be convertible to grib1
|
||||
filter=temp.setpv.filt
|
||||
COUNT=264
|
||||
rm -f $filter || true
|
||||
rm -f $filter
|
||||
echo "set NV=$COUNT;" >> $filter
|
||||
echo "set pv={" >> $filter
|
||||
i=1
|
||||
|
@ -73,4 +73,4 @@ if [ $? -eq 0 ]; then
|
|||
exit 1
|
||||
fi
|
||||
set -e
|
||||
rm -f $filter temp.pv.grib2 || true
|
||||
rm -f $filter temp.pv.grib2
|
||||
|
|
|
@ -83,6 +83,6 @@ do
|
|||
false
|
||||
exit
|
||||
fi
|
||||
rm -f $tmp | true
|
||||
rm -f $tmp
|
||||
|
||||
done
|
||||
|
|
|
@ -65,7 +65,7 @@ ${tools_dir}/grib_ls -plevels tmp_rlls.grib1 | grep MISSING>/dev/null
|
|||
|
||||
${tools_dir}/grib_set -s typeOfLevel=depthBelowLandLayer,bottomLevel=missing regular_latlon_surface.grib1 tmp_rlls.grib1
|
||||
${tools_dir}/grib_ls -plevels tmp_rlls.grib1 | grep MISSING>/dev/null
|
||||
rm -f tmp_rlls.grib1 | true
|
||||
rm -f tmp_rlls.grib1
|
||||
|
||||
# GRIB-305. GRIB edition 1 file with one large message
|
||||
if [ -f "sst_globus0083.grib" ]; then
|
||||
|
|
|
@ -15,11 +15,11 @@ temp=loc.padding.grib1
|
|||
|
||||
${tools_dir}/grib_set -s setLocalDefinition=1 ${data_dir}/regular_latlon_surface.grib1 $temp
|
||||
cat > $$_f <<EOF
|
||||
if (GRIBEXSection1Problem ) {
|
||||
print "localDefinitionNumber=[localDefinitionNumber] size(GRIBEX-section1)=[GRIBEXSection1Problem] section1Length=[section1Length]";
|
||||
write "problem.grib";
|
||||
assert(0);
|
||||
}
|
||||
if (GRIBEXSection1Problem ) {
|
||||
print "localDefinitionNumber=[localDefinitionNumber] size(GRIBEX-section1)=[GRIBEXSection1Problem] section1Length=[section1Length]";
|
||||
write "problem.grib";
|
||||
assert(0);
|
||||
}
|
||||
EOF
|
||||
|
||||
# Note: we cannot use -printf "%f\n" as on some unix platforms -printf is not an option
|
||||
|
@ -34,14 +34,16 @@ localDefinitions=`find ${def_dir}/grib1/ -name 'local.98.*def' | sed -e 's:.*/::
|
|||
|
||||
for l1 in $localDefinitions
|
||||
do
|
||||
${tools_dir}/grib_set -s localDefinitionNumber=$l1 $temp locx.grib1
|
||||
${tools_dir}/grib_filter $$_f locx.grib1
|
||||
for l2 in $localDefinitions
|
||||
do
|
||||
#echo "$l1 -> $l2"
|
||||
${tools_dir}/grib_set -s localDefinitionNumber=$l2 locx.grib1 locy.grib1
|
||||
${tools_dir}/grib_filter $$_f locy.grib1
|
||||
done
|
||||
${tools_dir}/grib_set -s localDefinitionNumber=$l1 $temp locx.grib1
|
||||
${tools_dir}/grib_filter $$_f locx.grib1
|
||||
for l2 in $localDefinitions
|
||||
do
|
||||
if [ $l1 -ne $l2 ]; then
|
||||
#echo "$l1 -> $l2"
|
||||
${tools_dir}/grib_set -s localDefinitionNumber=$l2 locx.grib1 locy.grib1
|
||||
${tools_dir}/grib_filter $$_f locy.grib1
|
||||
fi
|
||||
done
|
||||
done
|
||||
|
||||
rm -f $$_f locx.grib1 locy.grib1 $temp
|
||||
|
|
|
@ -15,7 +15,7 @@ REDIRECT=/dev/null
|
|||
infile=${data_dir}/regular_gaussian_surface.grib1
|
||||
outfile=${data_dir}/set.grib1
|
||||
|
||||
rm -f $outfile || true
|
||||
rm -f $outfile
|
||||
|
||||
${tools_dir}/grib_set -v -p levtype,centre,levtype:l,centre:l -s levtype=pl,centre=80 $infile $outfile >$REDIRECT
|
||||
|
||||
|
@ -31,12 +31,12 @@ levtype=`${tools_dir}/grib_get -p levtype:l $outfile`
|
|||
centre=`${tools_dir}/grib_get -p centre:l $outfile`
|
||||
[ $centre -eq 80 ]
|
||||
|
||||
rm -f $outfile || true
|
||||
rm -f $outfile
|
||||
|
||||
infile=${data_dir}/regular_gaussian_surface.grib2
|
||||
outfile=${data_dir}/set.grib2
|
||||
|
||||
rm -f $outfile || true
|
||||
rm -f $outfile
|
||||
|
||||
${tools_dir}/grib_set -v -p levtype:l,centre:s -s levtype:l=100,centre:s=cnmc $infile $outfile >$REDIRECT
|
||||
|
||||
|
@ -73,4 +73,4 @@ ${tools_dir}/grib_set -s centre=289 $ECCODES_SAMPLES_PATH/GRIB2.tmpl $outfile
|
|||
${tools_dir}/grib_dump -O $outfile | grep -q 'centre = 289.*Zambia'
|
||||
|
||||
|
||||
rm -f $outfile || true
|
||||
rm -f $outfile
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
set +e
|
||||
tmp_out=tmp_msg.out
|
||||
skip_test=0
|
||||
rm -f $tmp_out | true
|
||||
rm -f $tmp_out
|
||||
# Invoke the grib_to_netcdf command with no options. If NetCDF was enabled
|
||||
# we get a usage message otherwise we get a specific message. Note: In both cases
|
||||
# the command fails.
|
||||
|
@ -27,7 +27,7 @@ if [ $? -eq 0 ]; then
|
|||
fi
|
||||
# Restore the set -e so any error causes us to exit
|
||||
set -e
|
||||
rm -f $tmp_out | true
|
||||
rm -f $tmp_out
|
||||
if [ $skip_test -eq 1 ]; then
|
||||
echo "NetCDF was not enabled. Skipping this test."
|
||||
exit 0
|
||||
|
@ -51,7 +51,7 @@ for dt in $ncf_types
|
|||
do
|
||||
for f in $grib_files
|
||||
do
|
||||
rm -f $tmp_netcdf | true
|
||||
rm -f $tmp_netcdf
|
||||
if [ -f "${data_dir}/$f" ]; then
|
||||
${tools_dir}/grib_to_netcdf -D $dt -o $tmp_netcdf ${data_dir}/$f >/dev/null
|
||||
${tools_dir}/grib_to_netcdf -T -o $tmp_netcdf ${data_dir}/$f >/dev/null
|
||||
|
@ -67,5 +67,4 @@ ${tools_dir}/grib_to_netcdf -k 2 -o $tmp_netcdf $input >/dev/null
|
|||
#${tools_dir}/grib_to_netcdf -k 3 -o $tmp_netcdf $input >/dev/null
|
||||
#${tools_dir}/grib_to_netcdf -k 4 -o $tmp_netcdf $input >/dev/null
|
||||
|
||||
rm -f $tmp_netcdf | true
|
||||
|
||||
rm -f $tmp_netcdf
|
||||
|
|
|
@ -30,6 +30,6 @@ do
|
|||
${tools_dir}/grib_get -M -p count,shortName,level $infile > $out2
|
||||
diff $out1 $out2
|
||||
|
||||
rm -f $out1 $out2 | true
|
||||
rm -f $out1 $out2
|
||||
|
||||
done
|
||||
|
|
|
@ -25,7 +25,7 @@ do
|
|||
ref_num=$file.num.ref
|
||||
diff_num=$file.num.diff
|
||||
|
||||
rm -f $res_num | true
|
||||
rm -f $res_num
|
||||
|
||||
set +e
|
||||
${tools_dir}/codes_bufr_filter bufrdc_num_ref.filter $file 2> $REDIRECT > $res_num
|
||||
|
|
|
@ -23,23 +23,19 @@ temp2="temp.grib2_"
|
|||
# --- Do I want to exclude any file pattern from the comparison ?
|
||||
exclusion_pattern="tcw|ssr|str|skt|cap|ci|ttr|st|sm|sd|slhf|sshf"
|
||||
|
||||
for file in ${dir}/tigge_*.grib
|
||||
do
|
||||
for file in ${dir}/tigge_*.grib; do
|
||||
exclude=`echo $file | awk " /$exclusion_pattern/ {print \"found\";} "`
|
||||
if [ -z "$exclude" ]; then
|
||||
rm -f ${temp1} ${temp2}
|
||||
|
||||
exclude=`echo $file | awk " /$exclusion_pattern/ {print \"found\";} "`
|
||||
# 2 to 1 conversion check
|
||||
${tools_dir}/grib_set -s editionNumber=1 ${file} ${temp1} 2> $REDIRECT > $REDIRECT
|
||||
${tools_dir}/grib_compare -P -c data:n,geography:n ${temp1} ${file} 2> $REDIRECT > $REDIRECT
|
||||
|
||||
if [ -z "$exclude" ]; then
|
||||
|
||||
rm -f ${temp1} ${temp2} || true
|
||||
|
||||
# 2 to 1 conversion check
|
||||
${tools_dir}/grib_set -s editionNumber=1 ${file} ${temp1} 2> $REDIRECT > $REDIRECT
|
||||
${tools_dir}/grib_compare -P -c data:n,geography:n ${temp1} ${file} 2> $REDIRECT > $REDIRECT
|
||||
|
||||
# 1 to 2 conversion check
|
||||
${tools_dir}/grib_set -s editionNumber=2 ${temp1} ${temp2} 2> $REDIRECT > $REDIRECT
|
||||
${tools_dir}/grib_compare -P -c shortName,data:n,geography:n ${temp2} ${file} 2> $REDIRECT > $REDIRECT
|
||||
fi
|
||||
# 1 to 2 conversion check
|
||||
${tools_dir}/grib_set -s editionNumber=2 ${temp1} ${temp2} 2> $REDIRECT > $REDIRECT
|
||||
${tools_dir}/grib_compare -P -c shortName,data:n,geography:n ${temp2} ${file} 2> $REDIRECT > $REDIRECT
|
||||
fi
|
||||
done
|
||||
|
||||
rm -f ${temp1} ${temp2} || true
|
||||
rm -f ${temp1} ${temp2}
|
||||
|
|
Loading…
Reference in New Issue