mirror of https://github.com/ecmwf/eccodes.git
Merge branch 'eccodes' of ssh://software.ecmwf.int:7999/grib/grib_api into eccodes
This commit is contained in:
commit
4b1bbf02b1
|
@ -9,6 +9,7 @@ set(files_to_download
|
||||||
bad.grib
|
bad.grib
|
||||||
budg
|
budg
|
||||||
constant_field.grib1
|
constant_field.grib1
|
||||||
|
constant_field.grib2
|
||||||
constant_width_bitmap.grib
|
constant_width_bitmap.grib
|
||||||
constant_width_boust_bitmap.grib
|
constant_width_boust_bitmap.grib
|
||||||
gen.grib
|
gen.grib
|
||||||
|
@ -73,7 +74,9 @@ set(files_to_download
|
||||||
spectral_compex.grib1
|
spectral_compex.grib1
|
||||||
spectral_complex.grib1
|
spectral_complex.grib1
|
||||||
spherical_model_level.grib1
|
spherical_model_level.grib1
|
||||||
|
spherical_model_level.grib2
|
||||||
spherical_pressure_level.grib1
|
spherical_pressure_level.grib1
|
||||||
|
spherical_pressure_level.grib2
|
||||||
sst_globus0083.grib
|
sst_globus0083.grib
|
||||||
test.grib1
|
test.grib1
|
||||||
test_uuid.grib2
|
test_uuid.grib2
|
||||||
|
|
|
@ -127,6 +127,7 @@ set(bufr_files_to_download
|
||||||
syno_2.bufr
|
syno_2.bufr
|
||||||
syno_3.bufr
|
syno_3.bufr
|
||||||
syno_4.bufr
|
syno_4.bufr
|
||||||
|
synop_multi_subset.bufr
|
||||||
temp_101.bufr
|
temp_101.bufr
|
||||||
temp_102.bufr
|
temp_102.bufr
|
||||||
temp_106.bufr
|
temp_106.bufr
|
||||||
|
@ -269,6 +270,7 @@ set(bufr_refs_to_download
|
||||||
tros_31.bufr.num.ref
|
tros_31.bufr.num.ref
|
||||||
wavb_134.bufr.num.ref
|
wavb_134.bufr.num.ref
|
||||||
syno_multi.bufr.num.ref
|
syno_multi.bufr.num.ref
|
||||||
|
synop_multi_subset.bufr.num.ref
|
||||||
|
|
||||||
aaen_55.bufr.desc.ref
|
aaen_55.bufr.desc.ref
|
||||||
aben_55.bufr.desc.ref
|
aben_55.bufr.desc.ref
|
||||||
|
@ -403,6 +405,7 @@ set(bufr_refs_to_download
|
||||||
tros_31.bufr.desc.ref
|
tros_31.bufr.desc.ref
|
||||||
wavb_134.bufr.desc.ref
|
wavb_134.bufr.desc.ref
|
||||||
syno_multi.bufr.desc.ref
|
syno_multi.bufr.desc.ref
|
||||||
|
synop_multi_subset.bufr.desc.ref
|
||||||
|
|
||||||
aaen_55.bufr.ls.ref
|
aaen_55.bufr.ls.ref
|
||||||
syno_multi.bufr.header.ref
|
syno_multi.bufr.header.ref
|
||||||
|
|
|
@ -45,6 +45,7 @@ files="
|
||||||
in_copy.grib
|
in_copy.grib
|
||||||
budg
|
budg
|
||||||
constant_field.grib1
|
constant_field.grib1
|
||||||
|
constant_field.grib2
|
||||||
constant_width_bitmap.grib
|
constant_width_bitmap.grib
|
||||||
constant_width_boust_bitmap.grib
|
constant_width_boust_bitmap.grib
|
||||||
gen.grib
|
gen.grib
|
||||||
|
@ -110,7 +111,9 @@ files="
|
||||||
spectral_compex.grib1
|
spectral_compex.grib1
|
||||||
spectral_complex.grib1
|
spectral_complex.grib1
|
||||||
spherical_model_level.grib1
|
spherical_model_level.grib1
|
||||||
|
spherical_model_level.grib2
|
||||||
spherical_pressure_level.grib1
|
spherical_pressure_level.grib1
|
||||||
|
spherical_pressure_level.grib2
|
||||||
sst_globus0083.grib
|
sst_globus0083.grib
|
||||||
test.grib1
|
test.grib1
|
||||||
test_uuid.grib2
|
test_uuid.grib2
|
||||||
|
@ -494,6 +497,7 @@ files="
|
||||||
bufr/syno_3.bufr
|
bufr/syno_3.bufr
|
||||||
bufr/syno_4.bufr
|
bufr/syno_4.bufr
|
||||||
bufr/syno_multi.bufr
|
bufr/syno_multi.bufr
|
||||||
|
bufr/synop_multi_subset.bufr
|
||||||
bufr/temp_101.bufr
|
bufr/temp_101.bufr
|
||||||
bufr/temp_102.bufr
|
bufr/temp_102.bufr
|
||||||
bufr/temp_106.bufr
|
bufr/temp_106.bufr
|
||||||
|
@ -633,6 +637,7 @@ files="
|
||||||
bufr/tros_31.bufr.num.ref
|
bufr/tros_31.bufr.num.ref
|
||||||
bufr/wavb_134.bufr.num.ref
|
bufr/wavb_134.bufr.num.ref
|
||||||
bufr/syno_multi.bufr.num.ref
|
bufr/syno_multi.bufr.num.ref
|
||||||
|
bufr/synop_multi_subset.bufr.num.ref
|
||||||
|
|
||||||
bufr/aaen_55.bufr.desc.ref
|
bufr/aaen_55.bufr.desc.ref
|
||||||
bufr/aben_55.bufr.desc.ref
|
bufr/aben_55.bufr.desc.ref
|
||||||
|
@ -768,6 +773,7 @@ files="
|
||||||
bufr/wavb_134.bufr.desc.ref
|
bufr/wavb_134.bufr.desc.ref
|
||||||
bufr/aaen_55.bufr.ls.ref
|
bufr/aaen_55.bufr.ls.ref
|
||||||
bufr/syno_multi.bufr.desc.ref
|
bufr/syno_multi.bufr.desc.ref
|
||||||
|
bufr/synop_multi_subset.bufr.desc.ref
|
||||||
|
|
||||||
bufr/syno_multi.bufr.header.ref
|
bufr/syno_multi.bufr.header.ref
|
||||||
"
|
"
|
||||||
|
|
|
@ -11,11 +11,6 @@
|
||||||
|
|
||||||
${examples_dir}set > /dev/null
|
${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
|
${examples_dir}set_missing > /dev/null
|
||||||
|
|
||||||
rm -f out.grib1 out_surface_level.grib2 $grib2File
|
rm -f out.grib1 out_surface_level.grib2
|
||||||
|
|
|
@ -9,10 +9,5 @@
|
||||||
|
|
||||||
. ./include.sh
|
. ./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
|
${examples_dir}set_missing > /dev/null
|
||||||
rm -f out_surface_level.grib2 $grib2File
|
rm -f out_surface_level.grib2
|
||||||
|
|
|
@ -9,10 +9,5 @@
|
||||||
|
|
||||||
. ./include.sh
|
. ./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
|
${examples_dir}f_set_missing > /dev/null
|
||||||
rm -f out_surface_level.grib2 $grib2File
|
rm -f out_surface_level.grib2
|
||||||
|
|
|
@ -20,4 +20,3 @@ status=$?
|
||||||
set -e
|
set -e
|
||||||
# Check command did indeed fail
|
# Check command did indeed fail
|
||||||
[ $status != 0 ]
|
[ $status != 0 ]
|
||||||
|
|
||||||
|
|
|
@ -2,8 +2,8 @@
|
||||||
|
|
||||||
. ./include.sh
|
. ./include.sh
|
||||||
|
|
||||||
TEMP1=temp1
|
TEMP1=temp1.$$
|
||||||
TEMP2=temp2
|
TEMP2=temp2.$$
|
||||||
|
|
||||||
$PYTHON count_messages.py 2> $TEMP1 > $TEMP1
|
$PYTHON count_messages.py 2> $TEMP1 > $TEMP1
|
||||||
./p_count_messages ../../data/tigge_pf_ecmwf.grib2 2> $TEMP2 > $TEMP2
|
./p_count_messages ../../data/tigge_pf_ecmwf.grib2 2> $TEMP2 > $TEMP2
|
||||||
|
|
|
@ -2,8 +2,8 @@
|
||||||
|
|
||||||
. ./include.sh
|
. ./include.sh
|
||||||
|
|
||||||
TEMP1=temp1
|
TEMP1=temp1.$$
|
||||||
TEMP2=temp2
|
TEMP2=temp2.$$
|
||||||
|
|
||||||
FILE="${data_dir}/reduced_latlon_surface.grib1"
|
FILE="${data_dir}/reduced_latlon_surface.grib1"
|
||||||
$PYTHON iterator.py $FILE 2> $TEMP1 > $TEMP1
|
$PYTHON iterator.py $FILE 2> $TEMP1 > $TEMP1
|
||||||
|
|
|
@ -2,8 +2,8 @@
|
||||||
|
|
||||||
. ./include.sh
|
. ./include.sh
|
||||||
|
|
||||||
TEMP1=temp1
|
TEMP1=temp1.$$
|
||||||
TEMP2=temp2
|
TEMP2=temp2.$$
|
||||||
|
|
||||||
$PYTHON keys_iterator.py 2> $TEMP1 > $TEMP1
|
$PYTHON keys_iterator.py 2> $TEMP1 > $TEMP1
|
||||||
./p_keys_iterator ../../data/reduced_latlon_surface.grib1 2> $TEMP2 > $TEMP2
|
./p_keys_iterator ../../data/reduced_latlon_surface.grib1 2> $TEMP2 > $TEMP2
|
||||||
|
|
|
@ -2,8 +2,8 @@
|
||||||
|
|
||||||
. ./include.sh
|
. ./include.sh
|
||||||
|
|
||||||
TEMP1=temp1
|
TEMP1=temp1.$$
|
||||||
TEMP2=temp2
|
TEMP2=temp2.$$
|
||||||
|
|
||||||
$PYTHON print_data.py 2> $TEMP1 > $TEMP1
|
$PYTHON print_data.py 2> $TEMP1 > $TEMP1
|
||||||
./p_print_data ../../data/regular_latlon_surface.grib1 2> $TEMP2 > $TEMP2
|
./p_print_data ../../data/regular_latlon_surface.grib1 2> $TEMP2 > $TEMP2
|
||||||
|
|
|
@ -65,7 +65,6 @@ spectral_complex.grib1
|
||||||
spherical_model_level.grib1
|
spherical_model_level.grib1
|
||||||
spherical_pressure_level.grib1
|
spherical_pressure_level.grib1
|
||||||
test.grib1
|
test.grib1
|
||||||
with_bitmap.grib1
|
|
||||||
gep10.t12z.pgrb2af78.grib2
|
gep10.t12z.pgrb2af78.grib2
|
||||||
gfs.c255.grib2
|
gfs.c255.grib2
|
||||||
jpeg.grib2
|
jpeg.grib2
|
||||||
|
@ -117,4 +116,3 @@ done
|
||||||
# Extra test for grid_complex_spatial_differencing
|
# Extra test for grid_complex_spatial_differencing
|
||||||
res=`${tools_dir}grib_get -p decimalScaleFactor,bitsPerValue ${data_dir}/gfs.c255.grib2`
|
res=`${tools_dir}grib_get -p decimalScaleFactor,bitsPerValue ${data_dir}/gfs.c255.grib2`
|
||||||
[ "$res" = "1 20" ]
|
[ "$res" = "1 20" ]
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,6 @@
|
||||||
|
|
||||||
editions="1 2"
|
editions="1 2"
|
||||||
gridTypes="regular_ll rotated_ll"
|
gridTypes="regular_ll rotated_ll"
|
||||||
outfile=out.grib
|
|
||||||
Ni_list="5 8"
|
Ni_list="5 8"
|
||||||
Nj_list="7 4"
|
Nj_list="7 4"
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
REDIRECT=/dev/null
|
REDIRECT=/dev/null
|
||||||
|
|
||||||
infile="${data_dir}/regular_latlon_surface.grib1"
|
infile="${data_dir}/regular_latlon_surface.grib1"
|
||||||
outfile=${infile}.1
|
outfile=${infile}.compare.$$
|
||||||
|
|
||||||
rm -f $outfile || true
|
rm -f $outfile || true
|
||||||
|
|
||||||
|
|
|
@ -11,24 +11,21 @@
|
||||||
. ./include.sh
|
. ./include.sh
|
||||||
|
|
||||||
data="${data_dir}/*grib1 ${data_dir}/*grib2"
|
data="${data_dir}/*grib1 ${data_dir}/*grib2"
|
||||||
tmp="tmp.out"
|
tmp="tmp.concept.out"
|
||||||
|
|
||||||
for d in $data
|
for d in $data
|
||||||
do
|
do
|
||||||
|
set -e
|
||||||
set -e
|
${tools_dir}grib_ls -p gridType,packingType -w dataRepresentationType!=192 $d > $tmp
|
||||||
${tools_dir}grib_ls -p gridType,packingType -w dataRepresentationType!=192 $d > $tmp
|
|
||||||
|
set +e
|
||||||
set +e
|
grep unknown $tmp
|
||||||
grep unknown $tmp
|
|
||||||
|
if [ $? -eq 0 ]
|
||||||
if [ $? -eq 0 ]
|
then
|
||||||
then
|
false
|
||||||
false
|
exit
|
||||||
exit
|
fi
|
||||||
fi
|
rm -f $tmp | true
|
||||||
|
|
||||||
rm -f $tmp | true
|
|
||||||
|
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|
|
@ -15,19 +15,16 @@ REDIRECT=/dev/null
|
||||||
files="regular_latlon_surface.grib2 \
|
files="regular_latlon_surface.grib2 \
|
||||||
regular_latlon_surface.grib1"
|
regular_latlon_surface.grib1"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
for file in `echo $files`
|
for file in `echo $files`
|
||||||
do
|
do
|
||||||
infile=${data_dir}/$file
|
infile=${data_dir}/$file
|
||||||
outfile1=${infile}_decimalPrecision_1
|
outfile1=${infile}_decimalPrecision_1
|
||||||
outfile2=${infile}_decimalPrecision_2
|
outfile2=${infile}_decimalPrecision_2
|
||||||
${tools_dir}grib_set -r -s decimalScaleFactor=1,bitsPerValue=0 $infile $outfile1
|
${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_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_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 -b totalLength,section4Length,section7Length,dataLength,decimalScaleFactor,binaryScaleFactor,referenceValue,bitsPerValue $infile $outfile2 > $REDIRECT
|
||||||
${tools_dir}grib_compare $outfile1 $outfile2
|
${tools_dir}grib_compare $outfile1 $outfile2
|
||||||
rm -f $outfile1 $outfile2 || true
|
rm -f $outfile1 $outfile2 || true
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,7 @@ REDIRECT=/dev/null
|
||||||
|
|
||||||
if [ -f ${data_dir}/geavg.t12z.pgrbaf108 ]
|
if [ -f ${data_dir}/geavg.t12z.pgrbaf108 ]
|
||||||
then
|
then
|
||||||
tmpdata=grib_api.grib
|
tmpdata=grib_api.$$.grib
|
||||||
rm -f $tmpdata || true
|
rm -f $tmpdata || true
|
||||||
${tools_dir}grib_filter ${data_dir}/filter_rules ${data_dir}/geavg.t12z.pgrbaf108 > $REDIRECT
|
${tools_dir}grib_filter ${data_dir}/filter_rules ${data_dir}/geavg.t12z.pgrbaf108 > $REDIRECT
|
||||||
rm -f $tmpdata
|
rm -f $tmpdata
|
||||||
|
@ -68,8 +68,8 @@ set nlev=41.0;
|
||||||
write;
|
write;
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
${tools_dir}/grib_filter -o temp.grib2 temp.filt $ECCODES_SAMPLES_PATH/sh_ml_grib1.tmpl
|
${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.grib2`
|
result=`${tools_dir}/grib_get -p typeOfFirstFixedSurface,NV,nlev temp_filt.grib2`
|
||||||
[ "$result" = "150 6 41" ]
|
[ "$result" = "150 6 41" ]
|
||||||
|
|
||||||
# GRIB-394: grib_filter arithmetic operators not correct for floating point values
|
# 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
|
${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
|
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.
|
# virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction.
|
||||||
#
|
#
|
||||||
|
|
||||||
|
|
||||||
. ./include.sh
|
. ./include.sh
|
||||||
|
|
||||||
REDIRECT=/dev/null
|
REDIRECT=/dev/null
|
||||||
|
@ -21,5 +20,3 @@ if [ $? -eq 0 ]
|
||||||
then
|
then
|
||||||
exit 1;
|
exit 1;
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -32,19 +32,21 @@ files="constant_field\
|
||||||
for f in `echo $files`
|
for f in `echo $files`
|
||||||
do
|
do
|
||||||
file=${data_dir}/$f
|
file=${data_dir}/$f
|
||||||
rm -f ${file}.grib2 || true
|
output=${file}.grib2_
|
||||||
${tools_dir}grib_set -s editionNumber=2 ${file}.grib1 ${file}.grib2 2> $REDIRECT > $REDIRECT
|
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`
|
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" ]
|
if [ "$grib1Statistics" != "$grib2Statistics" ]; then
|
||||||
then
|
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#${tools_dir}grib_compare -A1.0e-8 -c values ${file}.grib1 ${file}.grib2 2> /dev/null > /dev/null
|
#${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 ${file}.grib2 2> $REDIRECT > $REDIRECT
|
${tools_dir}grib_compare -P -c values ${file}.grib1 ${output} 2> $REDIRECT > $REDIRECT
|
||||||
|
|
||||||
|
rm -f ${output}
|
||||||
|
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,6 @@
|
||||||
# In applying this licence, ECMWF does not waive the privileges and immunities granted to it by
|
# 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.
|
# virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction.
|
||||||
#
|
#
|
||||||
|
|
||||||
. ./include.sh
|
. ./include.sh
|
||||||
|
|
||||||
REDIRECT=/dev/null
|
REDIRECT=/dev/null
|
||||||
|
@ -29,22 +28,22 @@ files="constant_field\
|
||||||
spherical_pressure_level \
|
spherical_pressure_level \
|
||||||
spherical_model_level "
|
spherical_model_level "
|
||||||
|
|
||||||
for f in `echo $files`
|
for f in $files
|
||||||
do
|
do
|
||||||
file=${data_dir}/$f
|
file=${data_dir}/$f
|
||||||
rm -f ${file}.grib1_ || true
|
output=${file}.grib1_
|
||||||
${tools_dir}grib_set -s editionNumber=1 ${file}.grib2 ${file}.grib1_ 2> $REDIRECT > $REDIRECT
|
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`
|
grib2Statistics=`${tools_dir}grib_get -fp numberOfValues,numberOfPoints,max,min,average,numberOfMissing ${file}.grib2`
|
||||||
|
|
||||||
if [ "$grib1Statistics" != "$grib2Statistics" ]
|
if [ "$grib1Statistics" != "$grib2Statistics" ]; then
|
||||||
then
|
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#${tools_dir}grib_compare -A1.0e-8 -c values ${file}.grib1_ ${file}.grib2 2> /dev/null > /dev/null
|
#${tools_dir}grib_compare -A1.0e-8 -c values ${output} ${file}.grib2 2> /dev/null > /dev/null
|
||||||
rm -f ${file}.grib1_ || true
|
rm -f ${output}
|
||||||
done
|
done
|
||||||
|
|
||||||
# GRIB-262 Conversion works without error for L137 data
|
# GRIB-262 Conversion works without error for L137 data
|
||||||
|
|
|
@ -13,9 +13,8 @@
|
||||||
|
|
||||||
REDIRECT=/dev/null
|
REDIRECT=/dev/null
|
||||||
|
|
||||||
tmpdata=grib_api.grib
|
tmpdata=grib_api.gridType.grib
|
||||||
|
rm -f $tmpdata
|
||||||
rm -f $tmpdata || true
|
|
||||||
|
|
||||||
${tools_dir}grib_set -s gridType=regular_gg ${data_dir}/reduced_latlon_surface.grib1 ${tmpdata} > $REDIRECT
|
${tools_dir}grib_set -s gridType=regular_gg ${data_dir}/reduced_latlon_surface.grib1 ${tmpdata} > $REDIRECT
|
||||||
|
|
||||||
|
@ -40,4 +39,3 @@ then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
rm -f $tmpdata || true
|
rm -f $tmpdata || true
|
||||||
|
|
||||||
|
|
|
@ -15,3 +15,9 @@ test_dir=@CMAKE_BINARY_DIR@/tests
|
||||||
samp_dir="${proj_dir}/samples"
|
samp_dir="${proj_dir}/samples"
|
||||||
ECCODES_SAMPLES_PATH=${samp_dir}
|
ECCODES_SAMPLES_PATH=${samp_dir}
|
||||||
export ECCODES_SAMPLES_PATH
|
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
|
||||||
|
|
|
@ -11,14 +11,13 @@
|
||||||
. ./include.sh
|
. ./include.sh
|
||||||
#set -x
|
#set -x
|
||||||
|
|
||||||
outfile=out.grib
|
|
||||||
sample_g1=$ECCODES_SAMPLES_PATH/GRIB1.tmpl
|
sample_g1=$ECCODES_SAMPLES_PATH/GRIB1.tmpl
|
||||||
sample_g2=$ECCODES_SAMPLES_PATH/GRIB2.tmpl
|
sample_g2=$ECCODES_SAMPLES_PATH/GRIB2.tmpl
|
||||||
temp=temp.grib
|
temp=temp.level.grib
|
||||||
|
|
||||||
file=${data_dir}/regular_gaussian_pressure_level.grib1
|
file=${data_dir}/regular_gaussian_pressure_level.grib1
|
||||||
|
|
||||||
cat >good<<EOF
|
cat >temp.level.good<<EOF
|
||||||
grib1: level=850 isobaricInhPa indicatorOfTypeOfLevel=100
|
grib1: level=850 isobaricInhPa indicatorOfTypeOfLevel=100
|
||||||
grib2: level=850 isobaricInhPa pl 85000
|
grib2: level=850 isobaricInhPa pl 85000
|
||||||
grib1: level=850 isobaricInhPa indicatorOfTypeOfLevel=100
|
grib1: level=850 isobaricInhPa indicatorOfTypeOfLevel=100
|
||||||
|
@ -58,7 +57,7 @@ EOF
|
||||||
|
|
||||||
|
|
||||||
${tools_dir}grib_filter level.filter $file > test.dump
|
${tools_dir}grib_filter level.filter $file > test.dump
|
||||||
diff good test.dump
|
diff temp.level.good test.dump
|
||||||
|
|
||||||
# GRIB-492
|
# GRIB-492
|
||||||
${tools_dir}grib_set -s indicatorOfTypeOfLevel=110 $sample_g1 $temp
|
${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=`${tools_dir}grib_get -wcount=7 -F%.20f -p level:d $input`
|
||||||
[ "$res" = "2.00000000000000000000" ]
|
[ "$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 instrumentType={591,591,591,592};
|
||||||
set scaleFactorOfCentralWaveNumber={3,3,3,4};
|
set scaleFactorOfCentralWaveNumber={3,3,3,4};
|
||||||
set scaledValueOfCentralWaveNumber={26870,9272,8377,22334};
|
set scaledValueOfCentralWaveNumber={26870,9272,8377,22334};
|
||||||
write "test.grib";
|
write "test.list.grib";
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
file="${data_dir}/reduced_gaussian_model_level.grib2"
|
file="${data_dir}/reduced_gaussian_model_level.grib2"
|
||||||
|
@ -35,7 +35,7 @@ print("x.out") "scaleFactorOfCentralWaveNumber={[scaleFactorOfCentralWaveNumber'
|
||||||
print("x.out") "scaledValueOfCentralWaveNumber={[scaledValueOfCentralWaveNumber',']}";
|
print("x.out") "scaledValueOfCentralWaveNumber={[scaledValueOfCentralWaveNumber',']}";
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
${tools_dir}grib_filter list.filter test.grib
|
${tools_dir}grib_filter list.filter test.list.grib
|
||||||
|
|
||||||
cat >list.ref<<EOF
|
cat >list.ref<<EOF
|
||||||
productDefinitionTemplateNumber=31
|
productDefinitionTemplateNumber=31
|
||||||
|
@ -49,5 +49,5 @@ EOF
|
||||||
|
|
||||||
diff x.out list.ref
|
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.
|
# virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction.
|
||||||
#
|
#
|
||||||
|
|
||||||
|
|
||||||
. ./include.sh
|
. ./include.sh
|
||||||
#set -x
|
#set -x
|
||||||
|
|
||||||
REDIRECT=/dev/null
|
REDIRECT=/dev/null
|
||||||
|
|
||||||
cd ${data_dir}
|
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 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
|
for localDefinitionNumber in 1 15 26 30
|
||||||
do
|
do
|
||||||
${tools_dir}grib_set -s localDefinitionNumber=$localDefinitionNumber,perturbationNumber=2,numberOfForecastsInEnsemble=50 loc.grib1 eps.grib1
|
${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
|
. ./include.sh
|
||||||
|
|
||||||
rm -f log | true
|
tempLog=temp.ls.log
|
||||||
|
rm -f $tempLog
|
||||||
workdir=`pwd`
|
workdir=`pwd`
|
||||||
|
|
||||||
cd ${data_dir}
|
cd ${data_dir}
|
||||||
infile=regular_gaussian_model_level.grib1
|
infile=regular_gaussian_model_level.grib1
|
||||||
|
|
||||||
${tools_dir}grib_ls -P count $infile > log
|
${tools_dir}grib_ls -P count $infile > $tempLog
|
||||||
${tools_dir}grib_ls -p count,step $infile >> log
|
${tools_dir}grib_ls -p count,step $infile >> $tempLog
|
||||||
${tools_dir}grib_ls $infile >> log
|
${tools_dir}grib_ls $infile >> $tempLog
|
||||||
${tools_dir}grib_ls -l 0,0,1 $infile >> log
|
${tools_dir}grib_ls -l 0,0,1 $infile >> $tempLog
|
||||||
${tools_dir}grib_get -l 0,0,1 $infile >> log
|
${tools_dir}grib_get -l 0,0,1 $infile >> $tempLog
|
||||||
${tools_dir}grib_get -p count,step $infile >> log
|
${tools_dir}grib_get -p count,step $infile >> $tempLog
|
||||||
${tools_dir}grib_get -P count $infile >> log
|
${tools_dir}grib_get -P count $infile >> $tempLog
|
||||||
|
|
||||||
files=" reduced_gaussian_lsm.grib1
|
files=" reduced_gaussian_lsm.grib1
|
||||||
reduced_gaussian_model_level.grib1
|
reduced_gaussian_model_level.grib1
|
||||||
|
@ -52,12 +53,12 @@ regular_latlon_surface.grib2
|
||||||
for file in $files
|
for file in $files
|
||||||
do
|
do
|
||||||
[ -f "$file" ]
|
[ -f "$file" ]
|
||||||
echo $file >> log
|
echo $file >> $tempLog
|
||||||
${tools_dir}grib_ls -l 40,28 $file | grep index | awk '{print $4;}' >> log
|
${tools_dir}grib_ls -l 40,28 $file | grep index | awk '{print $4;}' >> $tempLog
|
||||||
done
|
done
|
||||||
|
|
||||||
diff log ls.log
|
diff $tempLog ls.log
|
||||||
rm -f log
|
rm -f $tempLog
|
||||||
|
|
||||||
# Test for bug GRIB-56
|
# Test for bug GRIB-56
|
||||||
${tools_dir}grib_set -s typeOfLevel=depthBelowLandLayer,topLevel=missing regular_latlon_surface.grib1 tmp_rlls.grib1
|
${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.
|
# virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction.
|
||||||
#
|
#
|
||||||
|
|
||||||
|
|
||||||
. ./include.sh
|
. ./include.sh
|
||||||
|
|
||||||
REDIRECT=/dev/null
|
REDIRECT=/dev/null
|
||||||
|
@ -37,4 +36,3 @@ ${tools_dir}grib_set -s centre=missing $infile $outfile 2> $REDIRECT > $REDIRECT
|
||||||
[ $? -ne 0 ]
|
[ $? -ne 0 ]
|
||||||
|
|
||||||
rm -f $outfile
|
rm -f $outfile
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,6 @@
|
||||||
# virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction.
|
# virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction.
|
||||||
#
|
#
|
||||||
|
|
||||||
|
|
||||||
. ./include.sh
|
. ./include.sh
|
||||||
|
|
||||||
if [ ! -f ${data_dir}/multi.grib2 ]
|
if [ ! -f ${data_dir}/multi.grib2 ]
|
||||||
|
@ -18,8 +17,7 @@ then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
tmpdata=grib_api.$$.grib
|
tmpdata=grib_api.$$.grib
|
||||||
|
rm -f $tmpdata
|
||||||
rm -f $tmpdata || true
|
|
||||||
|
|
||||||
parameterNumber=`${tools_dir}grib_get -p parameterNumber -w parameterCategory=2,parameterNumber=3 ${data_dir}/multi.grib2`
|
parameterNumber=`${tools_dir}grib_get -p parameterNumber -w parameterCategory=2,parameterNumber=3 ${data_dir}/multi.grib2`
|
||||||
if [ -z "$parameterNumber" ]
|
if [ -z "$parameterNumber" ]
|
||||||
|
@ -45,4 +43,3 @@ then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
rm -f $tmpdata.1 $tmpdata.rules || true
|
rm -f $tmpdata.1 $tmpdata.rules || true
|
||||||
|
|
||||||
|
|
|
@ -11,8 +11,9 @@
|
||||||
. ./include.sh
|
. ./include.sh
|
||||||
|
|
||||||
REDIRECT=/dev/null
|
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
|
cat > $$_f <<EOF
|
||||||
if (GRIBEXSection1Problem ) {
|
if (GRIBEXSection1Problem ) {
|
||||||
print "localDefinitionNumber=[localDefinitionNumber] size(GRIBEX-section1)=[GRIBEXSection1Problem] section1Length=[section1Length]";
|
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
|
for l1 in $localDefinitions
|
||||||
do
|
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
|
${tools_dir}grib_filter $$_f locx.grib1
|
||||||
for l2 in $localDefinitions
|
for l2 in $localDefinitions
|
||||||
do
|
do
|
||||||
|
@ -43,4 +44,4 @@ do
|
||||||
done
|
done
|
||||||
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
|
. ./include.sh
|
||||||
|
|
||||||
rm -f log | true
|
|
||||||
workdir=`pwd`
|
workdir=`pwd`
|
||||||
REDIRECT=/dev/null
|
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=`${tools_dir}grib_get -p centre:l $outfile`
|
||||||
[ $centre -eq 80 ]
|
[ $centre -eq 80 ]
|
||||||
|
|
||||||
|
rm -f $outfile || true
|
||||||
|
|
||||||
infile=${data_dir}/regular_gaussian_surface.grib2
|
infile=${data_dir}/regular_gaussian_surface.grib2
|
||||||
outfile=${data_dir}/set.grib2
|
outfile=${data_dir}/set.grib2
|
||||||
|
|
||||||
|
@ -56,4 +58,4 @@ ${tools_dir}grib_set -p levtype $infile $outfile 2> $REDIRECT > $REDIRECT
|
||||||
|
|
||||||
[ $? -ne 0 ]
|
[ $? -ne 0 ]
|
||||||
|
|
||||||
|
rm -f $outfile || true
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
REDIRECT=/dev/null
|
REDIRECT=/dev/null
|
||||||
|
|
||||||
templog=${data_dir}/log.step.$$
|
templog=${data_dir}/log.step.$$
|
||||||
rm -f ${templog} | true
|
rm -f ${templog} || true
|
||||||
for i in 0 10
|
for i in 0 10
|
||||||
do
|
do
|
||||||
for s in 0 1200 600 6000
|
for s in 0 1200 600 6000
|
||||||
|
|
Loading…
Reference in New Issue