mirror of https://github.com/ecmwf/eccodes.git
GRIB-527: prepare for parallel test runs
This commit is contained in:
parent
409c7ff468
commit
5038538820
|
@ -65,7 +65,6 @@ spectral_complex.grib1
|
|||
spherical_model_level.grib1
|
||||
spherical_pressure_level.grib1
|
||||
test.grib1
|
||||
with_bitmap.grib1
|
||||
gep10.t12z.pgrb2af78.grib2
|
||||
gfs.c255.grib2
|
||||
jpeg.grib2
|
||||
|
@ -117,4 +116,3 @@ done
|
|||
# Extra test for grid_complex_spatial_differencing
|
||||
res=`${tools_dir}grib_get -p decimalScaleFactor,bitsPerValue ${data_dir}/gfs.c255.grib2`
|
||||
[ "$res" = "1 20" ]
|
||||
|
||||
|
|
|
@ -13,7 +13,6 @@
|
|||
|
||||
editions="1 2"
|
||||
gridTypes="regular_ll rotated_ll"
|
||||
outfile=out.grib
|
||||
Ni_list="5 8"
|
||||
Nj_list="7 4"
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
REDIRECT=/dev/null
|
||||
|
||||
infile="${data_dir}/regular_latlon_surface.grib1"
|
||||
outfile=${infile}.1
|
||||
outfile=${infile}.compare.$$
|
||||
|
||||
rm -f $outfile || true
|
||||
|
||||
|
|
|
@ -11,24 +11,21 @@
|
|||
. ./include.sh
|
||||
|
||||
data="${data_dir}/*grib1 ${data_dir}/*grib2"
|
||||
tmp="tmp.out"
|
||||
tmp="tmp.concept.out"
|
||||
|
||||
for d in $data
|
||||
do
|
||||
|
||||
set -e
|
||||
${tools_dir}grib_ls -p gridType,packingType -w dataRepresentationType!=192 $d > $tmp
|
||||
|
||||
set +e
|
||||
grep unknown $tmp
|
||||
|
||||
if [ $? -eq 0 ]
|
||||
then
|
||||
false
|
||||
exit
|
||||
fi
|
||||
|
||||
rm -f $tmp | true
|
||||
set -e
|
||||
${tools_dir}grib_ls -p gridType,packingType -w dataRepresentationType!=192 $d > $tmp
|
||||
|
||||
set +e
|
||||
grep unknown $tmp
|
||||
|
||||
if [ $? -eq 0 ]
|
||||
then
|
||||
false
|
||||
exit
|
||||
fi
|
||||
rm -f $tmp | true
|
||||
|
||||
done
|
||||
|
||||
|
|
|
@ -15,19 +15,16 @@ REDIRECT=/dev/null
|
|||
files="regular_latlon_surface.grib2 \
|
||||
regular_latlon_surface.grib1"
|
||||
|
||||
|
||||
|
||||
|
||||
for file in `echo $files`
|
||||
do
|
||||
infile=${data_dir}/$file
|
||||
outfile1=${infile}_decimalPrecision_1
|
||||
outfile2=${infile}_decimalPrecision_2
|
||||
${tools_dir}grib_set -r -s decimalScaleFactor=1,bitsPerValue=0 $infile $outfile1
|
||||
${tools_dir}grib_compare -b totalLength,section4Length,section7Length,dataLength,decimalScaleFactor,binaryScaleFactor,referenceValue,bitsPerValue $infile $outfile1 > $REDIRECT
|
||||
${tools_dir}grib_set -s changeDecimalPrecision=1 $infile $outfile2
|
||||
${tools_dir}grib_compare -b totalLength,section4Length,section7Length,dataLength,decimalScaleFactor,binaryScaleFactor,referenceValue,bitsPerValue $infile $outfile2 > $REDIRECT
|
||||
${tools_dir}grib_compare $outfile1 $outfile2
|
||||
rm -f $outfile1 $outfile2 || true
|
||||
infile=${data_dir}/$file
|
||||
outfile1=${infile}_decimalPrecision_1
|
||||
outfile2=${infile}_decimalPrecision_2
|
||||
${tools_dir}grib_set -r -s decimalScaleFactor=1,bitsPerValue=0 $infile $outfile1
|
||||
${tools_dir}grib_compare -b totalLength,section4Length,section7Length,dataLength,decimalScaleFactor,binaryScaleFactor,referenceValue,bitsPerValue $infile $outfile1 > $REDIRECT
|
||||
${tools_dir}grib_set -s changeDecimalPrecision=1 $infile $outfile2
|
||||
${tools_dir}grib_compare -b totalLength,section4Length,section7Length,dataLength,decimalScaleFactor,binaryScaleFactor,referenceValue,bitsPerValue $infile $outfile2 > $REDIRECT
|
||||
${tools_dir}grib_compare $outfile1 $outfile2
|
||||
rm -f $outfile1 $outfile2 || true
|
||||
done
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ REDIRECT=/dev/null
|
|||
|
||||
if [ -f ${data_dir}/geavg.t12z.pgrbaf108 ]
|
||||
then
|
||||
tmpdata=grib_api.grib
|
||||
tmpdata=grib_api.$$.grib
|
||||
rm -f $tmpdata || true
|
||||
${tools_dir}grib_filter ${data_dir}/filter_rules ${data_dir}/geavg.t12z.pgrbaf108 > $REDIRECT
|
||||
rm -f $tmpdata
|
||||
|
@ -68,8 +68,8 @@ set nlev=41.0;
|
|||
write;
|
||||
EOF
|
||||
|
||||
${tools_dir}/grib_filter -o temp.grib2 temp.filt $ECCODES_SAMPLES_PATH/sh_ml_grib1.tmpl
|
||||
result=`${tools_dir}/grib_get -p typeOfFirstFixedSurface,NV,nlev temp.grib2`
|
||||
${tools_dir}/grib_filter -o temp_filt.grib2 temp.filt $ECCODES_SAMPLES_PATH/sh_ml_grib1.tmpl
|
||||
result=`${tools_dir}/grib_get -p typeOfFirstFixedSurface,NV,nlev temp_filt.grib2`
|
||||
[ "$result" = "150 6 41" ]
|
||||
|
||||
# GRIB-394: grib_filter arithmetic operators not correct for floating point values
|
||||
|
@ -117,5 +117,5 @@ EOF
|
|||
${tools_dir}/grib_filter temp.filt $ECCODES_SAMPLES_PATH/GRIB1.tmpl
|
||||
|
||||
|
||||
rm -f temp.grib2 temp.filt
|
||||
rm -f temp_filt.grib2 temp.filt
|
||||
rm -f ${data_dir}/formatint.rules ${data_dir}/binop.rules
|
||||
|
|
|
@ -8,7 +8,6 @@
|
|||
# virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction.
|
||||
#
|
||||
|
||||
|
||||
. ./include.sh
|
||||
|
||||
REDIRECT=/dev/null
|
||||
|
@ -21,5 +20,3 @@ if [ $? -eq 0 ]
|
|||
then
|
||||
exit 1;
|
||||
fi
|
||||
|
||||
|
||||
|
|
|
@ -32,19 +32,21 @@ files="constant_field\
|
|||
for f in `echo $files`
|
||||
do
|
||||
file=${data_dir}/$f
|
||||
rm -f ${file}.grib2 || true
|
||||
${tools_dir}grib_set -s editionNumber=2 ${file}.grib1 ${file}.grib2 2> $REDIRECT > $REDIRECT
|
||||
output=${file}.grib2_
|
||||
rm -f ${output}
|
||||
${tools_dir}grib_set -s editionNumber=2 ${file}.grib1 ${output} 2> $REDIRECT > $REDIRECT
|
||||
|
||||
grib1Statistics=`${tools_dir}grib_get -fp numberOfValues,numberOfPoints,max,min,average,numberOfMissing ${file}.grib1`
|
||||
grib2Statistics=`${tools_dir}grib_get -fp numberOfValues,numberOfPoints,max,min,average,numberOfMissing ${file}.grib2`
|
||||
grib2Statistics=`${tools_dir}grib_get -fp numberOfValues,numberOfPoints,max,min,average,numberOfMissing ${output}`
|
||||
|
||||
if [ "$grib1Statistics" != "$grib2Statistics" ]
|
||||
then
|
||||
if [ "$grib1Statistics" != "$grib2Statistics" ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
#${tools_dir}grib_compare -A1.0e-8 -c values ${file}.grib1 ${file}.grib2 2> /dev/null > /dev/null
|
||||
${tools_dir}grib_compare -P -c values ${file}.grib1 ${file}.grib2 2> $REDIRECT > $REDIRECT
|
||||
#${tools_dir}grib_compare -A1.0e-8 -c values ${file}.grib1 ${output} 2> /dev/null > /dev/null
|
||||
${tools_dir}grib_compare -P -c values ${file}.grib1 ${output} 2> $REDIRECT > $REDIRECT
|
||||
|
||||
rm -f ${output}
|
||||
|
||||
done
|
||||
|
||||
|
|
|
@ -7,7 +7,6 @@
|
|||
# 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
|
||||
|
||||
REDIRECT=/dev/null
|
||||
|
@ -29,22 +28,22 @@ files="constant_field\
|
|||
spherical_pressure_level \
|
||||
spherical_model_level "
|
||||
|
||||
for f in `echo $files`
|
||||
for f in $files
|
||||
do
|
||||
file=${data_dir}/$f
|
||||
rm -f ${file}.grib1_ || true
|
||||
${tools_dir}grib_set -s editionNumber=1 ${file}.grib2 ${file}.grib1_ 2> $REDIRECT > $REDIRECT
|
||||
output=${file}.grib1_
|
||||
rm -f ${output} || true
|
||||
${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 ${file}.grib1_`
|
||||
grib1Statistics=`${tools_dir}grib_get -fp numberOfValues,numberOfPoints,max,min,average,numberOfMissing ${output}`
|
||||
grib2Statistics=`${tools_dir}grib_get -fp numberOfValues,numberOfPoints,max,min,average,numberOfMissing ${file}.grib2`
|
||||
|
||||
if [ "$grib1Statistics" != "$grib2Statistics" ]
|
||||
then
|
||||
if [ "$grib1Statistics" != "$grib2Statistics" ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
#${tools_dir}grib_compare -A1.0e-8 -c values ${file}.grib1_ ${file}.grib2 2> /dev/null > /dev/null
|
||||
rm -f ${file}.grib1_ || true
|
||||
#${tools_dir}grib_compare -A1.0e-8 -c values ${output} ${file}.grib2 2> /dev/null > /dev/null
|
||||
rm -f ${output}
|
||||
done
|
||||
|
||||
# GRIB-262 Conversion works without error for L137 data
|
||||
|
|
|
@ -13,9 +13,8 @@
|
|||
|
||||
REDIRECT=/dev/null
|
||||
|
||||
tmpdata=grib_api.grib
|
||||
|
||||
rm -f $tmpdata || true
|
||||
tmpdata=grib_api.gridType.grib
|
||||
rm -f $tmpdata
|
||||
|
||||
${tools_dir}grib_set -s gridType=regular_gg ${data_dir}/reduced_latlon_surface.grib1 ${tmpdata} > $REDIRECT
|
||||
|
||||
|
@ -40,4 +39,3 @@ then
|
|||
fi
|
||||
|
||||
rm -f $tmpdata || true
|
||||
|
||||
|
|
|
@ -11,14 +11,13 @@
|
|||
. ./include.sh
|
||||
#set -x
|
||||
|
||||
outfile=out.grib
|
||||
sample_g1=$ECCODES_SAMPLES_PATH/GRIB1.tmpl
|
||||
sample_g2=$ECCODES_SAMPLES_PATH/GRIB2.tmpl
|
||||
temp=temp.grib
|
||||
temp=temp.level.grib
|
||||
|
||||
file=${data_dir}/regular_gaussian_pressure_level.grib1
|
||||
|
||||
cat >good<<EOF
|
||||
cat >temp.level.good<<EOF
|
||||
grib1: level=850 isobaricInhPa indicatorOfTypeOfLevel=100
|
||||
grib2: level=850 isobaricInhPa pl 85000
|
||||
grib1: level=850 isobaricInhPa indicatorOfTypeOfLevel=100
|
||||
|
@ -58,7 +57,7 @@ EOF
|
|||
|
||||
|
||||
${tools_dir}grib_filter level.filter $file > test.dump
|
||||
diff good test.dump
|
||||
diff temp.level.good test.dump
|
||||
|
||||
# GRIB-492
|
||||
${tools_dir}grib_set -s indicatorOfTypeOfLevel=110 $sample_g1 $temp
|
||||
|
@ -75,4 +74,4 @@ input=${data_dir}/tigge_pf_ecmwf.grib2
|
|||
res=`${tools_dir}grib_get -wcount=7 -F%.20f -p level:d $input`
|
||||
[ "$res" = "2.00000000000000000000" ]
|
||||
|
||||
rm -f level.filter good test.dump $temp
|
||||
rm -f level.filter temp.level.good test.dump $temp
|
||||
|
|
|
@ -18,7 +18,7 @@ set satelliteNumber={4,4,4,5};
|
|||
set instrumentType={591,591,591,592};
|
||||
set scaleFactorOfCentralWaveNumber={3,3,3,4};
|
||||
set scaledValueOfCentralWaveNumber={26870,9272,8377,22334};
|
||||
write "test.grib";
|
||||
write "test.list.grib";
|
||||
EOF
|
||||
|
||||
file="${data_dir}/reduced_gaussian_model_level.grib2"
|
||||
|
@ -35,7 +35,7 @@ print("x.out") "scaleFactorOfCentralWaveNumber={[scaleFactorOfCentralWaveNumber'
|
|||
print("x.out") "scaledValueOfCentralWaveNumber={[scaledValueOfCentralWaveNumber',']}";
|
||||
EOF
|
||||
|
||||
${tools_dir}grib_filter list.filter test.grib
|
||||
${tools_dir}grib_filter list.filter test.list.grib
|
||||
|
||||
cat >list.ref<<EOF
|
||||
productDefinitionTemplateNumber=31
|
||||
|
@ -49,5 +49,5 @@ EOF
|
|||
|
||||
diff x.out list.ref
|
||||
|
||||
rm -f x.out list.ref list.filter test.grib
|
||||
rm -f x.out list.ref list.filter test.list.grib
|
||||
|
||||
|
|
|
@ -8,19 +8,18 @@
|
|||
# virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction.
|
||||
#
|
||||
|
||||
|
||||
. ./include.sh
|
||||
#set -x
|
||||
|
||||
REDIRECT=/dev/null
|
||||
|
||||
cd ${data_dir}
|
||||
rm -f local.log | true
|
||||
rm -f local.log
|
||||
|
||||
${tools_dir}grib_set -s edition=2,setLocalDefinition=1 reduced_gaussian_model_level.grib1 loc.grib2
|
||||
${tools_dir}grib_set -s setLocalDefinition=1 reduced_gaussian_model_level.grib1 loc.grib1
|
||||
${tools_dir}grib_set -s setLocalDefinition=1 reduced_gaussian_model_level.grib1 loc.grib1
|
||||
|
||||
#conversion 1->2
|
||||
# conversion 1->2
|
||||
for localDefinitionNumber in 1 15 26 30
|
||||
do
|
||||
${tools_dir}grib_set -s localDefinitionNumber=$localDefinitionNumber,perturbationNumber=2,numberOfForecastsInEnsemble=50 loc.grib1 eps.grib1
|
||||
|
|
25
tests/ls.sh
25
tests/ls.sh
|
@ -10,19 +10,20 @@
|
|||
|
||||
. ./include.sh
|
||||
|
||||
rm -f log | true
|
||||
tempLog=temp.ls.log
|
||||
rm -f $tempLog
|
||||
workdir=`pwd`
|
||||
|
||||
cd ${data_dir}
|
||||
infile=regular_gaussian_model_level.grib1
|
||||
|
||||
${tools_dir}grib_ls -P count $infile > log
|
||||
${tools_dir}grib_ls -p count,step $infile >> log
|
||||
${tools_dir}grib_ls $infile >> log
|
||||
${tools_dir}grib_ls -l 0,0,1 $infile >> log
|
||||
${tools_dir}grib_get -l 0,0,1 $infile >> log
|
||||
${tools_dir}grib_get -p count,step $infile >> log
|
||||
${tools_dir}grib_get -P count $infile >> log
|
||||
${tools_dir}grib_ls -P count $infile > $tempLog
|
||||
${tools_dir}grib_ls -p count,step $infile >> $tempLog
|
||||
${tools_dir}grib_ls $infile >> $tempLog
|
||||
${tools_dir}grib_ls -l 0,0,1 $infile >> $tempLog
|
||||
${tools_dir}grib_get -l 0,0,1 $infile >> $tempLog
|
||||
${tools_dir}grib_get -p count,step $infile >> $tempLog
|
||||
${tools_dir}grib_get -P count $infile >> $tempLog
|
||||
|
||||
files=" reduced_gaussian_lsm.grib1
|
||||
reduced_gaussian_model_level.grib1
|
||||
|
@ -52,12 +53,12 @@ regular_latlon_surface.grib2
|
|||
for file in $files
|
||||
do
|
||||
[ -f "$file" ]
|
||||
echo $file >> log
|
||||
${tools_dir}grib_ls -l 40,28 $file | grep index | awk '{print $4;}' >> log
|
||||
echo $file >> $tempLog
|
||||
${tools_dir}grib_ls -l 40,28 $file | grep index | awk '{print $4;}' >> $tempLog
|
||||
done
|
||||
|
||||
diff log ls.log
|
||||
rm -f log
|
||||
diff $tempLog ls.log
|
||||
rm -f $tempLog
|
||||
|
||||
# Test for bug GRIB-56
|
||||
${tools_dir}grib_set -s typeOfLevel=depthBelowLandLayer,topLevel=missing regular_latlon_surface.grib1 tmp_rlls.grib1
|
||||
|
|
|
@ -8,7 +8,6 @@
|
|||
# virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction.
|
||||
#
|
||||
|
||||
|
||||
. ./include.sh
|
||||
|
||||
REDIRECT=/dev/null
|
||||
|
@ -37,4 +36,3 @@ ${tools_dir}grib_set -s centre=missing $infile $outfile 2> $REDIRECT > $REDIRECT
|
|||
[ $? -ne 0 ]
|
||||
|
||||
rm -f $outfile
|
||||
|
||||
|
|
|
@ -8,7 +8,6 @@
|
|||
# virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction.
|
||||
#
|
||||
|
||||
|
||||
. ./include.sh
|
||||
|
||||
if [ ! -f ${data_dir}/multi.grib2 ]
|
||||
|
@ -18,8 +17,7 @@ then
|
|||
fi
|
||||
|
||||
tmpdata=grib_api.$$.grib
|
||||
|
||||
rm -f $tmpdata || true
|
||||
rm -f $tmpdata
|
||||
|
||||
parameterNumber=`${tools_dir}grib_get -p parameterNumber -w parameterCategory=2,parameterNumber=3 ${data_dir}/multi.grib2`
|
||||
if [ -z "$parameterNumber" ]
|
||||
|
@ -45,4 +43,3 @@ then
|
|||
fi
|
||||
|
||||
rm -f $tmpdata.1 $tmpdata.rules || true
|
||||
|
||||
|
|
|
@ -11,8 +11,9 @@
|
|||
. ./include.sh
|
||||
|
||||
REDIRECT=/dev/null
|
||||
temp=loc.padding.grib1
|
||||
|
||||
${tools_dir}grib_set -s setLocalDefinition=1 ${data_dir}/regular_latlon_surface.grib1 loc.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]";
|
||||
|
@ -33,7 +34,7 @@ localDefinitions=`find ${def_dir}/grib1/ -name 'local.98.*def' | sed -e 's:.*/::
|
|||
|
||||
for l1 in $localDefinitions
|
||||
do
|
||||
${tools_dir}grib_set -s localDefinitionNumber=$l1 loc.grib1 locx.grib1
|
||||
${tools_dir}grib_set -s localDefinitionNumber=$l1 $temp locx.grib1
|
||||
${tools_dir}grib_filter $$_f locx.grib1
|
||||
for l2 in $localDefinitions
|
||||
do
|
||||
|
@ -43,4 +44,4 @@ do
|
|||
done
|
||||
done
|
||||
|
||||
rm -f $$_f locx.grib1 locy.grib1 loc.grib1
|
||||
rm -f $$_f locx.grib1 locy.grib1 $temp
|
||||
|
|
|
@ -10,7 +10,6 @@
|
|||
|
||||
. ./include.sh
|
||||
|
||||
rm -f log | true
|
||||
workdir=`pwd`
|
||||
REDIRECT=/dev/null
|
||||
|
||||
|
|
|
@ -31,6 +31,8 @@ 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
|
||||
|
||||
infile=${data_dir}/regular_gaussian_surface.grib2
|
||||
outfile=${data_dir}/set.grib2
|
||||
|
||||
|
@ -56,4 +58,4 @@ ${tools_dir}grib_set -p levtype $infile $outfile 2> $REDIRECT > $REDIRECT
|
|||
|
||||
[ $? -ne 0 ]
|
||||
|
||||
|
||||
rm -f $outfile || true
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
REDIRECT=/dev/null
|
||||
|
||||
templog=${data_dir}/log.step.$$
|
||||
rm -f ${templog} | true
|
||||
rm -f ${templog} || true
|
||||
for i in 0 10
|
||||
do
|
||||
for s in 0 1200 600 6000
|
||||
|
|
Loading…
Reference in New Issue