diff --git a/examples/C/bufr_clone.sh b/examples/C/bufr_clone.sh index 7e01649e3..dc0748486 100755 --- a/examples/C/bufr_clone.sh +++ b/examples/C/bufr_clone.sh @@ -26,7 +26,7 @@ ${examples_dir}c_bufr_clone $f $fBufrTmp >$REDIRECT 2> $REDIRECT #Compare clone to the original set +e -${tools_dir}bufr_compare $f $fBufrTmp >$REDIRECT 2> $REDIRECT +${tools_dir}/bufr_compare $f $fBufrTmp >$REDIRECT 2> $REDIRECT #Check if clone is different if [ $? -eq 0 ]; then diff --git a/examples/C/bufr_copy_data.sh b/examples/C/bufr_copy_data.sh index d13794623..bed15eebd 100755 --- a/examples/C/bufr_copy_data.sh +++ b/examples/C/bufr_copy_data.sh @@ -57,7 +57,7 @@ ${examples_dir}c_bufr_copy_data ${INPUT} ${TEMP} # The input and output BUFR messages should be different set +e -${tools_dir}bufr_compare ${TEMP} ${INPUT} > ${MYLOG} +${tools_dir}/bufr_compare ${TEMP} ${INPUT} > ${MYLOG} status=$? set -e [ $status -eq 1 ] diff --git a/examples/C/bufr_set_keys.sh b/examples/C/bufr_set_keys.sh index df1194f51..f885484c3 100755 --- a/examples/C/bufr_set_keys.sh +++ b/examples/C/bufr_set_keys.sh @@ -29,7 +29,7 @@ ${examples_dir}c_bufr_set_keys $fBufrTmp 2> $REDIRECT > $REDIRECT #Compare modified to the original set +e -${tools_dir}bufr_compare $f $fBufrTmp >$REDIRECT 2> $REDIRECT +${tools_dir}/bufr_compare $f $fBufrTmp >$REDIRECT 2> $REDIRECT #Check if modified is different if [ $? -eq 0 ]; then @@ -40,7 +40,7 @@ fi set -e #Check if modified has the same number of messages -[ `${tools_dir}bufr_count $f` -eq `${tools_dir}bufr_count ${fBufrTmp}` ] +[ `${tools_dir}/bufr_count $f` -eq `${tools_dir}/bufr_count ${fBufrTmp}` ] #Clean up rm -f $fBufrTmp | true diff --git a/examples/C/grib_clone.sh b/examples/C/grib_clone.sh index e5925c447..da0854860 100755 --- a/examples/C/grib_clone.sh +++ b/examples/C/grib_clone.sh @@ -13,10 +13,10 @@ TEMP=cloned.grib INPUT=${data_dir}/reduced_gaussian_pressure_level.grib1 ${examples_dir}c_grib_clone ${INPUT} ${TEMP} > /dev/null -${tools_dir}grib_compare ${INPUT} ${TEMP} +${tools_dir}/grib_compare ${INPUT} ${TEMP} INPUT=${data_dir}/sample.grib2 ${examples_dir}c_grib_clone ${INPUT} ${TEMP} > /dev/null -${tools_dir}grib_compare ${INPUT} ${TEMP} +${tools_dir}/grib_compare ${INPUT} ${TEMP} rm -f ${TEMP} diff --git a/examples/C/grib_copy_message.sh b/examples/C/grib_copy_message.sh index c9de0d70b..b25e3ace4 100755 --- a/examples/C/grib_copy_message.sh +++ b/examples/C/grib_copy_message.sh @@ -13,10 +13,10 @@ TEMP=c_grib_copy_message.grib INPUT=${data_dir}/reduced_gaussian_pressure_level.grib1 ${examples_dir}c_grib_copy_message ${INPUT} ${TEMP} > /dev/null -${tools_dir}grib_compare -b hour ${INPUT} ${TEMP} +${tools_dir}/grib_compare -b hour ${INPUT} ${TEMP} INPUT=${data_dir}/sample.grib2 ${examples_dir}c_grib_copy_message ${INPUT} ${TEMP} > /dev/null -${tools_dir}grib_compare -b hour ${INPUT} ${TEMP} +${tools_dir}/grib_compare -b hour ${INPUT} ${TEMP} rm -f ${TEMP} diff --git a/examples/C/grib_multi_write.sh b/examples/C/grib_multi_write.sh index c498756e1..4ee60c6c5 100755 --- a/examples/C/grib_multi_write.sh +++ b/examples/C/grib_multi_write.sh @@ -16,11 +16,11 @@ then fi ${examples_dir}c_grib_multi_write ${data_dir}/sample.grib2 ${data_dir}/multi_sample.grib2 > /dev/null -${tools_dir}grib_get -p step ${data_dir}/multi_sample.grib2 > ${data_dir}/multi_step.test +${tools_dir}/grib_get -p step ${data_dir}/multi_sample.grib2 > ${data_dir}/multi_step.test diff ${data_dir}/multi_step.test ${data_dir}/multi_step.txt -step=`${tools_dir}grib_get -M -p step ${data_dir}/multi_sample.grib2` +step=`${tools_dir}/grib_get -M -p step ${data_dir}/multi_sample.grib2` [ $step -eq 12 ] diff --git a/examples/C/grib_set_bitmap.sh b/examples/C/grib_set_bitmap.sh index 0aed0db38..de1f5ef18 100755 --- a/examples/C/grib_set_bitmap.sh +++ b/examples/C/grib_set_bitmap.sh @@ -14,7 +14,7 @@ OUT_TMP=out.set_bitmap_c.grib # The input and output files are hardcoded in the example ${examples_dir}c_grib_set_bitmap -x=`${tools_dir}grib_get -p numberOfDataPoints,numberOfCodedValues,numberOfMissing $OUT_TMP` +x=`${tools_dir}/grib_get -p numberOfDataPoints,numberOfCodedValues,numberOfMissing $OUT_TMP` [ "$x" = "496 486 10" ] rm -f $OUT_TMP diff --git a/examples/C/include.ctest.sh.in b/examples/C/include.ctest.sh.in index 899d30d78..ef165ae80 100644 --- a/examples/C/include.ctest.sh.in +++ b/examples/C/include.ctest.sh.in @@ -15,7 +15,7 @@ def_dir="@CMAKE_BINARY_DIR@/@ECCODES_DEFINITION_SUFF@" ECCODES_DEFINITION_PATH="${def_dir}" export ECCODES_DEFINITION_PATH -tools_dir=@CMAKE_BINARY_DIR@/bin/ +tools_dir=@CMAKE_BINARY_DIR@/bin examples_dir=@CMAKE_CURRENT_BINARY_DIR@/ # If this environment variable is set, then run the diff --git a/examples/C/include.sh b/examples/C/include.sh index 546e7f991..0a4d43e5d 100644 --- a/examples/C/include.sh +++ b/examples/C/include.sh @@ -32,11 +32,11 @@ else export ECCODES_DEFINITION_PATH ECCODES_SAMPLES_PATH=$cpath/samples export ECCODES_SAMPLES_PATH - tools_dir=$cpath/tools/ + tools_dir=$cpath/tools examples_dir=$cpath/examples/C/ if test "x$ECCODES_TEST_WITH_VALGRIND" != "x"; then - tools_dir="valgrind --error-exitcode=1 -q $cpath/tools/" + tools_dir="valgrind --error-exitcode=1 -q $cpath/tools" examples_dir="valgrind --error-exitcode=1 -q $cpath/examples/C/" fi @@ -61,6 +61,6 @@ else # Download the data needed for tests ${data_dir}/download.sh "${data_dir}" - #${tools_dir}codes_info + #${tools_dir}/codes_info set -u fi diff --git a/examples/C/large_grib1.sh b/examples/C/large_grib1.sh index 6b95b51ea..8e67805e7 100755 --- a/examples/C/large_grib1.sh +++ b/examples/C/large_grib1.sh @@ -14,5 +14,5 @@ ${examples_dir}c_large_grib1 # Make sure the newly created file can be listed OK output=bigfile.grib -${tools_dir}grib_ls $output > /dev/null +${tools_dir}/grib_ls $output > /dev/null rm -f $output diff --git a/examples/C/sections_copy.sh b/examples/C/sections_copy.sh index cb7579fab..949dc831c 100755 --- a/examples/C/sections_copy.sh +++ b/examples/C/sections_copy.sh @@ -19,7 +19,7 @@ ${examples_dir}c_sections_copy $REGUL_GRID_FILE $GAUSS_GRID_FILE g $OUTPUT >/dev # Now the output should have a regular grid # but its date should be the same as the Gaussian grid sample -grid_tmpl=`${tools_dir}grib_get -p gridType,date $OUTPUT` +grid_tmpl=`${tools_dir}/grib_get -p gridType,date $OUTPUT` [ "$grid_tmpl" = "regular_ll 20100912" ] @@ -29,7 +29,7 @@ ${examples_dir}c_sections_copy $GAUSS_GRID_FILE $REGUL_GRID_FILE g $OUTPUT >/dev # Now the output should have a gaussian grid # but its date should be the same as the regular grid -grid_tmpl=`${tools_dir}grib_get -p gridType,date $OUTPUT` +grid_tmpl=`${tools_dir}/grib_get -p gridType,date $OUTPUT` [ "$grid_tmpl" = "reduced_gg 20070323" ] @@ -39,7 +39,7 @@ ${examples_dir}c_sections_copy $REGUL_GRID_FILE $GAUSS_GRID_FILE gp $OUTPUT >/de # Now the output should have a regular grid # and its date should be the same as the regular latlon -grid_tmpl=`${tools_dir}grib_get -p gridType,date $OUTPUT` +grid_tmpl=`${tools_dir}/grib_get -p gridType,date $OUTPUT` [ "$grid_tmpl" = "regular_ll 20070323" ] @@ -48,6 +48,6 @@ grid_tmpl=`${tools_dir}grib_get -p gridType,date $OUTPUT` ${examples_dir}c_sections_copy $REGUL_GRID_FILE $GAUSS_GRID_FILE p,l,g,d,b $OUTPUT >/dev/null # Now the output should be identical to the regular grib -${tools_dir}grib_compare $REGUL_GRID_FILE $OUTPUT +${tools_dir}/grib_compare $REGUL_GRID_FILE $OUTPUT rm -f $OUTPUT diff --git a/examples/F90/bufr_clone.sh b/examples/F90/bufr_clone.sh index a792b4bc4..bd113a870 100755 --- a/examples/F90/bufr_clone.sh +++ b/examples/F90/bufr_clone.sh @@ -26,7 +26,7 @@ ${examples_dir}/eccodes_f_bufr_clone >$REDIRECT 2> $REDIRECT #Compare clone to the original set +e -${tools_dir}bufr_compare $f $fBufrTmp >$REDIRECT 2> $REDIRECT +${tools_dir}/bufr_compare $f $fBufrTmp >$REDIRECT 2> $REDIRECT #Check if clone is different if [ $? -eq 0 ]; then diff --git a/examples/F90/bufr_copy_data.sh b/examples/F90/bufr_copy_data.sh index a7ddc1184..dc6d7d00d 100755 --- a/examples/F90/bufr_copy_data.sh +++ b/examples/F90/bufr_copy_data.sh @@ -57,7 +57,7 @@ INPUT=metar_with_2_bias.bufr ${examples_dir}eccodes_f_bufr_copy_data ${INPUT} ${TEMP} # The input and output BUFR messages should be different set +e -${tools_dir}bufr_compare ${TEMP} ${INPUT} > ${MYLOG} +${tools_dir}/bufr_compare ${TEMP} ${INPUT} > ${MYLOG} status=$? set -e [ $status -eq 1 ] diff --git a/examples/F90/bufr_copy_keys.sh b/examples/F90/bufr_copy_keys.sh index dfe0230e3..ff30b3a8a 100755 --- a/examples/F90/bufr_copy_keys.sh +++ b/examples/F90/bufr_copy_keys.sh @@ -19,7 +19,7 @@ cd ${data_dir}/bufr #The input and output BUFR files are hardcoded in the f90 example!!! OUTPUT=out.$label.bufr ${examples_dir}eccodes_f_bufr_copy_keys -res=`${tools_dir}bufr_get -p bufrHeaderCentre $OUTPUT` +res=`${tools_dir}/bufr_get -p bufrHeaderCentre $OUTPUT` [ "$res" = "80" ] rm -f $OUTPUT diff --git a/examples/F90/bufr_copy_message.sh b/examples/F90/bufr_copy_message.sh index fd676d9e0..cf781055c 100755 --- a/examples/F90/bufr_copy_message.sh +++ b/examples/F90/bufr_copy_message.sh @@ -13,6 +13,6 @@ INPUT="../../data/bufr/syno_1.bufr" OUTPUT=out.copy.bufr ${examples_dir}eccodes_f_bufr_copy_message > /dev/null -${tools_dir}bufr_compare -b bufrHeaderSubCentre $INPUT $OUTPUT +${tools_dir}/bufr_compare -b bufrHeaderSubCentre $INPUT $OUTPUT rm -f $OUTPUT diff --git a/examples/F90/bufr_set_keys.sh b/examples/F90/bufr_set_keys.sh index 2da039918..caf886182 100755 --- a/examples/F90/bufr_set_keys.sh +++ b/examples/F90/bufr_set_keys.sh @@ -26,7 +26,7 @@ ${examples_dir}/eccodes_f_bufr_set_keys >$REDIRECT #Compare modified file to the original set +e -${tools_dir}bufr_compare $f $fBufrTmp >$REDIRECT +${tools_dir}/bufr_compare $f $fBufrTmp >$REDIRECT #Check if they are different if [ $? -eq 0 ]; then @@ -37,7 +37,7 @@ fi set -e #Check if modified file has the same number of messages -[ `${tools_dir}bufr_count $f` = `${tools_dir}bufr_count ${fBufrTmp}` ] +[ `${tools_dir}/bufr_count $f` = `${tools_dir}/bufr_count ${fBufrTmp}` ] #Clean up rm -f ${fBufrTmp} diff --git a/examples/F90/get_set_uuid.sh b/examples/F90/get_set_uuid.sh index e0a4a8d81..0dbeac2e7 100755 --- a/examples/F90/get_set_uuid.sh +++ b/examples/F90/get_set_uuid.sh @@ -10,7 +10,7 @@ . ./include.sh -uuid=`${tools_dir}grib_get -w count=1 -p uuidOfVGrid:s ${data_dir}/test_uuid.grib2` +uuid=`${tools_dir}/grib_get -w count=1 -p uuidOfVGrid:s ${data_dir}/test_uuid.grib2` [ "$uuid" = "08b1e836bc6911e1951fb51b5624ad8d" ] # This reads the file in data/test_uuid.grib2 and creates test_uuid.grib2 @@ -21,7 +21,7 @@ output=out_uuid.grib2 [ -f "$output" ] -uuid=`${tools_dir}grib_get -w count=1 -p uuidOfVGrid:s $output` +uuid=`${tools_dir}/grib_get -w count=1 -p uuidOfVGrid:s $output` [ "$uuid" = "8dad24561bb51f95e11169bc36e8b108" ] rm -f $output diff --git a/examples/F90/grib_copy_message.sh b/examples/F90/grib_copy_message.sh index 7d2abbb18..84544300d 100755 --- a/examples/F90/grib_copy_message.sh +++ b/examples/F90/grib_copy_message.sh @@ -13,6 +13,6 @@ INPUT="../../data/constant_field.grib1" OUTPUT=out.copy.grib1 ${examples_dir}eccodes_f_grib_copy_message > /dev/null -${tools_dir}grib_compare -b centre $INPUT $OUTPUT +${tools_dir}/grib_compare -b centre $INPUT $OUTPUT rm -f $OUTPUT diff --git a/examples/F90/grib_copy_namespace.sh b/examples/F90/grib_copy_namespace.sh index 5a7d9447a..815f072e2 100755 --- a/examples/F90/grib_copy_namespace.sh +++ b/examples/F90/grib_copy_namespace.sh @@ -13,14 +13,14 @@ label="grib_copy_namespace_test_f" INPUT=../../data/regular_latlon_surface.grib1 -res=`${tools_dir}grib_get -p Ni,Nj $INPUT` +res=`${tools_dir}/grib_get -p Ni,Nj $INPUT` [ "$res" = "16 31" ] #The input and output BUFR files are hardcoded in the f90 example!!! OUTPUT=out.grib_copy_namespace.grib ${examples_dir}./eccodes_f_grib_copy_namespace -res=`${tools_dir}grib_get -p Ni,Nj $OUTPUT` +res=`${tools_dir}/grib_get -p Ni,Nj $OUTPUT` [ "$res" = "MISSING 501" ] rm -f $OUTPUT diff --git a/examples/F90/grib_multi_write.sh b/examples/F90/grib_multi_write.sh index 076705058..e31ddbc6f 100755 --- a/examples/F90/grib_multi_write.sh +++ b/examples/F90/grib_multi_write.sh @@ -11,7 +11,7 @@ ${examples_dir}eccodes_f_grib_multi_write > /dev/null -${tools_dir}grib_compare ${data_dir}/multi_created.grib2 multi_created.grib2 +${tools_dir}/grib_compare ${data_dir}/multi_created.grib2 multi_created.grib2 rm -f multi_created.grib2 diff --git a/examples/F90/grib_set_bitmap.sh b/examples/F90/grib_set_bitmap.sh index 0c3f6bfb3..4fb077e11 100755 --- a/examples/F90/grib_set_bitmap.sh +++ b/examples/F90/grib_set_bitmap.sh @@ -14,7 +14,7 @@ OUT_TMP=out.set_bitmap_f.grib # The input and output files are hardcoded in the example ${examples_dir}eccodes_f_grib_set_bitmap -x=`${tools_dir}grib_get -p numberOfDataPoints,numberOfCodedValues,numberOfMissing $OUT_TMP` +x=`${tools_dir}/grib_get -p numberOfDataPoints,numberOfCodedValues,numberOfMissing $OUT_TMP` [ "$x" = "496 486 10" ] rm -f $OUT_TMP diff --git a/examples/F90/grib_set_keys.sh b/examples/F90/grib_set_keys.sh index cd5f17193..a35520e6f 100755 --- a/examples/F90/grib_set_keys.sh +++ b/examples/F90/grib_set_keys.sh @@ -10,11 +10,11 @@ . ./include.sh ${examples_dir}eccodes_f_grib_set_keys > /dev/null -res=`${tools_dir}grib_get -p centre out.set.grib1` +res=`${tools_dir}/grib_get -p centre out.set.grib1` [ "$res" = "cnmc" ] ${examples_dir}eccodes_f_grib_set_gvc > /dev/null -res=`${tools_dir}grib_get -p typeOfLevel,NV out_gvc.grib2` +res=`${tools_dir}/grib_get -p typeOfLevel,NV out_gvc.grib2` [ "$res" = "generalVertical 6" ] rm -f out.set.grib1 out_gvc.grib2 diff --git a/examples/F90/include.ctest.sh.in b/examples/F90/include.ctest.sh.in index ec5ab685b..18fc550d6 100644 --- a/examples/F90/include.ctest.sh.in +++ b/examples/F90/include.ctest.sh.in @@ -15,7 +15,7 @@ def_dir="@CMAKE_BINARY_DIR@/@ECCODES_DEFINITION_SUFF@" ECCODES_DEFINITION_PATH="${def_dir}" export ECCODES_DEFINITION_PATH -tools_dir=@CMAKE_BINARY_DIR@/bin/ +tools_dir=@CMAKE_BINARY_DIR@/bin examples_dir=@CMAKE_CURRENT_BINARY_DIR@/ # If this environment variable is set, then run the diff --git a/examples/F90/include.sh b/examples/F90/include.sh index cf77e198a..11e1e5d36 100755 --- a/examples/F90/include.sh +++ b/examples/F90/include.sh @@ -31,13 +31,13 @@ else export ECCODES_DEFINITION_PATH ECCODES_SAMPLES_PATH=$cpath/samples export ECCODES_SAMPLES_PATH - tools_dir=$cpath/tools/ + tools_dir=$cpath/tools examples_dir=$cpath/examples/F90/ data_dir=$cpath/data samples_dir=$cpath/samples if test "x$ECCODES_TEST_WITH_VALGRIND" != "x"; then - tools_dir="valgrind --error-exitcode=1 -q $cpath/tools/" + tools_dir="valgrind --error-exitcode=1 -q $cpath/tools" examples_dir="valgrind --error-exitcode=1 -q $cpath/examples/F90/" fi diff --git a/examples/F90/read_message.sh b/examples/F90/read_message.sh index 199d2a523..f43dbcd0c 100755 --- a/examples/F90/read_message.sh +++ b/examples/F90/read_message.sh @@ -16,7 +16,7 @@ rm -f $out | true ${examples_dir}eccodes_f_read_message > /dev/null -${tools_dir}grib_compare $in $out +${tools_dir}/grib_compare $in $out rm -f $out diff --git a/examples/deprecated/include.sh b/examples/deprecated/include.sh index b6f85e323..95ecf4d83 100644 --- a/examples/deprecated/include.sh +++ b/examples/deprecated/include.sh @@ -11,7 +11,7 @@ then export ECCODES_DEFINITION_PATH ECCODES_SAMPLES_PATH=$cpath/templates export ECCODES_SAMPLES_PATH - tools_dir=$cpath/tools/ + tools_dir=$cpath/tools examples_dir=$cpath/examples/ data_dir=$cpath/data else @@ -31,7 +31,7 @@ then GRIB_API_LIB=`pwd`/src fi -#${tools_dir}codes_info +#${tools_dir}/codes_info set -u diff --git a/examples/extra/include.sh b/examples/extra/include.sh index 9fbd2b7dd..771fd9c6f 100755 --- a/examples/extra/include.sh +++ b/examples/extra/include.sh @@ -11,7 +11,7 @@ then export ECCODES_DEFINITION_PATH ECCODES_SAMPLES_PATH=$cpath/samples export ECCODES_SAMPLES_PATH - tools_dir=$cpath/tools/ + tools_dir=$cpath/tools examples_dir=$cpath/examples/extra/ data_dir=$cpath/data else diff --git a/examples/python/bufr_copy_data.sh b/examples/python/bufr_copy_data.sh index 5da761892..7df69aa10 100755 --- a/examples/python/bufr_copy_data.sh +++ b/examples/python/bufr_copy_data.sh @@ -57,7 +57,7 @@ INPUT=metar_with_2_bias.bufr $PYTHON ${examples_src}bufr_copy_data.py ${INPUT} ${TEMP} # The input and output BUFR messages should be different set +e -${tools_dir}bufr_compare ${TEMP} ${INPUT} > ${MYLOG} +${tools_dir}/bufr_compare ${TEMP} ${INPUT} > ${MYLOG} status=$? set -e [ $status -eq 1 ] diff --git a/examples/python/bufr_encode_flight.sh b/examples/python/bufr_encode_flight.sh index 4ca5eacb1..b5d2f0763 100755 --- a/examples/python/bufr_encode_flight.sh +++ b/examples/python/bufr_encode_flight.sh @@ -17,9 +17,9 @@ REDIRECT=/dev/null $PYTHON $examples_src/bufr_encode_flight.py $csv_in $bufr_in $fBufrTmp # Make sure output is OK -${tools_dir}bufr_dump $fBufrTmp > $REDIRECT +${tools_dir}/bufr_dump $fBufrTmp > $REDIRECT -numSubsets=`${tools_dir}bufr_get -p numberOfSubsets $fBufrTmp` +numSubsets=`${tools_dir}/bufr_get -p numberOfSubsets $fBufrTmp` [ "$numSubsets" = "185" ] rm -f $fBufrTmp diff --git a/examples/python/bufr_set_keys.sh b/examples/python/bufr_set_keys.sh index 71b7c2ae2..3b0ec7728 100755 --- a/examples/python/bufr_set_keys.sh +++ b/examples/python/bufr_set_keys.sh @@ -28,7 +28,7 @@ $PYTHON $examples_src/bufr_set_keys.py 2> $REDIRECT > $REDIRECT #Compare modified to the original set +e -${tools_dir}/bufr_compare $f $fBufrTmp 1>$REDIRECT 2> $REDIRECT +${tools_dir}//bufr_compare $f $fBufrTmp 1>$REDIRECT 2> $REDIRECT #Check if modified is different if [ $? -eq 0 ]; then @@ -39,7 +39,7 @@ fi set -e #Check if modified has the same number of messages -[ `${tools_dir}bufr_count $f` -eq `${tools_dir}/bufr_count ${fBufrTmp}` ] +[ `${tools_dir}/bufr_count $f` -eq `${tools_dir}//bufr_count ${fBufrTmp}` ] #Clean up rm -f $fBufrTmp diff --git a/examples/python/include.ctest.sh.in b/examples/python/include.ctest.sh.in index 8bce78b5f..ab36c2853 100644 --- a/examples/python/include.ctest.sh.in +++ b/examples/python/include.ctest.sh.in @@ -14,7 +14,7 @@ def_dir="@CMAKE_BINARY_DIR@/@ECCODES_DEFINITION_SUFF@" ECCODES_DEFINITION_PATH="${def_dir}" export ECCODES_DEFINITION_PATH -tools_dir=@CMAKE_BINARY_DIR@/bin/ +tools_dir=@CMAKE_BINARY_DIR@/bin examples_dir=@CMAKE_CURRENT_BINARY_DIR@/ examples_src=@CMAKE_CURRENT_SOURCE_DIR@/ diff --git a/examples/python/include.sh b/examples/python/include.sh index caa26df2d..53341f3df 100644 --- a/examples/python/include.sh +++ b/examples/python/include.sh @@ -19,7 +19,7 @@ else export ECCODES_DEFINITION_PATH ECCODES_SAMPLES_PATH=$cpath/samples export ECCODES_SAMPLES_PATH - tools_dir=$cpath/tools/ + tools_dir=$cpath/tools examples_dir=$cpath/examples/python data_dir=$cpath/data examples_src=$examples_dir diff --git a/tests/badgrib.sh b/tests/badgrib.sh index 2403dd26e..1103a31e7 100755 --- a/tests/badgrib.sh +++ b/tests/badgrib.sh @@ -12,5 +12,5 @@ REDIRECT=/dev/null -${tools_dir}grib_ls -7 ${data_dir}/bad.grib 2> $REDIRECT > $REDIRECT +${tools_dir}/grib_ls -7 ${data_dir}/bad.grib 2> $REDIRECT > $REDIRECT diff --git a/tests/bitmap.sh b/tests/bitmap.sh index 4ac9004f8..e401508cd 100755 --- a/tests/bitmap.sh +++ b/tests/bitmap.sh @@ -20,20 +20,20 @@ outfile1=${data_dir}/without_bitmap.grib1 rm -f $outfile -${tools_dir}grib_set -s bitmapPresent=1 $infile $outfile >$REDIRECT +${tools_dir}/grib_set -s bitmapPresent=1 $infile $outfile >$REDIRECT -${tools_dir}grib_dump -O $infile | grep -v FILE > $infile.dump -${tools_dir}grib_dump -O $outfile | grep -v FILE > $outfile.dump +${tools_dir}/grib_dump -O $infile | grep -v FILE > $infile.dump +${tools_dir}/grib_dump -O $outfile | grep -v FILE > $outfile.dump diff $outfile.dump ${data_dir}/bitmap.diff diff $infile.dump ${data_dir}/no_bitmap.diff rm -f $infile.dump $outfile.dump || true -${tools_dir}grib_set -s bitmapPresent=0 $outfile $outfile1 >$REDIRECT +${tools_dir}/grib_set -s bitmapPresent=0 $outfile $outfile1 >$REDIRECT -${tools_dir}grib_dump -O $outfile1 | grep -v FILE > $outfile1.dump -${tools_dir}grib_dump -O $outfile | grep -v FILE> $outfile.dump +${tools_dir}/grib_dump -O $outfile1 | grep -v FILE > $outfile1.dump +${tools_dir}/grib_dump -O $outfile | grep -v FILE> $outfile.dump diff $outfile1.dump ${data_dir}/no_bitmap.diff @@ -48,12 +48,12 @@ set values={1,2,3,4,5,6,7,1111,1111,8,9,10}; write ; EOF -${tools_dir}grib_filter -o out.bmp.grib1 bitmap.rules $grib1 -${tools_dir}grib_filter -o out.bmp.grib2 bitmap.rules $grib2 +${tools_dir}/grib_filter -o out.bmp.grib1 bitmap.rules $grib1 +${tools_dir}/grib_filter -o out.bmp.grib2 bitmap.rules $grib2 #exit 0 -${tools_dir}grib_get_data -m missing out.bmp.grib1 > out.bmp.grib1.data -${tools_dir}grib_get_data -m missing out.bmp.grib2 > out.bmp.grib2.data +${tools_dir}/grib_get_data -m missing out.bmp.grib1 > out.bmp.grib1.data +${tools_dir}/grib_get_data -m missing out.bmp.grib2 > out.bmp.grib2.data diff out.bmp.grib1.data out.bmp.grib2.data diff --git a/tests/bitsPerValue.sh b/tests/bitsPerValue.sh index 5d10b3da3..9867e67c3 100755 --- a/tests/bitsPerValue.sh +++ b/tests/bitsPerValue.sh @@ -88,7 +88,7 @@ v.grib2 for file in $files; do infile=${data_dir}/$file if [ -f "$infile" ]; then - ${tools_dir}grib_get -p bitsPerValue $infile >/dev/null + ${tools_dir}/grib_get -p bitsPerValue $infile >/dev/null fi done @@ -102,16 +102,16 @@ for file in `echo $files`; do outfile1=${infile}_bitsPerValue_1 outfile2=${infile}_bitsPerValue_2 - ${tools_dir}grib_set -r -s bitsPerValue=10 $infile $outfile1 + ${tools_dir}/grib_set -r -s bitsPerValue=10 $infile $outfile1 - ${tools_dir}grib_set -s setBitsPerValue=10 $infile $outfile2 + ${tools_dir}/grib_set -s setBitsPerValue=10 $infile $outfile2 - ${tools_dir}grib_compare $outfile1 $outfile2 + ${tools_dir}/grib_compare $outfile1 $outfile2 rm -f $outfile1 $outfile2 || true done # 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" ] diff --git a/tests/budg.sh b/tests/budg.sh index e6333e0d0..38d961423 100755 --- a/tests/budg.sh +++ b/tests/budg.sh @@ -13,6 +13,6 @@ REDIRECT=/dev/null -${tools_dir}grib_ls ${data_dir}/budg > $REDIRECT -${tools_dir}grib_dump ${data_dir}/budg > $REDIRECT +${tools_dir}/grib_ls ${data_dir}/budg > $REDIRECT +${tools_dir}/grib_dump ${data_dir}/budg > $REDIRECT diff --git a/tests/bufr_change_edition.sh b/tests/bufr_change_edition.sh index b4d1d12e9..ca5788b9a 100755 --- a/tests/bufr_change_edition.sh +++ b/tests/bufr_change_edition.sh @@ -23,10 +23,10 @@ for f in ${bufr_files}; do if [ "$f" = "ias1_240.bufr" ]; then continue; fi # Convert to BUFR edition 4 - ${tools_dir}bufr_set -s editionNumber=4 $f $fBufrTmp - ${tools_dir}bufr_compare -b edition $f $fBufrTmp + ${tools_dir}/bufr_set -s editionNumber=4 $f $fBufrTmp + ${tools_dir}/bufr_compare -b edition $f $fBufrTmp - ed=`${tools_dir}bufr_get -w count=1 -p editionNumber $fBufrTmp` + ed=`${tools_dir}/bufr_get -w count=1 -p editionNumber $fBufrTmp` [ "$ed" = "4" ] done diff --git a/tests/bufr_compare.sh b/tests/bufr_compare.sh index 4728e5766..30ca5df68 100755 --- a/tests/bufr_compare.sh +++ b/tests/bufr_compare.sh @@ -35,7 +35,7 @@ fRules=${label}.filter f="syno_1.bufr" echo "Test: comparing the same files" >> $fLog echo "file: $f" >> $fLog -${tools_dir}/bufr_compare $f $f >> $fLog +${tools_dir}//bufr_compare $f $f >> $fLog #---------------------------------------------------- # Test: comparing two completely different files @@ -45,7 +45,7 @@ f1="syno_1.bufr" f2="aaen_55.bufr" echo "Test: comparing two completely different files" >> $fLog echo "file: $f" >> $fLog -${tools_dir}/bufr_compare $f1 $f2 >> $fLog +${tools_dir}//bufr_compare $f1 $f2 >> $fLog if [ $? -eq 0 ]; then echo "bufr_compare should have failed if files are completely different" >&2 exit 1 @@ -60,10 +60,10 @@ echo "Test: comparing with and witout the -b switch" >> $fLog echo "file: $f" >> $fLog #Alter a key in the file -${tools_dir}/bufr_set -s dataCategory=2 $f ${fBufrTmp} >> $fLog +${tools_dir}//bufr_set -s dataCategory=2 $f ${fBufrTmp} >> $fLog set +e -${tools_dir}/bufr_compare $f ${fBufrTmp}>> $fLog +${tools_dir}//bufr_compare $f ${fBufrTmp}>> $fLog if [ $? -eq 0 ]; then echo "bufr_compare should have failed if files are different" >&2 exit 1 @@ -71,7 +71,7 @@ fi set -e # Now compare with -b switch. No difference should be found. -${tools_dir}/bufr_compare -b dataCategory $f ${fBufrTmp}>> $fLog +${tools_dir}//bufr_compare -b dataCategory $f ${fBufrTmp}>> $fLog #---------------------------------------------------- # Test: comparing with the -r switch @@ -81,20 +81,20 @@ ${tools_dir}/bufr_compare -b dataCategory $f ${fBufrTmp}>> $fLog #cat temp_101.bufr syno_multi.bufr > $fBufrInput2 #set +e -#${tools_dir}/bufr_compare ${fBufrInput1} ${fBufrInput2} >> $fLog +#${tools_dir}//bufr_compare ${fBufrInput1} ${fBufrInput2} >> $fLog #if [ $? -eq 0 ]; then # echo "bufr_compare should have failed if the message order in the files is different" >&2 # exit 1 #fi #set -e -#${tools_dir}/bufr_compare -r ${fBufrInput1} ${fBufrInput2}>> $fLog +#${tools_dir}//bufr_compare -r ${fBufrInput1} ${fBufrInput2}>> $fLog #---------------------------------------------------- # Change subCentre and compare #---------------------------------------------------- -${tools_dir}bufr_set -s bufrHeaderSubCentre=12 aaen_55.bufr $fBufrTmp +${tools_dir}/bufr_set -s bufrHeaderSubCentre=12 aaen_55.bufr $fBufrTmp set +e -${tools_dir}bufr_compare aaen_55.bufr $fBufrTmp > $fLog 2>&1 +${tools_dir}/bufr_compare aaen_55.bufr $fBufrTmp > $fLog 2>&1 status=$? set -e [ $status -eq 1 ] @@ -107,14 +107,14 @@ temp_dir=tempdir.${label} mkdir -p $temp_dir infile=aaen_55.bufr cp $infile $temp_dir -${tools_dir}bufr_compare $infile $temp_dir >/dev/null +${tools_dir}/bufr_compare $infile $temp_dir >/dev/null rm -fr $temp_dir #---------------------------------------------------- # Compare attributes #---------------------------------------------------- set +e -${tools_dir}bufr_compare amv2_87.bufr amv3_87.bufr > $fLog 2>&1 +${tools_dir}/bufr_compare amv2_87.bufr amv3_87.bufr > $fLog 2>&1 status=$? set -e [ $status -eq 1 ] @@ -134,9 +134,9 @@ cat > $fRules </dev/null + ${tools_dir}/bufr_dump -O ${data_dir}/bufr/$file >/dev/null done #============================================== @@ -39,11 +39,11 @@ file="aaen_55.bufr" export ECCODES_DEBUG=1 # By default debug output goes to stderr -${tools_dir}bufr_dump -O ${data_dir}/bufr/$file 2>&1 | grep -q "BUFR data .*ing" +${tools_dir}/bufr_dump -O ${data_dir}/bufr/$file 2>&1 | grep -q "BUFR data .*ing" # Redirect it to stdout export ECCODES_LOG_STREAM=stdout -${tools_dir}bufr_dump -O ${data_dir}/bufr/$file | grep -q "BUFR data .*ing" +${tools_dir}/bufr_dump -O ${data_dir}/bufr/$file | grep -q "BUFR data .*ing" unset ECCODES_DEBUG unset ECCODES_LOG_STREAM @@ -62,7 +62,7 @@ unset ECCODES_LOG_STREAM # In v0.16.0 we changed the shortNames so we use a newer ref file #fJsonRef=${data_dir}/bufr/"bad.bufr.json.v0.16.0.ref" -#${tools_dir}bufr_dump -js $fBufr > $fJsonTmp +#${tools_dir}/bufr_dump -js $fBufr > $fJsonTmp #diff $fJsonTmp $fJsonRef @@ -77,7 +77,7 @@ unset ECCODES_LOG_STREAM #fBufr=${data_dir}/bufr/"207003.bufr" #fJsonRef=${data_dir}/bufr/"207003.bufr.json.ref" # -#${tools_dir}bufr_dump -ja $fBufr > $fJsonTmp +#${tools_dir}/bufr_dump -ja $fBufr > $fJsonTmp # #diff $fJsonTmp $fJsonRef # diff --git a/tests/bufr_dump_decode_C.sh b/tests/bufr_dump_decode_C.sh index 9257a9526..9f38c5c80 100755 --- a/tests/bufr_dump_decode_C.sh +++ b/tests/bufr_dump_decode_C.sh @@ -60,7 +60,7 @@ do filePath=${data_dir}/bufr/$file # Generate C code from BUFR file - ${tools_dir}bufr_dump -DC $filePath > $tempSrc + ${tools_dir}/bufr_dump -DC $filePath > $tempSrc # Too large for this test if [ "$file" = "ias1_240.bufr" ]; then diff --git a/tests/bufr_dump_decode_filter.sh b/tests/bufr_dump_decode_filter.sh index b4fbbcfee..d787e787f 100755 --- a/tests/bufr_dump_decode_filter.sh +++ b/tests/bufr_dump_decode_filter.sh @@ -46,9 +46,9 @@ do echo "Test: bufr_dump -Dfilter " >> $fLog echo "file: $f" >> $fLog - ${tools_dir}bufr_dump -Dfilter $f > $fRules + ${tools_dir}/bufr_dump -Dfilter $f > $fRules - ${tools_dir}bufr_filter $fRules $f >/dev/null + ${tools_dir}/bufr_filter $fRules $f >/dev/null rm -f $fRules fi diff --git a/tests/bufr_dump_decode_fortran.sh b/tests/bufr_dump_decode_fortran.sh index fe85372f4..39ea3b916 100755 --- a/tests/bufr_dump_decode_fortran.sh +++ b/tests/bufr_dump_decode_fortran.sh @@ -59,7 +59,7 @@ do filePath=${data_dir}/bufr/$file # Generate F90 code from BUFR file - ${tools_dir}bufr_dump -Dfortran ${filePath} > $tempSrc + ${tools_dir}/bufr_dump -Dfortran ${filePath} > $tempSrc # Too large for this test if [ "$file" = "ias1_240.bufr" ]; then diff --git a/tests/bufr_dump_decode_python.sh b/tests/bufr_dump_decode_python.sh index 24430b2f6..f01e94337 100755 --- a/tests/bufr_dump_decode_python.sh +++ b/tests/bufr_dump_decode_python.sh @@ -36,7 +36,7 @@ do fi # Generate Python code from BUFR file - ${tools_dir}bufr_dump -Dpython $inputBufr > $tempSrc + ${tools_dir}/bufr_dump -Dpython $inputBufr > $tempSrc $PYTHON $tempSrc $inputBufr diff --git a/tests/bufr_dump_encode_C.sh b/tests/bufr_dump_encode_C.sh index 66e950499..cffc57ae4 100755 --- a/tests/bufr_dump_encode_C.sh +++ b/tests/bufr_dump_encode_C.sh @@ -60,7 +60,7 @@ do tempExe=$label.$file.exe # Generate C code from BUFR file - ${tools_dir}bufr_dump -EC ${data_dir}/bufr/$file > $tempSrc + ${tools_dir}/bufr_dump -EC ${data_dir}/bufr/$file > $tempSrc # Too large for this test if [ "$file" = "ias1_240.bufr" ]; then @@ -79,12 +79,12 @@ do # The executable always creates a file called outfile.bufr # valgrind --error-exitcode=1 ./$tempExe ./$tempExe - ${tools_dir}bufr_compare ${data_dir}/bufr/$file $tempBufr + ${tools_dir}/bufr_compare ${data_dir}/bufr/$file $tempBufr TEMP_JSON1=${label}.$file.json TEMP_JSON2=${label}.$tempBufr.json - ${tools_dir}bufr_dump ${data_dir}/bufr/$file > $TEMP_JSON1 - ${tools_dir}bufr_dump $tempBufr > $TEMP_JSON2 + ${tools_dir}/bufr_dump ${data_dir}/bufr/$file > $TEMP_JSON1 + ${tools_dir}/bufr_dump $tempBufr > $TEMP_JSON2 diff $TEMP_JSON1 $TEMP_JSON2 rm -f $TEMP_JSON1 $TEMP_JSON2 fi diff --git a/tests/bufr_dump_encode_filter.sh b/tests/bufr_dump_encode_filter.sh index f4e72941b..62bc82a29 100755 --- a/tests/bufr_dump_encode_filter.sh +++ b/tests/bufr_dump_encode_filter.sh @@ -49,15 +49,15 @@ do echo "Test: bufr_dump -Efilter " >> $fLog echo "file: $f" >> $fLog - ${tools_dir}bufr_dump -Efilter $f > $fRules + ${tools_dir}/bufr_dump -Efilter $f > $fRules - ${tools_dir}bufr_filter -o $fBufrTmp $fRules $f - ${tools_dir}bufr_compare $fBufrTmp $f + ${tools_dir}/bufr_filter -o $fBufrTmp $fRules $f + ${tools_dir}/bufr_compare $fBufrTmp $f TEMP_JSON1=${label}.$f.json TEMP_JSON2=${label}.$fBufrTmp.json - ${tools_dir}bufr_dump $f > $TEMP_JSON1 - ${tools_dir}bufr_dump $fBufrTmp > $TEMP_JSON2 + ${tools_dir}/bufr_dump $f > $TEMP_JSON1 + ${tools_dir}/bufr_dump $fBufrTmp > $TEMP_JSON2 diff $TEMP_JSON1 $TEMP_JSON2 rm -f $TEMP_JSON1 $TEMP_JSON2 diff --git a/tests/bufr_dump_encode_fortran.sh b/tests/bufr_dump_encode_fortran.sh index 8fab66704..4f14572ca 100755 --- a/tests/bufr_dump_encode_fortran.sh +++ b/tests/bufr_dump_encode_fortran.sh @@ -58,7 +58,7 @@ do tempExe=$label.$file.exe # Generate F90 code from BUFR file - ${tools_dir}bufr_dump -Efortran ${data_dir}/bufr/$file > $tempSrc + ${tools_dir}/bufr_dump -Efortran ${data_dir}/bufr/$file > $tempSrc # Too large for this test if [ "$file" = "ias1_240.bufr" ]; then @@ -71,12 +71,12 @@ do # The executable always creates a file called outfile.bufr # valgrind --error-exitcode=1 ./$tempExe ./$tempExe - ${tools_dir}bufr_compare ${data_dir}/bufr/$file $tempBufr + ${tools_dir}/bufr_compare ${data_dir}/bufr/$file $tempBufr TEMP_JSON1=${label}.$file.json TEMP_JSON2=${label}.$tempBufr.json - ${tools_dir}bufr_dump ${data_dir}/bufr/$file > $TEMP_JSON1 - ${tools_dir}bufr_dump $tempBufr > $TEMP_JSON2 + ${tools_dir}/bufr_dump ${data_dir}/bufr/$file > $TEMP_JSON1 + ${tools_dir}/bufr_dump $tempBufr > $TEMP_JSON2 diff $TEMP_JSON1 $TEMP_JSON2 rm -f $TEMP_JSON1 $TEMP_JSON2 fi diff --git a/tests/bufr_dump_encode_python.sh b/tests/bufr_dump_encode_python.sh index ab139f52f..afe506baf 100755 --- a/tests/bufr_dump_encode_python.sh +++ b/tests/bufr_dump_encode_python.sh @@ -35,17 +35,17 @@ do fi # Generate Python code from BUFR file - ${tools_dir}bufr_dump -Epython $inputBufr > $tempSrc + ${tools_dir}/bufr_dump -Epython $inputBufr > $tempSrc # The python code always creates an output file called outfile.bufr $PYTHON $tempSrc # Check original BUFR file against one we generated from sample - ${tools_dir}bufr_compare $inputBufr $tempBufr + ${tools_dir}/bufr_compare $inputBufr $tempBufr TEMP_JSON1=${label}.$file.json TEMP_JSON2=${label}.$tempBufr.json - ${tools_dir}bufr_dump $inputBufr > $TEMP_JSON1 - ${tools_dir}bufr_dump $tempBufr > $TEMP_JSON2 + ${tools_dir}/bufr_dump $inputBufr > $TEMP_JSON1 + ${tools_dir}/bufr_dump $tempBufr > $TEMP_JSON2 diff $TEMP_JSON1 $TEMP_JSON2 2>/dev/null rm -f $TEMP_JSON1 $TEMP_JSON2 diff --git a/tests/bufr_filter.sh b/tests/bufr_filter.sh index 322f70545..76917ac48 100755 --- a/tests/bufr_filter.sh +++ b/tests/bufr_filter.sh @@ -44,8 +44,8 @@ EOF bufr_files=`cat bufr_data_files.txt` for f in ${bufr_files} ; do echo "file: $f" >> $fLog - ${tools_dir}codes_bufr_filter $fRules $f >> $fLog - ${tools_dir}bufr_filter $fRules $f >> $fLog # See ECC-205 + ${tools_dir}/codes_bufr_filter $fRules $f >> $fLog + ${tools_dir}/bufr_filter $fRules $f >> $fLog # See ECC-205 done #----------------------------------------------------------- @@ -60,7 +60,7 @@ EOF f="syno_multi.bufr" echo "Test: dump SYNOP values" >> $fLog echo "file: $f" >> $fLog -${tools_dir}codes_bufr_filter $fRules $f >> $fLog +${tools_dir}/codes_bufr_filter $fRules $f >> $fLog #----------------------------------------------------------- # Test: filter SYNOP message according to conditions @@ -81,7 +81,7 @@ rm -f $fBufrTmp | true f="syno_multi.bufr" echo "Test: filter SYNOP message according to conditions" >> $fLog echo "file: $f" >> $fLog -${tools_dir}codes_bufr_filter $fRules $f >> $fLog +${tools_dir}/codes_bufr_filter $fRules $f >> $fLog #Check if the resulting bufr message is the right one cat > $fRules <> $fLog echo "file: $f" >> $fLog -${tools_dir}codes_bufr_filter $fRules $f >> $fLog +${tools_dir}/codes_bufr_filter $fRules $f >> $fLog #Check if the resulting files exist for statid in 1 3 7 ; do @@ -137,9 +137,9 @@ EOF f="syno_1.bufr" echo "Test: attributes" >> $fLog echo "file: $f" >> $fLog -${tools_dir}codes_bufr_filter $fRules $f 2>> $fLog 1>> $fLog +${tools_dir}/codes_bufr_filter $fRules $f 2>> $fLog 1>> $fLog -${tools_dir}codes_bufr_filter $fRules $f 2> ${f}.log 1> ${f}.log +${tools_dir}/codes_bufr_filter $fRules $f 2> ${f}.log 1> ${f}.log cat > ${f}.ref <code=010004 @@ -169,9 +169,9 @@ EOF f="temp_101.bufr" echo "Test: access element by rank" >> $fLog echo "file: $f" >> $fLog -${tools_dir}codes_bufr_filter $fRules $f 2>> $fLog 1>> $fLog +${tools_dir}/codes_bufr_filter $fRules $f 2>> $fLog 1>> $fLog -${tools_dir}codes_bufr_filter $fRules $f 2> ${f}.log 1> ${f}.log +${tools_dir}/codes_bufr_filter $fRules $f 2> ${f}.log 1> ${f}.log cat > ${f}.ref <> $fLog echo "file: $f" >> $fLog -${tools_dir}codes_bufr_filter $fRules $f 2>> $fLog 1>> $fLog +${tools_dir}/codes_bufr_filter $fRules $f 2>> $fLog 1>> $fLog -${tools_dir}codes_bufr_filter $fRules $f 2> ${f}.log 1> ${f}.log +${tools_dir}/codes_bufr_filter $fRules $f 2> ${f}.log 1> ${f}.log cat > ${f}.ref <> $fLog echo "file: $f" >> $fLog -${tools_dir}codes_bufr_filter $fRules $f 2>> $fLog 1>> $fLog +${tools_dir}/codes_bufr_filter $fRules $f 2>> $fLog 1>> $fLog -${tools_dir}codes_bufr_filter $fRules $f 2> ${f}.log 1> ${f}.log +${tools_dir}/codes_bufr_filter $fRules $f 2> ${f}.log 1> ${f}.log cat > ${f}.ref <> $fLog echo "file: $f" >> $fLog -${tools_dir}codes_bufr_filter $fRules $f 2>> $fLog 1>> $fLog +${tools_dir}/codes_bufr_filter $fRules $f 2>> $fLog 1>> $fLog rm -f ${f}.log -${tools_dir}codes_bufr_filter $fRules $f 2> ${f}.log 1> ${f}.log +${tools_dir}/codes_bufr_filter $fRules $f 2> ${f}.log 1> ${f}.log REFERENCE_FILE="../../tests/asca_139.t1.ref" diff $REFERENCE_FILE ${f}.log @@ -354,9 +354,9 @@ EOF f="temp_101.bufr" echo "Test: access by condition 2" >> $fLog echo "file: $f" >> $fLog -${tools_dir}codes_bufr_filter $fRules $f 2>> $fLog 1>> $fLog +${tools_dir}/codes_bufr_filter $fRules $f 2>> $fLog 1>> $fLog -${tools_dir}codes_bufr_filter $fRules $f 2> ${f}.log 1> ${f}.log +${tools_dir}/codes_bufr_filter $fRules $f 2> ${f}.log 1> ${f}.log cat > ${f}.ref < $testScript1 #chmod +x $testScript1 -#${tools_dir}codes_bufr_filter $fRulesReady $f 2>> $fLog 1>> $testScript -#sed -e "s:diff:${tools_dir}bufr_compare:" < $testScript >> $testScript1 +#${tools_dir}/codes_bufr_filter $fRulesReady $f 2>> $fLog 1>> $testScript +#sed -e "s:diff:${tools_dir}/bufr_compare:" < $testScript >> $testScript1 #./$testScript1 #rm -f new_*bufr #rm -f $testScript $testScript1 @@ -449,9 +449,9 @@ for f in $files do echo "Test: packing " >> $fLog echo "file: $f" >> $fLog - ${tools_dir}codes_bufr_filter -o ${f}.out $fRules $f 2>> $fLog 1>> $fLog + ${tools_dir}/codes_bufr_filter -o ${f}.out $fRules $f 2>> $fLog 1>> $fLog - ${tools_dir}bufr_compare ${f}.out $f + ${tools_dir}/bufr_compare ${f}.out $f rm -f ${f}.out done @@ -470,9 +470,9 @@ EOF f="ship_9.bufr" echo "Test: get string" >> $fLog echo "file: $f" >> $fLog -${tools_dir}codes_bufr_filter $fRules $f 2>> $fLog 1>> $fLog +${tools_dir}/codes_bufr_filter $fRules $f 2>> $fLog 1>> $fLog -${tools_dir}codes_bufr_filter $fRules $f 2> ${f}.log 1> ${f}.log +${tools_dir}/codes_bufr_filter $fRules $f 2> ${f}.log 1> ${f}.log cat > ${f}.ref <> $fLog echo "file: $f" >> $fLog -${tools_dir}codes_bufr_filter $fRules $f 2>> $fLog 1>> $fLog +${tools_dir}/codes_bufr_filter $fRules $f 2>> $fLog 1>> $fLog -${tools_dir}codes_bufr_filter $fRules $f 2> ${f}.log 1> ${f}.log +${tools_dir}/codes_bufr_filter $fRules $f 2> ${f}.log 1> ${f}.log cat > ${f}.ref <> $fLog echo "file: $f" >> $fLog -${tools_dir}codes_bufr_filter $fRules $f 2>> $fLog 1>> $fLog +${tools_dir}/codes_bufr_filter $fRules $f 2>> $fLog 1>> $fLog if [ $? -eq 0 ]; then echo "bufr_filter should have failed if key not found" >&2 exit 1 @@ -554,7 +554,7 @@ fi set -e # Now repeat with -f option (do not exit on error) -${tools_dir}codes_bufr_filter -f $fRules $f 2>>$fLog 1>>$fLog +${tools_dir}/codes_bufr_filter -f $fRules $f 2>>$fLog 1>>$fLog #----------------------------------------------------------- @@ -572,7 +572,7 @@ set +e f="syno_1.bufr" echo "Test: not allowed key values" >> $fLog echo "file: $f" >> $fLog -${tools_dir}codes_bufr_filter $fRules $f 2>> $fLog 1>> $fLog +${tools_dir}/codes_bufr_filter $fRules $f 2>> $fLog 1>> $fLog if [ $? -eq 0 ]; then echo "bufr_filter should have failed if key value is not allowed" >&2 exit 1 @@ -580,7 +580,7 @@ fi set -e # Now repeat with -f option (do not exit on error) -${tools_dir}codes_bufr_filter -f $fRules $f 2>>$fLog 1>>$fLog +${tools_dir}/codes_bufr_filter -f $fRules $f 2>>$fLog 1>>$fLog #---------------------------------------------------- @@ -598,7 +598,7 @@ EOF f="syno_1.bufr" echo "Test: nformat specifier for integer keys" >> $fLog echo "file: $f" >> $fLog -result=`${tools_dir}codes_bufr_filter $fRules $f` +result=`${tools_dir}/codes_bufr_filter $fRules $f` #[ "$result" = "centre=098, height= 3" ] @@ -621,7 +621,7 @@ rm -f $fBufrTmp | true f="syno_1.bufr" echo "Test: setting keys" >> $fLog echo "file: $f" >> $fLog -#${tools_dir}codes_bufr_filter -o $fBufrTmp $fRules $f >> $fLog +#${tools_dir}/codes_bufr_filter -o $fBufrTmp $fRules $f >> $fLog #Check if the resulting bufr message is the right one cat > $fRules <> $fLog 1>> $fLog -${tools_dir}bufr_compare ${f}.out $f 2>> $fLog 1>> $fLog +${tools_dir}/codes_bufr_filter -o ${f}.out $fRules $f 2>> $fLog 1>> $fLog +${tools_dir}/bufr_compare ${f}.out $f 2>> $fLog 1>> $fLog rm -f ${f}.out @@ -671,8 +671,8 @@ set BufrTemplate="synopLand"; write; EOF -${tools_dir}codes_bufr_filter -o $fOut $fRules $f 2>> $fLog 1>> $fLog -${tools_dir}bufr_compare $fOut $fRef 2>> $fLog 1>> $fLog +${tools_dir}/codes_bufr_filter -o $fOut $fRules $f 2>> $fLog 1>> $fLog +${tools_dir}/bufr_compare $fOut $fRef 2>> $fLog 1>> $fLog rm -f $fOut @@ -684,8 +684,8 @@ set BufrTemplate="aircraftReportWithSecondsAndPressure"; write; EOF -${tools_dir}codes_bufr_filter -o $fOut $fRules $f 2>> $fLog 1>> $fLog -${tools_dir}bufr_compare $fOut $fRef 2>> $fLog 1>> $fLog +${tools_dir}/codes_bufr_filter -o $fOut $fRules $f 2>> $fLog 1>> $fLog +${tools_dir}/bufr_compare $fOut $fRef 2>> $fLog 1>> $fLog rm -f $fOut @@ -713,8 +713,8 @@ write; EOF -${tools_dir}codes_bufr_filter -o ${fout} $fRules $f 2>> $fLog 1>> $fLog -${tools_dir}bufr_compare $fout ${fout}.ref 2>> $fLog 1>> $fLog +${tools_dir}/codes_bufr_filter -o ${fout} $fRules $f 2>> $fLog 1>> $fLog +${tools_dir}/bufr_compare $fout ${fout}.ref 2>> $fLog 1>> $fLog #----------------------------------------------------------- # ECC-147 @@ -728,10 +728,10 @@ write; EOF f="syno_1.bufr" -${tools_dir}codes_bufr_filter -o ${f}.out $fRules $f +${tools_dir}/codes_bufr_filter -o ${f}.out $fRules $f # This part of the test is meant to fail set +e -${tools_dir}bufr_compare ${f}.out $f +${tools_dir}/bufr_compare ${f}.out $f status=$? set -e if [ $status -eq 0 ]; then @@ -739,7 +739,7 @@ if [ $status -eq 0 ]; then exit 1 fi # Now blacklist the failing keys and it should pass -${tools_dir}bufr_compare -b relativeHumidity,horizontalVisibility ${f}.out $f +${tools_dir}/bufr_compare -b relativeHumidity,horizontalVisibility ${f}.out $f rm -f ${f}.out @@ -763,9 +763,9 @@ EOF f="synop_multi_subset.bufr" echo "Test: access subsets by condition" >> $fLog echo "file: $f" >> $fLog -${tools_dir}codes_bufr_filter $fRules $f 2>> $fLog 1>> $fLog +${tools_dir}/codes_bufr_filter $fRules $f 2>> $fLog 1>> $fLog -${tools_dir}codes_bufr_filter $fRules $f 2> ${f}.log 1> ${f}.log +${tools_dir}/codes_bufr_filter $fRules $f 2> ${f}.log 1> ${f}.log cat > ${f}.ref <> $fLog echo "file: $f" >> $fLog -${tools_dir}codes_bufr_filter $fRules $f 2>> $fLog 1>> $fLog +${tools_dir}/codes_bufr_filter $fRules $f 2>> $fLog 1>> $fLog -${tools_dir}codes_bufr_filter $fRules $f 2> ${f}.log 1> ${f}.log +${tools_dir}/codes_bufr_filter $fRules $f 2> ${f}.log 1> ${f}.log cat > ${f}.ref <percentConfidence=70 % EOF @@ -816,9 +816,9 @@ EOF f="temp_101.bufr" echo "Test: set key by rank" >> $fLog echo "file: $f" >> $fLog -${tools_dir}codes_bufr_filter $fRules $f 2>> $fLog 1>> $fLog +${tools_dir}/codes_bufr_filter $fRules $f 2>> $fLog 1>> $fLog -${tools_dir}codes_bufr_filter $fRules $f 2> ${f}.log 1> ${f}.log +${tools_dir}/codes_bufr_filter $fRules $f 2> ${f}.log 1> ${f}.log cat > ${f}.ref <> $fLog echo "file: $f" >> $fLog -${tools_dir}codes_bufr_filter -o ${fOut} $fRules $f 2>> $fLog 1>> $fLog +${tools_dir}/codes_bufr_filter -o ${fOut} $fRules $f 2>> $fLog 1>> $fLog -${tools_dir}codes_bufr_filter -o ${fOut} $fRules $f > ${fOut}.log +${tools_dir}/codes_bufr_filter -o ${fOut} $fRules $f > ${fOut}.log cat > ${fOut}.log.ref <> $fLog echo "file: $f" >> $fLog - ${tools_dir}codes_bufr_filter -o ${fOut} $fRules $f 2>> $fLog 1>> $fLog + ${tools_dir}/codes_bufr_filter -o ${fOut} $fRules $f 2>> $fLog 1>> $fLog - ${tools_dir}bufr_ls ${fOut} > ${fOut}.log + ${tools_dir}/bufr_ls ${fOut} > ${fOut}.log cat > ${fOut}.log.ref <> $fLog echo "file: $f" >> $fLog -${tools_dir}codes_bufr_filter -o ${fOut} $fRules $f 2>> $fLog 1>> $fLog +${tools_dir}/codes_bufr_filter -o ${fOut} $fRules $f 2>> $fLog 1>> $fLog cat > ${fRules} < ${fOut}.log +${tools_dir}/codes_bufr_filter $fRules $f $fOut > ${fOut}.log cat > ${fOut}.log.ref <> $fLog echo "file: $f" >> $fLog -${tools_dir}codes_bufr_filter $fRules $f > ${f}.log +${tools_dir}/codes_bufr_filter $fRules $f > ${f}.log cat > ${f}.log.ref <associatedField=1 @@ -1013,7 +1013,7 @@ fOut="g2nd_208.bufr.out" echo "Test: extract subsets compressed data" >> $fLog echo "file: $f" >> $fLog -${tools_dir}bufr_filter -o $fOut $fRules $f 2>> $fLog 1>> $fLog +${tools_dir}/bufr_filter -o $fOut $fRules $f 2>> $fLog 1>> $fLog cat > ${fRules} < ${f}.log +${tools_dir}/bufr_filter $fRules $fOut > ${f}.log cat > ${f}.log.ref <> $fLog echo "file: $f" >> $fLog -${tools_dir}bufr_filter $fRules $f > ${f}.log +${tools_dir}/bufr_filter $fRules $f > ${f}.log cat > ${f}.log.ref <firstOrderStatisticalValue=-15 -15 -15 -15 -15 -15 -15 -15 -15 -15 @@ -1109,7 +1109,7 @@ fOut="asel_139.bufr.out" echo "Test: delayed replication compressed data" >> $fLog echo "file: $f" >> $fLog -${tools_dir}bufr_filter -o $fOut $fRules $f 2>> $fLog 1>> $fLog +${tools_dir}/bufr_filter -o $fOut $fRules $f 2>> $fLog 1>> $fLog cat > ${fRules} < ${f}.log +${tools_dir}/bufr_filter $fRules $fOut > ${f}.log cat > ${f}.log.ref <> $fLog echo "file: $f" >> $fLog -${tools_dir}bufr_filter -o $fOut $fRules $f 2>> $fLog 1>> $fLog +${tools_dir}/bufr_filter -o $fOut $fRules $f 2>> $fLog 1>> $fLog cat > ${fRules} < ${f}.log +${tools_dir}/bufr_filter $fRules $fOut > ${f}.log cat > ${f}.log.ref <> $fLog echo "file: $f" >> $fLog -${tools_dir}bufr_filter $fRules $f > ${f}.log +${tools_dir}/bufr_filter $fRules $f > ${f}.log cat > ${f}.log.ref <> $fLog echo "file: $f" >> $fLog -${tools_dir}bufr_filter $fRules $f > ${f}.log +${tools_dir}/bufr_filter $fRules $f > ${f}.log cat > ${f}.log.ref <> $fLog echo "file: $f" >> $fLog -${tools_dir}bufr_filter $fRules $f > ${f}.log +${tools_dir}/bufr_filter $fRules $f > ${f}.log cat > ${f}.log.ref <> $fLog echo "file: $f" >> $fLog -${tools_dir}bufr_filter $fRules $f > ${f}.log +${tools_dir}/bufr_filter $fRules $f > ${f}.log cat > ${f}.log.ref <> $fLog echo "file: $f" >> $fLog -${tools_dir}bufr_filter -o ${f}.out $fRules $f +${tools_dir}/bufr_filter -o ${f}.out $fRules $f cat > $fRules < ${f}.log +${tools_dir}/bufr_filter $fRules ${f}.out > ${f}.log cat > ${f}.log.ref <> $fLog echo "file: $f" >> $fLog -${tools_dir}bufr_filter -o ${f}.out $fRules $f +${tools_dir}/bufr_filter -o ${f}.out $fRules $f cat > $fRules < $fRules < ${f}.log +${tools_dir}/bufr_filter $fRules ${f}.out.out > ${f}.log cat > ${f}.log.ref <> $fLog echo "file: $f" >> $fLog -${tools_dir}bufr_filter -o ${f}.out $fRules $f +${tools_dir}/bufr_filter -o ${f}.out $fRules $f cat > $fRules < ${f}.log +${tools_dir}/bufr_filter $fRules ${f}.out > ${f}.log cat > ${f}.log.ref <> $fLog echo "file: $outputBufr" >> $fLog -${tools_dir}bufr_filter -o $outputBufr $fRules $inputBufr > $outputFilt +${tools_dir}/bufr_filter -o $outputBufr $fRules $inputBufr > $outputFilt [ -f $outputBufr ] cat > $fRules <> $outputFilt +${tools_dir}/bufr_filter $fRules $inputBufr $outputBufr >> $outputFilt cat > $outputRef <> $fLog echo "file: $inputBufr" >> $fLog -${tools_dir}bufr_filter -o $outputBufr $fRules $inputBufr > $outputFilt +${tools_dir}/bufr_filter -o $outputBufr $fRules $inputBufr > $outputFilt [ -f $outputBufr ] cat > $fRules <> $outputFilt +${tools_dir}/bufr_filter $fRules $inputBufr $outputBufr >> $outputFilt cat > $outputRef < $REDIRECT > ${file}.json + ${tools_dir}/bufr_dump -j$mode $file 2> $REDIRECT > ${file}.json if test "x$JSON_CHECK" != "x"; then json_xs < ${file}.json >$REDIRECT 2> $REDIRECT fi @@ -39,11 +39,11 @@ done # ECC-233: Test JSON dump when selecting messages with '-w' switch file=tropical_cyclone.bufr for c in 1 3 1/3; do - ${tools_dir}bufr_dump -w count=$c $file 2> $REDIRECT > ${file}.json + ${tools_dir}/bufr_dump -w count=$c $file 2> $REDIRECT > ${file}.json if test "x$JSON_CHECK" != "x"; then json_xs < ${file}.json >$REDIRECT 2> $REDIRECT fi done # ECC-272 -${tools_dir}bufr_dump -jf aaen_55.bufr | grep -q -w channelRadiance +${tools_dir}/bufr_dump -jf aaen_55.bufr | grep -q -w channelRadiance diff --git a/tests/bufrdc_desc_ref.sh b/tests/bufrdc_desc_ref.sh index 76195b77a..69952bd6d 100755 --- a/tests/bufrdc_desc_ref.sh +++ b/tests/bufrdc_desc_ref.sh @@ -28,7 +28,7 @@ do rm -f $res_desc - ${tools_dir}codes_bufr_filter bufrdc_desc_ref.filter $file 2> $REDIRECT > $res_desc + ${tools_dir}/codes_bufr_filter bufrdc_desc_ref.filter $file 2> $REDIRECT > $res_desc if [ -f "$ref_desc" ]; then diff $ref_desc $res_desc > $diff_desc 2> $diff_desc fi diff --git a/tests/bufrdc_ref.sh b/tests/bufrdc_ref.sh index 384ead6d0..4d6a96814 100755 --- a/tests/bufrdc_ref.sh +++ b/tests/bufrdc_ref.sh @@ -29,7 +29,7 @@ do rm -f $res_num | true - ${tools_dir}codes_bufr_filter bufrdc_num_ref.filter $file 2> $REDIRECT > $res_num + ${tools_dir}/codes_bufr_filter bufrdc_num_ref.filter $file 2> $REDIRECT > $res_num # Exclude the BUFR file uegabe.bufr because its reference file is incorrect if [ "$bf" = "uegabe.bufr" ]; then diff --git a/tests/calendar.sh b/tests/calendar.sh index 646192a17..6648025ee 100755 --- a/tests/calendar.sh +++ b/tests/calendar.sh @@ -17,19 +17,19 @@ temp2=temp2.calendar.$$ sample=$ECCODES_SAMPLES_PATH/GRIB2.tmpl -${tools_dir}grib_set -s tablesVersion=13,setCalendarId=1,typeOfCalendar=0 $sample $temp1 +${tools_dir}/grib_set -s tablesVersion=13,setCalendarId=1,typeOfCalendar=0 $sample $temp1 grib_check_key_equals $temp1 calendarIdPresent 1 grib_check_key_equals $temp1 section1Length 24 grib_check_key_equals $temp1 calendarIdentificationTemplateNumber 0 grib_check_key_equals $temp1 typeOfCalendar 0 -${tools_dir}grib_set -s tablesVersion=13,setCalendarId=1,calendarIdentificationTemplateNumber=1 $sample $temp1 +${tools_dir}/grib_set -s tablesVersion=13,setCalendarId=1,calendarIdentificationTemplateNumber=1 $sample $temp1 grib_check_key_equals $temp1 calendarIdPresent 1 grib_check_key_equals $temp1 section1Length 25 grib_check_key_equals $temp1 calendarIdentificationTemplateNumber 1 grib_check_key_equals $temp1 numberOfTensOfThousandsOfYearsOfOffset MISSING -${tools_dir}grib_set -s tablesVersion=13,setCalendarId=1,calendarIdentificationTemplateNumber=2 $sample $temp1 +${tools_dir}/grib_set -s tablesVersion=13,setCalendarId=1,calendarIdentificationTemplateNumber=2 $sample $temp1 grib_check_key_equals $temp1 calendarIdPresent 1 grib_check_key_equals $temp1 section1Length 26 grib_check_key_equals $temp1 calendarIdentificationTemplateNumber 2 @@ -37,7 +37,7 @@ grib_check_key_equals $temp1 typeOfCalendar 255 grib_check_key_equals $temp1 numberOfTensOfThousandsOfYearsOfOffset MISSING # Remove the calendar section -${tools_dir}grib_set -s deleteCalendarId=1 $temp1 $temp2 +${tools_dir}/grib_set -s deleteCalendarId=1 $temp1 $temp2 grib_check_key_equals $temp2 section1Length 21 grib_check_key_equals $temp2 calendarIdPresent 0 diff --git a/tests/ccsds.sh b/tests/ccsds.sh index 7b3794fbd..1a175f4c2 100755 --- a/tests/ccsds.sh +++ b/tests/ccsds.sh @@ -38,13 +38,13 @@ outfile1=$infile.tmp_ccsds.1 outfile2=$infile.tmp_ccsds.2 rm -f $outfile1 $outfile2 || true -${tools_dir}grib_set -f -r -s packingType=grid_simple $infile $outfile1 2> $REDIRECT -${tools_dir}grib_compare -P -b $BLACKLIST $outfile1 $infile > $REDIRECT +${tools_dir}/grib_set -f -r -s packingType=grid_simple $infile $outfile1 2> $REDIRECT +${tools_dir}/grib_compare -P -b $BLACKLIST $outfile1 $infile > $REDIRECT -${tools_dir}grib_set -r -s packingType=grid_ccsds $outfile1 $outfile2 -${tools_dir}grib_compare -P -b $BLACKLIST $outfile1 $outfile2 > $REDIRECT +${tools_dir}/grib_set -r -s packingType=grid_ccsds $outfile1 $outfile2 +${tools_dir}/grib_compare -P -b $BLACKLIST $outfile1 $outfile2 > $REDIRECT -templateNumber=`${tools_dir}grib_get -p dataRepresentationTemplateNumber $outfile2` +templateNumber=`${tools_dir}/grib_get -p dataRepresentationTemplateNumber $outfile2` if [ $templateNumber -ne 42 ] then @@ -58,14 +58,14 @@ infile=${data_dir}/reduced_latlon_surface.grib2 outfile1=$infile.tmp_ccsds.1 outfile2=$infile.tmp_ccsds.2 -${tools_dir}grib_set -r -s packingType=grid_ccsds $infile $outfile1 -${tools_dir}grib_compare -P -b $BLACKLIST $infile $outfile1 > $REDIRECT -${tools_dir}grib_set -f -r -s packingType=grid_simple $outfile1 $outfile2 2> $REDIRECT -${tools_dir}grib_compare -P -b $BLACKLIST $outfile2 $outfile1 > $REDIRECT +${tools_dir}/grib_set -r -s packingType=grid_ccsds $infile $outfile1 +${tools_dir}/grib_compare -P -b $BLACKLIST $infile $outfile1 > $REDIRECT +${tools_dir}/grib_set -f -r -s packingType=grid_simple $outfile1 $outfile2 2> $REDIRECT +${tools_dir}/grib_compare -P -b $BLACKLIST $outfile2 $outfile1 > $REDIRECT -res1=`${tools_dir}grib_get '-F%1.2f' -p min,max,avg $infile` -res2=`${tools_dir}grib_get '-F%1.2f' -p min,max,avg $outfile1` -res3=`${tools_dir}grib_get '-F%1.2f' -p min,max,avg $outfile2` +res1=`${tools_dir}/grib_get '-F%1.2f' -p min,max,avg $infile` +res2=`${tools_dir}/grib_get '-F%1.2f' -p min,max,avg $outfile1` +res3=`${tools_dir}/grib_get '-F%1.2f' -p min,max,avg $outfile2` [ "$res1" = "$res2" ] [ "$res1" = "$res3" ] @@ -76,8 +76,8 @@ infile=${data_dir}/tigge_ecmwf.grib2 outfile1=$infile.tmp_ccsds.1 outfile2=$infile.tmp_ccsds.2 -${tools_dir}grib_set -r -s bitsPerValue=17 $infile $outfile1 -${tools_dir}grib_set -r -s packingType=grid_ccsds $outfile1 $outfile2 -${tools_dir}grib_compare -P -c data:n $outfile1 $outfile2 +${tools_dir}/grib_set -r -s bitsPerValue=17 $infile $outfile1 +${tools_dir}/grib_set -r -s packingType=grid_ccsds $outfile1 $outfile2 +${tools_dir}/grib_compare -P -c data:n $outfile1 $outfile2 rm -f $outfile1 $outfile2 diff --git a/tests/change_scanning.sh b/tests/change_scanning.sh index b9271fc8e..7500f9ccc 100755 --- a/tests/change_scanning.sh +++ b/tests/change_scanning.sh @@ -54,17 +54,17 @@ EOF write "${data_dir}/scan1.grib"; EOF - ${tools_dir}grib_filter ${data_dir}/change_scanning_${gridType}.filter $file - #ed=`${tools_dir}grib_get -p edition ${data_dir}/scan1.grib` + ${tools_dir}/grib_filter ${data_dir}/change_scanning_${gridType}.filter $file + #ed=`${tools_dir}/grib_get -p edition ${data_dir}/scan1.grib` #echo edition=$ed - ${tools_dir}grib_set -s swapScanningX=1 ${data_dir}/scan1.grib ${data_dir}/scan.grib - ${tools_dir}grib_get_data -F "%g" ${data_dir}/scan.grib > ${data_dir}/scan_x_${gridType}_${Ni}_${Nj}.dump + ${tools_dir}/grib_set -s swapScanningX=1 ${data_dir}/scan1.grib ${data_dir}/scan.grib + ${tools_dir}/grib_get_data -F "%g" ${data_dir}/scan.grib > ${data_dir}/scan_x_${gridType}_${Ni}_${Nj}.dump diff ${data_dir}/scan_x_${gridType}_${Ni}_${Nj}.dump ${data_dir}/scan_x_${gridType}_${Ni}_${Nj}_good.dump rm -f ${data_dir}/scan_x_${gridType}_${Ni}_${Nj}.dump - ${tools_dir}grib_set -s swapScanningY=1 ${data_dir}/scan1.grib ${data_dir}/scan.grib - ${tools_dir}grib_get_data -F "%g" ${data_dir}/scan.grib > ${data_dir}/scan_y_${gridType}_${Ni}_${Nj}.dump + ${tools_dir}/grib_set -s swapScanningY=1 ${data_dir}/scan1.grib ${data_dir}/scan.grib + ${tools_dir}/grib_get_data -F "%g" ${data_dir}/scan.grib > ${data_dir}/scan_y_${gridType}_${Ni}_${Nj}.dump diff ${data_dir}/scan_y_${gridType}_${Ni}_${Nj}.dump ${data_dir}/scan_y_${gridType}_${Ni}_${Nj}_good.dump rm -f ${data_dir}/scan_y_${gridType}_${Ni}_${Nj}.dump rm -f ${data_dir}/change_scanning_${gridType}.filter diff --git a/tests/check_gaussian_grids.sh b/tests/check_gaussian_grids.sh index f27868760..53aabfced 100755 --- a/tests/check_gaussian_grids.sh +++ b/tests/check_gaussian_grids.sh @@ -12,6 +12,6 @@ # Check all sample GRIBs with a Gaussian grid samples_dir=$ECCODES_SAMPLES_PATH for gg in ${samples_dir}/reduced_gg_* ${samples_dir}/regular_gg_*; do - ${tools_dir}grib_check_gaussian_grid $gg >/dev/null + ${tools_dir}/grib_check_gaussian_grid $gg >/dev/null grib_check_key_equals $gg "global" 1 done diff --git a/tests/concept.sh b/tests/concept.sh index b38c42ad0..59c306014 100755 --- a/tests/concept.sh +++ b/tests/concept.sh @@ -74,7 +74,7 @@ tmp="tmp.concept.out" for d in $data do set -e - ${tools_dir}grib_ls -p gridType,packingType -w dataRepresentationType!=192 ${data_dir}/$d > $tmp + ${tools_dir}/grib_ls -p gridType,packingType -w dataRepresentationType!=192 ${data_dir}/$d > $tmp set +e grep unknown $tmp diff --git a/tests/decimalPrecision.sh b/tests/decimalPrecision.sh index a0f217da3..b018f57b3 100755 --- a/tests/decimalPrecision.sh +++ b/tests/decimalPrecision.sh @@ -20,11 +20,11 @@ for file in $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 -P -c data:n $infile $outfile1 > $REDIRECT + ${tools_dir}/grib_set -r -s decimalScaleFactor=1,bitsPerValue=0 $infile $outfile1 + ${tools_dir}/grib_compare -P -c data:n $infile $outfile1 > $REDIRECT - ${tools_dir}grib_set -s changeDecimalPrecision=1 $infile $outfile2 - ${tools_dir}grib_compare -P -c data:n $infile $outfile2 > $REDIRECT - ${tools_dir}grib_compare $outfile1 $outfile2 + ${tools_dir}/grib_set -s changeDecimalPrecision=1 $infile $outfile2 + ${tools_dir}/grib_compare -P -c data:n $infile $outfile2 > $REDIRECT + ${tools_dir}/grib_compare $outfile1 $outfile2 rm -f $outfile1 $outfile2 || true done diff --git a/tests/definitions.sh b/tests/definitions.sh index 075138dcc..0cd94bca7 100755 --- a/tests/definitions.sh +++ b/tests/definitions.sh @@ -13,10 +13,10 @@ REDIRECT=/dev/null -[ -z "$ECCODES_DEFINITION_PATH" ] | ECCODES_DEFINITION_PATH=`${tools_dir}codes_info -d` +[ -z "$ECCODES_DEFINITION_PATH" ] | ECCODES_DEFINITION_PATH=`${tools_dir}/codes_info -d` for file in `find ${ECCODES_DEFINITION_PATH}/ -name '*.def' -print` do - ${tools_dir}codes_parser $file > $REDIRECT + ${tools_dir}/codes_parser $file > $REDIRECT done diff --git a/tests/ecc-197.sh b/tests/ecc-197.sh index 6197bc693..d1427edda 100755 --- a/tests/ecc-197.sh +++ b/tests/ecc-197.sh @@ -40,7 +40,7 @@ MY_DEFS=`pwd`/$TEMP_DIR/definitions export ECCODES_DEFINITION_PATH=$MY_DEFS:$ECCODES_DEFINITION_PATH # Now decode -${tools_dir}bufr_dump $input > $TEMP +${tools_dir}/bufr_dump $input > $TEMP # Ensure output JSON has all the expected contents # After calling 'wc' and 'set', $1 will be the line count set `wc -l $TEMP` diff --git a/tests/ecc-286.sh b/tests/ecc-286.sh index 4a811ab6d..5549f7bb6 100755 --- a/tests/ecc-286.sh +++ b/tests/ecc-286.sh @@ -29,7 +29,7 @@ cat > $tempRules < $tempOut +${tools_dir}/bufr_filter $tempRules $BufrFile > $tempOut cat > $tempRef < $tempRules </dev/null +${tools_dir}/bufr_filter -o $tempOut $tempRules $BufrFile 2>/dev/null status=$? set -e [ $status -ne 0 ] # Now set environment variable to turn out-of-range values into 'missing' export ECCODES_BUFR_SET_TO_MISSING_IF_OUT_OF_RANGE=1 -${tools_dir}bufr_filter -o $tempOut $tempRules $BufrFile +${tools_dir}/bufr_filter -o $tempOut $tempRules $BufrFile unset ECCODES_BUFR_SET_TO_MISSING_IF_OUT_OF_RANGE -#echo 'set unpack=1;print "[longitude]";' | ${tools_dir}bufr_filter - $BufrFile -#echo 'set unpack=1;print "[longitude]";' | ${tools_dir}bufr_filter - $tempOut > $tempText +#echo 'set unpack=1;print "[longitude]";' | ${tools_dir}/bufr_filter - $BufrFile +#echo 'set unpack=1;print "[longitude]";' | ${tools_dir}/bufr_filter - $tempOut > $tempText #cat > $tempRef << EOF #-1e+100 -172.14317 -1e+100 -170.17433 -169.407 -168.9308 -168.49104 -167.98389 #-166.95331 -166.52921 -166.06108 -165.66135 -164.99666 -164.67058 -164.23764 @@ -62,13 +62,13 @@ EOF # The latitude is out of range. So we expect this to fail set +e -${tools_dir}bufr_filter -o $tempOut $tempRules $BufrFile 2>/dev/null +${tools_dir}/bufr_filter -o $tempOut $tempRules $BufrFile 2>/dev/null status=$? set -e [ $status -ne 0 ] export ECCODES_BUFR_SET_TO_MISSING_IF_OUT_OF_RANGE=1 -${tools_dir}bufr_filter -o $tempOut $tempRules $BufrFile +${tools_dir}/bufr_filter -o $tempOut $tempRules $BufrFile unset ECCODES_BUFR_SET_TO_MISSING_IF_OUT_OF_RANGE # ------------------------ diff --git a/tests/ecc-393.sh b/tests/ecc-393.sh index 9e423b5ad..6fa55131b 100755 --- a/tests/ecc-393.sh +++ b/tests/ecc-393.sh @@ -31,24 +31,24 @@ cat > $tempRules <$tempText +${tools_dir}/bufr_compare -b '#5#channelQualityFlagsForAtovs' $tempOut $BufrFile >$tempText status=$? set -e [ $status -eq 1 ] diff --git a/tests/get_fail.sh b/tests/get_fail.sh index 629a6705a..01d5c3e8b 100755 --- a/tests/get_fail.sh +++ b/tests/get_fail.sh @@ -14,7 +14,7 @@ REDIRECT=/dev/null set +e -${tools_dir}grib_get -p gribname ${data_dir}/regular_latlon_surface.grib1 2> $REDIRECT > $REDIRECT +${tools_dir}/grib_get -p gribname ${data_dir}/regular_latlon_surface.grib1 2> $REDIRECT > $REDIRECT if [ $? -eq 0 ] then diff --git a/tests/grib1to2.sh b/tests/grib1to2.sh index 23c0c49ae..c979a8e39 100755 --- a/tests/grib1to2.sh +++ b/tests/grib1to2.sh @@ -34,30 +34,30 @@ do file=${data_dir}/$f output=${file}.grib2_ rm -f ${output} - ${tools_dir}grib_set -s editionNumber=2 ${file}.grib1 ${output} 2> $REDIRECT > $REDIRECT + ${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 ${output}` + 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 ${output}` if [ "$grib1Statistics" != "$grib2Statistics" ]; then exit 1 fi - #${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 + #${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 -#sed "s:toolsdir:${tools_dir}:" ${tools_dir}grib1to2.txt > ${tools_dir}grib1to2.test -#chmod +x ${tools_dir}grib1to2.test -#${tools_dir}grib1to2.test -f ${data_dir}/test.grib1 ${data_dir}/test.grib2 -#${tools_dir}grib_get -p typeOfProcessedData:s,type:s ${data_dir}/test.grib2 > ${data_dir}/typeOfProcessedData.log +#sed "s:toolsdir:${tools_dir}/:" ${tools_dir}/grib1to2.txt > ${tools_dir}/grib1to2.test +#chmod +x ${tools_dir}/grib1to2.test +#${tools_dir}/grib1to2.test -f ${data_dir}/test.grib1 ${data_dir}/test.grib2 +#${tools_dir}/grib_get -p typeOfProcessedData:s,type:s ${data_dir}/test.grib2 > ${data_dir}/typeOfProcessedData.log #diff ${data_dir}/typeOfProcessedData.log ${data_dir}/typeOfProcessedData.ok -#${tools_dir}grib_compare -Pe ${data_dir}/test.grib1 ${data_dir}/test.grib2 +#${tools_dir}/grib_compare -Pe ${data_dir}/test.grib1 ${data_dir}/test.grib2 #rm -f ${data_dir}/test.grib2 diff --git a/tests/grib2to1.sh b/tests/grib2to1.sh index 945d56817..5697d6a09 100755 --- a/tests/grib2to1.sh +++ b/tests/grib2to1.sh @@ -33,16 +33,16 @@ do file=${data_dir}/$f output=${file}.grib1_ rm -f ${output} || true - ${tools_dir}grib_set -s editionNumber=1 ${file}.grib2 ${output} 2> $REDIRECT > $REDIRECT + ${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}` - grib2Statistics=`${tools_dir}grib_get -fp numberOfValues,numberOfPoints,max,min,average,numberOfMissing ${file}.grib2` + 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 exit 1 fi - #${tools_dir}grib_compare -A1.0e-8 -c values ${output} ${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 ${output} done @@ -64,10 +64,10 @@ while [ $i -le $COUNT ]; do done echo "};write;" >> $filter # Apply this filter to a grib2 file from samples. -${tools_dir}grib_filter -o temp.pv.grib2 $filter $ECCODES_SAMPLES_PATH/reduced_gg_ml_grib2.tmpl +${tools_dir}/grib_filter -o temp.pv.grib2 $filter $ECCODES_SAMPLES_PATH/reduced_gg_ml_grib2.tmpl # Convert this new grib2 file to grib1. This command SHOULD FAIL set +e -${tools_dir}grib_set -s edition=1 temp.pv.grib2 temp.bad.grib1 2>$REDIRECT +${tools_dir}/grib_set -s edition=1 temp.pv.grib2 temp.bad.grib1 2>$REDIRECT if [ $? -eq 0 ]; then echo "ERROR: Conversion from grib2 to grib1 should have failed for large NV!" >&2 exit 1 diff --git a/tests/grib_compare.sh b/tests/grib_compare.sh index c1ac5ff76..7852f8523 100755 --- a/tests/grib_compare.sh +++ b/tests/grib_compare.sh @@ -17,20 +17,20 @@ outfile=${infile}.compare.$$ rm -f $outfile -${tools_dir}grib_set -s shortName=2d $infile $outfile -${tools_dir}grib_compare -b indicatorOfParameter,paramId,shortName $infile $outfile > $REDIRECT +${tools_dir}/grib_set -s shortName=2d $infile $outfile +${tools_dir}/grib_compare -b indicatorOfParameter,paramId,shortName $infile $outfile > $REDIRECT # Test the -r switch # ---------------------------------------- infile=${data_dir}/v.grib2 for i in 1 2 3; do - ${tools_dir}grib_copy -wcount=$i $infile temp_comp.$i + ${tools_dir}/grib_copy -wcount=$i $infile temp_comp.$i done cat temp_comp.1 temp_comp.2 temp_comp.3 > temp_comp.123 cat temp_comp.3 temp_comp.2 temp_comp.1 > temp_comp.321 # Compare files in which the messages are not in the same order -${tools_dir}grib_compare -r temp_comp.123 temp_comp.321 +${tools_dir}/grib_compare -r temp_comp.123 temp_comp.321 rm -f temp_comp.1 temp_comp.2 temp_comp.3 temp_comp.123 temp_comp.321 @@ -39,29 +39,29 @@ rm -f temp_comp.1 temp_comp.2 temp_comp.3 temp_comp.123 temp_comp.321 temp_dir=tempdir.grib_compare mkdir -p $temp_dir cp $infile $temp_dir -${tools_dir}grib_compare $infile $temp_dir +${tools_dir}/grib_compare $infile $temp_dir rm -rf $temp_dir # ECC-245: blacklist and 2nd order packing # ---------------------------------------- temp1=grib_compare_temp1.grib temp2=grib_compare_temp2.grib -${tools_dir}grib_copy -w count=25 ${data_dir}/lfpw.grib1 $temp1 -${tools_dir}grib_copy -w count=30 ${data_dir}/lfpw.grib1 $temp2 +${tools_dir}/grib_copy -w count=25 ${data_dir}/lfpw.grib1 $temp1 +${tools_dir}/grib_copy -w count=30 ${data_dir}/lfpw.grib1 $temp2 # This should fail but not crash! so check exit code is not 134 set +e -${tools_dir}grib_compare -b firstOrderValues $temp1 $temp2 >/dev/null +${tools_dir}/grib_compare -b firstOrderValues $temp1 $temp2 >/dev/null status=$? set -e [ $status -eq 1 ] # GRIB-915: blacklisting totalLength key -${tools_dir}grib_copy -w count=1 ${data_dir}/v.grib2 $temp1 -${tools_dir}grib_copy -w count=2 ${data_dir}/v.grib2 $temp2 +${tools_dir}/grib_copy -w count=1 ${data_dir}/v.grib2 $temp1 +${tools_dir}/grib_copy -w count=2 ${data_dir}/v.grib2 $temp2 # This should fail as we only blacklisted one key set +e -${tools_dir}grib_compare -b totalLength $temp1 $temp2 >/dev/null +${tools_dir}/grib_compare -b totalLength $temp1 $temp2 >/dev/null status=$? set -e [ $status -eq 1 ] @@ -69,13 +69,13 @@ set -e # ECC-355: -R with "all" option # ---------------------------------------- -${tools_dir}grib_copy -w count=1 ${data_dir}/tigge_cf_ecmwf.grib2 $temp1 -${tools_dir}grib_copy -w count=1 ${data_dir}/tigge_pf_ecmwf.grib2 $temp2 +${tools_dir}/grib_copy -w count=1 ${data_dir}/tigge_cf_ecmwf.grib2 $temp1 +${tools_dir}/grib_copy -w count=1 ${data_dir}/tigge_pf_ecmwf.grib2 $temp2 BLACKLIST="typeOfProcessedData,typeOfEnsembleForecast,perturbationNumber" # Specify relative tolerances for each floating point key -${tools_dir}grib_compare -b $BLACKLIST -R referenceValue=0.03,codedValues=2 $temp1 $temp2 +${tools_dir}/grib_compare -b $BLACKLIST -R referenceValue=0.03,codedValues=2 $temp1 $temp2 # Now try the "all" option with the highest relative diff value -${tools_dir}grib_compare -b $BLACKLIST -R all=2 $temp1 $temp2 +${tools_dir}/grib_compare -b $BLACKLIST -R all=2 $temp1 $temp2 rm -f $temp1 $temp2 diff --git a/tests/grib_dump.sh b/tests/grib_dump.sh index d64ee8370..52eb222e6 100755 --- a/tests/grib_dump.sh +++ b/tests/grib_dump.sh @@ -68,6 +68,6 @@ v.grib2 for file in $files; do if [ -f ${data_dir}/$file ]; then - ${tools_dir}grib_dump -O ${data_dir}/$file 2> $REDIRECT > $REDIRECT + ${tools_dir}/grib_dump -O ${data_dir}/$file 2> $REDIRECT > $REDIRECT fi done diff --git a/tests/grib_dump_debug.sh b/tests/grib_dump_debug.sh index f81c7dc34..24da96e12 100755 --- a/tests/grib_dump_debug.sh +++ b/tests/grib_dump_debug.sh @@ -68,6 +68,6 @@ v.grib2 for file in $files; do if [ -f ${data_dir}/$file ]; then - ${tools_dir}grib_dump -Da ${data_dir}/$file 2> $REDIRECT > $REDIRECT + ${tools_dir}/grib_dump -Da ${data_dir}/$file 2> $REDIRECT > $REDIRECT fi done diff --git a/tests/grib_filter.sh b/tests/grib_filter.sh index ed5b3aeb0..ac8f6e7ee 100755 --- a/tests/grib_filter.sh +++ b/tests/grib_filter.sh @@ -16,7 +16,7 @@ if [ -f ${data_dir}/geavg.t12z.pgrbaf108 ] then tmpdata=grib_api.$$.grib 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 fi @@ -26,7 +26,7 @@ EOF [ -d ${data_dir}/split ] || mkdir -p ${data_dir}/split -${tools_dir}grib_filter ${data_dir}/f.rules ${data_dir}/tigge_pf_ecmwf.grib2 2> $REDIRECT > $REDIRECT +${tools_dir}/grib_filter ${data_dir}/f.rules ${data_dir}/tigge_pf_ecmwf.grib2 2> $REDIRECT > $REDIRECT rm -f ${data_dir}/split/* rmdir ${data_dir}/split @@ -39,14 +39,14 @@ set center="john"; EOF # Invoke without -f i.e. should fail if error encountered set +e -${tools_dir}grib_filter ${data_dir}/nonexkey.rules ${data_dir}/tigge_pf_ecmwf.grib2 2> $REDIRECT > $REDIRECT +${tools_dir}/grib_filter ${data_dir}/nonexkey.rules ${data_dir}/tigge_pf_ecmwf.grib2 2> $REDIRECT > $REDIRECT if [ $? -eq 0 ]; then echo "grib_filter should have failed if key not found" >&2 exit 1 fi set -e # Now repeat with -f option (do not exit on error) -${tools_dir}grib_filter -f ${data_dir}/nonexkey.rules ${data_dir}/tigge_pf_ecmwf.grib2 2> $REDIRECT > $REDIRECT +${tools_dir}/grib_filter -f ${data_dir}/nonexkey.rules ${data_dir}/tigge_pf_ecmwf.grib2 2> $REDIRECT > $REDIRECT rm -f ${data_dir}/nonexkey.rules @@ -57,7 +57,7 @@ cat > ${data_dir}/formatint.rules </dev/null +${tools_dir}//grib_filter ${data_dir}/binop.rules $ECCODES_SAMPLES_PATH/gg_sfc_grib1.tmpl >/dev/null # GRIB-526 grib_filter very picky about format of floats @@ -114,18 +114,18 @@ set values = { .4, 45. }; EOF -${tools_dir}/grib_filter temp.filt $ECCODES_SAMPLES_PATH/GRIB1.tmpl +${tools_dir}//grib_filter temp.filt $ECCODES_SAMPLES_PATH/GRIB1.tmpl # Test reading from stdin -echo 'set centre="kwbc";write;' | ${tools_dir}/grib_filter -o temp_filt.grib2 - $ECCODES_SAMPLES_PATH/GRIB2.tmpl -result=`${tools_dir}/grib_get -p centre temp_filt.grib2` +echo 'set centre="kwbc";write;' | ${tools_dir}//grib_filter -o temp_filt.grib2 - $ECCODES_SAMPLES_PATH/GRIB2.tmpl +result=`${tools_dir}//grib_get -p centre temp_filt.grib2` [ "$result" = "kwbc" ] # ECC-365: placeholder in the output filename ######################################################## input=${data_dir}/tigge_cf_ecmwf.grib2 -echo 'write;' | ${tools_dir}/grib_filter -o 'temp.out.gfilter.[date].[level].grib' - $input +echo 'write;' | ${tools_dir}//grib_filter -o 'temp.out.gfilter.[date].[level].grib' - $input [ -f temp.out.gfilter.20070122.925.grib ] [ -f temp.out.gfilter.20070122.320.grib ] [ -f temp.out.gfilter.20070122.2.grib ] @@ -134,7 +134,7 @@ echo 'write;' | ${tools_dir}/grib_filter -o 'temp.out.gfilter.[date].[level].gri [ -f temp.out.gfilter.20060630.0.grib ] [ -f temp.out.gfilter.20060623.0.grib ] # Check the contents of one of the output files -c=`${tools_dir}/grib_count temp.out.gfilter.20070122.320.grib` +c=`${tools_dir}//grib_count temp.out.gfilter.20070122.320.grib` [ "$c" = 1 ] grib_check_key_equals temp.out.gfilter.20070122.320.grib "date,level" "20070122 320" rm -f temp.out.gfilter.*.grib diff --git a/tests/grib_png.sh b/tests/grib_png.sh index fe36c0347..e2fc753e9 100755 --- a/tests/grib_png.sh +++ b/tests/grib_png.sh @@ -34,10 +34,10 @@ fi for file in $files; do infile=${data_dir}/$file - ${tools_dir}grib_set -r -s packingType=grid_png $infile $temp >/dev/null + ${tools_dir}/grib_set -r -s packingType=grid_png $infile $temp >/dev/null - ${tools_dir}grib_get '-F%.2f' -p min,max,avg $infile > $temp1 - ${tools_dir}grib_get '-F%.2f' -p min,max,avg $temp > $temp2 + ${tools_dir}/grib_get '-F%.2f' -p min,max,avg $infile > $temp1 + ${tools_dir}/grib_get '-F%.2f' -p min,max,avg $temp > $temp2 diff $temp1 $temp2 rm -f $temp $temp1 $temp2 diff --git a/tests/grib_to_netcdf.sh b/tests/grib_to_netcdf.sh index 107687fdc..4e77bd36f 100755 --- a/tests/grib_to_netcdf.sh +++ b/tests/grib_to_netcdf.sh @@ -19,7 +19,7 @@ rm -f $tmp_out | true # 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. -${tools_dir}grib_to_netcdf > $tmp_out +${tools_dir}/grib_to_netcdf > $tmp_out grep 'ecCodes was not compiled with NETCDF enabled' $tmp_out > /dev/null if [ $? -eq 0 ]; then # Message was found @@ -53,8 +53,8 @@ do do rm -f $tmp_netcdf | true 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 + ${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 fi done done @@ -62,10 +62,10 @@ done # Try creating different kinds; netcdf3 classic and large # TODO: enable tests for netcdf4 formats too input=${data_dir}/regular_latlon_surface.grib2 -${tools_dir}grib_to_netcdf -k 1 -o $tmp_netcdf $input >/dev/null -${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 +${tools_dir}/grib_to_netcdf -k 1 -o $tmp_netcdf $input >/dev/null +${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 diff --git a/tests/grib_util_set_spec.sh b/tests/grib_util_set_spec.sh index 26aacc907..623b94ca9 100755 --- a/tests/grib_util_set_spec.sh +++ b/tests/grib_util_set_spec.sh @@ -22,21 +22,21 @@ rm -f $outfile # GRIB1 with local definition for MARS. Convert to edition2 and remove local def ${test_dir}grib_util_set_spec -e 2 -r $infile $outfile > /dev/null -res=`${tools_dir}grib_get -p edition,section2Used,Ni,Nj,numberOfValues,bitsPerValue $outfile` +res=`${tools_dir}/grib_get -p edition,section2Used,Ni,Nj,numberOfValues,bitsPerValue $outfile` [ "$res" = "2 0 17 14 238 24" ] # Check output file geometry -${tools_dir}grib_get_data $outfile > /dev/null +${tools_dir}/grib_get_data $outfile > /dev/null # Remove the local definition from input -${tools_dir}grib_set -s deleteLocalDefinition=1 $infile $tempOut +${tools_dir}/grib_set -s deleteLocalDefinition=1 $infile $tempOut ${test_dir}grib_util_set_spec $tempOut $outfile > /dev/null # Add another grib1 local definition (which is not in grib2) -${tools_dir}grib_set -s setLocalDefinition=1,localDefinitionNumber=5 $infile $tempOut +${tools_dir}/grib_set -s setLocalDefinition=1,localDefinitionNumber=5 $infile $tempOut infile=$tempOut ${test_dir}grib_util_set_spec -r -e 2 $tempOut $outfile > /dev/null -res=`${tools_dir}grib_get -p edition,section2Used $outfile` +res=`${tools_dir}/grib_get -p edition,section2Used $outfile` [ "$res" = "2 0" ] # GRIB2 input with local definition @@ -55,7 +55,7 @@ if [ x"$HAVE_JPEG" != "x" ]; then if [ $HAVE_JPEG -eq 1 ]; then infile=../data/latlon.grib ${test_dir}grib_util_set_spec -e 2 -p grid_jpeg $infile $outfile > /dev/null - res=`${tools_dir}grib_get -p edition,section2Used,packingType $outfile` + res=`${tools_dir}/grib_get -p edition,section2Used,packingType $outfile` [ "$res" = "2 1 grid_jpeg" ] fi fi @@ -68,18 +68,18 @@ infile=../data/reduced_gaussian_model_level.grib2 outfile=out.grib_util_set_spec.grib rm -f $outfile -stats_old=`${tools_dir}grib_get -F%.2f -p min,max $infile` +stats_old=`${tools_dir}/grib_get -F%.2f -p min,max $infile` [ "$stats_old" = "160.25 224.45" ] ${test_dir}grib_util_set_spec -p grid_second_order $infile $outfile # Check output file. Values are scaled up by 1.1 grib_check_key_equals $outfile packingType grid_second_order -stats_new=`${tools_dir}grib_get -F%.2f -p min,max $outfile` +stats_new=`${tools_dir}/grib_get -F%.2f -p min,max $outfile` [ "$stats_new" = "176.28 246.90" ] -${tools_dir}grib_get_data $outfile > /dev/null -CHECK_TOOL="${tools_dir}grib_check_gaussian_grid" +${tools_dir}/grib_get_data $outfile > /dev/null +CHECK_TOOL="${tools_dir}/grib_check_gaussian_grid" if [ -x $CHECK_TOOL ]; then $CHECK_TOOL $outfile fi @@ -91,7 +91,7 @@ rm -f $outfile ${test_dir}grib_util_set_spec $infile $outfile grib_check_key_equals $outfile "packingType,const" "grid_simple 1" -${tools_dir}grib_get_data $outfile > /dev/null +${tools_dir}/grib_get_data $outfile > /dev/null ### Clean up diff --git a/tests/gridType.sh b/tests/gridType.sh index 116056a96..1dc777a77 100755 --- a/tests/gridType.sh +++ b/tests/gridType.sh @@ -15,9 +15,9 @@ REDIRECT=/dev/null tmpdata=grib_api.gridType.grib rm -f $tmpdata -${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 -gridType=`${tools_dir}grib_get -p gridType $tmpdata` +gridType=`${tools_dir}/grib_get -p gridType $tmpdata` if [ $gridType != "regular_gg" ] then echo "Unable to change from reduced_latlon to regular_gg" @@ -27,9 +27,9 @@ fi rm -f $tmpdata -${tools_dir}grib_set -s gridType=reduced_gg ${data_dir}/regular_gaussian_pressure_level.grib1 ${tmpdata} > $REDIRECT +${tools_dir}/grib_set -s gridType=reduced_gg ${data_dir}/regular_gaussian_pressure_level.grib1 ${tmpdata} > $REDIRECT -gridType=`${tools_dir}grib_get -p gridType $tmpdata` +gridType=`${tools_dir}/grib_get -p gridType $tmpdata` if [ $gridType != "reduced_gg" ] then echo "Unable to change from regular_gg to reduced_gg" @@ -43,11 +43,11 @@ rm -f $tmpdata # gridName ########### for f in $ECCODES_SAMPLES_PATH/regular_gg_ml_grib*tmpl; do - gname=`${tools_dir}grib_get -p gridName $f` + gname=`${tools_dir}/grib_get -p gridName $f` [ "$gname" = "F32" ] done for f in $ECCODES_SAMPLES_PATH/reduced_gg_pl_512_grib*.tmpl; do - gname=`${tools_dir}grib_get -p gridName $f` + gname=`${tools_dir}/grib_get -p gridName $f` [ "$gname" = "N512" ] done diff --git a/tests/gts_compare.sh b/tests/gts_compare.sh index cfa25614c..0704438f7 100755 --- a/tests/gts_compare.sh +++ b/tests/gts_compare.sh @@ -35,7 +35,7 @@ fBufrInput2=${label}".bufr.input2" gts_file="EGRR20150317121020_00493212.DAT" echo "Test: comparing the same files" >> $fLog echo "file: $gts_file" >> $fLog -${tools_dir}/gts_compare $gts_file $gts_file +${tools_dir}//gts_compare $gts_file $gts_file #---------------------------------------------------- # Test: comparing two different files @@ -44,9 +44,9 @@ cat > $fRules<> $fLog +${tools_dir}//gts_compare -b GG $gts_file $fGtsTmp >> $fLog #Clean up rm -f $fLog $fGtsTmp $fRules diff --git a/tests/ieee.sh b/tests/ieee.sh index 09727ec7a..c1bf5c0f4 100755 --- a/tests/ieee.sh +++ b/tests/ieee.sh @@ -34,51 +34,51 @@ cat > r.filter < $outsimple.txt +${tools_dir}/grib_filter r.filter $outsimple > $outsimple.txt diff $outsimple.txt ${data_dir}/ieee_test.good -${tools_dir}grib_set -r -s packingType=grid_ieee $outsimple $out32 -${tools_dir}grib_filter r.filter $out32 > $out32.txt +${tools_dir}/grib_set -r -s packingType=grid_ieee $outsimple $out32 +${tools_dir}/grib_filter r.filter $out32 > $out32.txt diff $out32.txt ${data_dir}/ieee_test.good # Disabled for now. See GRIB-2 and GRIB-80 #GRIB_IEEE_PACKING=32 #export GRIB_IEEE_PACKING -#${tools_dir}grib_filter -o $out32 w.filter $infile -#${tools_dir}grib_filter r.filter $out32 > $out32.txt +#${tools_dir}/grib_filter -o $out32 w.filter $infile +#${tools_dir}/grib_filter r.filter $out32 > $out32.txt #diff $out32.txt ${data_dir}/ieee_test.good #GRIB_IEEE_PACKING=64 #export GRIB_IEEE_PACKING -#${tools_dir}grib_filter -o $out64 w.filter $infile -#${tools_dir}grib_filter r.filter $out64 > $out64.txt +#${tools_dir}/grib_filter -o $out64 w.filter $infile +#${tools_dir}/grib_filter r.filter $out64 > $out64.txt #diff $out64.txt ${data_dir}/ieee_test.good rm -f $outsimple $out32 $out64 $out32.txt $out64.txt rm -f ${data_dir}/$outsimple.txt ${data_dir}/$out32.txt ${data_dir}/$out64.txt rm -f w.filter $outsimple.txt -${tools_dir}grib_filter r.filter $shdata > $shdata.txt +${tools_dir}/grib_filter r.filter $shdata > $shdata.txt diff $shdata.txt $shdata.good -${tools_dir}grib_set -r -s packingType=grid_ieee $shdata ${shdata}_ieee -${tools_dir}grib_filter r.filter ${shdata}_ieee > $shdata.txt +${tools_dir}/grib_set -r -s packingType=grid_ieee $shdata ${shdata}_ieee +${tools_dir}/grib_filter r.filter ${shdata}_ieee > $shdata.txt diff $shdata.txt $shdata.good rm -f ${shdata}_ieee ########################## #GRIB_IEEE_PACKING=32 #export GRIB_IEEE_PACKING -#${tools_dir}grib_copy -r $shdata ${shdata}_32 -#${tools_dir}grib_filter r.filter ${shdata}_32 > ${shdata}_32.txt +#${tools_dir}/grib_copy -r $shdata ${shdata}_32 +#${tools_dir}/grib_filter r.filter ${shdata}_32 > ${shdata}_32.txt #diff ${shdata}_32.txt ${shdata}_32.good #GRIB_IEEE_PACKING=64 #export GRIB_IEEE_PACKING -#${tools_dir}grib_copy -r $shdata ${shdata}_64 -#${tools_dir}grib_filter r.filter ${shdata}_64 > ${shdata}_64.txt +#${tools_dir}/grib_copy -r $shdata ${shdata}_64 +#${tools_dir}/grib_filter r.filter ${shdata}_64 > ${shdata}_64.txt #diff ${shdata}_64.txt ${shdata}.good rm -f r.filter ${shdata}_64.txt ${shdata}_32.txt $shdata.txt diff --git a/tests/include.ctest.sh.in b/tests/include.ctest.sh.in index 783d0d92f..2d00d1c00 100644 --- a/tests/include.ctest.sh.in +++ b/tests/include.ctest.sh.in @@ -16,13 +16,13 @@ ECCODES_DEFINITION_PATH="${def_dir}" export ECCODES_DEFINITION_PATH # binaries are in the TOP CMAKE_BINARY_DIR -tools_dir=@CMAKE_BINARY_DIR@/bin/ +tools_dir=@CMAKE_BINARY_DIR@/bin tigge_dir=@CMAKE_BINARY_DIR@/bin/ # If this environment variable is set, then run the # executables with valgrind if test "x$ECCODES_TEST_WITH_VALGRIND" != "x"; then - tools_dir="valgrind --error-exitcode=1 -q @CMAKE_BINARY_DIR@/bin/" + tools_dir="valgrind --error-exitcode=1 -q @CMAKE_BINARY_DIR@/bin" fi # ecCodes tests are in the PROJECT_BINARY_DIR diff --git a/tests/include.sh b/tests/include.sh index a5a12a8cd..9a304089f 100644 --- a/tests/include.sh +++ b/tests/include.sh @@ -39,10 +39,10 @@ else export ECCODES_DEFINITION_PATH ECCODES_SAMPLES_PATH=$cpath/samples export ECCODES_SAMPLES_PATH - tools_dir=$cpath/tools/ + tools_dir=$cpath/tools if test "x$ECCODES_TEST_WITH_VALGRIND" != "x"; then - tools_dir="valgrind --error-exitcode=1 -q $cpath/tools/" + tools_dir="valgrind --error-exitcode=1 -q $cpath/tools" fi tigge_dir=$cpath/tigge/ @@ -51,7 +51,7 @@ else def_dir=$cpath/definitions src_dir=$cpath/src else - tools_dir="" + tools_dir="." tigge_dir="" fi diff --git a/tests/index.sh b/tests/index.sh index 76f148d61..c3857ebd1 100755 --- a/tests/index.sh +++ b/tests/index.sh @@ -33,13 +33,13 @@ rm -f index.out out.gribidx # Test grib_index_build #------------------------------- tempIndex=temp.$$.ix -${tools_dir}grib_index_build -o $tempIndex ${infile} >/dev/null -${tools_dir}grib_dump -D ${tempIndex} > /dev/null +${tools_dir}/grib_index_build -o $tempIndex ${infile} >/dev/null +${tools_dir}/grib_dump -D ${tempIndex} > /dev/null -${tools_dir}grib_index_build -k mars.levtype -o $tempIndex ${data_dir}/tigge_cf_ecmwf.grib2 |\ +${tools_dir}/grib_index_build -k mars.levtype -o $tempIndex ${data_dir}/tigge_cf_ecmwf.grib2 |\ grep -q "mars.levtype = { sfc, pl, pv, pt }" -${tools_dir}grib_index_build -k mars.levtype:i -o $tempIndex ${data_dir}/tigge_cf_ecmwf.grib2 |\ +${tools_dir}/grib_index_build -k mars.levtype:i -o $tempIndex ${data_dir}/tigge_cf_ecmwf.grib2 |\ grep -q "mars.levtype = { 103, 1, 106, 100, 101, 8, 109, 107 }" rm -f $tempIndex diff --git a/tests/iterator.sh b/tests/iterator.sh index 24451e2f1..018a5aede 100755 --- a/tests/iterator.sh +++ b/tests/iterator.sh @@ -24,8 +24,8 @@ files="reduced_latlon_surface.grib1 \ for f in `echo $files` do file=${data_dir}/$f - iterator_count=`${tools_dir}grib_get_data -m 9999:missing -f -p centre -F "%g" -w count=1 $file | grep -v Lat |wc -l ` - numberOfPoints=`${tools_dir}grib_get -w count=1 -p numberOfPoints $file` + iterator_count=`${tools_dir}/grib_get_data -m 9999:missing -f -p centre -F "%g" -w count=1 $file | grep -v Lat |wc -l ` + numberOfPoints=`${tools_dir}/grib_get -w count=1 -p numberOfPoints $file` [ $numberOfPoints = ${iterator_count} ] done diff --git a/tests/jpeg.sh b/tests/jpeg.sh index aac4abe2e..e197125da 100755 --- a/tests/jpeg.sh +++ b/tests/jpeg.sh @@ -39,12 +39,12 @@ outfile2=$infile.tmp_jpeg.2 rm -f $outfile1 $outfile2 -${tools_dir}grib_set -s packingType=grid_simple $infile $outfile1 -${tools_dir}grib_compare -P -b $BLACKLIST,typeOfCompressionUsed,targetCompressionRatio $infile $outfile1 > $REDIRECT -${tools_dir}grib_set -s packingType=grid_jpeg $outfile1 $outfile2 -${tools_dir}grib_compare -P -b $BLACKLIST $outfile1 $outfile2 > $REDIRECT +${tools_dir}/grib_set -s packingType=grid_simple $infile $outfile1 +${tools_dir}/grib_compare -P -b $BLACKLIST,typeOfCompressionUsed,targetCompressionRatio $infile $outfile1 > $REDIRECT +${tools_dir}/grib_set -s packingType=grid_jpeg $outfile1 $outfile2 +${tools_dir}/grib_compare -P -b $BLACKLIST $outfile1 $outfile2 > $REDIRECT -templateNumber=`${tools_dir}grib_get -p dataRepresentationTemplateNumber $outfile2` +templateNumber=`${tools_dir}/grib_get -p dataRepresentationTemplateNumber $outfile2` if [ $templateNumber -ne 40 ] then @@ -57,21 +57,21 @@ rm -f $outfile1 $outfile2 infile=${data_dir}/reduced_latlon_surface.grib2 outfile1=$infile.tmp_jpeg.1 outfile2=$infile.tmp_jpeg.2 -${tools_dir}grib_set -s packingType=grid_jpeg $infile $outfile1 -${tools_dir}grib_compare -P -b $BLACKLIST $infile $outfile1 > $REDIRECT -${tools_dir}grib_set -s packingType=grid_simple $outfile1 $outfile2 -${tools_dir}grib_compare -P -b $BLACKLIST,typeOfCompressionUsed,targetCompressionRatio $outfile1 $outfile2 > $REDIRECT +${tools_dir}/grib_set -s packingType=grid_jpeg $infile $outfile1 +${tools_dir}/grib_compare -P -b $BLACKLIST $infile $outfile1 > $REDIRECT +${tools_dir}/grib_set -s packingType=grid_simple $outfile1 $outfile2 +${tools_dir}/grib_compare -P -b $BLACKLIST,typeOfCompressionUsed,targetCompressionRatio $outfile1 $outfile2 > $REDIRECT -res1=`${tools_dir}grib_get '-F%1.2f' -p min,max,avg $infile` -res2=`${tools_dir}grib_get '-F%1.2f' -p min,max,avg $outfile1` -res3=`${tools_dir}grib_get '-F%1.2f' -p min,max,avg $outfile2` +res1=`${tools_dir}/grib_get '-F%1.2f' -p min,max,avg $infile` +res2=`${tools_dir}/grib_get '-F%1.2f' -p min,max,avg $outfile1` +res3=`${tools_dir}/grib_get '-F%1.2f' -p min,max,avg $outfile2` [ "$res1" = "$res2" ] [ "$res1" = "$res3" ] rm -f $outfile2 # GRIB-564 nearest 4 neighbours with JPEG packing -res=`${tools_dir}grib_get -l 0,50 $outfile1` +res=`${tools_dir}/grib_get -l 0,50 $outfile1` [ "$res" = "2.47244 2.47244 2.5115 2.51931 " ] rm -f $outfile1 @@ -83,7 +83,7 @@ infile=${data_dir}/jpeg.grib2 outfile=$infile.temp.const tempFilter1=temp.grib_jpeg_test1.filt tempFilter2=temp.grib_jpeg_test2.filt -numberOfValuesOrig=`${tools_dir}grib_get -p numberOfValues $infile` +numberOfValuesOrig=`${tools_dir}/grib_get -p numberOfValues $infile` # Create a filter to print the values. This will be used to create another filter cat > $tempFilter1 < $tempFilter1 < $tempFilter2 # Apply the new filter to create the constant field JPEG file -${tools_dir}grib_filter -o $outfile $tempFilter2 $infile +${tools_dir}/grib_filter -o $outfile $tempFilter2 $infile numberOfValuesNew=`expr $numberOfValuesOrig + 1` grib_check_key_equals $outfile "numberOfValues" $numberOfValuesNew rm -f $tempFilter1 $tempFilter2 diff --git a/tests/lamb_az_eq_area.sh b/tests/lamb_az_eq_area.sh index 425bac515..07e65337b 100755 --- a/tests/lamb_az_eq_area.sh +++ b/tests/lamb_az_eq_area.sh @@ -41,13 +41,13 @@ write "lamb_az_eq_area.grib2"; EOF # Use this filter and the input GRIB to create a new GRIB -${tools_dir}grib_filter $FILTER_FILE $GRIB_INFILE +${tools_dir}/grib_filter $FILTER_FILE $GRIB_INFILE if [ ! -f "$GRIB_OUTFILE" ]; then echo Failed to create output GRIB from filter >&2 exit 1 fi # Now get the data from the newly created GRIB file -${tools_dir}grib_get_data $GRIB_OUTFILE > $DATA_OUTFILE +${tools_dir}/grib_get_data $GRIB_OUTFILE > $DATA_OUTFILE # Compare output with reference. If the diff fails, script will immediately exit with status 1 diff $DATA_OUTFILE $REF_FILE diff --git a/tests/level.sh b/tests/level.sh index 78c45a59a..997e58998 100755 --- a/tests/level.sh +++ b/tests/level.sh @@ -56,22 +56,22 @@ print "grib[edition]: level=[level] topLevel=[topLevel] bottomLevel=[bottomLevel EOF -${tools_dir}grib_filter level.filter $file > test.dump +${tools_dir}/grib_filter level.filter $file > test.dump diff temp.level.good test.dump # GRIB-492 -${tools_dir}grib_set -s indicatorOfTypeOfLevel=110 $sample_g1 $temp -res=`${tools_dir}grib_get -p indicatorOfTypeOfLevel:l,topLevel,bottomLevel $temp` +${tools_dir}/grib_set -s indicatorOfTypeOfLevel=110 $sample_g1 $temp +res=`${tools_dir}/grib_get -p indicatorOfTypeOfLevel:l,topLevel,bottomLevel $temp` [ "$res" = "110 0 0" ] # GRIB-415 evaluate level as a double -${tools_dir}grib_set -s scaledValueOfFirstFixedSurface=15,scaleFactorOfFirstFixedSurface=1 $sample_g2 $temp -res=`${tools_dir}grib_get -p level:d $temp` +${tools_dir}/grib_set -s scaledValueOfFirstFixedSurface=15,scaleFactorOfFirstFixedSurface=1 $sample_g2 $temp +res=`${tools_dir}/grib_get -p level:d $temp` [ "$res" = "1.5" ] # GRIB-637 grib2 Potential vorticity surface 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" ] rm -f level.filter temp.level.good test.dump $temp diff --git a/tests/list.sh b/tests/list.sh index 24f513368..2f8445ae3 100755 --- a/tests/list.sh +++ b/tests/list.sh @@ -23,7 +23,7 @@ EOF file="${data_dir}/reduced_gaussian_model_level.grib2" -${tools_dir}grib_filter list.filter $file +${tools_dir}/grib_filter list.filter $file cat >list.filter<list.ref<> tmp$$ + ${tools_dir}/grib_list_keys $file >> tmp$$ done cat >keys <2 for localDefinitionNumber in 1 15 26 30 do - ${tools_dir}grib_set -s localDefinitionNumber=$localDefinitionNumber,perturbationNumber=2,numberOfForecastsInEnsemble=50 loc.grib1 eps.grib1 - ${tools_dir}grib_set -s edition=2 eps.grib1 eps.grib2 + ${tools_dir}/grib_set -s localDefinitionNumber=$localDefinitionNumber,perturbationNumber=2,numberOfForecastsInEnsemble=50 loc.grib1 eps.grib1 + ${tools_dir}/grib_set -s edition=2 eps.grib1 eps.grib2 - ${tools_dir}grib_get -p localDefinitionNumber,perturbationNumber,numberOfForecastsInEnsemble,productDefinitionTemplateNumber eps.grib2 >> local.log - ${tools_dir}grib_compare -e -b param eps.grib1 eps.grib2 + ${tools_dir}/grib_get -p localDefinitionNumber,perturbationNumber,numberOfForecastsInEnsemble,productDefinitionTemplateNumber eps.grib2 >> local.log + ${tools_dir}/grib_compare -e -b param eps.grib1 eps.grib2 - ${tools_dir}grib_set -s localDefinitionNumber=$localDefinitionNumber,numberOfForecastsInEnsemble=0 loc.grib1 eps.grib1 - ${tools_dir}grib_set -s edition=2 eps.grib1 eps.grib2 + ${tools_dir}/grib_set -s localDefinitionNumber=$localDefinitionNumber,numberOfForecastsInEnsemble=0 loc.grib1 eps.grib1 + ${tools_dir}/grib_set -s edition=2 eps.grib1 eps.grib2 - ${tools_dir}grib_get -f -p localDefinitionNumber,perturbationNumber,productDefinitionTemplateNumber eps.grib2 >> local.log - ${tools_dir}grib_compare -e -b param eps.grib1 eps.grib2 + ${tools_dir}/grib_get -f -p localDefinitionNumber,perturbationNumber,productDefinitionTemplateNumber eps.grib2 >> local.log + ${tools_dir}/grib_compare -e -b param eps.grib1 eps.grib2 done #local -> local for localStart in 1 7 9 20 25 26 30 do - ${tools_dir}grib_set -s localDefinitionNumber=$localStart loc.grib1 loc1.grib1 - ${tools_dir}grib_set -s edition=2 loc1.grib1 loc1.grib2 - ${tools_dir}grib_get -p localDefinitionNumber loc1.grib1 >> local.log - ${tools_dir}grib_get -p localDefinitionNumber loc1.grib2 >> local.log + ${tools_dir}/grib_set -s localDefinitionNumber=$localStart loc.grib1 loc1.grib1 + ${tools_dir}/grib_set -s edition=2 loc1.grib1 loc1.grib2 + ${tools_dir}/grib_get -p localDefinitionNumber loc1.grib1 >> local.log + ${tools_dir}/grib_get -p localDefinitionNumber loc1.grib2 >> local.log for localEps in 1 15 26 30 do - ${tools_dir}grib_set -s localDefinitionNumber=$localEps,eps=1,perturbationNumber=2,numberOfForecastsInEnsemble=50 loc1.grib2 eps.grib2 - ${tools_dir}grib_get -p localDefinitionNumber,perturbationNumber,numberOfForecastsInEnsemble,productDefinitionTemplateNumber eps.grib2 >> local.log + ${tools_dir}/grib_set -s localDefinitionNumber=$localEps,eps=1,perturbationNumber=2,numberOfForecastsInEnsemble=50 loc1.grib2 eps.grib2 + ${tools_dir}/grib_get -p localDefinitionNumber,perturbationNumber,numberOfForecastsInEnsemble,productDefinitionTemplateNumber eps.grib2 >> local.log done done #special types/streams -${tools_dir}grib_set -s localDefinitionNumber=1,numberOfForecastsInEnsemble=0 loc.grib1 loc1.grib1 -${tools_dir}grib_set -s edition=2 loc1.grib1 loc1.grib2 -${tools_dir}grib_get -f -p localDefinitionNumber,perturbationNumber loc1.grib2 >> local.log -${tools_dir}grib_set -s type=em loc1.grib2 eps.grib2 -${tools_dir}grib_get -p localDefinitionNumber,productDefinitionTemplateNumber,derivedForecast eps.grib2 >> local.log -${tools_dir}grib_set -s type=es loc1.grib2 eps.grib2 -${tools_dir}grib_get -p localDefinitionNumber,productDefinitionTemplateNumber,derivedForecast eps.grib2 >> local.log -${tools_dir}grib_set -s stream=enda loc1.grib2 eps.grib2 #2> $REDIRECT -${tools_dir}grib_get -p localDefinitionNumber,productDefinitionTemplateNumber eps.grib2 >> local.log +${tools_dir}/grib_set -s localDefinitionNumber=1,numberOfForecastsInEnsemble=0 loc.grib1 loc1.grib1 +${tools_dir}/grib_set -s edition=2 loc1.grib1 loc1.grib2 +${tools_dir}/grib_get -f -p localDefinitionNumber,perturbationNumber loc1.grib2 >> local.log +${tools_dir}/grib_set -s type=em loc1.grib2 eps.grib2 +${tools_dir}/grib_get -p localDefinitionNumber,productDefinitionTemplateNumber,derivedForecast eps.grib2 >> local.log +${tools_dir}/grib_set -s type=es loc1.grib2 eps.grib2 +${tools_dir}/grib_get -p localDefinitionNumber,productDefinitionTemplateNumber,derivedForecast eps.grib2 >> local.log +${tools_dir}/grib_set -s stream=enda loc1.grib2 eps.grib2 #2> $REDIRECT +${tools_dir}/grib_get -p localDefinitionNumber,productDefinitionTemplateNumber eps.grib2 >> local.log diff local.log local.good.log diff --git a/tests/ls.sh b/tests/ls.sh index d685300fa..d0fef07e1 100755 --- a/tests/ls.sh +++ b/tests/ls.sh @@ -16,13 +16,13 @@ rm -f $tempLog cd ${data_dir} infile=regular_gaussian_model_level.grib1 -${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 +${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 @@ -53,37 +53,37 @@ for file in $files do [ -f "$file" ] echo $file >> $tempLog - ${tools_dir}grib_ls -l 40,28 $file | grep index | awk '{print $4;}' >> $tempLog + ${tools_dir}/grib_ls -l 40,28 $file | grep index | awk '{print $4;}' >> $tempLog done 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 -${tools_dir}grib_ls -plevels tmp_rlls.grib1 | grep MISSING>/dev/null +${tools_dir}/grib_set -s typeOfLevel=depthBelowLandLayer,topLevel=missing regular_latlon_surface.grib1 tmp_rlls.grib1 +${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 +${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 # GRIB-305. GRIB edition 1 file with one large message if [ -f "sst_globus0083.grib" ]; then - ${tools_dir}grib_ls sst_globus0083.grib > /dev/null + ${tools_dir}/grib_ls sst_globus0083.grib > /dev/null fi # GRIB-387 printing key of type byte -${tools_dir}grib_ls -p uuidOfVGrid test_uuid.grib2 > /dev/null +${tools_dir}/grib_ls -p uuidOfVGrid test_uuid.grib2 > /dev/null -type=`${tools_dir}grib_get -wcount=1 -p typeOfLevel test_uuid.grib2` +type=`${tools_dir}/grib_get -wcount=1 -p typeOfLevel test_uuid.grib2` [ "$type" = "generalVertical" ] # GRIB-213 nearest with land-sea mask temp_ls=test.grib-213.temp -${tools_dir}grib_ls -l 85,13,1,reduced_gaussian_lsm.grib1 reduced_gaussian_surface.grib1 >$temp_ls +${tools_dir}/grib_ls -l 85,13,1,reduced_gaussian_lsm.grib1 reduced_gaussian_surface.grib1 >$temp_ls grep -q 'Point chosen #3 index=21 .* distance=11\.' $temp_ls -${tools_dir}grib_ls -l 53,2,1,reduced_gaussian_lsm.grib1 reduced_gaussian_surface.grib1 >$temp_ls +${tools_dir}/grib_ls -l 53,2,1,reduced_gaussian_lsm.grib1 reduced_gaussian_surface.grib1 >$temp_ls grep -q 'Point chosen #2 index=749 .* distance=204\.' $temp_ls rm -f $temp_ls diff --git a/tests/md5.sh b/tests/md5.sh index 6ce23e5a7..7bbe32a3a 100755 --- a/tests/md5.sh +++ b/tests/md5.sh @@ -13,7 +13,7 @@ test_md5() file=$ECCODES_SAMPLES_PATH/$1 expected=$2 - result=`${tools_dir}grib_get -p md5GridSection:s $file` + result=`${tools_dir}/grib_get -p md5GridSection:s $file` [ "$result" = "$expected" ] } diff --git a/tests/metar_get.sh b/tests/metar_get.sh index 7440bde15..abbf0d46b 100755 --- a/tests/metar_get.sh +++ b/tests/metar_get.sh @@ -32,7 +32,7 @@ metar_file=metar.txt export METAR_YEAR=2015 export METAR_MONTH=4 -${tools_dir}metar_get -n ls $metar_file >/dev/null -${tools_dir}metar_get -w count=1/2/3 -p CCCC,latitude,longitude,dateTime,elevation,temperature,dewPointTemperature,qnh $metar_file +${tools_dir}/metar_get -n ls $metar_file >/dev/null +${tools_dir}/metar_get -w count=1/2/3 -p CCCC,latitude,longitude,dateTime,elevation,temperature,dewPointTemperature,qnh $metar_file rm -f $fLog diff --git a/tests/metar_ls.sh b/tests/metar_ls.sh index 8fd4fe646..55053d9e0 100755 --- a/tests/metar_ls.sh +++ b/tests/metar_ls.sh @@ -34,7 +34,7 @@ export METAR_YEAR=2015 export METAR_MONTH=4 echo $f >> $fLog -${tools_dir}metar_ls $f >> $fLog +${tools_dir}/metar_ls $f >> $fLog #------------------------------------------- # Test "-p" switch @@ -43,7 +43,7 @@ ref_ls=$f".ls.ref" res_ls=$f".ls.test" REDIRECT=/dev/null -${tools_dir}/metar_ls -pCCCC,latitude,longitude,dateTime,elevation,temperature,dewPointTemperature,qnh $f 2> $REDIRECT > $res_ls +${tools_dir}//metar_ls -pCCCC,latitude,longitude,dateTime,elevation,temperature,dewPointTemperature,qnh $f 2> $REDIRECT > $res_ls diff $ref_ls $res_ls >$REDIRECT 2> $REDIRECT diff --git a/tests/missing.sh b/tests/missing.sh index 758f7bc93..eabba1291 100755 --- a/tests/missing.sh +++ b/tests/missing.sh @@ -15,23 +15,23 @@ REDIRECT=/dev/null infile="${data_dir}/missing.grib2" outfile="${data_dir}/missing_new.grib2" -scaleFactorOfSecondFixedSurface=`${tools_dir}grib_get -w count=1 -p scaleFactorOfSecondFixedSurface $infile` +scaleFactorOfSecondFixedSurface=`${tools_dir}/grib_get -w count=1 -p scaleFactorOfSecondFixedSurface $infile` [ "$scaleFactorOfSecondFixedSurface" = "0" ] -scaledValueOfSecondFixedSurface=`${tools_dir}grib_get -w count=1 -p scaledValueOfSecondFixedSurface $infile` +scaledValueOfSecondFixedSurface=`${tools_dir}/grib_get -w count=1 -p scaledValueOfSecondFixedSurface $infile` [ "$scaledValueOfSecondFixedSurface" = "0" ] -${tools_dir}grib_set -s scaleFactorOfSecondFixedSurface=missing,scaledValueOfSecondFixedSurface=missing $infile $outfile +${tools_dir}/grib_set -s scaleFactorOfSecondFixedSurface=missing,scaledValueOfSecondFixedSurface=missing $infile $outfile -scaleFactorOfSecondFixedSurface=`${tools_dir}grib_get -w count=1 -p scaleFactorOfSecondFixedSurface $outfile` +scaleFactorOfSecondFixedSurface=`${tools_dir}/grib_get -w count=1 -p scaleFactorOfSecondFixedSurface $outfile` [ "$scaleFactorOfSecondFixedSurface" = "MISSING" ] -scaledValueOfSecondFixedSurface=`${tools_dir}grib_get -w count=1 -p scaledValueOfSecondFixedSurface $outfile` +scaledValueOfSecondFixedSurface=`${tools_dir}/grib_get -w count=1 -p scaledValueOfSecondFixedSurface $outfile` [ "$scaledValueOfSecondFixedSurface" = "MISSING" ] set +e -${tools_dir}grib_set -s centre=missing $infile $outfile 2> $REDIRECT > $REDIRECT +${tools_dir}/grib_set -s centre=missing $infile $outfile 2> $REDIRECT > $REDIRECT [ $? -ne 0 ] diff --git a/tests/multi.sh b/tests/multi.sh index 6902363b1..d21f519b8 100755 --- a/tests/multi.sh +++ b/tests/multi.sh @@ -19,15 +19,15 @@ fi tmpdata=grib_api.$$.grib rm -f $tmpdata -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" ] then echo ---------- grib_get failure exit 1 fi -${tools_dir}grib_copy -w parameterCategory=2,parameterNumber=3 ${data_dir}/multi.grib2 $tmpdata.1 -${tools_dir}grib_compare ${data_dir}/v.grib2 $tmpdata.1 +${tools_dir}/grib_copy -w parameterCategory=2,parameterNumber=3 ${data_dir}/multi.grib2 $tmpdata.1 +${tools_dir}/grib_compare ${data_dir}/v.grib2 $tmpdata.1 cat > $tmpdata.rules < $out1 - ${tools_dir}grib_get -p count,shortName,level $infile > $out2 + ${tools_dir}/grib_get -p count,shortName,level $infile > $out2 diff $out1 $out2 ${test_dir}/multi_from_message $infile > $out1 - ${tools_dir}grib_get -M -p count,shortName,level $infile > $out2 + ${tools_dir}/grib_get -M -p count,shortName,level $infile > $out2 diff $out1 $out2 rm -f $out1 $out2 | true diff --git a/tests/mybufrdc_ref.sh b/tests/mybufrdc_ref.sh index b61399e43..252295d0d 100755 --- a/tests/mybufrdc_ref.sh +++ b/tests/mybufrdc_ref.sh @@ -28,7 +28,7 @@ do rm -f $res_num | true set +e - ${tools_dir}codes_bufr_filter bufrdc_num_ref.filter $file 2> $REDIRECT > $res_num + ${tools_dir}/codes_bufr_filter bufrdc_num_ref.filter $file 2> $REDIRECT > $res_num if [ $? != 0 ] then mv $file $file.no diff --git a/tests/neg_fctime.sh b/tests/neg_fctime.sh index 932835f3b..93516909c 100755 --- a/tests/neg_fctime.sh +++ b/tests/neg_fctime.sh @@ -21,7 +21,7 @@ input=${data_dir}/sample.grib2 sample2=$ECCODES_SAMPLES_PATH/GRIB2.tmpl PDTs="0 1 2 3 8 9 10 11 12 13 14 45 46 47 48 53" for p in $PDTs; do - ${tools_dir}grib_set -s productDefinitionTemplateNumber=$p,forecastTime=-2 $sample2 $temp + ${tools_dir}/grib_set -s productDefinitionTemplateNumber=$p,forecastTime=-2 $sample2 $temp done @@ -32,33 +32,33 @@ grib_check_key_equals $input 'dataDate,dataTime' '20080206 1200' # Negative step in same day # -------------------------- -${tools_dir}grib_set -s forecastTime=-2 $input $temp +${tools_dir}/grib_set -s forecastTime=-2 $input $temp grib_check_key_equals $temp 'validityDate,validityTime' '20080206 1000' -${tools_dir}grib_set -s forecastTime=-11 $input $temp +${tools_dir}/grib_set -s forecastTime=-11 $input $temp grib_check_key_equals $temp 'validityDate,validityTime' '20080206 100' -${tools_dir}grib_set -s forecastTime=-12 $input $temp +${tools_dir}/grib_set -s forecastTime=-12 $input $temp grib_check_key_equals $temp 'validityDate,validityTime' '20080206 0' # Negative step previous day # -------------------------- -${tools_dir}grib_set -s forecastTime=-13 $input $temp +${tools_dir}/grib_set -s forecastTime=-13 $input $temp grib_check_key_equals $temp 'validityDate,validityTime' '20080205 2300' -${tools_dir}grib_set -s forecastTime=-24 $input $temp +${tools_dir}/grib_set -s forecastTime=-24 $input $temp grib_check_key_equals $temp 'validityDate,validityTime' '20080205 1200' -${tools_dir}grib_set -s forecastTime=-33 $input $temp +${tools_dir}/grib_set -s forecastTime=-33 $input $temp grib_check_key_equals $temp 'validityDate,validityTime' '20080205 300' # Negative step further back # -------------------------- -${tools_dir}grib_set -s forecastTime=-38 $input $temp +${tools_dir}/grib_set -s forecastTime=-38 $input $temp grib_check_key_equals $temp 'validityDate,validityTime' '20080204 2200' -${tools_dir}grib_set -s forecastTime=-185 $input $temp +${tools_dir}/grib_set -s forecastTime=-185 $input $temp grib_check_key_equals $temp 'validityDate,validityTime' '20080129 1900' diff --git a/tests/octahedral.sh b/tests/octahedral.sh index 0efb910d9..ce8afd762 100755 --- a/tests/octahedral.sh +++ b/tests/octahedral.sh @@ -24,7 +24,7 @@ grib_check_key_equals $input "global,isOctahedral" "1 1" grib_check_key_equals $input "numberOfDataPoints,numberOfCodedValues" "6599680 6599680" # Iterator -${tools_dir}grib_get_data $input > $temp +${tools_dir}/grib_get_data $input > $temp numlines=`wc -l $temp | awk '{print $1}'` [ "$numlines" = "6599681" ] # 1 + numberOfDataPoints diff --git a/tests/padding.sh b/tests/padding.sh index c7bc7995e..ee9c794ca 100755 --- a/tests/padding.sh +++ b/tests/padding.sh @@ -13,7 +13,7 @@ REDIRECT=/dev/null temp=loc.padding.grib1 -${tools_dir}grib_set -s setLocalDefinition=1 ${data_dir}/regular_latlon_surface.grib1 $temp +${tools_dir}/grib_set -s setLocalDefinition=1 ${data_dir}/regular_latlon_surface.grib1 $temp cat > $$_f < $l2" - ${tools_dir}grib_set -s localDefinitionNumber=$l2 locx.grib1 locy.grib1 - ${tools_dir}grib_filter $$_f locy.grib1 + ${tools_dir}/grib_set -s localDefinitionNumber=$l2 locx.grib1 locy.grib1 + ${tools_dir}/grib_filter $$_f locy.grib1 done done diff --git a/tests/second_order.sh b/tests/second_order.sh index 8cace325b..08f2ded2e 100755 --- a/tests/second_order.sh +++ b/tests/second_order.sh @@ -38,23 +38,23 @@ simple_bitmap.grib" no_packing="gen.grib|row.grib|gen_bitmap.grib|constant_width_bitmap.grib|constant_width_boust_bitmap.grib" test_data() { - ${tools_dir}grib_filter test.filter $simple > $simple.data + ${tools_dir}/grib_filter test.filter $simple > $simple.data for f in $files do - ${tools_dir}grib_filter test.filter $f > $f.data + ${tools_dir}/grib_filter test.filter $f > $f.data diff $simple.data $f.data > /dev/null - ${tools_dir}grib_compare -cvalues $f $simple + ${tools_dir}/grib_compare -cvalues $f $simple echo $f decoding test passed > $REDIRECT exclude=`echo $f | awk " /$no_packing/ {print \"found\";} "` if [ -z "$exclude" ] && [ $encoding != 0 ] then rm -f $f.copied - ${tools_dir}grib_copy -r $f $f.copied - ${tools_dir}grib_filter test.filter $f.copied > $f.copied.data + ${tools_dir}/grib_copy -r $f $f.copied + ${tools_dir}/grib_filter test.filter $f.copied > $f.copied.data diff $simple.data $f.copied.data > /dev/null - ${tools_dir}grib_compare -cvalues $f.copied $simple + ${tools_dir}/grib_compare -cvalues $f.copied $simple echo $f encoding test passed > $REDIRECT echo > $REDIRECT fi @@ -78,26 +78,26 @@ test_data # Now make sure grib_dump works on a second-order row-by-row file # See GRIB-147 -${tools_dir}grib_dump second_ord_rbr.grib1 > $REDIRECT +${tools_dir}/grib_dump second_ord_rbr.grib1 > $REDIRECT # Test nearest neighbour on second order with a bitmap # GRIB-541 sec_ord_bmp=sec_ord_bmp.$$.grib1 # Convert to second order packing -${tools_dir}grib_set -r -s packingType=grid_second_order gen_bitmap.grib $sec_ord_bmp +${tools_dir}/grib_set -r -s packingType=grid_second_order gen_bitmap.grib $sec_ord_bmp # Check there are missing values -nums=`${tools_dir}grib_get -p numberOfDataPoints,numberOfCodedValues,numberOfMissing $sec_ord_bmp` +nums=`${tools_dir}/grib_get -p numberOfDataPoints,numberOfCodedValues,numberOfMissing $sec_ord_bmp` [ "$nums" = "5969 4 5965" ] -res=`${tools_dir}grib_get -l 33,88.5 $sec_ord_bmp` +res=`${tools_dir}/grib_get -l 33,88.5 $sec_ord_bmp` [ "$res" = "9999 5.51552 9999 9999 " ] -res=`${tools_dir}/grib_get -l 28.5,90 $sec_ord_bmp` +res=`${tools_dir}//grib_get -l 28.5,90 $sec_ord_bmp` [ "$res" = "3.51552 9999 5.26552 9999 " ] # GRIB-203 nearest on M-F second order boustrophedonic -res=`${tools_dir}grib_get -w count=1 -l 0,0 lfpw.grib1` +res=`${tools_dir}/grib_get -w count=1 -l 0,0 lfpw.grib1` [ "$res" = "20560.7 20563.4 20554.7 20559.5 " ] rm -f $sec_ord_bmp diff --git a/tests/set.sh b/tests/set.sh index 10fc9f493..e3da95c49 100755 --- a/tests/set.sh +++ b/tests/set.sh @@ -17,18 +17,18 @@ outfile=${data_dir}/set.grib1 rm -f $outfile || true -${tools_dir}grib_set -v -p levtype,centre,levtype:l,centre:l -s levtype=pl,centre=80 $infile $outfile >$REDIRECT +${tools_dir}/grib_set -v -p levtype,centre,levtype:l,centre:l -s levtype=pl,centre=80 $infile $outfile >$REDIRECT -levtype=`${tools_dir}grib_get -p levtype $outfile` +levtype=`${tools_dir}/grib_get -p levtype $outfile` [ $levtype = "pl" ] -centre=`${tools_dir}grib_get -p centre $outfile` +centre=`${tools_dir}/grib_get -p centre $outfile` [ $centre = "cnmc" ] -levtype=`${tools_dir}grib_get -p levtype:l $outfile` +levtype=`${tools_dir}/grib_get -p levtype:l $outfile` [ $levtype -eq 100 ] -centre=`${tools_dir}grib_get -p centre:l $outfile` +centre=`${tools_dir}/grib_get -p centre:l $outfile` [ $centre -eq 80 ] rm -f $outfile || true @@ -38,23 +38,23 @@ outfile=${data_dir}/set.grib2 rm -f $outfile || true -${tools_dir}grib_set -v -p levtype:l,centre:s -s levtype:l=100,centre:s=cnmc $infile $outfile >$REDIRECT +${tools_dir}/grib_set -v -p levtype:l,centre:s -s levtype:l=100,centre:s=cnmc $infile $outfile >$REDIRECT -levtype=`${tools_dir}grib_get -p levtype $outfile` +levtype=`${tools_dir}/grib_get -p levtype $outfile` [ $levtype = "pl" ] -centre=`${tools_dir}grib_get -p centre $outfile` +centre=`${tools_dir}/grib_get -p centre $outfile` [ $centre = "cnmc" ] -levtype=`${tools_dir}grib_get -p levtype:l $outfile` +levtype=`${tools_dir}/grib_get -p levtype:l $outfile` [ $levtype -eq 100 ] -centre=`${tools_dir}grib_get -p centre:l $outfile` +centre=`${tools_dir}/grib_get -p centre:l $outfile` [ $centre -eq 80 ] set +e # This is expected to fail -${tools_dir}grib_set -p levtype $infile $outfile 2> $REDIRECT > $REDIRECT +${tools_dir}/grib_set -p levtype $infile $outfile 2> $REDIRECT > $REDIRECT [ $? -ne 0 ] set -e @@ -64,13 +64,13 @@ angleInMicroDegrees=130998900 files="GRIB2.tmpl regular_gg_pl_grib2.tmpl reduced_gg_pl_320_grib2.tmpl polar_stereographic_pl_grib2.tmpl" for f in $files; do f=$ECCODES_SAMPLES_PATH/$f - ${tools_dir}grib_set -s longitudeOfFirstGridPointInDegrees=$angleInDegrees $f $outfile + ${tools_dir}/grib_set -s longitudeOfFirstGridPointInDegrees=$angleInDegrees $f $outfile grib_check_key_equals $outfile longitudeOfFirstGridPoint $angleInMicroDegrees done # GRIB-943: centre code table -${tools_dir}grib_set -s centre=289 $ECCODES_SAMPLES_PATH/GRIB2.tmpl $outfile -${tools_dir}grib_dump -O $outfile | grep -q 'centre = 289.*Zambia' +${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 diff --git a/tests/statistics.sh b/tests/statistics.sh index 8af1fd09b..629943811 100755 --- a/tests/statistics.sh +++ b/tests/statistics.sh @@ -30,7 +30,7 @@ print "max=[max] min=[min] average=[average]"; EOF -${tools_dir}grib_filter statistics.filter ${data_dir}/$file > statistics.out +${tools_dir}/grib_filter statistics.filter ${data_dir}/$file > statistics.out diff statistics.out ${data_dir}/statistics.out.good diff --git a/tests/step.sh b/tests/step.sh index f5b144ffc..8c4c7625d 100755 --- a/tests/step.sh +++ b/tests/step.sh @@ -21,10 +21,10 @@ do for key in stepRange:s startStep endStep do rm -f ${data_dir}/out.grib | true - ${tools_dir}grib_set -s ${key}=$s ${data_dir}/timeRangeIndicator_${i}.grib ${data_dir}/out.grib + ${tools_dir}/grib_set -s ${key}=$s ${data_dir}/timeRangeIndicator_${i}.grib ${data_dir}/out.grib # echo grib_set -s ${key}=$s ${data_dir}/timeRangeIndicator_${i}.grib ${data_dir}/out.grib # grib_get -p step,startStep,endStep,P1,P2,timeRangeIndicator,indicatorOfUnitOfTimeRange ${data_dir}/timeRangeIndicator_${i}.grib ${data_dir}/out.grib - ${tools_dir}grib_get -p mars.step,stepRange,startStep,endStep,P1,P2,timeRangeIndicator,indicatorOfUnitOfTimeRange:l ${data_dir}/timeRangeIndicator_${i}.grib ${data_dir}/out.grib >> ${templog} + ${tools_dir}/grib_get -p mars.step,stepRange,startStep,endStep,P1,P2,timeRangeIndicator,indicatorOfUnitOfTimeRange:l ${data_dir}/timeRangeIndicator_${i}.grib ${data_dir}/out.grib >> ${templog} done done done @@ -33,23 +33,23 @@ i=5 key=stepRange:s for s in "0-24" "600-1200" "24-48" "36-66" do - ${tools_dir}grib_set -s ${key}=$s ${data_dir}/timeRangeIndicator_${i}.grib ${data_dir}/out.grib + ${tools_dir}/grib_set -s ${key}=$s ${data_dir}/timeRangeIndicator_${i}.grib ${data_dir}/out.grib # echo grib_set -s ${key}=$s ${data_dir}/timeRangeIndicator_${i}.grib ${data_dir}/out.grib # grib_ls -p step,startStep,endStep,P1,P2,timeRangeIndicator,indicatorOfUnitOfTimeRange ${data_dir}/timeRangeIndicator_${i}.grib ${data_dir}/out.grib - ${tools_dir}grib_get -p mars.step,stepRange,startStep,endStep,P1,P2,timeRangeIndicator,indicatorOfUnitOfTimeRange:l ${data_dir}/timeRangeIndicator_${i}.grib ${data_dir}/out.grib >> ${templog} + ${tools_dir}/grib_get -p mars.step,stepRange,startStep,endStep,P1,P2,timeRangeIndicator,indicatorOfUnitOfTimeRange:l ${data_dir}/timeRangeIndicator_${i}.grib ${data_dir}/out.grib >> ${templog} done rm -f ${data_dir}/out.grib | true # test added for ifs stepType=max,min -${tools_dir}grib_set -s stepType=max,startStep=3,endStep=6 ${data_dir}/reduced_gaussian_model_level.grib1 ${data_dir}/out.grib -${tools_dir}grib_get -p mars.step,stepRange,startStep,endStep,P1,P2,timeRangeIndicator,indicatorOfUnitOfTimeRange:l ${data_dir}/reduced_gaussian_model_level.grib1 ${data_dir}/out.grib >> ${templog} +${tools_dir}/grib_set -s stepType=max,startStep=3,endStep=6 ${data_dir}/reduced_gaussian_model_level.grib1 ${data_dir}/out.grib +${tools_dir}/grib_get -p mars.step,stepRange,startStep,endStep,P1,P2,timeRangeIndicator,indicatorOfUnitOfTimeRange:l ${data_dir}/reduced_gaussian_model_level.grib1 ${data_dir}/out.grib >> ${templog} rm -f ${data_dir}/out.grib | true diff ${templog} ${data_dir}/step.log -(${tools_dir}grib_filter ${data_dir}/step_grib1.filter ${data_dir}/timeRangeIndicator_0.grib > ${templog}) 2>$REDIRECT +(${tools_dir}/grib_filter ${data_dir}/step_grib1.filter ${data_dir}/timeRangeIndicator_0.grib > ${templog}) 2>$REDIRECT diff ${templog} ${data_dir}/step_grib1.log @@ -58,17 +58,17 @@ rm -f ${templog} | true # GRIB-180 # Set PDT 4.8 where you can find the EndOfOverallTimeInterval keys grib2File=${data_dir}/reduced_latlon_surface_constant.grib2 -${tools_dir}grib_set -sproductDefinitionTemplateNumber=8 $grib2File ${grib2File}.p8tmp +${tools_dir}/grib_set -sproductDefinitionTemplateNumber=8 $grib2File ${grib2File}.p8tmp # 78 hours is 3 days and 6 hours -${tools_dir}grib_set -s step=78 $grib2File.p8tmp ${grib2File}.tmp -set `${tools_dir}grib_get -p hourOfEndOfOverallTimeInterval,dayOfEndOfOverallTimeInterval ${grib2File}.tmp` +${tools_dir}/grib_set -s step=78 $grib2File.p8tmp ${grib2File}.tmp +set `${tools_dir}/grib_get -p hourOfEndOfOverallTimeInterval,dayOfEndOfOverallTimeInterval ${grib2File}.tmp` hourEnd=$1; dayEnd=$2 [ "$hourEnd" = "18" ] [ "$dayEnd" = "8" ] -${tools_dir}grib_set -s step=12 $grib2File.p8tmp ${grib2File}.tmp -set `${tools_dir}grib_get -p hourOfEndOfOverallTimeInterval,dayOfEndOfOverallTimeInterval ${grib2File}.tmp` +${tools_dir}/grib_set -s step=12 $grib2File.p8tmp ${grib2File}.tmp +set `${tools_dir}/grib_get -p hourOfEndOfOverallTimeInterval,dayOfEndOfOverallTimeInterval ${grib2File}.tmp` hourEnd=$1; dayEnd=$2 [ "$hourEnd" = "0" ] [ "$dayEnd" = "6" ] @@ -79,19 +79,19 @@ grib1_sample=$ECCODES_SAMPLES_PATH/GRIB1.tmpl grib2_sample=$ECCODES_SAMPLES_PATH/GRIB2.tmpl temp=temp.step.$$.grib # M is for Month (code 3) -${tools_dir}grib_set -s indicatorOfUnitOfTimeRange=M $grib1_sample $temp -unit=`${tools_dir}grib_get -p unitOfTimeRange $temp` +${tools_dir}/grib_set -s indicatorOfUnitOfTimeRange=M $grib1_sample $temp +unit=`${tools_dir}/grib_get -p unitOfTimeRange $temp` [ "$unit" = "3" ] -${tools_dir}grib_set -s indicatorOfUnitOfTimeRange=M $grib2_sample $temp -unit=`${tools_dir}grib_get -p indicatorOfUnitOfTimeRange $temp` +${tools_dir}/grib_set -s indicatorOfUnitOfTimeRange=M $grib2_sample $temp +unit=`${tools_dir}/grib_get -p indicatorOfUnitOfTimeRange $temp` [ "$unit" = "3" ] # m is for Minute (code 0) -${tools_dir}grib_set -s indicatorOfUnitOfTimeRange=m $grib1_sample $temp -unit=`${tools_dir}grib_get -p unitOfTimeRange $temp` +${tools_dir}/grib_set -s indicatorOfUnitOfTimeRange=m $grib1_sample $temp +unit=`${tools_dir}/grib_get -p unitOfTimeRange $temp` [ "$unit" = "0" ] -${tools_dir}grib_set -s indicatorOfUnitOfTimeRange=m $grib2_sample $temp -unit=`${tools_dir}grib_get -p indicatorOfUnitOfTimeRange $temp` +${tools_dir}/grib_set -s indicatorOfUnitOfTimeRange=m $grib2_sample $temp +unit=`${tools_dir}/grib_get -p indicatorOfUnitOfTimeRange $temp` [ "$unit" = "0" ] rm -f $temp diff --git a/tests/tigge.sh b/tests/tigge.sh index 41b4ade15..ae97c6f57 100755 --- a/tests/tigge.sh +++ b/tests/tigge.sh @@ -42,14 +42,14 @@ done # GRIB-531 TEMP=temp.$$.tigge -${tools_dir}grib_get -nparameter ${data_dir}/tigge_pf_ecmwf.grib2 > $TEMP +${tools_dir}/grib_get -nparameter ${data_dir}/tigge_pf_ecmwf.grib2 > $TEMP diff ${data_dir}/tigge_pf_ecmwf.grib2.ref $TEMP # GRIB-205. Changing productionStatusOfProcessedData should not change # anything else input=${dir}/tigge_ecmf_sfc_sd.grib -${tools_dir}grib_set -s productionStatusOfProcessedData=5 $input $TEMP -${tools_dir}grib_compare -bproductionStatusOfProcessedData $input $TEMP +${tools_dir}/grib_set -s productionStatusOfProcessedData=5 $input $TEMP +${tools_dir}/grib_compare -bproductionStatusOfProcessedData $input $TEMP rm -f $TEMP diff --git a/tests/tigge_conversions.sh b/tests/tigge_conversions.sh index 51b64128d..eeaf7985b 100755 --- a/tests/tigge_conversions.sh +++ b/tests/tigge_conversions.sh @@ -33,12 +33,12 @@ 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 + ${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 + ${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 diff --git a/tests/tiny.sh b/tests/tiny.sh index 645923be1..ea13750f4 100755 --- a/tests/tiny.sh +++ b/tests/tiny.sh @@ -18,5 +18,5 @@ set values = { 1.0e-110, 1.5e-110, 1.005e-110 } write; EOF -${tools_dir}grib_filter ${data_dir}/f.rules ${data_dir}/ 2> $REDIRECT > $REDIRECT +${tools_dir}/grib_filter ${data_dir}/f.rules ${data_dir}/ 2> $REDIRECT > $REDIRECT diff --git a/tests/uerra.sh b/tests/uerra.sh index 9a554a2b0..4aba67504 100755 --- a/tests/uerra.sh +++ b/tests/uerra.sh @@ -29,35 +29,35 @@ test_stream_and_type() pspd=9 fi - ${tools_dir}grib_set -s tablesVersion=15,productionStatusOfProcessedData=$pspd \ + ${tools_dir}/grib_set -s tablesVersion=15,productionStatusOfProcessedData=$pspd \ $grib2_sample $tempSample grib_check_key_equals $tempSample 'stream,mars.stream' 'oper oper' # Check mars model is not set - model=`${tools_dir}grib_get -f -p mars.model $tempSample` + model=`${tools_dir}/grib_get -f -p mars.model $tempSample` [ "$model" = "not_found" ] - ${tools_dir}grib_set -s typeOfProcessedData=0 $tempSample $temp1 + ${tools_dir}/grib_set -s typeOfProcessedData=0 $tempSample $temp1 grib_check_key_equals $temp1 'mars.type' 'an' - ${tools_dir}grib_set -s typeOfProcessedData=1 $tempSample $temp1 + ${tools_dir}/grib_set -s typeOfProcessedData=1 $tempSample $temp1 grib_check_key_equals $temp1 'mars.type' 'fc' - ${tools_dir}grib_set -s marsStream=enda $tempSample $temp1 # ENSEMBLE + ${tools_dir}/grib_set -s marsStream=enda $tempSample $temp1 # ENSEMBLE grib_check_key_exists $temp1 'perturbationNumber' # All combinations for mt in an fc; do for ms in oper enda; do echo "Testing stream=$ms type=$mt ..." - ${tools_dir}grib_set -s marsStream=$ms,marsType=$mt $tempSample $temp1 + ${tools_dir}/grib_set -s marsStream=$ms,marsType=$mt $tempSample $temp1 grib_check_key_equals $temp1 'mars.stream,mars.type' "$ms $mt" # Param 228228 (accum) and 167 (instant) - ${tools_dir}grib_set -s stepType=accum,paramId=228228 $temp1 $temp2 + ${tools_dir}/grib_set -s stepType=accum,paramId=228228 $temp1 $temp2 grib_check_key_equals $temp2 'stream,type' "$ms $mt" - ${tools_dir}grib_set -s paramId=167 $temp1 $temp2 + ${tools_dir}/grib_set -s paramId=167 $temp1 $temp2 grib_check_key_equals $temp2 'stream,type' "$ms $mt" done done diff --git a/tests/utils.sh b/tests/utils.sh index a7ecf316a..8c3b6d724 100644 --- a/tests/utils.sh +++ b/tests/utils.sh @@ -20,7 +20,7 @@ grib_check_key_equals() a_file=$1 a_key=$2 a_expected=$3 - a_result=`${tools_dir}grib_get -p $a_key $a_file` + a_result=`${tools_dir}/grib_get -p $a_key $a_file` if [ "$a_result" != "$a_expected" ]; then echo "File: $a_file" echo "Key(s): $a_key"