eccodes/tests/grib_check_param_concepts.sh

94 lines
3.4 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.sh
label="grib_check_param_concepts_test"
#
# Do various checks on the concepts files
#
# First check the GRIB2 paramId.def and shortName.def
# ----------------------------------------------------
$EXEC ${test_dir}/grib_check_param_concepts paramId $ECCODES_DEFINITION_PATH/grib2/paramId.def
$EXEC ${test_dir}/grib_check_param_concepts paramId $ECCODES_DEFINITION_PATH/grib2/localConcepts/ecmf/paramId.def
2021-09-30 10:12:40 +00:00
$EXEC ${test_dir}/grib_check_param_concepts paramId $ECCODES_DEFINITION_PATH/grib2/localConcepts/uerra/paramId.def
$EXEC ${test_dir}/grib_check_param_concepts paramId $ECCODES_DEFINITION_PATH/grib2/localConcepts/hydro/paramId.def
$EXEC ${test_dir}/grib_check_param_concepts shortName $ECCODES_DEFINITION_PATH/grib2/shortName.def
$EXEC ${test_dir}/grib_check_param_concepts shortName $ECCODES_DEFINITION_PATH/grib2/localConcepts/ecmf/shortName.def
2021-09-30 10:12:40 +00:00
$EXEC ${test_dir}/grib_check_param_concepts shortName $ECCODES_DEFINITION_PATH/grib2/localConcepts/uerra/shortName.def
$EXEC ${test_dir}/grib_check_param_concepts shortName $ECCODES_DEFINITION_PATH/grib2/localConcepts/hydro/shortName.def
# Check the group: name.def paramId.def shortName.def units.def cfVarName.def
# ----------------------------------------------------------------------------
# Check whether the Test::More Perl module is available
set +e
perl -e 'use Test::More;'
status=$?
set -e
if [ $status -ne 0 ]; then
echo "Perl Test::More not installed. Test will be skipped"
exit 0
fi
2019-05-16 13:50:32 +00:00
CHECK_DEFS=$ECCODES_DEFINITION_PATH/check_grib_defs.pl
defs_dirs="
$ECCODES_DEFINITION_PATH/grib1
$ECCODES_DEFINITION_PATH/grib2
$ECCODES_DEFINITION_PATH/grib1/localConcepts/ecmf
$ECCODES_DEFINITION_PATH/grib2/localConcepts/ecmf
2016-11-24 14:10:19 +00:00
$ECCODES_DEFINITION_PATH/grib1/localConcepts/ammc
$ECCODES_DEFINITION_PATH/grib1/localConcepts/eidb
$ECCODES_DEFINITION_PATH/grib1/localConcepts/ekmi
$ECCODES_DEFINITION_PATH/grib1/localConcepts/enmi
$ECCODES_DEFINITION_PATH/grib1/localConcepts/eswi
$ECCODES_DEFINITION_PATH/grib1/localConcepts/lfpw
$ECCODES_DEFINITION_PATH/grib1/localConcepts/lowm
$ECCODES_DEFINITION_PATH/grib1/localConcepts/rjtd
2021-09-30 10:12:40 +00:00
$ECCODES_DEFINITION_PATH/grib2/localConcepts/uerra
$ECCODES_DEFINITION_PATH/grib2/localConcepts/hydro
2016-11-24 14:10:19 +00:00
$ECCODES_DEFINITION_PATH/grib2/localConcepts/egrr
$ECCODES_DEFINITION_PATH/grib2/localConcepts/ekmi
$ECCODES_DEFINITION_PATH/grib2/localConcepts/eswi
$ECCODES_DEFINITION_PATH/grib2/localConcepts/lfpw
"
for dir in $defs_dirs; do
cd $dir
$CHECK_DEFS
done
cd $test_dir
# -------------------------------
echo "ECMWF legacy parameters..."
# -------------------------------
ECMF_DIR=$ECCODES_DEFINITION_PATH/grib2/localConcepts/ecmf
tempDir=temp.${label}.dir
rm -fr $tempDir
mkdir -p $tempDir
cd $tempDir
cp $ECMF_DIR/cfName.legacy.def cfName.def
cp $ECMF_DIR/cfVarName.legacy.def cfVarName.def
cp $ECMF_DIR/name.legacy.def name.def
cp $ECMF_DIR/paramId.legacy.def paramId.def
cp $ECMF_DIR/shortName.legacy.def shortName.def
cp $ECMF_DIR/units.legacy.def units.def
$CHECK_DEFS
cd $test_dir
rm -fr $tempDir