Skip to content

Commit

Permalink
Refactor stage yamls
Browse files Browse the repository at this point in the history
  • Loading branch information
KateFriedman-NOAA committed May 23, 2024
1 parent 5e8f92f commit 1cf0063
Show file tree
Hide file tree
Showing 8 changed files with 50 additions and 55 deletions.
9 changes: 2 additions & 7 deletions parm/stage/fv3_cold.yaml.j2
Original file line number Diff line number Diff line change
@@ -1,16 +1,11 @@
# # First 1/2 cycle also needs a atmos increment if doing warm start
# if inputs.start in ['warm']:
# for ftype in ['atmi003.nc', 'atminc.nc', 'atmi009.nc']:
# if inputs.nens > 0:
#for ftype in ['ratmi003.nc', 'ratminc.nc', 'ratmi009.nc']
{% set cycle_YMDH = current_cycle | to_YMDH %}
fv3_cold:
mkdir:
- "{{ COM_ATMOS_INPUT }}"
copy:
- ["{{ BASE_CPLIC }}/{{ CPL_ATMIC }}/{{ cycle_YMDH }}/atmos/gfs_ctrl.nc", "{{ COM_ATMOS_INPUT }}/gfs_ctrl.nc"]
- ["{{ BASE_CPLIC }}/{{ CPL_ATMIC }}/{{ cycle_YMDH }}/{{ MEMDIR }}/atmos/gfs_ctrl.nc", "{{ COM_ATMOS_INPUT }}/gfs_ctrl.nc"]
{% for ftype in ["gfs_data", "sfc_data"] %}
{% for ntile in range(1, ntiles + 1) %}
- ["{{ BASE_CPLIC }}/{{ CPL_ATMIC }}/{{ cycle_YMDH }}/atmos/{{ ftype }}.tile{{ ntile }}.nc", "{{ COM_ATMOS_INPUT }}/{{ ftype }}.tile{{ ntile }}.nc"]
- ["{{ BASE_CPLIC }}/{{ CPL_ATMIC }}/{{ cycle_YMDH }}/{{ MEMDIR }}/atmos/{{ ftype }}.tile{{ ntile }}.nc", "{{ COM_ATMOS_INPUT }}/{{ ftype }}.tile{{ ntile }}.nc"]
{% endfor %} # ntile
{% endfor %} # ftype
13 changes: 8 additions & 5 deletions parm/stage/fv3_nest.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,14 @@
# tgt="${COM_ATMOS_INPUT}/${ftype}.tile${tt}.nc"
# if (( ntiles > 6 )); then
# ${NLN} "${COM_ATMOS_INPUT}/${ftype}.tile7.nc" "${COM_ATMOS_INPUT}/${ftype}.nest02.tile7.nc"
fv3:
name: "FV3"
target: "{{ COM_ATMOS_RESTART_PREV }}"
{% set ntile = 7 %}
required:
{% set cycle_HH = current_cycle | strftime("%H") %}
{% set cycle_YMD = current_cycle | to_YMD %}
{% set cycle_YMDH = current_cycle | to_YMDH %}
{% set ntile = 7 %}
fv3_nest:
mkdir:
- "{{ COM_ATMOS_RESTART_PREV }}"
copy:
#---------------
# WARM START
#---------------
Expand Down
21 changes: 9 additions & 12 deletions parm/stage/fv3_warm.yaml.j2
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
# # First 1/2 cycle also needs a atmos increment if doing warm start
# if inputs.start in ['warm']:
# for ftype in ['atmi003.nc', 'atminc.nc', 'atmi009.nc']:
# if inputs.nens > 0:
#for ftype in ['ratmi003.nc', 'ratminc.nc', 'ratmi009.nc']
{% set cycle_HH = current_cycle | strftime("%H") %}
{% set cycle_YMD = current_cycle | to_YMD %}
{% set cycle_YMDH = current_cycle | to_YMDH %}
fv3_warm:
name: "FV3_WARM"
target: "{{ COM_ATMOS_RESTART_PREV }}"
required:
#TODO: Set MEMDIR as empty if not set?
{% set head = "{{ BASE_CPLIC }}/{{ CPL_ATMIC }}/{{ cycle_YMD }}{{ cycle_HH }}/{{ MEMDIR }}/atmos/{{ cycle_YMD }}.{{ cycle_HH }}0000." %}
mkdir:
- "{{ COM_ATMOS_RESTART_PREV }}"
copy:
{% set head = "{{ BASE_CPLIC }}/{{ CPL_ATMIC }}/{{ cycle_YMDH }}/{{ MEMDIR }}/atmos/{{ cycle_YMD }}.{{ cycle_HH }}0000." %}
{% for ftype in ["coupler.res", "fv_core.res.nc"] %}
- "{{ head }}{{ ftype }}"
- ["{{ head }}{{ ftype }}", "{{ COM_ATMOS_RESTART_PREV }}/{{ cycle_YMD }}.{{ cycle_HH }}0000.{{ ftype }}"]
{% 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) %}
- "{{ head }}{{ ftype }}.tile{{ ntile }}.nc"
- ["{{ head }}{{ ftype }}.tile{{ ntile }}.nc", "{{ COM_ATMOS_RESTART_PREV }}/{{ cycle_YMD }}.{{ cycle_HH }}0000.{{ ftype }}.tile{{ ntile }}.nc"]
{% endfor %} # ntile
{% endfor %} # ftype
11 changes: 7 additions & 4 deletions parm/stage/ice.yaml.j2
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
{% set cycle_HH = current_cycle | strftime("%H") %}
{% set cycle_YMD = current_cycle | to_YMD %}
{% set cycle_YMDH = current_cycle | to_YMDH %}
ice:
name: "ICE"
target: "{{ COM_ICE_RESTART_PREV }}"
required:
- "{{ BASE_CPLIC }}/{{ CPL_ICEIC }}/{{ cycle_YMD }}{{ cycle_HH }}/{{ MEMDIR }}/ice/{{ cycle_YMD }}.{{ cycle_HH }}0000.cice_model.res.nc"
mkdir:
- "{{ COM_ICE_RESTART_PREV }}"
copy:
- ["{{ BASE_CPLIC }}/{{ CPL_ICEIC }}/{{ cycle_YMDH }}/{{ MEMDIR }}/ice/{{ cycle_YMD }}.{{ cycle_HH }}0000.cice_model.res.nc", "{{ COM_ICE_RESTART_PREV }}/{{ cycle_YMD }}.{{ cycle_HH }}0000.cice_model.res.nc"]
9 changes: 0 additions & 9 deletions parm/stage/master_forecast_only.yaml.j2
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
{% set cycle_HH = current_cycle | strftime("%H") %}
{% set cycle_YMD = current_cycle | to_YMD %}
{% set cycle_YMDH = current_cycle | to_YMDH %}
datasets:

{% if EXP_WARM_START %}
Expand All @@ -20,26 +17,20 @@ datasets:
{% endif %}

{% if DO_WAVE %}
{% if EXP_WARM_START %}
{% filter indent(width=4) %}
{% include "wave.yaml.j2" %}
{% endfilter %}
{% endif %}
{% endif %}

{% if DO_OCN %}
{% if EXP_WARM_START %}
{% filter indent(width=4) %}
{% include "ocean.yaml.j2" %}
#TODO:#{% include "mediator.yaml.j2" %}
{% endfilter %}
{% endif %}
{% endif %}

{% if DO_ICE %}
{% if EXP_WARM_START %}
{% filter indent(width=4) %}
{% include "ice.yaml.j2" %}
{% endfilter %}
{% endif %}
{% endif %}
11 changes: 7 additions & 4 deletions parm/stage/mediator.yaml.j2
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
{% set cycle_HH = current_cycle | strftime("%H") %}
{% set cycle_YMD = current_cycle | to_YMD %}
{% set cycle_YMDH = current_cycle | to_YMDH %}
mediator:
name: "MEDIATOR"
target: "{{ COM_MED_RESTART_PREV }}"
required:
- "{{ BASE_CPLIC }}/{{ CPL_MEDIC }}/{{ cycle_YMD }}{{ cycle_HH }}/{{ MEMDIR }}/med/{{ cycle_YMD }}.{{ cycle_HH }}0000.ufs.cpld.cpl.r.nc"
mkdir:
- "{{ COM_MED_RESTART_PREV }}"
copy:
- ["{{ BASE_CPLIC }}/{{ CPL_MEDIC }}/{{ cycle_YMDH }}/{{ MEMDIR }}/med/{{ cycle_YMD }}.{{ cycle_HH }}0000.ufs.cpld.cpl.r.nc", "{{ COM_MED_RESTART_PREV }}/{{ cycle_YMD }}.{{ cycle_HH }}0000.ufs.cpld.cpl.r.nc"]
18 changes: 10 additions & 8 deletions parm/stage/ocean.yaml.j2
Original file line number Diff line number Diff line change
@@ -1,24 +1,26 @@
{% set cycle_HH = current_cycle | strftime("%H") %}
{% set cycle_YMD = current_cycle | to_YMD %}
{% set cycle_YMDH = current_cycle | to_YMDH %}
ocean:
name: "OCEAN"
target: "{{ COM_OCEAN_RESTART_PREV }}"
required:
{% set head = "{{ BASE_CPLIC }}/{{ CPL_OCNIC }}/{{ cycle_YMD }}{{ cycle_HH }}/{{ MEMDIR }}/ocean" %}
mkdir:
- "{{ COM_OCEAN_RESTART_PREV }}"
copy:
{% set head = "{{ BASE_CPLIC }}/{{ CPL_OCNIC }}/{{ cycle_YMDH }}/{{ MEMDIR }}/ocean" %}
#-------------------------
# Ocean initial conditions
#-------------------------
- "{{ head }}/{{ cycle_YMD }}.{{ cycle_HH }}0000.MOM.res.nc"
- ["{{ head }}/{{ cycle_YMD }}.{{ cycle_HH }}0000.MOM.res.nc", "{{ COM_OCEAN_RESTART_PREV }}/{{ cycle_YMD }}.{{ cycle_HH }}0000.MOM.res.nc"]
#------------------------------------
# Resolution based initial conditions
#------------------------------------
#NOTE: {% if OCNRES == 500 or OCNRES == 100 %} # Nothing more to do for these resolutions
{% if OCNRES == 025 %}
{% for nn in $(seq 1 3) %}
- "{{ head }}/{{ cycle_YMD }}.{{ cycle_HH }}0000.MOM.res_{{ nn }}.nc"
- ["{{ head }}/{{ cycle_YMD }}.{{ cycle_HH }}0000.MOM.res_{{ nn }}.nc", "{{ COM_OCEAN_RESTART_PREV }}/{{ cycle_YMD }}.{{ cycle_HH }}0000.MOM.res_{{ nn }}.nc"]
{% endfor %}
{% endif %}
optional:
#-------------------------
# Ocean Perturbation Files
#-------------------------
{% if MEMDIR > 0 and USE_OCN_PERTURB_FILES %}
- "{{ head }}/{{ cycle_YMD }}.{{ cycle_HH }}0000.mom6_increment.nc"
- ["{{ head }}/{{ cycle_YMD }}.{{ cycle_HH }}0000.mom6_increment.nc", "{{ COM_OCEAN_RESTART_PREV }}/{{ cycle_YMD }}.{{ cycle_HH }}0000.mom6_increment.nc"]
13 changes: 7 additions & 6 deletions parm/stage/wave.yaml.j2
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
#TODO: these should be placed in $RUN.$gPDY/$gcyc)
{% set cycle_HH = current_cycle | strftime("%H") %}
{% set cycle_YMD = current_cycle | to_YMD %}
{% set cycle_YMDH = current_cycle | to_YMDH %}
wave:
#TODO: check if BASE_CPLIC/CPL_WAVIC exists?
name: "WAVE"
target: "{{ COM_WAVE_RESTART }}"
required:
mkdir:
- "{{ COM_WAVE_RESTART }}"
copy:
{% for grdID in waveGRD %}
- "{{ BASE_CPLIC }}/{{ CPL_WAVIC }}/{{ cycle_YMD }}{{ cycle_HH }}/{{ MEMDIR }}/wave/{{ cycle_YMD }}.{{ cycle_HH }}0000.restart.{{ grdID }}"
- ["{{ BASE_CPLIC }}/{{ CPL_WAVIC }}/{{ cycle_YMDH }}/{{ MEMDIR }}/wave/{{ cycle_YMD }}.{{ cycle_HH }}0000.restart.{{ grdID }}", "{{ COM_WAVE_RESTART }}/{{ cycle_YMD }}.{{ cycle_HH }}0000.restart.{{ grdID }}"]
{% endfor %}

0 comments on commit 1cf0063

Please sign in to comment.