begin options
{% if save_flows is defined %}  save_flows
{% endif %}
{%- if storagecoefficient is defined %}  storagecoefficient
{% endif -%}
end options

begin griddata
  iconvert{% if iconvert_layered %} layered{% endif %}
{% for x in iconvert %}    {{x}}
{% endfor %}  ss{% if ss_layered %} layered{% endif %}
{% for x in ss %}    {{x}}
{% endfor %} 
{%- if sy is defined %}  sy{% if sy_layered %} layered{% endif %}
{% for x in sy %}    {{x}}
{% endfor -%}
{% endif -%}

end griddata

{% for i, value in periods.items() %}begin period {{i}}
  {% if value %}transient{% else %}steady-state{% endif %}
end period
{% endfor %}