Skip to content

Commit

Permalink
Move IC variables from base to stage config
Browse files Browse the repository at this point in the history
- Move ICSDIR and BASE_IC variables to config.stage_ic
- Update workflow/setup_expt.py to fill in templates
in config.stage_ic based on user input and host

Refs #2475
  • Loading branch information
KateFriedman-NOAA committed Aug 6, 2024
1 parent e14e623 commit a0b9af0
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 6 deletions.
2 changes: 0 additions & 2 deletions parm/config/gefs/config.base
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@ export FIXugwd=${FIXgfs}/ugwd
export PACKAGEROOT="@PACKAGEROOT@" # TODO: set via prod_envir in Ops
export COMROOT="@COMROOT@" # TODO: set via prod_envir in Ops
export COMINsyn="@COMINsyn@"
export ICSDIR="@ICSDIR@"
export BASE_IC="@BASE_IC@"

# USER specific paths
export HOMEDIR="@HOMEDIR@"
Expand Down
3 changes: 3 additions & 0 deletions parm/config/gefs/config.stage_ic
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ echo "BEGIN: config.stage_ic"
# Get task specific resources
source "${EXPDIR}/config.resources" stage_ic

export ICSDIR="@ICSDIR@"
export BASE_IC="@BASE_IC@"

export STAGE_IC_YAML_TMPL="${PARMgfs}/stage/stage.yaml.j2"

# Set ICSDIR
Expand Down
2 changes: 0 additions & 2 deletions parm/config/gfs/config.base
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,6 @@ export PACKAGEROOT="@PACKAGEROOT@" # TODO: set via prod_envir in Ops
export COMROOT="@COMROOT@" # TODO: set via prod_envir in Ops
export COMINsyn="@COMINsyn@"
export DMPDIR="@DMPDIR@"
export ICSDIR="@ICSDIR@"
export BASE_IC="@BASE_IC@"

# Gempak from external models
# Default locations are to dummy locations for testing
Expand Down
3 changes: 3 additions & 0 deletions parm/config/gfs/config.stage_ic
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ echo "BEGIN: config.stage_ic"
# Get task specific resources
source "${EXPDIR}/config.resources" stage_ic

export ICSDIR="@ICSDIR@"
export BASE_IC="@BASE_IC@"

export STAGE_IC_YAML_TMPL="${PARMgfs}/stage/stage.yaml.j2"

# Set ICSDIR (if not defined)
Expand Down
13 changes: 11 additions & 2 deletions workflow/setup_expt.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,17 @@ def _update_defaults(dict_in: dict) -> dict:
# First update config.base
edit_baseconfig(host, inputs, yaml_dict)

# loop over other configs and update them
# Update stage config
stage_dict = {
"@ICSDIR@": inputs.icsdir
}
host_dict = get_template_dict(host.info)
stage_dict = dict(stage_dict, **host_dict)
stage_input = f'{inputs.configdir}/config.stage_ic'
stage_output = f'{inputs.expdir}/{inputs.pslot}/config.stage_ic'
edit_config(stage_input, stage_output, stage_dict)

# Loop over other configs and update them with defaults
for cfg in yaml_dict.keys():
if cfg == 'base':
continue
Expand Down Expand Up @@ -104,7 +114,6 @@ def edit_baseconfig(host, inputs, yaml_dict):
"@OCNRES@": f"{int(100.*inputs.resdetocean):03d}",
"@EXPDIR@": inputs.expdir,
"@COMROOT@": inputs.comroot,
"@ICSDIR@": inputs.icsdir,
"@EXP_WARM_START@": is_warm_start,
"@MODE@": inputs.mode,
"@gfs_cyc@": inputs.gfs_cyc,
Expand Down

0 comments on commit a0b9af0

Please sign in to comment.