diff --git a/jobs/JGLOBAL_STAGE_IC b/jobs/JGLOBAL_STAGE_IC index a92ffafb01..a1707b18a0 100755 --- a/jobs/JGLOBAL_STAGE_IC +++ b/jobs/JGLOBAL_STAGE_IC @@ -17,6 +17,9 @@ current_cycle="${PDY}${cyc}" previous_cycle=$(date --utc -d "${current_cycle:0:8} ${current_cycle:8:2} - ${assim_freq} hours" +%Y%m%d%H) current_cycle_begin=$(date --utc -d "${current_cycle:0:8} ${current_cycle:8:2} - ${half_window} hours" +%Y%m%d%H) current_cycle_end=$(date --utc -d "${current_cycle:0:8} ${current_cycle:8:2} + ${half_window} hours" +%Y%m%d%H) +current_cycle_offset=$(date --utc -d "${PDY} ${cyc} + ${OFFSET_START_HOUR} hours" +%Y%m%d%H) +export current_cycle_offset + # Define model start date for current_cycle as the time the forecast will start if [[ "${DOIAU:-NO}" == "YES" ]]; then model_start_date_current_cycle="${current_cycle_begin}" diff --git a/parm/stage/stage.yaml.j2 b/parm/stage/stage.yaml.j2 index 125d111a17..bfa1da217f 100644 --- a/parm/stage/stage.yaml.j2 +++ b/parm/stage/stage.yaml.j2 @@ -20,7 +20,8 @@ # Set variables used below {% set cycle_HH = current_cycle | strftime("%H") %} -{% set r_prefix = model_start_date_current_cycle | to_YMD + "." + model_start_date_current_cycle | strftime("%H") + "0000" %} +{% set m_prefix = model_start_date_current_cycle | to_YMD + "." + model_start_date_current_cycle | strftime("%H") + "0000" %} +{% set o_prefix = current_cycle_offset | to_YMD + "." + current_cycle_offset | strftime("%H") + "0000" %} ############################################################# # Initial condition to stage @@ -30,8 +31,10 @@ analysis: mkdir: - "{{ COMOUT_ATMOS_ANALYSIS }}" copy: - {% for ftype in ["abias", "abias_air", "abias_pc", "radstat"] %} + {% for ftype in ["abias", "abias_air", "abias_int", "abias_pc", "atminc.nc", "radstat"] %} + {% if path_exists(ICSDIR ~ "/" ~ COMOUT_ATMOS_ANALYSIS | relpath(ROTDIR) ~ "/" ~ RUN ~ ".t" ~ cycle_HH ~ "z." ~ ftype) %} - ["{{ ICSDIR }}/{{ COMOUT_ATMOS_ANALYSIS | relpath(ROTDIR) }}/{{ RUN }}.t{{ cycle_HH }}z.{{ ftype }}", "{{ COMOUT_ATMOS_ANALYSIS }}"] + {% endif %} {% endfor %} {% endif %} @@ -41,11 +44,11 @@ atmosphere_warm: - "{{ COMOUT_ATMOS_RESTART_PREV }}" copy: {% for ftype in ["coupler.res", "fv_core.res.nc"] %} - - ["{{ ICSDIR }}/{{ COMOUT_ATMOS_RESTART_PREV | relpath(ROTDIR) }}/{{ r_prefix }}.{{ ftype }}", "{{ COMOUT_ATMOS_RESTART_PREV }}"] + - ["{{ ICSDIR }}/{{ COMOUT_ATMOS_RESTART_PREV | relpath(ROTDIR) }}/{{ m_prefix }}.{{ ftype }}", "{{ COMOUT_ATMOS_RESTART_PREV }}"] {% endfor %} {% for ftype in ["ca_data", "fv_core.res", "fv_srf_wnd.res", "fv_tracer.res", "phy_data", "sfc_data"] %} {% for ntile in range(1, ntiles + 1) %} - - ["{{ ICSDIR }}/{{ COMOUT_ATMOS_RESTART_PREV | relpath(ROTDIR) }}/{{ r_prefix }}.{{ ftype }}.tile{{ ntile }}.nc", "{{ COMOUT_ATMOS_RESTART_PREV }}"] + - ["{{ ICSDIR }}/{{ COMOUT_ATMOS_RESTART_PREV | relpath(ROTDIR) }}/{{ m_prefix }}.{{ ftype }}.tile{{ ntile }}.nc", "{{ COMOUT_ATMOS_RESTART_PREV }}"] {% endfor %} # ntile {% endfor %} # ftype {% else %} @@ -66,7 +69,7 @@ atmosphere_perturbation: mkdir: - "{{ COMOUT_ATMOS_ANALYSIS }}" copy: - - ["{{ ICSDIR }}/{{ COMOUT_ATMOS_ANALYSIS | relpath(ROTDIR) }}/{{ r_prefix }}.fv3_perturbation.nc", "{{ COMOUT_ATMOS_ANALYSIS }}/{{ RUN }}.t{{ cycle_HH }}z.atminc.nc"] + - ["{{ ICSDIR }}/{{ COMOUT_ATMOS_ANALYSIS | relpath(ROTDIR) }}/{{ m_prefix }}.fv3_perturbation.nc", "{{ COMOUT_ATMOS_ANALYSIS }}/{{ RUN }}.t{{ cycle_HH }}z.atminc.nc"] {% endif %} {% if DO_NEST %} @@ -77,7 +80,7 @@ atmosphere_nest: copy: {% if EXP_WARM_START == True %} {% for ftype in ["ca_data", "fv_core.res", "fv_srf_wnd.res", "fv_tracer.res", "phy_data", "sfc_data"] %} - - ["{{ ICSDIR }}/{{ COMOUT_ATMOS_RESTART_PREV | relpath(ROTDIR) }}/{{ r_prefix }}.{{ ftype }}.tile{{ ntile }}.nc", "{{ COMOUT_ATMOS_RESTART_PREV }}/{{ r_prefix }}.{{ ftype }}.nest0{{ ntile-5 }}.tile{{ ntile }}.nc"] + - ["{{ ICSDIR }}/{{ COMOUT_ATMOS_RESTART_PREV | relpath(ROTDIR) }}/{{ m_prefix }}.{{ ftype }}.tile{{ ntile }}.nc", "{{ COMOUT_ATMOS_RESTART_PREV }}/{{ m_prefix }}.{{ ftype }}.nest0{{ ntile-5 }}.tile{{ ntile }}.nc"] {% endfor %} # ftype {% else %} {% for ftype in ["gfs_data", "sfc_data"] %} @@ -91,7 +94,7 @@ ice: mkdir: - "{{ COMOUT_ICE_RESTART_PREV }}" copy: - - ["{{ ICSDIR }}/{{ COMOUT_ICE_RESTART_PREV | relpath(ROTDIR) }}/{{ r_prefix }}.cice_model.res.nc", "{{ COMOUT_ICE_RESTART_PREV }}"] + - ["{{ ICSDIR }}/{{ COMOUT_ICE_RESTART_PREV | relpath(ROTDIR) }}/{{ o_prefix }}.cice_model.res.nc", "{{ COMOUT_ICE_RESTART_PREV }}"] {% endif %} {% if DO_OCN %} @@ -99,10 +102,10 @@ ocean: mkdir: - "{{ COMOUT_OCEAN_RESTART_PREV }}" copy: - - ["{{ ICSDIR }}/{{ COMOUT_OCEAN_RESTART_PREV | relpath(ROTDIR) }}/{{ r_prefix }}.MOM.res.nc", "{{ COMOUT_OCEAN_RESTART_PREV }}"] + - ["{{ ICSDIR }}/{{ COMOUT_OCEAN_RESTART_PREV | relpath(ROTDIR) }}/{{ o_prefix }}.MOM.res.nc", "{{ COMOUT_OCEAN_RESTART_PREV }}"] {% if OCNRES == "025" %} {% for nn in range(1, 3) %} - - ["{{ ICSDIR }}/{{ COMOUT_OCEAN_RESTART_PREV | relpath(ROTDIR) }}/{{ r_prefix }}.MOM.res_{{ nn }}.nc", "{{ COMOUT_OCEAN_RESTART_PREV }}"] + - ["{{ ICSDIR }}/{{ COMOUT_OCEAN_RESTART_PREV | relpath(ROTDIR) }}/{{ o_prefix }}.MOM.res_{{ nn }}.nc", "{{ COMOUT_OCEAN_RESTART_PREV }}"] {% endfor %} {% endif %} @@ -111,16 +114,16 @@ replay: mkdir: - "{{ COMOUT_OCEAN_ANALYSIS }}" copy: - - ["{{ ICSDIR }}/{{ COMOUT_OCEAN_ANALYSIS | relpath(ROTDIR) }}/{{ r_prefix }}.mom6_perturbation.nc", "{{ COMOUT_OCEAN_ANALYSIS }}/mom6_increment.nc"] + - ["{{ ICSDIR }}/{{ COMOUT_OCEAN_ANALYSIS | relpath(ROTDIR) }}/{{ o_prefix }}.mom6_perturbation.nc", "{{ COMOUT_OCEAN_ANALYSIS }}/mom6_increment.nc"] {% endif %} {% if EXP_WARM_START == True %} -{% if path_exists(ICSDIR ~ "/" ~ COMOUT_MED_RESTART_PREV | relpath(ROTDIR) ~ "/" ~ r_prefix ~ ".ufs.cpld.cpl.r.nc") %} +{% if path_exists(ICSDIR ~ "/" ~ COMOUT_MED_RESTART_PREV | relpath(ROTDIR) ~ "/" ~ m_prefix ~ ".ufs.cpld.cpl.r.nc") %} mediator: mkdir: - "{{ COMOUT_MED_RESTART_PREV }}" copy: - - ["{{ ICSDIR }}/{{ COMOUT_MED_RESTART_PREV | relpath(ROTDIR) }}/{{ r_prefix }}.ufs.cpld.cpl.r.nc", "{{ COMOUT_MED_RESTART_PREV }}"] + - ["{{ ICSDIR }}/{{ COMOUT_MED_RESTART_PREV | relpath(ROTDIR) }}/{{ m_prefix }}.ufs.cpld.cpl.r.nc", "{{ COMOUT_MED_RESTART_PREV }}"] {% endif %} # path exists {% endif %} # warm start true @@ -131,5 +134,5 @@ wave: mkdir: - "{{ COMOUT_WAVE_RESTART_PREV }}" copy: - - ["{{ ICSDIR }}/{{ COMOUT_WAVE_RESTART_PREV | relpath(ROTDIR) }}/{{ r_prefix }}.restart.{{ waveGRD }}", "{{ COMOUT_WAVE_RESTART_PREV }}"] + - ["{{ ICSDIR }}/{{ COMOUT_WAVE_RESTART_PREV | relpath(ROTDIR) }}/{{ o_prefix }}.restart.{{ waveGRD }}", "{{ COMOUT_WAVE_RESTART_PREV }}"] {% endif %} diff --git a/scripts/exglobal_stage_ic.py b/scripts/exglobal_stage_ic.py index b294ebb018..02b3b62973 100755 --- a/scripts/exglobal_stage_ic.py +++ b/scripts/exglobal_stage_ic.py @@ -18,8 +18,8 @@ def main(): stage = Stage(config) # Pull out all the configuration keys needed to run stage job - keys = ['RUN', 'MODE', 'EXP_WARM_START', - 'current_cycle', 'model_start_date_current_cycle', + keys = ['RUN', 'MODE', 'EXP_WARM_START', 'current_cycle', + 'current_cycle_offset', 'model_start_date_current_cycle', 'ROTDIR', 'ICSDIR', 'STAGE_IC_YAML_TMPL', 'OCNRES', 'waveGRD', 'ntiles', 'REPLAY_ICS', 'DO_WAVE', 'DO_OCN', 'DO_ICE', 'DO_NEST']