From e75315f664aa59930541e975f2adbeb686f62c14 Mon Sep 17 00:00:00 2001 From: "Walter.Kolczynski" Date: Mon, 6 Nov 2023 12:43:10 -0600 Subject: [PATCH] Replace nems cpl validation Removes the old cpl validation script since the nemsconfigure string is no longer used and replaces it with a check whether the specified template file is readable. Refs #1692 --- parm/config/gefs/config.ufs | 5 +++++ parm/config/gfs/config.ufs | 5 +++++ scripts/exglobal_forecast.sh | 8 -------- ush/cplvalidate.sh | 39 ------------------------------------ 4 files changed, 10 insertions(+), 47 deletions(-) delete mode 100755 ush/cplvalidate.sh diff --git a/parm/config/gefs/config.ufs b/parm/config/gefs/config.ufs index 9d5cfb29bb4..8ed9787326c 100644 --- a/parm/config/gefs/config.ufs +++ b/parm/config/gefs/config.ufs @@ -473,4 +473,9 @@ case "${model_list}" in ;; esac +if [[ ! -r ${ufs_configure_template} ]]; then + echo "FATAL ERROR: ${ufs_configure_template} either doesn't exist or is not readable." + exit 17 +fi + echo "END: config.ufs" diff --git a/parm/config/gfs/config.ufs b/parm/config/gfs/config.ufs index baddce33699..aa695cde59d 100644 --- a/parm/config/gfs/config.ufs +++ b/parm/config/gfs/config.ufs @@ -493,4 +493,9 @@ case "${model_list}" in ;; esac +if [[ ! -r ${ufs_configure_template} ]]; then + echo "FATAL ERROR: ${ufs_configure_template} either doesn't exist or is not readable." + exit 17 +fi + echo "END: config.ufs" diff --git a/scripts/exglobal_forecast.sh b/scripts/exglobal_forecast.sh index 86cea85dee1..ff0e159dec5 100755 --- a/scripts/exglobal_forecast.sh +++ b/scripts/exglobal_forecast.sh @@ -80,16 +80,12 @@ source "${HOMEgfs}/ush/preamble.sh" # include all subroutines. Executions later. -source "${HOMEgfs}/ush/cplvalidate.sh" # validation of cpl* source "${HOMEgfs}/ush/forecast_predet.sh" # include functions for variable definition source "${HOMEgfs}/ush/forecast_det.sh" # include functions for run type determination source "${HOMEgfs}/ush/forecast_postdet.sh" # include functions for variables after run type determination source "${HOMEgfs}/ush/nems_configure.sh" # include functions for nems_configure processing source "${HOMEgfs}/ush/parsing_model_configure_FV3.sh" -# Compset string. For nems.configure.* template selection. Default ATM only -confignamevarfornems=${confignamevarfornems:-'atm'} - # Coupling control switches, for coupling purpose, off by default cpl=${cpl:-.false.} cplflx=${cplflx:-.false.} # default off,import from outside source @@ -104,10 +100,6 @@ ICETIM=${DELTIM} CPL_SLOW=${CPL_SLOW:-${OCNTIM}} CPL_FAST=${CPL_FAST:-${ICETIM}} -echo "MAIN: Validating '${confignamevarfornems}' with cpl switches" -cplvalidate -echo "MAIN: '${confignamevarfornems}' validated, continue" - echo "MAIN: Loading common variables before determination of run type" common_predet diff --git a/ush/cplvalidate.sh b/ush/cplvalidate.sh deleted file mode 100755 index 168bd0ff532..00000000000 --- a/ush/cplvalidate.sh +++ /dev/null @@ -1,39 +0,0 @@ -#! /usr/bin/env bash - -##### -## This script validates $confignamevarfornems -## against cpl** switches to check consistency -## -## This is a child script of modular -## forecast script. This script is a direct execution -##### - -cplvalidate(){ -echo "SUB cplvalidate: validating cpl** switches for ${confignamevarfornems}" -return # TODO: Why are we returning right here? -case ${confignamevarfornems} in - 'atm') combination=.false..false..false..false..false.;; - 'datm') combination=.true..true..false..false..false.;; - 'atm_aero') combination=.true..false..false..false..true.;; - 'med_atm_ocn_ice') combination=.true..true..true..false..false.;; - 'cpld') combination=.true..true..true..false..false.;; - 'blocked_atm_wav') combination=.true..false..false..true..false.;; - 'leapfrog_atm_wav')combination=.true..false..false..true..false.;; - 'med_atm_ocn_ice_wav') combination=.true..true..true..true..false.;; - 'cpld_wave') combination=.true..true..true..true..false.;; - 'cpld_aero_wave') combination=.true..true..true..true..true.;; - 'medcold_atm_ocn_ice_wav') combination=.true..true..true..true..false.;; - 'med_atm_ocn_ice_wav1way') combination=.true..true..true..true..false.;; - 'med_atm_ocn_ice_wav1waywcurr') combination=.true..true..true..true..false.;; - 'medcold_atm_ocn_ice') combination=.true..true..true..false..false.;; - *) echo "SUB cplvalidate: Combination not supported" - exit 1 ;; -esac -control="${cpl}${cplflx}${cplice}${cplwav}${cplchm}" -if [[ "${control}" != "${combination}" ]]; then - echo "SUB cplvalidate: inconsistent cpl setting!" - exit 2 -else - echo "SUB cplvalidate: cpl settings validated!" -fi -}