From 2696940d473e48f2114d21b09d91f6594920b577 Mon Sep 17 00:00:00 2001 From: "kate.friedman" Date: Thu, 1 Aug 2024 13:52:57 +0000 Subject: [PATCH] Add STAGE_IC_YAML_TMPL variable - Set it in configs so users can change the path to their own yaml - Update python to use variable from configs Refs #2475 --- parm/config/gefs/config.stage_ic | 2 ++ parm/config/gfs/config.stage_ic | 2 ++ scripts/exglobal_stage_ic.py | 7 +++---- ush/python/pygfs/task/stage.py | 4 +--- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/parm/config/gefs/config.stage_ic b/parm/config/gefs/config.stage_ic index 03b852c8d5..ff749bdf87 100644 --- a/parm/config/gefs/config.stage_ic +++ b/parm/config/gefs/config.stage_ic @@ -7,6 +7,8 @@ echo "BEGIN: config.stage_ic" # Get task specific resources source "${EXPDIR}/config.resources" stage_ic +export STAGE_IC_YAML_TMPL="${PARMgfs}/stage/stage.yaml.j2" + # Set ICSDIR if [[ -z "${ICSDIR}" ]] ; then diff --git a/parm/config/gfs/config.stage_ic b/parm/config/gfs/config.stage_ic index 03b852c8d5..ff749bdf87 100644 --- a/parm/config/gfs/config.stage_ic +++ b/parm/config/gfs/config.stage_ic @@ -7,6 +7,8 @@ echo "BEGIN: config.stage_ic" # Get task specific resources source "${EXPDIR}/config.resources" stage_ic +export STAGE_IC_YAML_TMPL="${PARMgfs}/stage/stage.yaml.j2" + # Set ICSDIR if [[ -z "${ICSDIR}" ]] ; then diff --git a/scripts/exglobal_stage_ic.py b/scripts/exglobal_stage_ic.py index 0eb1f03b17..b297840a72 100755 --- a/scripts/exglobal_stage_ic.py +++ b/scripts/exglobal_stage_ic.py @@ -19,11 +19,10 @@ def main(): # Pull out all the configuration keys needed to run stage job keys = ['RUN', 'MODE', 'CASE', 'CASE_ENS', 'OCNRES', 'ICERES', 'waveGRD', - 'EXP_WARM_START', 'current_cycle', 'RDATE', - 'ROTDIR', 'PARMgfs', 'ICSDIR', 'CDUMP', 'rCDUMP', + 'EXP_WARM_START', 'current_cycle', 'RDATE', 'CDUMP', 'rCDUMP', + 'ROTDIR', 'PARMgfs', 'ICSDIR', 'STAGE_IC_YAML_TMPL', 'ntiles', 'MEMDIR', 'REPLAY_ICS', - 'DO_WAVE', 'DO_OCN', 'DO_ICE', 'DO_NEST', - 'CPL_ATMIC', 'CPL_ICEIC', 'CPL_OCNIC', 'CPL_WAVIC'] + 'DO_WAVE', 'DO_OCN', 'DO_ICE', 'DO_NEST'] stage_dict = AttrDict() for key in keys: diff --git a/ush/python/pygfs/task/stage.py b/ush/python/pygfs/task/stage.py index 14b3f3bf3d..d5f6af28ee 100644 --- a/ush/python/pygfs/task/stage.py +++ b/ush/python/pygfs/task/stage.py @@ -44,9 +44,7 @@ def execute_stage(self, stage_dict: Dict[str, Any]) -> None: if not os.path.isdir(stage_dict.ROTDIR): raise FileNotFoundError(f"FATAL ERROR: The ROTDIR ({stage_dict.ROTDIR}) does not exist!") - stage_parm = os.path.join(stage_dict.PARMgfs, "stage") - - stage_set = parse_j2yaml(os.path.join(stage_parm, "stage.yaml.j2"), stage_dict) + stage_set = parse_j2yaml(self.task_config.STAGE_IC_YAML_TMPL, stage_dict) # Copy files to ROTDIR for key in stage_set.keys():