Skip to content

Commit

Permalink
coding norms + more IAU fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
CoryMartin-NOAA committed Jun 10, 2024
1 parent 18aaafa commit 135c57f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 9 deletions.
21 changes: 14 additions & 7 deletions parm/gdas/snow_finalize_ens_update.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,6 @@
######################################
{% set PDY = current_cycle | to_YMD %}
{% set cyc = current_cycle | strftime("%H") %}
{% if DOIAU %}
{% set bkg_time = SNOW_WINDOW_BEGIN | to_fv3time %}
{% else %}
{% set bkg_time = current_cycle | to_fv3time %}
{% endif %}
copy:
######################################
# copy analyses to directories
Expand All @@ -33,8 +28,14 @@ copy:
{% set com_ns.COM_SNOW_ANALYSIS_MEM = com_ns.COM_SNOW_ANALYSIS_MEM.replace(search_term, replace_term) %}
{% endfor %}
{% for tile in range(1, 7) %}
- ["{{ DATA }}/anl/mem{{ '%03d' % mem }}/{{ bkg_time }}.sfc_data.tile{{ tile }}.nc", "{{ com_ns.COM_SNOW_ANALYSIS_MEM }}/{{ bkg_time }}.sfc_data.tile{{ tile }}.nc"]
- ["{{ DATA }}/anl/mem{{ '%03d' % mem }}/{{ current_cycle | to_fv3time }}.sfc_data.tile{{ tile }}.nc", "{{ com_ns.COM_SNOW_ANALYSIS_MEM }}/{{ current_cycle | to_fv3time }}.sfc_data.tile{{ tile }}.nc"]
{% endfor %}
{% if DOIAU %}
# if using IAU, also need analyses copied at the beginning of the window
{% for tile in range(1, 7) %}
- ["{{ DATA }}/anl/mem{{ '%03d' % mem }}/{{ SNOW_WINDOW_BEGIN | to_fv3time }}.sfc_data.tile{{ tile }}.nc", "{{ com_ns.COM_SNOW_ANALYSIS_MEM }}/{{ SNOW_WINDOW_BEGIN | to_fv3time }}.sfc_data.tile{{ tile }}.nc"]
{% endfor %}
{% endif %}
{% endfor %}
######################################
# copy ensemble mean increment to COM
Expand All @@ -59,5 +60,11 @@ copy:
{% set com_ns.COM_SNOW_ANALYSIS_MEM = com_ns.COM_SNOW_ANALYSIS_MEM.replace(search_term, replace_term) %}
{% endfor %}
{% for tile in range(1, 7) %}
- ["{{ DATA }}/inc/ensmean/snowinc.{{ bkg_time }}.sfc_data.tile{{ tile }}.nc", "{{ com_ns.COM_SNOW_ANALYSIS_MEM }}/snowinc.{{ bkg_time }}.sfc_data.tile{{ tile }}.nc"]
- ["{{ DATA }}/inc/ensmean/snowinc.{{ current_cycle | to_fv3time }}.sfc_data.tile{{ tile }}.nc", "{{ com_ns.COM_SNOW_ANALYSIS_MEM }}/snowinc.{{ current_cycle | to_fv3time }}.sfc_data.tile{{ tile }}.nc"]
{% endfor %}
{% if DOIAU %}
# if using IAU, also need increment copied at the beginning of the window
{% for tile in range(1, 7) %}
- ["{{ DATA }}/inc/ensmean/snowinc.{{ SNOW_WINDOW_BEGIN | to_fv3time }}.sfc_data.tile{{ tile }}.nc", "{{ com_ns.COM_SNOW_ANALYSIS_MEM }}/snowinc.{{ SNOW_WINDOW_BEGIN | to_fv3time }}.sfc_data.tile{{ tile }}.nc"]
{% endfor %}
{% endif %}
4 changes: 2 additions & 2 deletions ush/python/pygfs/task/snowens_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,12 +239,12 @@ def addEnsIncrements(self) -> None:
for itile in range(1, 7):
filename_in = template_in.format(tilenum=itile)
filename_out = template_out.format(tilenum=itile)
src = os.path.join(self.task_config.DATA, 'inc', 'ensmean', filename_in)
src = os.path.join(self.task_config.DATA, 'inc', 'ensmean', filename_in)
dest = os.path.join(self.task_config.DATA, 'inc', 'ensmean', filename_out)
inclist.append([src, dest])
FileHandler({'copy': inclist}).sync()
# if running with IAU, we also need an analysis at the beginning of the window
bkg_times.append(self.task_config.SNOW_WINDOW_BEGIN)
bkg_times.append(self.task_config.SNOW_WINDOW_BEGIN)

for bkg_time in bkg_times:
for mem in range(1, self.task_config.NMEM_ENS + 1):
Expand Down

0 comments on commit 135c57f

Please sign in to comment.