From 88aaa12fc1278b3cdb6d8f6046df28a50eaa4dbe Mon Sep 17 00:00:00 2001 From: David Huber Date: Wed, 6 Nov 2024 07:49:31 -0600 Subject: [PATCH] Check wave support at setup time rather than runtime --- parm/config/gefs/config.base | 19 ++++--------------- parm/config/gfs/config.base | 19 ++++--------------- workflow/hosts/awspw.yaml | 2 +- workflow/hosts/azurepw.yaml | 2 +- workflow/hosts/googlepw.yaml | 2 +- workflow/setup_expt.py | 4 ++++ 6 files changed, 15 insertions(+), 33 deletions(-) diff --git a/parm/config/gefs/config.base b/parm/config/gefs/config.base index e5a4315ff5..8492db3c7d 100644 --- a/parm/config/gefs/config.base +++ b/parm/config/gefs/config.base @@ -131,7 +131,6 @@ export APP=@APP@ export DO_ATM="YES" export DO_COUPLED="NO" export DO_WAVE="NO" -export DISABLE_WAVE="@DISABLE_WAVE@" export DO_OCN="NO" export DO_ICE="NO" export DO_AERO="NO" @@ -189,13 +188,8 @@ case "${APP}" in ;; ATMW) export DO_COUPLED="YES" - if [[ "${DISABLE_WAVE}" != "YES" ]]; then - export DO_WAVE="YES" - export WAVE_RUN="both" - else - echo "WARNING: WW3 is explicitly disabled but APP=ATMW! Disabling waves." - export APP=ATM - fi + export DO_WAVE="YES" + export WAVE_RUN="both" ;; NG-GODAS) export DO_ATM="NO" @@ -214,13 +208,8 @@ case "${APP}" in fi if [[ "${APP}" =~ ^S2SW ]]; then - if [[ "${DISABLE_WAVE}" != "YES" ]]; then - export DO_WAVE="YES" - export WAVE_RUN="both" - else - echo "WARNING WW3 is explicitly disabled, but APP=${APP}! Disabling waves." - export APP="${APP//W/}" - fi + export DO_WAVE="YES" + export WAVE_RUN="both" fi ;; *) diff --git a/parm/config/gfs/config.base b/parm/config/gfs/config.base index b62ae3e584..4f702f9668 100644 --- a/parm/config/gfs/config.base +++ b/parm/config/gfs/config.base @@ -172,7 +172,6 @@ shopt -u extglob export DO_ATM="YES" export DO_COUPLED="NO" export DO_WAVE="NO" -export DISABLE_WAVE="@DISABLE_WAVE@" export DO_OCN="NO" export DO_ICE="NO" export DO_AERO="NO" @@ -235,13 +234,8 @@ case "${APP}" in ;; ATMW) export DO_COUPLED="YES" - if [[ "${DISABLE_WAVE}" != "YES" ]]; then - export DO_WAVE="YES" - export WAVE_RUN="both" - else - echo "WARNING: WW3 is explicitly disabled but APP=ATMW! Disabling waves." - export APP=ATM - fi + export DO_WAVE="YES" + export WAVE_RUN="both" ;; NG-GODAS) export DO_ATM="NO" @@ -260,13 +254,8 @@ case "${APP}" in fi if [[ "${APP}" =~ ^S2SW ]]; then - if [[ "${DISABLE_WAVE}" != "YES" ]]; then - export DO_WAVE="YES" - export WAVE_RUN="both" - else - echo "WARNING WW3 is explicitly disabled, but APP=${APP}! Disabling waves." - export APP="${APP//W/}" - fi + export DO_WAVE="YES" + export WAVE_RUN="both" fi ;; *) diff --git a/workflow/hosts/awspw.yaml b/workflow/hosts/awspw.yaml index 29ac71e2f8..b98c838faa 100644 --- a/workflow/hosts/awspw.yaml +++ b/workflow/hosts/awspw.yaml @@ -27,5 +27,5 @@ MAKE_ACFTBUFR: 'NO' DO_TRACKER: 'NO' DO_GENESIS: 'NO' DO_METP: 'NO' -DISABLE_WAVE: 'YES' +SUPPORT_WAVES: 'NO' SUPPORTED_RESOLUTIONS: ['C48', 'C96'] # TODO: Test and support all cubed-sphere resolutions. diff --git a/workflow/hosts/azurepw.yaml b/workflow/hosts/azurepw.yaml index 99ac2af845..4725e28962 100644 --- a/workflow/hosts/azurepw.yaml +++ b/workflow/hosts/azurepw.yaml @@ -24,5 +24,5 @@ LOCALARCH: 'NO' ATARDIR: '' # TODO: This will not yet work from AZURE. MAKE_NSSTBUFR: 'NO' MAKE_ACFTBUFR: 'NO' -DISABLE_WAVE: 'YES' +SUPPORT_WAVES: 'NO' SUPPORTED_RESOLUTIONS: ['C48', 'C96'] # TODO: Test and support all cubed-sphere resolutions. diff --git a/workflow/hosts/googlepw.yaml b/workflow/hosts/googlepw.yaml index 7a83d50b35..1b979b6bc9 100644 --- a/workflow/hosts/googlepw.yaml +++ b/workflow/hosts/googlepw.yaml @@ -24,5 +24,5 @@ LOCALARCH: 'NO' ATARDIR: '' # TODO: This will not yet work from GOOGLE. MAKE_NSSTBUFR: 'NO' MAKE_ACFTBUFR: 'NO' -DISABLE_WAVE: 'YES' +SUPPORT_WAVES: 'NO' SUPPORTED_RESOLUTIONS: ['C48', 'C96'] # TODO: Test and support all cubed-sphere resolutions. diff --git a/workflow/setup_expt.py b/workflow/setup_expt.py index a27cfa0c53..26a5186fd2 100755 --- a/workflow/setup_expt.py +++ b/workflow/setup_expt.py @@ -364,6 +364,7 @@ def query_and_clean(dirname, force_clean=False): def validate_user_request(host, inputs): supp_res = host.info['SUPPORTED_RESOLUTIONS'] + supp_waves = host.info.get('SUPPORT_WAVES', 'YES') machine = host.machine for attr in ['resdetatmos', 'resensatmos']: try: @@ -373,6 +374,9 @@ def validate_user_request(host, inputs): if expt_res not in supp_res: raise NotImplementedError(f"Supported resolutions on {machine} are:\n{', '.join(supp_res)}") + if "W" in inputs.app and supp_waves == "NO": + raise NotImplementedError(f"Waves are not supported on {machine}") + def get_ocean_resolution(resdetatmos): """