diff --git a/parm/stage/aero.yaml.j2 b/parm/stage/aero.yaml.j2 index 6a9aca30bbc..0df2993b769 100644 --- a/parm/stage/aero.yaml.j2 +++ b/parm/stage/aero.yaml.j2 @@ -3,7 +3,7 @@ aero: - "{{ COMOUT_CHEM_ANALYSIS }}" link_req: - {% if path_exists(ICSDIR ~ "/" ~ COMOUT_CHEM_ANALYSIS | relpath(ROTDIR) ~ "/" ~ RUN ~ ".t" ~ current_cycle_HH ~ "z." ~ ftype) %} + {% if DO_AERO_ANL %} - ["{{ ICSDIR }}/{{ COMOUT_CHEM_ANALYSIS | relpath(ROTDIR) }}/{{ RUN }}.t{{ current_cycle_HH }}z.aero_varbc_params.tar", "{{ COMOUT_CHEM_ANALYSIS }}"] - {% endif %} + {% endif %} diff --git a/parm/stage/analysis.yaml.j2 b/parm/stage/analysis.yaml.j2 index ddb10b5ad72..dde0ea055a6 100644 --- a/parm/stage/analysis.yaml.j2 +++ b/parm/stage/analysis.yaml.j2 @@ -1,7 +1,6 @@ {# ============================================================================ #} {# Analysis Staging Configuration #} {# ============================================================================ #} -{% if path_exists(ICSDIR ~ "/" ~ COMOUT_ATMOS_ANALYSIS | relpath(ROTDIR)) %} analysis: mkdir: - "{{ COMOUT_ATMOS_ANALYSIS }}" @@ -10,70 +9,96 @@ analysis: {# -------------------------------------------------------------------- #} {# JEDI Atmospheric Variational Data Assimilation #} {# -------------------------------------------------------------------- #} - {% if DO_JEDIATMVAR %} - {# Cubed Sphere Grid Configuration #} - {% if ATMINC_GRID == "cubed_sphere_grid" %} + {# Cubed Sphere Grid Configuration #} + {% if ATMINC_GRID == "cubed_sphere_grid" %} + + {% if (DO_JEDIATMVAR or DO_JEDIATMENS) and EXP_WARM_START %} {% for itile in range(ntiles) %} {# Deterministic Member (member == -1) #} {% if member == -1 %} + {% if DOIAU %} - {% set ftypes = ["jedi_increment.atm.i003", "jedi_increment.atm.i006", "jedi_increment.atm.i009" ] %} + {% set ftypes = ["jedi_increment.atm.i003", "jedi_increment.atm.i006" ] %} {% else %} - {% set ftypes = ["jedi_increment.atm.i006" ] %} + {% set ftypes = [ "jedi_increment.atm.i009" ] %} {% endif %} {# Ensemble Members (member != -1) #} {% else %} + {% if DOIAU_ENKF %} {% set ftypes = ["recentered_jedi_increment.atm.i003", "recentered_jedi_increment.atm.i006", "recentered_jedi_increment.atm.i009" ] %} {% else %} {% set ftypes = ["recentered_jedi_increment.atm.i006" ] %} {% endif %} + {% endif %} {% for ftype in ftypes %} - {% if path_exists(ICSDIR ~ "/" ~ COMOUT_ATMOS_ANALYSIS | relpath(ROTDIR) ~ "/" ~ RUN ~ ".t" ~ current_cycle_HH ~ "z." ~ ftype ~ ".tile" ~ (itile+1) ~ ".nc") %} - ["{{ ICSDIR }}/{{ COMOUT_ATMOS_ANALYSIS | relpath(ROTDIR) }}/{{ RUN }}.t{{ current_cycle_HH }}z.{{ ftype }}.tile{{ itile+1 }}.nc", "{{ COMOUT_ATMOS_ANALYSIS }}"] - {% endif %} {% endfor %} {% endfor %} - {# Non-Cubed Sphere Grid Configuration #} + {% endif %} + + {# Non-Cubed Sphere Grid Configuration #} + {% else %} + + {% if DO_JEDIATMVAR %} + - ["{{ ICSDIR }}/{{ COMOUT_ATMOS_ANALYSIS | relpath(ROTDIR) }}/{{ RUN }}.t{{ current_cycle_HH }}z.rad_varbc_params.tar", "{{ COMOUT_ATMOS_ANALYSIS }}"] + + {# Data Assimilation (Non-JEDI) #} {% else %} - {# Atmospheric Increments #} - {% for ftype in ["increment.atm.i006.nc", "increment.atm.i009.nc", "increment.atm.i003.nc", - "recentered_increment.atm.i006.nc", "recentered_increment.atm.i009.nc", "recentered_increment.atm.i003.nc"] %} - {% if path_exists(ICSDIR ~ "/" ~ COMOUT_ATMOS_ANALYSIS | relpath(ROTDIR) ~ "/" ~ RUN ~ ".t" ~ current_cycle_HH ~ "z." ~ ftype) %} + {% for ftype in ["abias.txt", "abias_air.txt", "abias_int.txt", "abias_pc.txt"] %} - ["{{ ICSDIR }}/{{ COMOUT_ATMOS_ANALYSIS | relpath(ROTDIR) }}/{{ RUN }}.t{{ current_cycle_HH }}z.{{ ftype }}", "{{ COMOUT_ATMOS_ANALYSIS }}"] - {% endif %} {% endfor %} - {% endif %} + {% if EXP_WARM_START %} + + {% for ftype in ["increment.atm.i006.nc", "recentered_increment.atm.i006.nc"] %} + - ["{{ ICSDIR }}/{{ COMOUT_ATMOS_ANALYSIS | relpath(ROTDIR) }}/{{ RUN }}.t{{ current_cycle_HH }}z.{{ ftype }}", "{{ COMOUT_ATMOS_ANALYSIS }}"] + {% endfor %} - {# Bias Correction Files #} - {% for ftype in ["abias.txt", "abias_air.txt", "abias_int.txt", "abias_pc.txt", "rad_varbc_params.tar"] %} - {% if path_exists(ICSDIR ~ "/" ~ COMOUT_ATMOS_ANALYSIS | relpath(ROTDIR) ~ "/" ~ RUN ~ ".t" ~ current_cycle_HH ~ "z." ~ ftype) %} + {% if DOIAU %} + {% for ftype in ["increment.atm.i003.nc", "increment.atm.i009.nc", "recentered_increment.atm.i003.nc", "recentered_increment.atm.i009.nc"] %} - ["{{ ICSDIR }}/{{ COMOUT_ATMOS_ANALYSIS | relpath(ROTDIR) }}/{{ RUN }}.t{{ current_cycle_HH }}z.{{ ftype }}", "{{ COMOUT_ATMOS_ANALYSIS }}"] + {% endfor %} {% endif %} - {% endfor %} + + {% endif %} + + {% endif %} + + {% endif %} {# -------------------------------------------------------------------- #} {# GSI Data Assimilation (Non-JEDI) #} {# -------------------------------------------------------------------- #} - {% else %} + {% if not DO_JEDIATMVAR %} + + {# GSI Analysis Files #} + {% for ftype in ["abias.txt", "abias_air.txt", "abias_int.txt", "abias_pc.txt", "radstat.tar"] %} + - ["{{ ICSDIR }}/{{ COMOUT_ATMOS_ANALYSIS | relpath(ROTDIR) }}/{{ RUN }}.t{{ current_cycle_HH }}z.{{ ftype }}", "{{ COMOUT_ATMOS_ANALYSIS }}"] + {% endfor %} + + {% if EXP_WARM_START %} + {% for ftype in ["increment.atm.i006.nc", "recentered_increment.atm.i006.nc"] %} + - ["{{ ICSDIR }}/{{ COMOUT_ATMOS_ANALYSIS | relpath(ROTDIR) }}/{{ RUN }}.t{{ current_cycle_HH }}z.{{ ftype }}", "{{ COMOUT_ATMOS_ANALYSIS }}"] + {% endfor %} - {# All GSI Analysis Files #} - {% for ftype in ["abias.txt", "abias_air.txt", "abias_int.txt", "abias_pc.txt", - "increment.atm.i006.nc", "increment.atm.i009.nc", "increment.atm.i003.nc", "radstat.tar", - "recentered_increment.atm.i006.nc", "recentered_increment.atm.i009.nc", "recentered_increment.atm.i003.nc", "rad_varbc_params.tar"] %} - {% if path_exists(ICSDIR ~ "/" ~ COMOUT_ATMOS_ANALYSIS | relpath(ROTDIR) ~ "/" ~ RUN ~ ".t" ~ current_cycle_HH ~ "z." ~ ftype) %} + {% if DOIAU or DOIAU_ENKF %} + {% for ftype in ["increment.atm.i003.nc", "increment.atm.i009.nc", + "recentered_increment.atm.i003.nc", "recentered_increment.atm.i009.nc"] %} - ["{{ ICSDIR }}/{{ COMOUT_ATMOS_ANALYSIS | relpath(ROTDIR) }}/{{ RUN }}.t{{ current_cycle_HH }}z.{{ ftype }}", "{{ COMOUT_ATMOS_ANALYSIS }}"] + {% endfor %} + + {% endif %} + {% endif %} - {% endfor %} {% endif %} @@ -82,12 +107,18 @@ analysis: {# -------------------------------------------------------------------- #} {% if DO_GSISOILDA %} - {# Surface Increments #} - {% for ftype in ["increment.sfc.i003.nc", "increment.sfc.i006.nc", "increment.sfc.i009.nc"] %} - {% if path_exists(ICSDIR ~ "/" ~ COMOUT_ATMOS_ANALYSIS | relpath(ROTDIR) ~ "/" ~ RUN ~ ".t" ~ current_cycle_HH ~ "z." ~ ftype) %} + {# Surface Increments #} + {% if EXP_WARM_START %} + - ["{{ ICSDIR }}/{{ COMOUT_ATMOS_ANALYSIS | relpath(ROTDIR) }}/{{ RUN }}.t{{ current_cycle_HH }}z.increment.sfc.i006.nc", "{{ COMOUT_ATMOS_ANALYSIS }}"] + + {% if DOAIU %} + {# Surface Increments #} + {% for ftype in ["increment.sfc.i003.nc", "increment.sfc.i009.nc"] %} - ["{{ ICSDIR }}/{{ COMOUT_ATMOS_ANALYSIS | relpath(ROTDIR) }}/{{ RUN }}.t{{ current_cycle_HH }}z.{{ ftype }}", "{{ COMOUT_ATMOS_ANALYSIS }}"] + {% endfor %} {% endif %} - {% endfor %} + + {% endif %} {# Land IAU Increments (Tiled) #} {% if DO_LAND_IAU %} @@ -97,5 +128,3 @@ analysis: {% endif %} {% endif %} - -{% endif %} diff --git a/parm/stage/atmosphere_warm.yaml.j2 b/parm/stage/atmosphere_warm.yaml.j2 index c943fe57545..0d1bf01a97e 100644 --- a/parm/stage/atmosphere_warm.yaml.j2 +++ b/parm/stage/atmosphere_warm.yaml.j2 @@ -3,22 +3,23 @@ atmosphere_warm: - "{{ COMOUT_ATMOS_RESTART_PREV }}" - "{{ COMOUT_ATMOS_RESTART }}" link_req: - {% if path_exists(ICSDIR ~ "/" ~ COMOUT_ATMOS_RESTART_PREV | relpath(ROTDIR) ~ "/" ~ m_prefix ~ ".atm_stoch.res.nc") %} - ["{{ ICSDIR }}/{{ COMOUT_ATMOS_RESTART_PREV | relpath(ROTDIR) }}/{{ m_prefix }}.atm_stoch.res.nc", "{{ COMOUT_ATMOS_RESTART_PREV }}"] - {% endif %} # path_exists + {% for ftype in ["coupler.res", "fv_core.res.nc"] %} - ["{{ ICSDIR }}/{{ COMOUT_ATMOS_RESTART_PREV | relpath(ROTDIR) }}/{{ m_prefix }}.{{ ftype }}", "{{ COMOUT_ATMOS_RESTART_PREV }}"] {% endfor %} + {% for ntile in range(1, ntiles + 1) %} - {% for ftype in ["fv_core.res", "fv_srf_wnd.res", "fv_tracer.res", "phy_data", "sfc_data"] %} + {% for ftype in ["fv_core.res", "fv_srf_wnd.res", "fv_tracer.res", "phy_data", "sfc_data"] %} - ["{{ ICSDIR }}/{{ COMOUT_ATMOS_RESTART_PREV | relpath(ROTDIR) }}/{{ m_prefix }}.{{ ftype }}.tile{{ ntile }}.nc", "{{ COMOUT_ATMOS_RESTART_PREV }}"] - {% endfor %} # ftype - {% if DO_CA %} + {% endfor %} # ftype + {% if DO_CA %} - ["{{ ICSDIR }}/{{ COMOUT_ATMOS_RESTART_PREV | relpath(ROTDIR) }}/{{ m_prefix }}.ca_data.tile{{ ntile }}.nc", "{{ COMOUT_ATMOS_RESTART_PREV }}"] - {% endif %} + {% endif %} {% endfor %} # ntile + {% for ntile in range(1, ntiles + 1) %} - {% if path_exists(ICSDIR ~ "/" ~ COMOUT_ATMOS_RESTART | relpath(ROTDIR) ~ "/" ~ m_prefix ~ ".sfcanl_data.tile" ~ ntile ~ ".nc") %} + {% if member > 0 %} - ["{{ ICSDIR }}/{{ COMOUT_ATMOS_RESTART | relpath(ROTDIR) }}/{{ m_prefix }}.sfcanl_data.tile{{ ntile }}.nc", "{{ COMOUT_ATMOS_RESTART }}"] - {% endif %} # path_exists + {% endif %} {% endfor %} # ntile diff --git a/parm/stage/atmosphere_warm_RT.yaml.j2 b/parm/stage/atmosphere_warm_RT.yaml.j2 index afc69d1f5e6..08072ab0147 100644 --- a/parm/stage/atmosphere_warm_RT.yaml.j2 +++ b/parm/stage/atmosphere_warm_RT.yaml.j2 @@ -13,17 +13,16 @@ atmosphere_warm_RT: - ["{{ file }}", "{{ increment_destination_path }}"] {% endfor %} - {% if path_exists(ICSDIR) %} - {% set file = restart_mem_path ~ 'coupler.res' %} + {% set file = restart_mem_path ~ 'coupler.res' %} - ["{{ file }}", "{{ COMOUT_ATMOS_RESTART_PREV }}"] - {% set file = restart_mem_path ~ 'fv_core.res.nc' %} + {% set file = restart_mem_path ~ 'fv_core.res.nc' %} - ["{{ file }}", "{{ COMOUT_ATMOS_RESTART_PREV }}"] - {% set ntiles = 6 %} - {% for ftype in ["fv_core.res", "fv_srf_wnd.res", "phy_data", "sfc_data"] %} - # Include restart tile files (e.g., .tile1 to .tile6) - {% for tile in range(1, ntiles + 1) %} - {% set file = restart_mem_path ~ ftype ~ '.tile' ~ tile ~ '.nc' %} + + {% set ntiles = 6 %} + {% for ftype in ["fv_core.res", "fv_srf_wnd.res", "phy_data", "sfc_data"] %} + # Include restart tile files (e.g., .tile1 to .tile6) + {% for tile in range(1, ntiles + 1) %} + {% set file = restart_mem_path ~ ftype ~ '.tile' ~ tile ~ '.nc' %} - ["{{ file }}", "{{ COMOUT_ATMOS_RESTART_PREV }}"] - {% endfor %} {% endfor %} - {% endif %} + {% endfor %} diff --git a/parm/stage/ocean_RT.yaml.j2 b/parm/stage/ocean_RT.yaml.j2 index 810f533d20a..d98f3a3d695 100644 --- a/parm/stage/ocean_RT.yaml.j2 +++ b/parm/stage/ocean_RT.yaml.j2 @@ -11,10 +11,14 @@ ocean_RT: {% set file = increment_mem_path %} - ["{{ file }}", "{{ COMOUT_OCEAN_ANALYSIS }}"] - {% if path_exists(ICSDIR) %} - {% for ftype in ["MOM.res.nc", "MOM.res_1.nc", "MOM.res_2.nc", "MOM.res_3.nc"] %} + {% if DO_OCN %} + {% set file = restart_mem_path ~ 'MOM.res.nc' %} + - ["{{ file }}", "{{ COMOUT_OCEAN_RESTART_PREV }}"] + {% if OCNRES > 25 %} + {% for ftype in ["MOM.res_1.nc", "MOM.res_2.nc", "MOM.res_3.nc"] %} # Include base file for restart files - {% set file = restart_mem_path ~ ftype %} + {% set file = restart_mem_path ~ ftype %} - ["{{ file }}", "{{ COMOUT_OCEAN_RESTART_PREV }}"] - {% endfor %} + {% endfor %} + {% endif %} {% endif %} diff --git a/parm/stage/ocean_mediator.yaml.j2 b/parm/stage/ocean_mediator.yaml.j2 index 6a60a933df4..46431f5bd92 100644 --- a/parm/stage/ocean_mediator.yaml.j2 +++ b/parm/stage/ocean_mediator.yaml.j2 @@ -1,7 +1,7 @@ -{% if path_exists(ICSDIR ~ "/" ~ COMOUT_MED_RESTART_PREV | relpath(ROTDIR) ~ "/" ~ m_prefix ~ ".ufs.cpld.cpl.r.nc") %} ocean_mediator: mkdir: - "{{ COMOUT_MED_RESTART_PREV }}" link_req: + {% if DO_OCN and EXP_WARM_START %} - ["{{ ICSDIR }}/{{ COMOUT_MED_RESTART_PREV | relpath(ROTDIR) }}/{{ m_prefix }}.ufs.cpld.cpl.r.nc", "{{ COMOUT_MED_RESTART_PREV }}"] -{% endif %} # path exists + {% endif %} diff --git a/parm/stage/wave.yaml.j2 b/parm/stage/wave.yaml.j2 index ecb3ff50781..84d68bdb20c 100644 --- a/parm/stage/wave.yaml.j2 +++ b/parm/stage/wave.yaml.j2 @@ -1,12 +1,9 @@ wave: mkdir: - "{{ COMOUT_WAVE_RESTART_PREV }}" - link_req: + link_opt: + {% if DO_WAVE %} {% set ww3_file = ICSDIR ~ "/" ~ COMOUT_WAVE_RESTART_PREV | relpath(ROTDIR) ~ "/" ~ m_prefix ~ ".restart.ww3" %} - {% if path_exists(ww3_file ~ ".nc") %} - ["{{ ww3_file }}.nc" , "{{ COMOUT_WAVE_RESTART_PREV }}/{{ m_prefix }}.restart.ww3.nc"] - {% else %} - {% if path_exists(ww3_file) %} - ["{{ ww3_file }}" , "{{ COMOUT_WAVE_RESTART_PREV }}/{{ m_prefix }}.restart.ww3"] - {% endif %} - {% endif %} + {% endif %} diff --git a/ush/python/pygfs/task/stage_ic.py b/ush/python/pygfs/task/stage_ic.py index f660fb7096d..3b6149804de 100644 --- a/ush/python/pygfs/task/stage_ic.py +++ b/ush/python/pygfs/task/stage_ic.py @@ -43,7 +43,7 @@ def _copy_base_config(self) -> Dict[str, Any]: 'assim_freq', 'current_cycle', 'previous_cycle', 'ROTDIR', 'ICSDIR', 'STAGE_IC_YAML_TMPL', 'DO_JEDIATMVAR', 'OCNRES', 'waveGRD', 'ntiles', 'DOIAU', 'ATMINC_GRID', - 'DO_JEDIOCNVAR', 'DO_STARTMEM_FROM_JEDIICE', + 'DO_JEDIOCNVAR', 'DO_STARTMEM_FROM_JEDIICE', 'DO_JEDIATMENS', 'DO_WAVE', 'DO_OCN', 'DO_ICE', 'DO_NEST', 'DO_CA', 'DO_AERO_ANL', 'MOM6_INTERP_ICS', 'USE_ATM_ENS_PERTURB_FILES', 'USE_OCN_ENS_PERTURB_FILES', 'DO_GSISOILDA', 'DO_LAND_IAU' ]