#!/bin/bash # This script defines grib table 126 for EC-Earth usage. # The new grib definitions are put in the source dir of EC-Earth 3. set -e # --- Path to "grib_api/definitions" GRIBAPI_BASE_DIR=[[[PLT:ACTIVE:GRIBAPI_BASE_DIR]]] if [ -z "${GRIBAPI_BASE_DIR}" ] then echo Your GRIBAPI_BASE_DIR is empty echo Trying to retrieve '/share/grib_api/definitions' instead echo You probably rely on module to set your env. Be sure that the grib_api is loaded. grib_def_dir=$(grib_info | sed -n "s|Default definition files path is used: ||p") if [ -z "${grib_def_dir}" ] then echo "Could not find the path to grib_api/definitions" echo "Please set GRIBAPI_BASE_DIR manually, or load the grib_api module and run again this script." exit 1 fi else grib_def_dir=${GRIBAPI_BASE_DIR}/share/grib_api/definitions fi # --- Create target and populate target_dir=[[[PLT:ACTIVE:ECEARTH_SRC_DIR]]]/util/grib_table_126/grib1/localConcepts/ecmf mkdir -p ${target_dir} cp ${grib_def_dir}/grib1/localConcepts/ecmf/* ${target_dir} # --- additions to grib definitions for EC-Earth table 126 cd $target_dir for ((i=1;i<=255;i++)) do #cfVarname cat >> cfVarName.def <> paramId.def <> name.def <> shortName.def <> units.def <