Skip to content

Commit

Permalink
Check wave support at setup time rather than runtime
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidHuber-NOAA committed Nov 6, 2024
1 parent 86c66f9 commit 88aaa12
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 33 deletions.
19 changes: 4 additions & 15 deletions parm/config/gefs/config.base
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand All @@ -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
;;
*)
Expand Down
19 changes: 4 additions & 15 deletions parm/config/gfs/config.base
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand All @@ -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
;;
*)
Expand Down
2 changes: 1 addition & 1 deletion workflow/hosts/awspw.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
2 changes: 1 addition & 1 deletion workflow/hosts/azurepw.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
2 changes: 1 addition & 1 deletion workflow/hosts/googlepw.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
4 changes: 4 additions & 0 deletions workflow/setup_expt.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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):
"""
Expand Down

0 comments on commit 88aaa12

Please sign in to comment.