Merge branch 'eccodes' of ssh://software.ecmwf.int:7999/grib/grib_api into eccodes

This commit is contained in:
Enrico Fucile 2015-01-26 16:17:06 +00:00
commit 4b1bbf02b1
32 changed files with 107 additions and 122 deletions

View File

@ -9,6 +9,7 @@ set(files_to_download
bad.grib
budg
constant_field.grib1
constant_field.grib2
constant_width_bitmap.grib
constant_width_boust_bitmap.grib
gen.grib
@ -73,7 +74,9 @@ set(files_to_download
spectral_compex.grib1
spectral_complex.grib1
spherical_model_level.grib1
spherical_model_level.grib2
spherical_pressure_level.grib1
spherical_pressure_level.grib2
sst_globus0083.grib
test.grib1
test_uuid.grib2

View File

@ -127,6 +127,7 @@ set(bufr_files_to_download
syno_2.bufr
syno_3.bufr
syno_4.bufr
synop_multi_subset.bufr
temp_101.bufr
temp_102.bufr
temp_106.bufr
@ -269,6 +270,7 @@ set(bufr_refs_to_download
tros_31.bufr.num.ref
wavb_134.bufr.num.ref
syno_multi.bufr.num.ref
synop_multi_subset.bufr.num.ref
aaen_55.bufr.desc.ref
aben_55.bufr.desc.ref
@ -403,6 +405,7 @@ set(bufr_refs_to_download
tros_31.bufr.desc.ref
wavb_134.bufr.desc.ref
syno_multi.bufr.desc.ref
synop_multi_subset.bufr.desc.ref
aaen_55.bufr.ls.ref
syno_multi.bufr.header.ref

View File

@ -45,6 +45,7 @@ files="
in_copy.grib
budg
constant_field.grib1
constant_field.grib2
constant_width_bitmap.grib
constant_width_boust_bitmap.grib
gen.grib
@ -110,7 +111,9 @@ files="
spectral_compex.grib1
spectral_complex.grib1
spherical_model_level.grib1
spherical_model_level.grib2
spherical_pressure_level.grib1
spherical_pressure_level.grib2
sst_globus0083.grib
test.grib1
test_uuid.grib2
@ -494,6 +497,7 @@ files="
bufr/syno_3.bufr
bufr/syno_4.bufr
bufr/syno_multi.bufr
bufr/synop_multi_subset.bufr
bufr/temp_101.bufr
bufr/temp_102.bufr
bufr/temp_106.bufr
@ -633,6 +637,7 @@ files="
bufr/tros_31.bufr.num.ref
bufr/wavb_134.bufr.num.ref
bufr/syno_multi.bufr.num.ref
bufr/synop_multi_subset.bufr.num.ref
bufr/aaen_55.bufr.desc.ref
bufr/aben_55.bufr.desc.ref
@ -768,6 +773,7 @@ files="
bufr/wavb_134.bufr.desc.ref
bufr/aaen_55.bufr.ls.ref
bufr/syno_multi.bufr.desc.ref
bufr/synop_multi_subset.bufr.desc.ref
bufr/syno_multi.bufr.header.ref
"

View File

@ -11,11 +11,6 @@
${examples_dir}set > /dev/null
# Create the grib2 file needed for this test
grib1File=${data_dir}/reduced_gaussian_pressure_level.grib1
grib2File=${data_dir}/reduced_gaussian_pressure_level.grib2
${tools_dir}grib_set -s editionNumber=2 $grib1File $grib2File
${examples_dir}set_missing > /dev/null
rm -f out.grib1 out_surface_level.grib2 $grib2File
rm -f out.grib1 out_surface_level.grib2

View File

@ -9,10 +9,5 @@
. ./include.sh
# Create the grib2 file needed for this test
grib1File=${data_dir}/reduced_gaussian_pressure_level.grib1
grib2File=${data_dir}/reduced_gaussian_pressure_level.grib2
${tools_dir}grib_set -s editionNumber=2 $grib1File $grib2File
${examples_dir}set_missing > /dev/null
rm -f out_surface_level.grib2 $grib2File
rm -f out_surface_level.grib2

View File

@ -9,10 +9,5 @@
. ./include.sh
# Create the grib2 file needed for this test
grib1File=${data_dir}/reduced_gaussian_pressure_level.grib1
grib2File=${data_dir}/reduced_gaussian_pressure_level.grib2
${tools_dir}grib_set -s editionNumber=2 $grib1File $grib2File
${examples_dir}f_set_missing > /dev/null
rm -f out_surface_level.grib2 $grib2File
rm -f out_surface_level.grib2

View File

@ -20,4 +20,3 @@ status=$?
set -e
# Check command did indeed fail
[ $status != 0 ]

View File

@ -2,8 +2,8 @@
. ./include.sh
TEMP1=temp1
TEMP2=temp2
TEMP1=temp1.$$
TEMP2=temp2.$$
$PYTHON count_messages.py 2> $TEMP1 > $TEMP1
./p_count_messages ../../data/tigge_pf_ecmwf.grib2 2> $TEMP2 > $TEMP2

View File

@ -2,8 +2,8 @@
. ./include.sh
TEMP1=temp1
TEMP2=temp2
TEMP1=temp1.$$
TEMP2=temp2.$$
FILE="${data_dir}/reduced_latlon_surface.grib1"
$PYTHON iterator.py $FILE 2> $TEMP1 > $TEMP1

View File

@ -2,8 +2,8 @@
. ./include.sh
TEMP1=temp1
TEMP2=temp2
TEMP1=temp1.$$
TEMP2=temp2.$$
$PYTHON keys_iterator.py 2> $TEMP1 > $TEMP1
./p_keys_iterator ../../data/reduced_latlon_surface.grib1 2> $TEMP2 > $TEMP2

View File

@ -2,8 +2,8 @@
. ./include.sh
TEMP1=temp1
TEMP2=temp2
TEMP1=temp1.$$
TEMP2=temp2.$$
$PYTHON print_data.py 2> $TEMP1 > $TEMP1
./p_print_data ../../data/regular_latlon_surface.grib1 2> $TEMP2 > $TEMP2

View File

@ -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" ]

View File

@ -13,7 +13,6 @@
editions="1 2"
gridTypes="regular_ll rotated_ll"
outfile=out.grib
Ni_list="5 8"
Nj_list="7 4"

View File

@ -14,7 +14,7 @@
REDIRECT=/dev/null
infile="${data_dir}/regular_latlon_surface.grib1"
outfile=${infile}.1
outfile=${infile}.compare.$$
rm -f $outfile || true

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -15,3 +15,9 @@ test_dir=@CMAKE_BINARY_DIR@/tests
samp_dir="${proj_dir}/samples"
ECCODES_SAMPLES_PATH=${samp_dir}
export ECCODES_SAMPLES_PATH
# If this environment variable is set, then become verbose
# so one can see why and how a test failed
if test "x$ECCODES_TEST_VERBOSE_OUTPUT" != "x"; then
set -x
fi

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -10,7 +10,6 @@
. ./include.sh
rm -f log | true
workdir=`pwd`
REDIRECT=/dev/null

View File

@ -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

View File

@ -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