2013-03-25 12:04:10 +00:00
|
|
|
#!/bin/sh
|
2020-01-28 14:32:34 +00:00
|
|
|
# (C) Copyright 2005- ECMWF.
|
2013-03-25 12:04:10 +00:00
|
|
|
#
|
|
|
|
# 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.
|
2014-08-28 09:03:16 +00:00
|
|
|
#
|
2013-03-25 12:04:10 +00:00
|
|
|
# In applying this licence, ECMWF does not waive the privileges and immunities granted to it by
|
|
|
|
# virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction.
|
|
|
|
#
|
|
|
|
|
|
|
|
. ./include.sh
|
2021-08-23 15:38:53 +00:00
|
|
|
set -u
|
|
|
|
temp=temp.grib_iterator.grib
|
2013-03-25 12:04:10 +00:00
|
|
|
|
|
|
|
files="reduced_latlon_surface.grib1 \
|
|
|
|
reduced_gaussian_pressure_level.grib1 \
|
|
|
|
regular_gaussian_pressure_level.grib1 \
|
|
|
|
reduced_gaussian_sub_area.grib1 \
|
|
|
|
regular_latlon_surface.grib1 \
|
|
|
|
reduced_latlon_surface.grib2 \
|
|
|
|
reduced_gaussian_pressure_level.grib2 \
|
|
|
|
regular_gaussian_pressure_level.grib2 \
|
|
|
|
reduced_gaussian_sub_area.grib2 \
|
|
|
|
regular_latlon_surface.grib2"
|
|
|
|
|
2020-07-05 21:40:57 +00:00
|
|
|
for f in $files; do
|
2013-11-13 12:49:54 +00:00
|
|
|
file=${data_dir}/$f
|
2021-02-02 18:25:49 +00:00
|
|
|
# Must exclude the first line of grib_get_data which is "Latitude Longitude Value"
|
2017-02-03 14:21:24 +00:00
|
|
|
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`
|
2013-11-13 12:49:54 +00:00
|
|
|
[ $numberOfPoints = ${iterator_count} ]
|
2013-03-25 12:04:10 +00:00
|
|
|
done
|
|
|
|
|
2021-02-03 17:25:51 +00:00
|
|
|
# ECC-822: Increase lat/lon decimals using default grib_get_data
|
|
|
|
${tools_dir}/grib_get_data -L%12.6f%11.5f ${data_dir}/regular_latlon_surface.grib2
|
|
|
|
|
2021-08-23 15:38:53 +00:00
|
|
|
${tools_dir}/grib_get_data -p shortName,level ${data_dir}/regular_latlon_surface.grib2 > $temp
|
|
|
|
grep -q "Latitude Longitude Value shortName level" $temp
|
|
|
|
|
|
|
|
rm -f $temp
|