diff --git a/coastal/coastal.yaml b/coastal/coastal.yaml index 4cd346f..63e5dea 100644 --- a/coastal/coastal.yaml +++ b/coastal/coastal.yaml @@ -36,7 +36,7 @@ cdeps: yearAlign: 2008 yearFirst: 2008 yearLast: 2008 - template_file: '{{ dir.test }}/stream.jinja2' + template_file: stream.jinja2 coastal: execution: batchargs: diff --git a/coastal/stream.jinja2 b/coastal/stream.jinja2 new file mode 100644 index 0000000..28ac7cf --- /dev/null +++ b/coastal/stream.jinja2 @@ -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 %}