Skip to content

Commit

Permalink
Add stream.jinja2 file
Browse files Browse the repository at this point in the history
  • Loading branch information
maddenp-noaa committed Aug 8, 2024
1 parent 1359f11 commit 39dad35
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 1 deletion.
2 changes: 1 addition & 1 deletion coastal/coastal.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ cdeps:
yearAlign: 2008
yearFirst: 2008
yearLast: 2008
template_file: '{{ dir.test }}/stream.jinja2'
template_file: stream.jinja2
coastal:
execution:
batchargs:
Expand Down
33 changes: 33 additions & 0 deletions coastal/stream.jinja2
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{% set stream_info = [] -%}
{% for key, val in streams.items() -%}
{% set _ = stream_info.append( key ) -%}
{% endfor -%}
stream_info: {{ stream_info | join(' ') }}
{% for key, val in streams.items() %}
taxmode{{'%02d' % loop.index}}: {{ val['taxmode'] }}
mapalgo{{'%02d' % loop.index}}: {{ val['mapalgo'] }}
tInterpAlgo{{'%02d' % loop.index}}: {{ val['tinterpalgo'] }}
readMode{{'%02d' % loop.index}}: {{ val['readmode'] }}
dtlimit{{'%02d' % loop.index}}: {{ val['dtlimit'] }}
stream_offset{{'%02d' % loop.index}}: {{ val['stream_offset'] }}
yearFirst{{'%02d' % loop.index}}: {{ val['yearFirst'] }}
yearLast{{'%02d' % loop.index}}: {{ val['yearLast'] }}
yearAlign{{'%02d' % loop.index}}: {{ val['yearAlign'] }}
{% if val['stream_vectors'] is string -%}
stream_vectors{{'%02d' % loop.index}}: {{ val['stream_vectors'] }}
{% else -%}
stream_vectors{{'%02d' % loop.index}}: "{{ val['stream_vectors'] | join(':') }}"
{% endif -%}
stream_mesh_file{{'%02d' % loop.index}}: {{ val['stream_mesh_file'] }}
stream_lev_dimname{{'%02d' % loop.index}}: {{ val['stream_lev_dimname'] }}
{% if val['stream_data_files'] | length > 1 -%}
stream_data_files{{'%02d' % loop.index}}: ""{{ val['stream_data_files'] | join('" "') }}""
{% else -%}
stream_data_files{{'%02d' % loop.index}}: "{{ val['stream_data_files'] | first }}"
{% endif -%}
{% if val['stream_data_variables'] is string -%}
stream_data_variables{{'%02d' % loop.index}}: "{{ val['stream_data_variables'] }}"
{% else -%}
stream_data_variables{{'%02d' % loop.index}}: "{{ val['stream_data_variables'] | join('" "') }}"
{% endif -%}
{% endfor %}

0 comments on commit 39dad35

Please sign in to comment.