C*******************************************************************************
C
C                      IWFM STREAM CONFIGURATION FILE
C
C                         Version {{ version | default('5.0') }}
C                         Generated by pyiwfm
C                         {{ generation_time }}
C
C*******************************************************************************
C
C   This file defines the stream network geometry and connectivity.
C
C   NREACH  ; Number of stream reaches
C
C   For each reach:
C     ID        ; Reach identification number
C     UPNODE    ; Upstream boundary stream node
C     DNNODE    ; Downstream boundary stream node
C     OUTREACH  ; Outflow reach (0 if outflows from model)
C     INFLOW    ; Inflow reach list (negative for external inflow)
C
C-----------------------------------------------------------------------------
{{ n_reaches | default(0) }}                                     / NREACH
{% if n_reaches > 0 %}
C
C   For each reach, define its properties
C
{% for reach in reaches %}
C   Reach {{ reach.id }}
{{ reach.id }}                                             / ID
{{ reach.upstream_node }}                                  / UPNODE
{{ reach.downstream_node }}                                / DNNODE
{{ reach.outflow_reach | default(0) }}                     / OUTREACH
{% for inflow in reach.inflows %}
{{ inflow }}                                               / INFLOW
{% endfor %}
{% endfor %}
{% endif %}
C
C   NSTRMNODE  ; Number of stream nodes
C
C   For each stream node:
C     ID      ; Stream node identification number
C     GWN     ; Groundwater node associated with this stream node
C     REACH   ; Reach that this stream node belongs to
C     STAGE   ; Stage elevation at stream node
C
C-----------------------------------------------------------------------------
{{ n_stream_nodes | default(0) }}                                / NSTRMNODE
{% if n_stream_nodes > 0 %}
C
C   ID      GWN   REACH        STAGE
C-----------------------------------------------------------------------------
{% endif %}
