Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Renamed and reapportioned yamls for letkf task #1212

Merged
merged 3 commits into from
Jul 8, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions parm/soca/letkf/letkf.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ background:
members from template:
template:
date: '{{ WINDOW_MIDDLE | to_isotime }}'
ocn_filename: "{{ GDUMP_ENS }}.ocean.t{{ gcyc }}z.inst.f006.nc"
ice_filename: "{{ GDUMP_ENS }}.ice.t{{ gcyc }}z.inst.f006.nc"
ocn_filename: "{{ RUN }}.ocean.t{{ gcyc }}z.inst.f006.nc"
ice_filename: "{{ RUN }}.ice.t{{ gcyc }}z.inst.f006.nc"
read_from_file: 1
basename: ./ens/mem%mem%
state variables: [socn, tocn, ssh, uocn, vocn, cicen]
Expand Down
38 changes: 0 additions & 38 deletions parm/soca/letkf/letkf_stage.yaml.j2
Original file line number Diff line number Diff line change
@@ -1,49 +1,11 @@
######################################
# set some variables
######################################
{% set gPDY = previous_cycle | to_YMD %}
{% set gcyc = previous_cycle | strftime("%H") %}
{% set PDY = current_cycle | to_YMD %}
{% set cyc = current_cycle | strftime("%H") %}
######################################
# create working directories
######################################
mkdir:
- "{{ DATA }}/Data"
- "{{ DATA }}/obs"
- "{{ DATA }}/INPUT"
{% for mem in range(1, NMEM_ENS + 1) %}
- "{{ DATA }}/ens/mem{{ '%03d' % mem }}"
{% endfor %}
copy:
######################################
# copy mom input template
######################################
- ["{{ PARMgfs }}/gdas/soca/fms/input.nml", "{{ DATA }}/mom_input.nml.tmpl"]
######################################
# copy ensemble background files
######################################
{% for mem in range(1, NMEM_ENS + 1) %}
# define variables
# Declare a dict of search and replace terms to GDUMP on each template
{% set tmpl_dict = {'ROTDIR':ROTDIR,
'RUN': GDUMP_ENS,
'YMD':gPDY,
'HH':gcyc,
'MEMDIR':"mem" + '%03d' % mem} %}

# Replace template variables with tmpl_dict, one key at a time
# This must be done in a namespace to overcome jinja scoping
# Variables set inside of a for loop are lost at the end of the loop
# unless they are part of a namespace
{% set com_prev_ocn = namespace(COMIN_OCEAN_HISTORY_MEM = COM_OCEAN_HISTORY_TMPL) %}
{% set com_prev_ice = namespace(COMIN_ICE_HISTORY_MEM = COM_ICE_HISTORY_TMPL) %}
{% for key in tmpl_dict.keys() %}
{% set search_term = '${' + key + '}' %}
{% set replace_term = tmpl_dict[key] %}
{% set com_prev_ocn.COMIN_OCEAN_HISTORY_MEM = com_prev_ocn.COMIN_OCEAN_HISTORY_MEM.replace(search_term, replace_term) %}
{% set com_prev_ice.COMIN_ICE_HISTORY_MEM = com_prev_ice.COMIN_ICE_HISTORY_MEM.replace(search_term, replace_term) %}
{% endfor %}
- ["{{ com_prev_ocn.COMIN_OCEAN_HISTORY_MEM }}/{{ GDUMP_ENS }}.ocean.t{{ gcyc }}z.inst.f006.nc", "{{ DATA }}/ens/mem{{ '%03d' % mem }}/{{ GDUMP_ENS }}.ocean.t{{ gcyc }}z.inst.f006.nc"]
- ["{{ com_prev_ice.COMIN_ICE_HISTORY_MEM }}/{{ GDUMP_ENS }}.ice.t{{ gcyc }}z.inst.f006.nc", "{{ DATA }}/ens/mem{{ '%03d' % mem }}/{{ GDUMP_ENS }}.ice.t{{ gcyc }}z.inst.f006.nc"]
{% endfor %}
40 changes: 40 additions & 0 deletions parm/soca/soca_ens_bkg_stage.yaml.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
######################################
# set some variables
######################################
{% set gPDY = previous_cycle | to_YMD %}
{% set gcyc = previous_cycle | strftime("%H") %}
######################################
# create ens bkg directories
######################################
mkdir:
{% for mem in range(1, NMEM_ENS + 1) %}
- "{{ DATA }}/ens/mem{{ '%03d' % mem }}"
{% endfor %}
######################################
# copy ensemble background files
######################################
copy:
{% for mem in range(1, NMEM_ENS + 1) %}
AndrewEichmann-NOAA marked this conversation as resolved.
Show resolved Hide resolved
# define variables
# Declare a dict of search and replace terms to GDUMP on each template
{% set tmpl_dict = {'ROTDIR':ROTDIR,
'RUN': RUN,
'YMD':gPDY,
'HH':gcyc,
'MEMDIR':"mem" + '%03d' % mem} %}

# Replace template variables with tmpl_dict, one key at a time
# This must be done in a namespace to overcome jinja scoping
# Variables set inside of a for loop are lost at the end of the loop
# unless they are part of a namespace
{% set com_prev_ocn = namespace(COMIN_OCEAN_HISTORY_MEM = COM_OCEAN_HISTORY_TMPL) %}
{% set com_prev_ice = namespace(COMIN_ICE_HISTORY_MEM = COM_ICE_HISTORY_TMPL) %}
{% for key in tmpl_dict.keys() %}
{% set search_term = '${' + key + '}' %}
{% set replace_term = tmpl_dict[key] %}
{% set com_prev_ocn.COMIN_OCEAN_HISTORY_MEM = com_prev_ocn.COMIN_OCEAN_HISTORY_MEM.replace(search_term, replace_term) %}
{% set com_prev_ice.COMIN_ICE_HISTORY_MEM = com_prev_ice.COMIN_ICE_HISTORY_MEM.replace(search_term, replace_term) %}
{% endfor %}
- ["{{ com_prev_ocn.COMIN_OCEAN_HISTORY_MEM }}/{{ RUN }}.ocean.t{{ gcyc }}z.inst.f006.nc", "{{ DATA }}/ens/mem{{ '%03d' % mem }}/{{ RUN }}.ocean.t{{ gcyc }}z.inst.f006.nc"]
- ["{{ com_prev_ice.COMIN_ICE_HISTORY_MEM }}/{{ RUN }}.ice.t{{ gcyc }}z.inst.f006.nc", "{{ DATA }}/ens/mem{{ '%03d' % mem }}/{{ RUN }}.ice.t{{ gcyc }}z.inst.f006.nc"]
{% endfor %}
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
mkdir:
- "{{ DATA }}/INPUT"
######################################
AndrewEichmann-NOAA marked this conversation as resolved.
Show resolved Hide resolved
# fix files to copy
######################################
Expand Down
Loading