#!/bin/sh # (C) Copyright 2005- ECMWF. # # This software is licensed under the terms of the Apache Licence Version 2.0 # which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. # # In applying this licence, ECMWF does not waive the privileges and immunities granted to it by # virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. # . ./include.ctest.sh label="grib_nearest_test" temp=temp.$label.txt tempGrib=temp.$label.grib tempRef=temp.$label.ref input_grb=${data_dir}/reduced_gaussian_pressure_level.grib1 # Nearest with decoding the data values # -------------------------------------- $EXEC ${test_dir}/grib_nearest_test $input_grb > $temp cat > $tempRef < $temp cat > $tempRef < $temp grep -q "3.24e-08" $temp ${tools_dir}/grib_ls -l 70,345.2,1 $input_grb > $temp grep -q "Grid Point chosen #4 index=0 " $temp # CCDSDS regular lat/lon # ---------------------------------------- if [ $HAVE_AEC -eq 1 ]; then input_grb=${data_dir}/ccsds.grib2 ${tools_dir}/grib_get -l 79.0,203.0,1 $input_grb > $temp grep -q "103484" $temp ${tools_dir}/grib_ls -l 79.0,203.0,1 $input_grb > $temp grep -q "Grid Point chosen #2 index=4163 " $temp # Constant field input_grb=${samp_dir}/ccsds_grib2.tmpl ${tools_dir}/grib_get -l 0,0,1 $input_grb > $temp grep -q "1" $temp fi # GRIB2 Complex packing regular lat/lon # ---------------------------------------- input_grb=${data_dir}/sample.grib2 ${tools_dir}/grib_set -r -s packingType=grid_complex $input_grb $tempGrib ${tools_dir}/grib_get -F%3.6g -l 0,0,1 $tempGrib > $temp grep -q "300.119" $temp ${tools_dir}/grib_ls -l 0,0,1 $tempGrib > $temp grep -q "Grid Point chosen #2 index=480 " $temp # Subarea: Reduced Gaussian grid # ------------------------------ input_grb=${data_dir}/reduced_gaussian_sub_area.grib1 ${tools_dir}/grib_get -F%3.6g -l 89.656,220,1 $input_grb > $temp grep -q "274.038" $temp ${tools_dir}/grib_ls -l 89.656,220,1 $input_grb > $temp grep -q "Grid Point chosen #1 index=0 " $temp ${tools_dir}/grib_ls -l 0.225,399.6,1 $input_grb > $temp grep -q "Grid Point chosen #1 index=53563 " $temp ${tools_dir}/grib_get -F%3.6g -l 11.91,366.3,1 $input_grb > $temp grep -q "299.632" $temp ${tools_dir}/grib_ls -l 11.91,366.3,1 $input_grb > $temp grep -q "Grid Point chosen #1 index=43089 " $temp # Clean up rm -f $temp $tempRef $tempGrib