Skip to content

Commit

Permalink
Add previous_cycle to staging yaml for sfcanl_data
Browse files Browse the repository at this point in the history
- Add previous_cycle as p_prefix
- Add sfcanl_data tile files to warm start file pickup
- Change some m_prefix to o_prefix

Refs #2475
  • Loading branch information
KateFriedman-NOAA committed Aug 5, 2024
1 parent deec1af commit 5f755ae
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
3 changes: 1 addition & 2 deletions jobs/JGLOBAL_STAGE_IC
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ previous_cycle=$(date --utc -d "${current_cycle:0:8} ${current_cycle:8:2} - ${as
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
Expand All @@ -30,7 +29,7 @@ else
model_start_date_current_cycle=${current_cycle}
fi
fi
export model_start_date_current_cycle
export previous_cycle current_cycle_offset model_start_date_current_cycle

# Define MEMDIR_ARRAY
MEMDIR_ARRAY=()
Expand Down
10 changes: 7 additions & 3 deletions parm/stage/stage.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
{% set cycle_HH = current_cycle | strftime("%H") %}
{% 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" %}
{% set p_prefix = previous_cycle | to_YMD + "." + previous_cycle | strftime("%H") + "0000" %}

#############################################################
# Initial condition to stage
Expand All @@ -44,13 +45,16 @@ atmosphere_warm:
- "{{ COMOUT_ATMOS_RESTART_PREV }}"
copy:
{% for ftype in ["coupler.res", "fv_core.res.nc"] %}
- ["{{ ICSDIR }}/{{ COMOUT_ATMOS_RESTART_PREV | relpath(ROTDIR) }}/{{ m_prefix }}.{{ ftype }}", "{{ COMOUT_ATMOS_RESTART_PREV }}"]
- ["{{ ICSDIR }}/{{ COMOUT_ATMOS_RESTART_PREV | relpath(ROTDIR) }}/{{ o_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) }}/{{ m_prefix }}.{{ ftype }}.tile{{ ntile }}.nc", "{{ COMOUT_ATMOS_RESTART_PREV }}"]
- ["{{ ICSDIR }}/{{ COMOUT_ATMOS_RESTART_PREV | relpath(ROTDIR) }}/{{ o_prefix }}.{{ ftype }}.tile{{ ntile }}.nc", "{{ COMOUT_ATMOS_RESTART_PREV }}"]
{% endfor %} # ntile
{% endfor %} # ftype
{% for ntile in range(1, ntiles + 1) %}
- ["{{ ICSDIR }}/{{ COMOUT_ATMOS_RESTART_PREV | relpath(ROTDIR) }}/{{ p_prefix }}.sfcanl_data.tile{{ ntile }}.nc", "{{ COMOUT_ATMOS_RESTART_PREV }}"]
{% endfor %} # ntile
{% else %}
atmosphere_cold:
mkdir:
Expand Down Expand Up @@ -80,7 +84,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) }}/{{ m_prefix }}.{{ ftype }}.tile{{ ntile }}.nc", "{{ COMOUT_ATMOS_RESTART_PREV }}/{{ m_prefix }}.{{ ftype }}.nest0{{ ntile-5 }}.tile{{ ntile }}.nc"]
- ["{{ ICSDIR }}/{{ COMOUT_ATMOS_RESTART_PREV | relpath(ROTDIR) }}/{{ o_prefix }}.{{ ftype }}.tile{{ ntile }}.nc", "{{ COMOUT_ATMOS_RESTART_PREV }}/{{ o_prefix }}.{{ ftype }}.nest0{{ ntile-5 }}.tile{{ ntile }}.nc"]
{% endfor %} # ftype
{% else %}
{% for ftype in ["gfs_data", "sfc_data"] %}
Expand Down
3 changes: 2 additions & 1 deletion scripts/exglobal_stage_ic.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +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',
keys = ['RUN', 'MODE', 'EXP_WARM_START',
'previous_cycle', 'current_cycle',
'current_cycle_offset', 'model_start_date_current_cycle',
'ROTDIR', 'ICSDIR', 'STAGE_IC_YAML_TMPL',
'OCNRES', 'waveGRD', 'ntiles',
Expand Down

0 comments on commit 5f755ae

Please sign in to comment.