ECC-1319: Add test

This commit is contained in:
Shahram Najm 2021-12-15 17:41:09 +00:00
parent c007279433
commit 19d695e531
2 changed files with 68 additions and 0 deletions

View File

@ -91,6 +91,7 @@ if( HAVE_BUILD_TOOLS )
grib_ecc-1261
grib_ecc-1271
grib_ecc-1315
grib_ecc-1319
bufr_ecc-1028
bufr_ecc-1195
bufr_ecc-1259

67
tests/grib_ecc-1319.sh Executable file
View File

@ -0,0 +1,67 @@
#!/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.sh
set -u
label="grib_ecc-1319-test"
temp=temp.$label.grib
sample_grib2=$ECCODES_SAMPLES_PATH/GRIB2.tmpl
lev_types="
surface
tropopause
nominalTop
mostUnstableParcel
mixedLayerParcel
isobaricInPa
isobaricInhPa
isobaricLayer
meanSea
heightAboveGround
heightAboveGroundLayer
hybrid
hybridHeight
hybridLayer
depthBelowLand
depthBelowLandLayer
theta
thetaLayer
potentialVorticity
soil
soilLayer
entireAtmosphere
entireOcean
snow
snowLayer
seaIce
seaIceLayer"
ok_levtypes="hhl ml o2d pl pt pv sfc sol"
check_levtype()
{
_arg=$1
result=1
for n in $ok_levtypes; do
if [ "$_arg" = "$n" ]; then result=0; break; fi
done
return $result
}
for lt in $lev_types; do
${tools_dir}/grib_set -s tablesVersion=27,typeOfLevel=$lt $sample_grib2 $temp
ltype=`${tools_dir}/grib_get -p mars.levtype $temp`
check_levtype $ltype
done
rm -f $temp