eccodes/tests/grib_ecc-600.sh

37 lines
1.2 KiB
Bash
Raw Normal View History

#!/bin/sh
2020-01-28 14:32:34 +00:00
# (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
2022-06-06 14:41:18 +00:00
if [ $HAVE_GEOGRAPHY -eq 0 ]; then
exit 0
fi
# ---------------------------------------------------------
# This is the test for the JIRA issue ECC-600.
2019-02-20 13:29:11 +00:00
# Nearest neighbour for rotated lat/lon grids.
# ---------------------------------------------------------
2022-06-06 14:41:18 +00:00
label="grib_ecc-600_test"
tempOut=temp.${label}.out
tempGrib=temp.${label}.grib
2019-02-20 13:29:11 +00:00
input=${data_dir}/tigge/tiggelam_cnmc_sfc.grib
${tools_dir}/grib_copy -w count=4 $input $tempGrib
2019-02-20 13:29:11 +00:00
${tools_dir}/grib_ls -l 40,0,1 $tempGrib > $tempOut
grep -q "Grid Point chosen #3 index=54294 latitude=39.98 longitude=0.00 distance=2.03 (Km)" $tempOut
${tools_dir}/grib_ls -l 50,-10,1 $tempGrib > $tempOut
grep -q "Grid Point chosen #3 index=145684 latitude=49.99 longitude=-9.97 distance=2.57 (Km)" $tempOut
# Clean up
rm -f $tempOut $tempGrib