Skip to content

Commit

Permalink
Add STAGE_IC_YAML_TMPL variable
Browse files Browse the repository at this point in the history
- Set it in configs so users can change the path to their own yaml
- Update python to use variable from configs

Refs #2475
  • Loading branch information
KateFriedman-NOAA committed Aug 1, 2024
1 parent 73eed18 commit 2696940
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
2 changes: 2 additions & 0 deletions parm/config/gefs/config.stage_ic
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions parm/config/gfs/config.stage_ic
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 3 additions & 4 deletions scripts/exglobal_stage_ic.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 1 addition & 3 deletions ush/python/pygfs/task/stage.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down

0 comments on commit 2696940

Please sign in to comment.