Flowcharts and variable descriptions by subroutine. 32. 2.1 ..... file names and years and nodes for which output is desired. The salt .... may be real or integer except for those ... station identifier gw3 ...... Values are stored in the file QRINF(i).
LBL--32063 DE93 001536
SAN JOAQUIN-
TULARE CONJUNCTIVE MODEL
Detailed
Model
Nigel
W.T.
USE
Description
Quinn
Earth Sciences Division Lawrence Berkeley Laboratory University of California Berkeley, California 94720
March 1992
This work was supported in part by the US Bureau of Reclamation, under U.S. Department of the Interior Interagency Agreement No. 0-AA-20-09410, through U.S, Department of Energy Contract No. DE-AC0376SF00098.
MASTER Q_TRIBUTION
OF THIS DOCUMENT
IS U_NLIMtTEL.,
Abstract The
San
originally
Joaquin
developed
evaluate
possible
drainage
- related
California. delivery
model.
The the
for
the
scenarios
model
main
objectives
for
This variables
State
document
is
Joaquin
used
and
Joaquin-Tulare
Conjunctive
Zhao.
Version
1.0
of
Berkeley
and
LBL
at
UC
the by
balances River
to
Control
a
Valley
along
Board
of
the
and
of a surface
regional
allow
to
drainage
coupling
with
description
in the
Suggestions Use
model for
Model
SANTUCM Dr
its
Program
of
Joaquin
was
groundwater tributaries
assessment
water
and
of
quality
River.
a detailed
parameters
"Evaluation
Resources
is
model
Joaquin
Drainage
San
model
salinity
(SANTUCM)
management
western
this
Model
Valley
operations
Water
San
Joaquin
the
of
San
Use
long-term
performs
of the
the
and
in
reservoir
stem
with
San
aspect
also
Conjunctive
for
problems
and
compliance
document
Tulare
A unique
water
along
-
and
was
Taghavi,
Corporation.
- 111-
the
various
complements
Further
(SANTUCM)"
model
Alireza
of
the
Development by
formerly
to
Quinn,
the of
review
of
Tabios,
provided
subroutines,
the
Shen
research
Boyle
San and
team
Engineering
TABLE OF CONTENTS Page 1.
2.
General description and study objectives 1.1 Gverview
6 6
1.2
General description of SANTUCM 1.2.1 Tulare operations module 1.2.2 Millerton operations module 1.2.3 Salinity Model
6 9 10 12
1.3
Variable definitions
12
1.4
Abbreviations
12
1.5
Linkage 1.5.1 1.5.2 1.5.3
13 13 13 13
1.6
Groundwater Model parameter files 1.6.1 .INC files 1.6.2 .CMN files 1.6.3 .BLK files
14 14 14 14
1.7
Surface Water Model parameter files 1.7.1 .INC files 1.7.2 .CMN files 1.7.3 .BLK files
23 23 23 28
1.8
Output routines 1.8.1 .INC files 1.8.2 .CMN files 1.8.3 .BLK files
29 29 29 29
1.9
Salt Model parameter Files 1.9.1 .INC files 1.9.2 .CMN files 1.9.3 .BLK files
30 30 30 30
1.10
Binary switches
31
parameter files .INC files .CMN files .BLK files
Flowcharts and variable descriptions by subroutine
32
2.1
Main program and linkage subroutines 2.1.1 TULARE.for (main) 2.1.2 SGTRANS.for (linkage)
32 32 35
2.2
Groundwater model subroutines - PASS 1 2.2.1 GWl.for 2.2.2 GETG.for 2.2.3 NDFG.for 2.2.4 ELEM.for
37 37 40 43 45
-V-
2.2.5 2.2.6 2.2.7 2.2.8
WLOCA.for TIMDAT.for SKIP.for IOSUB.for
46 49 50 51
2.3
Groundwater model subroutines- PASS2 2.3.1 GW21.for 2.3.2 GW22.for 2.3.3 GETGD.for 2.3.4 INITl.for 2.3.5 GENER.for 2.3.6 GETQ.for 2.3.7 SURFL.for 2.3.8 BOUND.for 2.3.9 ASIGNP.for 2.3.10 RIVER.for 2.3.11 CONE2.for
52 52 55 57 61 66 68 71 73 75 76 79
2.4
Groundwater model : solver subroutine 2.4.1 SOLVE.for
81 81
2.5
Groundwater model : output subroutines 2.5.1 OUTC.for 2.5.2 OUTPH.for 2.5.3 OUTPQ.for 2.5.4 OUTPV.for 2.5.5 IOSUB.for 2.5.6 SKIP.for
83 83 85 86 88 89 89
2.6
Surface water model subroutines 2.6.1 SURFINP.for 2.6.2 SURFACE.for (main and internal) 2.6.3 SJROUTE.for 2.6.4 TLROUTE.for 2.6.4.1 tlroute 2.6.4.2 tsource 2.6.4.3 tulnode 2.6.5 CSROUTE.for 2.6.6 MODl.for 2.6.6.1 resvr 2.6.6.2 snowmlt 2.6.6.3 smaray 2.6.6.4 sannode 2.6.6.5 reaUoc 2.6.6.6 floadj 2.6.7 MOD2. for 2.6.7.1 six:ali 2.6.7.2 space 2.6.7.3 vsrta 2.6.7.4 pumpmax 2.6.7.5 cvpdel 2.6.7.6 fwpars 2.6.7.7 fwintp 2.6.7.8 goodwin - vi -
90 90 95 100 103 103 105 106 108 110 110 111 112 113 115 116 117 117 118 119 120 121 122 124 125
2.6.8
MOD3.for 2.6.8.1 milflod 2.6.8.2 mildelv 2.6.8.3 wq 2.6.8.4 initial 2.6.8.5 skipln 2.6.8.6 ndchekl 2.6.8.7 ndchek2 2.6.8.8 zero2 2.6.8.9 zerol 2.6.8.10 izerol 2.6.8.11 area
127 127 128 130 131 131 131 131 132 132 132 133
2.7
Model output subroutines 2.7.1 SURFWRIT.for 2.7.1.1 wrtonce 2.7.1.2 sltonce 2.7.1.3 wfittim 2.7.1.4 salttim 2.7.2 WRITE.for 2.7.2.1 writonce 2.7.2.2 writtime
134 134 134 137 138 140 141 141 144
2.8
Balance 2.8.1. 2.8.2 2.8.3 2.8.4 2.8.5 2.8.6 2.8.7
sheet: BAl,SHEET.for TUOL.for MERC.for SJKN.for KTCK.for CAST.for TDAU.for BSUB.for
146 148 149 150 152 153 154 155
2.9
Post-processor: SANVAR.for 2.9.1 CALCX1
157 159
2.10
Salinity model 2.10.1 SALT.for
160 160
3.0
Model status
163
4.0
References
164
- vii -
Acknowledgements This MP-710, more
document
resulting
was produced
from an initiative
fully understand
the decision
like to thank
Susan
Hoffman
Hilts
for his diligence
the USBR
for funding
this effort
reviewing
the first draft of this
project.
I also wish
to thank
the project
and managing
Glen
and Sally Benson
09410,
U.S. Department through
U.S.
document
Glen
Tabios
Lawrence
the USBR
Department
review
of Energy
in
for his helpful
My appreciation
for initiating also
to both
comments.
Interagency Contract
of Reclamation,
Agreement
of
as COTR on this
Laboratory
in part by the US Bureau
of the Interior
and Bob Edwards
at UC Berkeley
Berkeley
and
used to make
and his efforts
contract.
for their
This work was supported under
and Derek
(USBR),
to maintain
being
I would
and Sally Benson,
Reclamation tools
decisions.
suggestions
within
of Reclamation
support
planning
Tabios
for the US Bureau
No. 0-AA-20-
No. DE-AC03-76SF00098.
SAN JOAQUIN - TULARE CONJUNCTIVE USE MODEL 1.1.
Overview SANTUCM
which
is a linked
simulates
a monthly
Water
the model
code.
The
purpose
The document
model
Overview
o
Flowcharts
to the existing
1.2
interactions
of previous
Engineering
model
U.S. Bureau
Corporation
to the San Joaquin
and Valley
is to aid comprehension
into two parts
on
as follows
of
:
description
and variable
descriptions
by subroutine
subroutines model
subroutines
water model
Salinity
and evaluates
- groundwater
contract
of this document
Ground water
document
by Boyle
under
and general
Surface
hydrosalinity
is an extension
is organized
Linkage
reviews
and surface
Inc. while
o
A supplementary
- groundwater,
and was developed
Management
Program.
water
operations
The current
models
Resources
Drainage
reservoir
timestep.
of Reclamation
surface
model
subroutines
has been prepared
the SANTUCM
subroutines
model
by Tabios
and makes
et al.
(1992), which
suggestions
for improvements
model.
General description of SANTUCM SANTUCM
groundwater
comprises model;
three
and a salinity
the San Joaquin
Area
code that
the surface
water
links
and groundwater
conjunctively surface levels
Simulation
models
as linked
water model
separate
models:
model.
Model
water
model
River.
Another
-I-
water
water
model;
model
model.
mass
balance
difference
utilises
The surface
between
or
output
calculations
to
of computer
and can be run separately model
a
is similar
with the addition
to the groundwater
The salinity
in order to perform
in the San Joaquin
The surface
(SANJASM),
are coupled
models.
a surface
from the
of salinity
SANTUCM
and
SANJASM
is that SANTUCM
and subsurface Surface sources:
hydology
water
the California
in both
Kaweah,
Aqueduct
spills
geographic
the San Joaquin
Tule,
Basin
and Kern
and the Friant-Kern
transported
within
the James By-Pass,
Pool.
Operational
to the Tulare
a greater
flows into the Tulare
the King's,
reservoir
covers
by King's
flow north
spills that
Lake bed,
simulating
and Tulare
originate
seven primary
rivers,
the Delta-Mendota
Canal.
Flow
River
and that
the capacity
with
surface
basins.
from
diversions
spills
Canal, or
can be accomodated
into the San Joaquin
exceed
together
area,
River
at Mendota
of the James
from the Kaweah,
By-Pass
Tule,
flow
and Kern
rivers. The Delta Mendota the San Francisco the west
Bay Delta
foothills
(FKC) delivers of the eastern
the other major
surface
transports
the Sierra
with many
provisions
of operation generalized
conveyance
reservoirs
(on King's,
to codify
Class
Hence,
Tulare
Detailed
Analysis
The nodes that
Units
slope
model)
of
basin
and Kern
Kaweah rivers,
by numerous
agencies,
upon demand.
This type
to describe
reservoir
using
operations
The reservoir
file
into the Basin
are based
on the historical
Inflow Kern
into the DMC and the CAQ comes Canal
portion
DAUs are labelled
-2-
water using
subareas
take
into
flows.
(south of the area
of two types:
irrigation
from
in the model
These
2 (short term)
of the model
are primarily
into three
is computed
of Reclamation.
and Class
(DAUs), where
is divided
Tule
Lake,
reservoirs.
2 (long term)
are designated
for DAU 216, which
Valley
for these
The nodes in the Tulare basin in the SANJASM
(CVC) is
data
set by the US Bureau
included
Pine Flat
impossible
of the model.
into the Friant
I, Class
Canal
the eastern
Kaweah,
of water
and almost
by the developers
to criteria
along
on
the
in the San Joaquin
and operated
and delivery
from the four reservoirs.
according
used
The Friant-
along
Valley
in use in the area:
are owned
for banking
Inflow
Basin.
The Cross
to users
water
in
range.
for the four rivers
output.
(CAQ), originate
Lake to users
structure
no rule or storage-area-elevation
outflows
account
and in the Tulare
of the Sierr_
rules or algorithms.
Inflows
Aqueduct
of the irrigation
from Millerton
reservoirs
is difficult
not simulated
contains
Valley
and Lake Isabella
These
much
from the Aqueduct
mountain
Success
respectively).
water
water
are four main
Lake, Lake
PROSIM
and provide
slope
water
Nevada
There
were
(DMC) and California
side of the San Joaquin
Kern Canal
which
Canal
junction
nodes
is consumptively the DAU number,
and labelled
216-1,
and
used. except 216-2
1
Mites 0
Figure
20
2.
40
Schematic
60
of the groundwater
-4-
model finite element
network
and 216-3. These
Other types
include
model)
non-DAU
of nodes
demand
used within
nodes,
PROSIM
the model
nodes
are shown
(linkage nodes
in Figure
i.
to the PROSIM
and reservoirs.
The Tulare are the DAUs.
is modeled The sources
I) Friant-Kern
as a series
of sources
and sinks, where
the sinks
are:
Canal,
2) King' s River, 3) Kaweah
River,
4) Tule
River,
5) Kern
River,
6) PROSIM
nodes
45 and 46,
7) PROSIM
node 47,
8) PROSIM
node 32,
9) PROSIM
node 35,
I0) PROSIM
node 36,
II) Cross Valley 12) PROSIM
Millerton
flowing
for the year of this
New Melones. the sinks
Analaysis
For many rivers, taken
Unit
243, 254, and 256-258. taken
that
directly
is further
flow volumes water
monthly
A
the remainder
split
Exchequer, are then
from
is computed.
The four river
to Millerton,
obtain
with
than
to be released
February)
Canal,
index.
differently
into
long-
index
and
is the
Don Pedro
distributed
and
among
from the FKC and further
surface
water
deliveries
to each
(DAU).
of the FKC-supplied
from the rivers.
the following
2 FKC water
annual
somewhat
1 and 2 water
down the Madera
to determine
the FKC water
of Class
July inflows
points)
by month
is handled
on the four river
designated
(diverson
distributed
the volume
The Class
through
These
(FKC) source
water flows
flows based
sum of the April
node 37), and
(March through
down the VKC.
short-term
Detailed
Canal
Each March,
percentage
(PROSIM
node 38.
The Friant-Kern the others.
Canal
DAUs along
is diverted This
King's,
into the rivers,
is the case
Note that half
for DAUs
Kaweah,
and the diversions 233, 236,
of the FKC diversion
from the FKC and half from the Kaweah
-5-
Tule and Kern
River.
238,
are then
241, 242,
to DAU 242 is The remainder
of
£tI m >
,
z
I o
ELi E3 Z'_' n,,,•_ ¢:3 I.=.l
L,_ Z _ :_
_
,.,
0
.E
o.
z
I.--
>
_
a
LULL.. _..j n,,'I-I.-- ::D (nO
--O:
--
_--
cn
30NVA3ANOO Ol 1S07 _31V_ 3OV._I7S
,.,.Z _ _
•-_
=
o z I.--
Li..
°
-
o
•_1
i,i
n.. __
= ""_
m _ o.
I._
lr,= =
I,_ U3
U._
uu > "-I--0..
Z O ,._. I.--
:_ (/1 Z 0 (D
O I:_ n," --
..
.
"-
£SO7 39Va33S
n,"Z I,,u.,_ I--- -J "
Z 0 (D
Z n "_ D 0.
>_ _w C) Z
--
0 m o w
z LA.. z -6-
....
the sources
obtain
water
on a monthly
are read in as input data. computed year
1.2.1
(wet, normal
Tulare
different reservoirs
from a source
of the source
of the model
in the San Joaquin
are _-perated according
additional
inflows
from each
sourcc
to each DAU is
flow going
to that DAU and the
module
portion
from those
Monthly
or dry).
operations
In the Tulare
Then
The diversion
base_ on the percentage
type
basis.
releases
reservoir area.
operations
In the San Joaquin
to some set rules,
are made
if needed
are substantially area,
and releases
to satisfy
computed.
downstream
requirements. While
the reservoir
nature,
the Tulare
heavily
interconnected
complex
than
diversions
numbers
that
source
(percent)
month
file
node.
(currently
Also
included
TSOURCE
and year-type
deliveries is used
(SDELV)
named
Lake
make
in
is more
it far more any spills
and are lost to the
deliveries
to compute
industrial
(M&I) use.
each
is used
in the
that
obtain
nodes
of source water
Canal.
as the flow
For each
from the source
to a given
sink.
to a sink are summed
The total
and this
water
balance
water
node
is called,
which
uses the surface
between
data.
(non-sinks)
(AG.) and municipal
the majority
of usage
AG. and M&I based
If sarface
up to a certain
-7-
from
to set the diversions,
and in the surface
Basin
sets
sink node.
of agricultural
are split
items
surface
(In the Tulare
in the input
groundwater
is calculated
Tulare
TLROUTE
is a table
the Friant-Kern
TULNODE
First
set are the distribution
for all source
TULNODE
the amount
Deliveries
AG. and M&I demands
sink node numbers
of the flow diverted
in subroutine
and subroutine
SJROUTE.
TULBASIN.DAT)
from all sources
also
agricultural).
Basin
River,
One of the input
to a particular
the diversion
Flows leaving
computed
sink.
nodes representing
subroutines.
the demands,
from subroutine
in this data
is called
by the percentage
nodal value
which
for the King's
end up in Tulare
to each
of flow from a source
multiplied
to be serial
The Tulare
exchanges,
Except
basin
is called
source
for the source
surface
area.
and the corresponding
Subroutine except
and water
tend
evaporation.
from each
node
by canals
TLROUTE
Basin data
in the San Joaquin
tend to be parallel.
in the Tulare
through
Subroutine
Tulare
operations
the San Joaquin
from the rivers atmosphere
operations
water
maximum
are water
and
is
on the ratio
deliveries allowable
don't
of meet
safe yield
in order to meet groundwater shortage
1.2.2
the remaining
pumping
is exceeded
calculated
division
between
the Madera
further
uses the four river Exchequer,
These three
annual
among the sinks that
The annual
volumes
the percentage percentages specified
1.2.3
summed
used
file names
file
2L and Class
a single
inflows
to
annual
deivery
volumes
volume
into monthly
spatially
variable.
on the pe_/eentage of
sink for the month
the FKC flows
Engineering
2S) are then divided
These
annual
divided
This
as an independent
to each DAU.
flow for that
and years
(Table 5) contains
gain,
return
data that
return,
to each
volumes
DAU.
using
in question.
and temporally
for
The
are all
initial
flow.
from the binary
or groundwater
(parts per million
These
a concentration
for which
The control output
salt concentrations
works as follows:
import
node.
to the users
and nodes
files.
(Table 4)
is desired. for each
The salt model
file, which
file
also
is written
The salt
reservoir,
reads
all the
by the flow
the salt model.
concentration,
to that
from three
and groundwater
it needs
for use with
concentration times
to obtain
the FKC Class
exports. by Boyle
from the FKC, based
allocated
takes input
The salt model gain,
and New Melones)
Then
July
to
Salinity model
inflow,
model
developed
MOD3.for
in the input data.
contains
flow
of
1 and 2 exports
canals.
(April through
(Classl, Class
to divide
The salt model
data
index
Class
and short-term
for each DAU are then
of annual
in module
and Friant-Kern
obtain water
each of the three volumes each DAU are then
and the amount
exports.
equation,
Don Pedro,
volumes
MILDELV
Canal
into long-
is based on a regression
Millerton,
from
module
of Friant-Kern
are divided
Corp, which
safe yield
is declared
were made to subroutine
the accounting
2 exports
a shortage
operations
Some revisions
are and divided
If the annual
by the model.
Millerton
permit
demands.
expressed fluxes
node,
flow variable
pumping)
or ppm).
in tons)
At each
is computed
the node.
or "applied"
-8-
(streamflow,
has a corresponding
are summed and divided
of salt leaving
for that
Each
node,
inflow,
salt
the salt flux
for each
source
by the summed
The concentration in the terminology
(flow
of inflow
flows to get
of water
diverted
of the program,
is
-9-
SANTUCM Figure
_.nd h_a_m _
_
input file description
_'mtarenotserved by a majorproject
(inputasRxed
lixedmonlNypeltem)
(Ir'Tx,It as a lime series)
[ Omundwstmr pumpln41 dm
J
M_ 8rid _ (inputas _xedamos
[ Oroundwm, .,,,...,_,t,,v pu,,,pl,_i ,J
eroun_ater_
!
I
ll,,toeto_ I=lNtrvo0, tlq;=on, l,altl_ =laltl
/
_
[
C.o=_,. om_Une R¢III_, _1
ji
L_
SANTUCM
Timeuqies for_
input =ii _
de,_l/time
5.1
] ,,,
_Mer based on I:x._ M ell_'t demlnd amount yeartypewitha monthlynode pattern9
ateachdema_ nodein_
roql,Jrqn_:l to _
Mierton
Relervoir
Datarecl_red tot_J_te Goodwin ctvemiorm
IT.ll;._o,_ _=0_,_n=,, N_,=_'L
Return flowtothoSamaoacll__
iI
s= jo=_i_vi_y_r ty_¢a_r¢=_
w..-,,..,_m
t
;H'leio_k_ Uil_ _m'_...__.__ 'I ............... Ft_nt-Kem mM _ C, 'I
i_e _ies
Historic Millerlon exports to Frw#-Kem
asa rem.ltof
ro'td Mldera c_-I_.
,twin I_ln=/_==_ d= = --n.--.--,Slrq_nrn gairvi/tossos duotogroundwater i'vtoq'aic'don
:_-'_-m_ ;
- _t_=r_'_=_,"
" - :
(u_ my_=route.mr mo¢_ m_ run)
.................
"="
;''" ;_,'o_n_Inll .... I ,. ffi
,_ne"en'_ _-_
Hi=torte re=_'voir EOM storage=
I '
"I
I Ui_nd_aonanOUo_ L _. I
Powor ol:)orldr_ n-_e=
8_ I:_
_
Inllet file
............ , ' Oli_l Inpl_ fllo_ I I I
for fu'_o olomo_
............
I"omm_.w II_1
i
l o_o
-10-
_'_"
i
SANTUCM Figure
r i r
. L
........
'I
PumldWl flit
_ ,
_.l
md soil_
T'Pri _
of puml3_
for lth
Node/Elen_
L._.._._=_t cM=
I
clgmo_
! t
! I
For orour,,Owaterhead levelsat various/
.....
u_efl_ts
ser_ ofm.rfacewaterdeliveriesto eachelement
! f.lemm oonflg.rotlTx'_--'! ,
I_re _
aa_
s'rNrmnowat amt,m'.ded n'mm'_nodes ( 0 read in monthly pumping data if conjunctive use model is not used distribute element level pumping values to corresponding nodes assume one pumping value per element (recharge +ve) add in pumping from each element for all layers if using annual values of pumping use the monthly distribution table icolpu(nlpua) and yydist(iidt) to obtain monthly pumping amounts groundwater model supplies pumping values on an annual basis surface water model supplioes pumping values on a monthly basis calculate the amount of irrigation water applied at each node (qaply) for both triangular and quadrilateral elements read in annual imported water data if the conjunctive use model is not being used (kswgw = -i) distribute the annual imported water based on geographic locatlon (idtim > 0) calculate the total imported water for mass balance analysis perform similar check for imported water on a node basis if the conjunctive use model is being used overwrite with streamflow data from the surface water model read streamflows and diversions from data files read rainfall data in annual format if krain = 1 read rainfall data in monthly format if krain = 2
-89 -
GETQ.for
/
If kpuyr > 0 & Itime > itpuyr
yel
If kswgw < 0 & kpumo > 0
,era
_]
Read in annual pumping
data
"I
J _]
Read
in monthly pumping I
data
I
I
II
I no
If kpmp 1 (pumping by element ) 1
yel
_P no o If using distribution table (idtpu>0) then determine monthly pumping values from annual pumping values (multiply by fractions for ag pumping and each month during year) o
otherwise
read in values directly
w
I
Distribute element level pumping to zorresponding nodes assuming one pumping value per element. Perform separately for triangular and quadrilateral elements
4,
:alculate
4
II
applied at each element the amount of irrigation I
water
I
I
If kpmp - 2 (Pumping by node)
yem
J o Determine annual pumping monthly values pumping (multiply values by from Wl f_actlons for ag pumping and each month I during year) O otherwise read in values directly
I
I
no
-90-
I i
Account for source-sink terms during calculation of total well pumping from an element I
|
I
I I
Distribute node level pumping to corresponding nodes. Perform separately for triangular and quadrilateral e lement s ii
lilli
, Account for source-sink terms during calculation of total well pumping at a node ii
i
I
applied at each node :al_ulate the_ount ofirrigation water i ii
•
i
Read groundwater model is used (kswgw--l)
yes
in annual imported
water data file
TULIMP. DAT (14) If data available read in monthly imported water data TULIMP .DAT (16)
If kimp > 0 (switch for water)
_/Do
loop : 1 to neimp_ (elements with
_
Imported water)f
A
I
no
Distribute annual imported water based on geographic location (Idtim > 0) or year type (idtlm < 0).
balance for nodes and for elements I Zalculate total imported water for water i
L J _]
data files IIIII III Read streamflows and diversions
Read dummy
from
F _
values for flow and actual
values for riparian
L
F
I I
I
yes
I
i
-91 -
diversions
i
!
(no. of stream nodes with water import) Do loop : 1 to ndst
Convert
current
value ot
of
qstrm
(index
river
flow sum
to
units
cfs
Ifindicating ndivo
_et
>
diversion of qstrm
yea
Set
< 1 node)
demand values
Upstream
_ _
equal
to
and sum
tributary of qstrm
inflow
equal
values
to
Continue
If either krain> 0 or itime > itrn
'es
Read rainfall If from yearly data J kraln = 1 formatted : _ if krain -2 - I read rainfall from monthly formatted data
|
Return
-92 -
I
2.3.7
SURFL.for
Performs Variables aimp airg
soil moisture and
airig aper aply as(idl) c
accounting
parameters : area of element that is impervious area associated with a groundwater node that is irrigated set to the minimum of sda and associated area irrigated area of element that is irrigated area of element that is pervious excluding irrigated area depth of irrigation applied water specific yield of aquifer / aquifer storage coefficient soil moisture content
cdh cdhn(i) ck
-
cl(idl) clk (i) cn
-
depth deptha dtev dtrn(krs, imo) eg elg(id) es evap facto filt hlake(i) bn(i) id
-
idl imo irngn(i)
-
itd klake krain krs krsta(i) kstr nd pirig(i)
-
pv qaply(i) qd(idl) qevap qlake(i) qrain(i) qrtr(*) qsurf(id) ra
-
rcl(i) rcn*(*)
-
capilliary rise (feet) data for element capilliary rise (feet) data for node vertical conductance : vertical hydraulic conductivity / area associated with each node vertical hydraulic conductivity (ft/day) vertical leakance aquifer yield from storage specific yield / area associated with each node moisture retained in the unsaturated zone (ft) depth of the unsaturated zone (surface - water table) potential evapotranspiration rainfall for month (imo) amount of water that can be evaporated from the root zone ground surface elevation at each groundwater node minimum soil moisture value evapotranspiration of applied water conversion factor : cfs - cubic ft/month water infiltrating during the month water surface elevation of lake groundwater head at each groundwater node node number index set equal to id, idl or idr(temporary index) month during the simulation corresponding stream node that surface water will flow to. If gw node does not flow to a stream node - enter O. node number of aquifer below number of elements with lakes, input switch to use rainfall rainfall station identifier (scalar) rainfall station identifier for a node switch to use stream data number of nodes percentage of area associated with a node that is irrigated fraction of area that is pervious to infiltration irrigation applied water at a node source/sink term (pumping etc.) evapotranspiration from each element area flux from the lake quantity of incident rainfall in each element upstream and tributary inflow for each stream node surface water infiltration maximum value of either incident rainfall or maximum infiltration capacity maximum available soil moisture coefficients in the rainfall - runoff equation
-93-
rdh* rdhn* rech rechmx rechmxn roff roffa roffd rp sd(id) sda sirrtn sirrtnd(i)
-
slake(id) soilc soilm soilmt soilr(i) srtn tevrt traina troll troffs
-
wevap(i) wrain(i) wsurf(i)
-
Subroutine none
calls
Files none
read
from:
Files none
written
Flowchart o o
o
o
root zone depth (feet) root zone depth at a node groundwater recharge maximum monthly recharge (ins/month) monthly recharge at an individual node (i) rainfall runoff actual runoff limited by rainfall (depth) total volume of runoff amount of rainfall that infiltrates area associated with each groundwater node area at a groundwater node ; set equal to sd(ld) percentage of applied water to return flow percentage of applied water to return flow at an individual node (i) area of each element that is covered with water set to 50% of available soil moisture soil moisture storage maximum available soil moisture soil moisture retained in the soil total runoff from irrigation applied water total volume of evaporated water (ET) rainfall (annual values for each region) rainfall runoff (annual values for each region) rainfall runoff from element which is diverted to the adjacent stream total amount of evaporation at a node during simulation total rainfall at a node for the simulation period cumulative surface water infiltration at node (ld) for the simulation period :
to:
:
if rainfall - runoff parameters are by node use the nodal values using rainfall station data for non-irrigated areas perform the following rainfall balance o apply rainfall - runoff relationship o calculate rainfall that goes to groundwater recharge based on soil moisture. A limiting value is set by the vertical hydraulic conductivity. o calculate rainfall that goes to evaporation o assign water that dosen't infiltrate or evaporate to surface runoff for irrigated areas perform the following rainfall balance o determine the percentage of applied water that becomes runoff o calculate the amount of applied water that becomes groundwater recharge based on soil moisture. Limit this amount to a maximum equal to the hydraulic conductivity of the aquifer. o calculate evapotranspiration of surface applied water. o assign water that dosen't infiltrate or evaporate to surface runoff account for any interaction with lakes
-94 -
C
SURFL.for Do loop : i to nd (number of nodes)
I HN > ELG
yes
condition) (ponded
Set infiltration
al
Calculate
surface
water
conductivity parameters infiltration based on aquifer
_
to zero
Continue
Do loop v_
(number
: 1 to nd of nodes)
yes
_Set
no b
f Calculate the areas of irrigated land and non-lrrlgated, pervious and impervious land
Determine surface runoff using rainfallrunoff relationships and potential volume a_ailable for infiltration (RA)
no
If pervious area > 0
yes
Calculate actual infiltrating volume based on potential volume (RA) and current soil moisture
-95-
I
I
rainf_
Icurrent - run°fr node parameters
I
U_date
soil
moisture
content
,,,
I
yes
evaporation
based
on available
potential evapo-transpiration Determine soil m'_isture i ii V
soil
moisture
depth
and
Determine soil water evaporation based on ratio of current and maximum available soil moisture i
Runoff is calculated as the excess soil moisture above the soil moisture retained i
Calculate total volume of runoff volume of evaporated water
and
I If impervious area > 0
yes
!
_
Calculate total volume of runoff and volume of evaporated water in the impervious area (if AIRG > 0)
-I
no
no
I Calculate
If irrigated area > 0.00001
goes directly to runoff the percentage of water
that
Calculate actual infiltrating volume based on potential volume (RA) and current soil moisture
4, -96-
I I
I
I
I
I
Account estimation
for capilllary rise in the of soil moisture retained in the unsaturated zone
If depth > root zone depth
yes
evaporation based on available soil moisture depth and potential evapo-transpiration Determine soil moisture
Determine soil water evaporation based on ratio of current and maximum available soil moisture
Runoff is calculated as the excess soll moisture above the soil moisture retained II
Calculate total volume of runoff volume of evaporated water
and
Continue
yes
If flag KLAKE = 0
no _
?etermine
on aquifer leakance
storativlty from the lake based
J
Sum
evaporation and rainfall each node
-97-
at
I
I
I
2.3.8
BOUND.for
Adjusts groundwater finite element fluxes and rating table boundary the groundwater model. (Constant head boundary inflow is calculated program GWFMI42 after the matrix is solved at each time step. Variables as(idl) at(i) c ca
and
conditions in main
in
parameters : specific yield of aquifer / aquifer storage coefficient hydraulic conductivity in horizontal direction limiting value for boundary inflow flux inflow from surrounding nodes to boundary node of interest
cb dh(idl) elg(id) hmtb(j) bn(i) ib lc id
-
boundary flux based on one dimensional darcy's bedrock elevation ground surface elevation for each groundwater head in the rating table groundwater head at each groundwater node node number where diversion applied groundwater node number node number
li il lm imb(ki) lqb(i) it
-
set equal to im + 1 index for top layer of element variable counter for number of flux index counter for boundary nodes index counter for boundary nodes iteration index
ita 3nd ld nd
-
temporary index variable set to previous node numbers surrounding a node array storage variable set equal to ily number of nodes
nj njd(*) nl nmb(il) nmtb(ki) nqb(il) ntmb(ki)
-
ntqb
-
qd(id) qmb(i) qqb(i)
-
qmtb(j) wmb(i)
-
wqb(i)
-
sum of the number of nodes surrounding each GW node cumulative number of nodes surrounding each node number of layers number of rating table boundary nodes in each layer flag ; set equal to -i for general head boundary number of flux boundary nodes for each layer number of boundary nodes where the relaticnship between head and flux is specified number of boundary nodes where the constant fluxes are specified source/sink term (pumping etc.) flux for rating table and general boundary nodes flux across the model boundary at a specified flux boundary node flux in the rating table totalled flux at head dependent and general head boundary nodes for output water balance totalled flux at flux boundary nodes for output water balances
Subroutine none
calls
Files none
read
from:
Files none
written
:
to'
-98-
boundary
law node
nodes
value x nd
mmmmlllml,
ImlllNllmmlmmmmmmmmmNllmmmmNmlmlmN.
Flowchart o o o o o o o o
: adjust the specified flux for a flux boundary adjust the rating table boundary conditions for a general head boundary condition nmtb = 0 just the rating table boundary conditions for a general head bounciary condition nmtb = -i limit the flux value based on the flux from surrounding nodes and the available aquifer storage calculate the flux inflow from surrounding nodes to the boundary node of interest calculate the boundary fluxes based on one dimensional Darcy flow. check the limiting value for boundary outflow. sum up boundary flux values for output water balance check.
-99-
. If number
of
specified flux nodes with
.ne.
Y'"
_
De
loop
: i to
nl
_
0
i.
no
I
Count
number nodes of
the
flux
boundary
W 0 loop
nodes _dependent
I m
of
with
no
im
appropriate boundary nodes AssignII the specified flux at I the
I
If nu_r
: ii tO
l n
head flux
Jr _yeB
_
Do
2-
loop
: 1 to
nl
__
,
I
Count
the
!
boundary nodes nu_r I of general
o loop
: ii
to
im
head
I •
_--
If using the rating table : Determine boundary fluxes from the rating table for new aquifer head values (nmtb = -I)
If calculating boundary fluxes : Calculate the flux inflow from surrounding nodes to the node of interest. Boundary flux is based on one-dimensional Darcy flow
I
Check
boundary outflow i the limiting valuse
II
for
I
ntqb .ne. 0 (boundary with constant flux)
yes
no
less 0
current than
and next greater
ratio
maximum
is ratio
breakpoint is than current ratio
Add
storable
total
Set the indicating no
_
-180-
inflow
to
storable inflow reservolr(kr)
switch that
a_cw it is
the for
to 1 active
I
A_
SPACE
If sunlned storable inflows > 0.00001
Calculate d_lzat - smaller of (a) the difference between breakpoints or (b) the ratio of the required release divided by the sunlned storable inflow
P Do loop : k - I, nr (number of usable reservoirs)
Calculate release volume d_l delrat * the summed storable inflow (active reservoirs only)
Calculate additional releases izel, _urrent month remaining storage zltor and total releases to meet requirements zdem
_ecalculate kzmt _ krat added to the ratio of release volume del divided by the storable inflows to reservoirs mtrf
,
f
181 -
2.6.7.3
Subroutine
vsrta(a,n)
This is a quick vector sorting routine adapted from Kernighan and Richie (C language) and called within the SPACE subroutine. The sort routine is applied to the vector of breakpoints obtained by calculating both the current free volume/storable inflow ratio and the maximum ratio for each reservoir node. Variables a(j) igap n temp Subroutine none
and
parameters : test variable counter index; set to the number end of range index temporary variable
calls
Files none
read
Files none
written
of reservoirs
:
from:
to:
Summary flowchart : o set igap to number of reservoirs o if igap has a value greater than 1 - iterate for the number of reservoirs o visit each breakpoint node in order o reverse the order of the breakpoints a(j) and a(j+igap) if a(J) greater than a (j+igap) o return the sorted vector of the breakpoints
- 182-
is
VSRTA.for
counter
igap
,
,_
= n/2
Igap+ I, n increment I from current value to n Do loop : i u
__
Do loop : J = i-igap, I, -igap decrement J from 1 to i-igap
yes
If a(J) 0.01 define pspllt pspllt = annual ag demand/trim ii
Repeat
for months
Oct.
i
_A
Doloop:mo= through Sept.1,12 Calculate monthly maximum and minimum non-project pumping xnp_/w and ynpgw by multiplying rain and max levels by the monthly distribution pattern for each water year (kp = 1,2,3)
Calculate minimum and maximum M&I pumping _m_L_/w and _Lgw and minimum and maximum ag. pumping xaggw and y&ggw by multiplying the rain. and max. water year p_nping activity levels by the ratio psplit (or l-pspllt) and by the monthly distribution pattern xl:_atP and yi_patp iii
mo --12
- 185 , ,;9_.,
j
2.6.7.5
Subroutine
Performs
cvpdel(iyr,red)
the CVP demand
Variables and contag(nd, lm) contmi (nd,im) im iyr knodcvp(in) ncvpdm nd pdel (nd, im) pdelag (nd, im) pdelmi (nd, lm) red tpdmag (nd,lm) tpdmmi (nd,im) yrtype (iyr)
reduction.
parameters : monthly contracted agricultural deliveries at a node product of anagcon(nd) and agrpat(kdnd, mo) monthly contracted M&I deliveries at a node product of anmicon(nd) and mnipat(kdnd, mo) index of months year during the simulation array of nodes with CVP demands (kdnd) number of CVP demand nodes node number corresponding to CVP demand node total project delivery to all demand nodes (kdnd, 12) project deiveries to agriculture (kdnd, 12) project deliveries to M&I (kdnd, 12) CVP demand deficiency factor - set according to water year - type target project agricultural demand (kdnd, 12) target project M&I demand (kdnd, 12) (integer) array of year types, input (kdyr)
Subroutine none
calls
Files none
read
from:
Files none
written
:
to:
Summary flowchart : o Set the deficiency factor (RED) according to San Joaquin basin water year-type o Set the deficiency for Mendota Pool (node 15) according to the Sacramento basin water year type o For each CVP demand node, set project agricultural deliveries (PDELAG) and project M&I deliveries PDELMI to the contract delivery corrected for any project mandated deficiencies. If no deficiency is set deliveries are set equal to the total project agricultural demand TPDMAG and the total M&I demand TPDMMI respectively.
- 186 -
CVPDEL.for II I
]
Set deficiency factor zed by yeartype. If yz%ype = 4 (dry) : zed = 0.5 If ymwcype = 5 (critically dry) : zQd = 0.75) I
Iterate on monthly counter Do loop: im = 1,12
>
Do loop: in = l,cvpdm_ Iterate for each CVP __" demand
node
f
b I Assign
node
numbers
to CVP demand
nodes
Calculate the project deliveries to ag. and M&I by multiplying the contract amount by the deficiency factor zed
lxllalag and pdalmi are set equal to the smaller of either zed*contract amount (oomtag or oomtJ_L) and project demand tpclAg or t_&
Continue until im =12
Continue until in=ncvDdm
R_turn
-187-
the
I I
2.6.7.6
Subroutine
fwpars(iyr,mo,nd,rstor)
Parses the equation in the FW input into a value for routine TRIGGR. The equation is read in sets of up to four characters each. The subroutine parses the first character of each four character set into an algebraic sign ( + - * / ) and the remaining characters as either (a) a flow variable and node number or (b) a scale factor. The second character is a switch - if it is a number it is a multiplier or divisor for the computed value of TRIGGR. In this case the third and fourth characters are the appropriate node numbers and these single characters are assigned to v_riable INDX. If the second character is a alphabetic character the trigger value is computed in subroutines FORINF, INFLO, GAIN or STOR. Characters three and four contain the remainder of the scale factor. This value is scaled by the factor 0.01 to avoiQ decimal points. Variables equ(*)
parameters : set equivalent to the fish and wildlife requirement at a given node fwclas (nd,month, array of fw req.values at 7 levels (kdnd, 12, 7),input iyrtml ) fwequn (nd) array of fw req.values at 7 levels (kdnd, 12, 7), input fwreq(nd, month) flowby requirements for f&w (kdnd, 12) ichar (eq*) ascii conversion from character to integer variable idnx node number obtained from parsing equation ieq* parsing variable iyrt year type leng length of a character string month month ndd temporary variable for node number ndnum(nd) array of node numbers (kdnd) rstor (kn) current month reservoir storage scale scale factor invoked if a _*" or "/" occurs in the parsing equation triggr trigger value to calculate FWREQ yrtype(iyr) (integer) array of year types, input (kdyr) Subroutine fwintp
and
calls
: -
Files none
read
Files none
written
calculates fish and wildlife flow requirement (FWREQ) by ix_terpolation of a table of 6 classes of trigger values (FWTRIG) .
from:
to"
Summary flowchart : o if the first year of simulation set the year-type to current year-type otherwise use the previous year o check the parsing equation for the string _trig' o if using water year-types, set the fish and wildlife requirements within the monthly DO loop o for Tuolomne nodes 70 and 75, set the fish and wildlife requirements on last year's year-type 0 determine the number of words in the parsing equation o assign each character in parsing equation to a separate variable o reassign each of these character variables to integer variables
- 188 -
0
o o
o o
if the second character of the equation is a switch (value 0-9) compute the scaling factor from the remaining digits in the equation - multiply by 0.01 to avoid the decimal point if the second character isn't a switch the hast two digits are a node number 0-99 which is assigned to variable indx if the second character isn't a switch and is equal to a character "f', _g', _i' or _s' set the trigger in terms of forecasted inflow (forinf), stream gains (gain), reservoir inflows (inflo) or storage (stor) multiply of divide the fish and wildlife requirement triggr by the scaling factor once parsing is completed call subroutine fwintp to interpolate between classes of fish and wildlife requirement values
- 189 -
FWPARS.for
If FWIPAB8
has
yes
more than once been called
yes
I
Repeat
the
computation
of
the
T_L_C_
_
the previous call to save time FW requirement using the equation
from
for string 'trig'in parsing equation
! yes
if FWRSQ
|
For nodes on the Tuolonm_e River set FWREQ's based on last year's iri otherwise use F_ value for current _E
_3
to be based on water year type
Begin
_i
equation. parsing of each
For
values
of
I I
]_Q2
haracter is a number) _ t the scale factor for he co,puted value of etween 48 and 57 (2nd_ TRIGGR
i
FW input
yes j
wI
Calculate nun_r
_X as a groundwater node with value fro{n 0 to 99
|d
I
_"
/
each node depending on values of IEQI (+ or -)_ and EQ2 (forinf, gain,_ inflo
or
rstor)
. eq2 f f g g i i s s
lue cale
if IEQI = 42 or TB/GGR by SC_KLE>
_ ! J
eql 43 45 43 45 43 45 43 45
value trlggr + forinf triggr - forinf triggr + gain triggr - gain triggr + inflo triggr - inflo triggr + rstor tri(igr - rstor
interpolation Cell subroutine
of _/C_ value __ to perform
- 190 -
2.6.7.7
Subroutine
fwintp(nd,triggr)
Calculates FWREQ values. The FWREQ values interpolated from the 6 classes of fish and wildlife requirement values are based on the trigger array (FWTRIG) and the value of TRIGGR. The value of TRIGGR is interpolated from the FWTRIG array. If TRIGGR is greater or equal to the highest value of FWTRIG or if TRIGGR is less than or equal to the lowest value of FWTRIG then FWTRIG is assigned to be equal to the highest or lowest FWCLAS value. Variables and fwclas(nd, mo,*) fwreq(nd, mo) fwtrig(nd, _) triggr
parameters : array of fw req.values at 7 levels (kdnd, 12, 7), input flowby requirements for f&w (kdnd, 12) array of fw req. trigger values (kdnd, 7), input trigger value to calculate FWREQ
Subroutine none
calls
Files none
read
from:
Files none
written
:
to:
Summary flowchart : o if TRIGGR is >= the highest value of FWTRIG then set FWREQ to the highest FWCLAS value (FWCLAS(nd, mo, I)) - return o if TRIGGR is
_I_l_J by subtracting flood space required from releases storage J Calculate Mlllerton wlavailable, making adjustments
yes
space available
I
no
i
Set Millerton
releases
= 0
I
Reset MII_JJ to account got class I and class 2 exports to the Frlant Kern and Madera canals
Update WlLSTOR to account for releases end add BPILL to KIT_%EL to obtain the total monthly release
- 198-
diagram and adding any additional fishery releases to match the flood control
2.6.8.2
Subroutine
mildelv(iyt,fkdaup)
Computes the Classl and Class2 water leaving Millerton bound for the FriantKern Canal and the Madera Canal. Hillerton storage availability (AVAIL) is calculated as the end of February Millerton storage plus the March through September inflow (INFLO) minus Millerton dead storage. The availability of water from Friant is calculated from regression equations. Variables and avail classl class2 div(l,nd, mo) fkacl fkaclt fkac2 fkac21 fkac2s fkcl (mo) fkc21 (mo) fkc2s(mo) fkdaul fkdau21 fkdau2s fkdaup(*,kdsnk) fkmspl (iyt)
fsnkcls(j,mo) gain (n (*),im) inflo(n(*),im) iyt madcl (mo) madc2 (mo) madxpat (mo,iyt) milinf nsink (*) r4indx rstor (n (*)) upstore(*) ystor (n (*))
parameters : accumulated INFLO to Millerton from March - September total annual Millerton class 1 deliveries total annual Mi llerton class 2 deliveries total monthly diversion from the Frian-Kern Canal after correcting for water year (FSNKCLS (J,MO)) volume of class 1 water going to the Friant-Kern Canal temporary variable : equal to (fkacl-130,000 acre-ft) volume of class 2 water going to the Friant-Kern Canal portion of class 2 water flow that is long-term water portion of class 2 water flow that is short-term water monthly volume of Friant-Kern (FKC) Class 1 flow (12) monthly volume of FKC Class 2 long-term flow (12) monthly volume of FKC Class 2 short-term flow (12) monthly diversion of Class 1 water from the FriantKern Canal to a DAU (12) monthly long-term diversions of Class 2 water from the Friant-Kern Canalto a DAU monthly short-term divesrions of Class 2 water from the Friant-Kern Canal to a DAU monthly delivery pattern for Friant-Kern Canal water to each DAU, input fraction of Class 1 and Class 2 water going to Friant-Kern Canal. remainder goes to Madera Canal (EXPORT 25). input, (5) deficiency factor for Friant Kern Canal diversions set according to water year type gains (kdnd, 12), input (real) inflows to reservoirs, (kdnd, 12), input temporary variable for year type monthly volume of Classl flow in Madera canal (12) monthly volume of Class2 flow in Madera canal (12) (real) monthly pattern of Madera Canal exports input, (12, 5) natural monthly inflow into Millerton, assuming no upstream storage, real, input, (12) number of DAUs getting water from a sink, input, (kdsrc) four river index based on April through July flows for Millerton, Exchequer, Don Pedro and New Melones current month reservoir storage storage in reservoirs u/s from Millerton, input, (12) used to compute Millerton flood storages and spills minimum storage (kdnd)
Subroutine none
calls
Files none
from:
read
:
199-
Files none
written
to:
Summary flowchart : o set the availability of water for diversion, based on Millerton storage, forecasted inflow (March - September) o calculate the 4-river index o if sufficient water, set full entitlements for Classl deliveries o if insufficient water, based on 4-river index, use regression equations to set annual CLASS1 and CLASS2 diversions o
For each DAU getting water from a sink determine Class 1 and Class 2 long and short term delivery totals
o o
Calculate monthly diversions from Distribute class 1 and class 2 to account project deliveries to the
each source the Madera Friant-Kern
o 200 -
the Friant-Kern patterns from
Canal by Canal
month,
Canal delivery
taking
into
MILDELV.Ior
]
°o. Calculate AVAIL from regression cu_es of availability vs class I and Class 2 deliveries for the _rlod March through September
Compute the 4 river Index from inflows from Mille_on, Exchequer, Don PeSo and New Melones for months April through July
Cont Inue
Set full entitlement for class I deliveries if AVAIL > 8004(00) acre-ft; otherwise use the regression equation to calculate deliveries.
Set class 2 deliveries according to availability (AVAX lr-)as determined by the regressslon equation or supply a minimum delivery of 11250 acre-ft.
Calculate the volume of class 1 and class 2 water going to the Friant-Kern Canal using ¢"KlcI_pland f]cmmpl2 respectively.
Reduce the FKC classl deliveries by 130,000 acre-ft if kpzoJ - l (scenario run i)
Calculate the class2 short-terr_ and long-term flows using a regress;ion equation and the 4 river inoex
1 - 201 -
Do loop : mo -i,12>
I Initialize
and _rkc2 variables _al,
_e.21
For each DAU getting water from a sink determine the FKC class I and class 2 short and long-term deliveries patterns from ahnual delivery totals
Do loop : mo=i,12
Calculate the monthly FKC deliveries of class I, class 2 (short-term) and class 2 (long-term) water supplies fkdau (I, 21 and 2s)
Calculate total monthly diversion from each source (dlv}
Continue
Continue
Do loop : mo - 1,12_
Distribute classl and class2 water to the Madera canal by month, taking into account project deliveries to the FKC i
i
- 202 -
]
2.6.8.3
Subroutine
wq(mo,rsjwq,sjflo,trel,qtar,rwqrel,rwq)
Performs the water quality computations. Water quality is calculated only at the Vernalis station. Upstream water quality is determined using a regression equation - a single number is used for monthly TDS from the Tuolomne and Stanislaus rivers. Variables C* (mo) factor(mo) qtar rsjwq rwq rwqrel
and
sjflo sjqual stflo
parameters • regression coefficients (12) factor to convert units (12) target water quality objective (mg/l TDS) water quality objective in the San Joaquin River water quality below Vernalis monitoring station required release to meet water quality objective the San Joaquin River San Joaquin River flow (acre-ft/month) San Joaquin River river water quality (mg/l TDS) Stanislaus River flow (acre-ft/month)
stqual trel vflo
-
Subroutine none Files none
read
Files none
written
calls
in
Stanislaus River water quality (mg/l TDS) Stanislaus River flow set equal to target flow combined flow of the Stanislaus and San Joaquin River (above the Stanislaus) - equal to the flow below the Vernalis gauging station :
from:
to:
Summary flowchart : o set San Joaquin River water quality (SJQUAL) from the regression equation, minimum value of 75 ppm TDS o assume Stanislaus River water quality (STQUAL) is 50 ppm TDS. Compute water quality below Vernalis (RWQ) o if RWQ is below the target, set the required New Melones release (RWQREL) to adjust water quality to the target concentration
- 203 -
I
WO.for
Read in monthly data for regression equation parameters al, e_ and a3 and monthly values for variable data £aatoz Hl
FDS
yes
_
Set
at
Verhalis migdal (TDS objective)
water
quality
= zmJt._
objective
for
i
Estimate equation
mJgual from a regression based on monthly flow at Vernalis
I
I Set
Estimate equation
sJg_ based
sJqual
= 75 ppm
TDS
?
from a regression on monthly flow at Vernalis
b
Reset next months water quality mJgB_al at Vernalis to current water quality
I
I
mm
set TDS to 50 ppm Read|i in Stanlslaus monthly flow
Stanislaus River flow and calculate combined TDS downstream of the confluence zt,_. Initialize zegzel= Add I San Joaquln River flow to
quality
gtaz
I
and
I
0
is
ppm ?? > iess If than target75 water
releases yes
_
required from New Melones BE_,_ to meet water quality target at Vernalis. Set running TDS at Vernalis equal to the target TDS gtaz I Calculate additional releases
- 204 -
Prlnt
are out
required
aMelones message
from New that
no
1
2.6.8.4 Zeros
Subroutine out arrays
Variables and capcty(i) fwclas(i,mo, j) kdnd
calls
Files none
read
from:
Files none
written
m mm |
m m mmm
2.6.8.5
mm
mmm
mmm |
and
Files input
read
Files none
written
m mm m m mm mm
m m m m
| m mm
| I m m mm ummm mm
m mm
m m m
m | mlm
skipln(kunit,n) of lines.
designated
and
read
Files output
written
by kunit
to:
Subroutine
ndchekl(node,inode,label) check
for non-time
series
files
parameters : matching node number label indicatin,_ node mismatch original node number
from:
to: -
Subroutine
Does a node
m | m mm
in a two dimensional in a one dimensional in a one dimensional
from:
Files none
2.6.8.7
zero values zero values zero values
parameters : unit number to be read number of lines to be skipped
a node number
Variables inode label node
produces produces produces array
number
-
2.6.8.6
(zeros).
to:
Subroutine
Variables kunit n
blanks
: -
Skips a designated
Does
contain
parameters : capacity of links (kdnd) (channel capacity) array of fw req.values at 7 levels (kdnd, 12,7),input node dimension
Subroutine zero2 zerol izerol
mum
initial
that
number
output
to screen
ndchek2(kunit,nnod,knodes,label) check for time
series
files.
,-205 -
m
array array integer
INITIAL.for
Call lezo2 to initialize the following two dimensional arrays to zero : fwreq; fwtrig; mnipat; agrpat; tpdmag; tpdmmi; npefnon; miefnon; agefnon; npefcri; mlefcri; agefcri IIIII I
Call ,,ezol to initialize the following one dimensional arrays zero : anagdem; anmidem; upstore
I to
following integer arrays to zero : ndnum; n; knodin; knodgn; knodrs; kswhist; knodfw; knoddm; knodnp; knodcvp; knodprJ; knodpts; knodpmp; knodgts; knodcp I Call. J.ZeZ01 to init_ialize the
i = i, kdnd mo I, 12 j 1,5 o loops :
Initialize
fwclasli,mo,
Continue
Return
-206-
/ J) = 0
I
Variables inodes (i) knodes(i) label nnod
and
Files none
read
Files output
written
2.6.8.8
parameters : matching node number original node number label indicating a node mismatch number of nodes
from:
to: -
Subroutine
output
zero2(x,ni,nj)
Zeros out a two dimensional Variables ni nj x(i, j)
and
Files none
read
Files none
written
2.6.8.9 Zeros
and
Files none
read
Files none
written
Zeros
to:
zerol(x,ni) array.
parameters : number of elements to be assigned zero values variable to be assigned a zero value
from:
to:
Subroutine
izerol(j,ni)
out a one dimensional
Variables n(i) j(i)
zero values
from:
Subroutine
2.6.8.10
array
parameters : rows of two dimensional array columns of two dimensional array array of variables to be assigned
out a one dimensional
Variables n(i) x(i)
to screen
and
Files none
read
Files none
written
integer
array.
parameters : number of elements to be assigned zero values integer variable to be assigned a zero value
from:
to:
-207 -
2.6.8.11
Function
Calculates
reservoir
Variables and area rstor(nr) starcf (nr,*) Files none
read
Files none
written
area(nr) surface
area
from storage.
parameters : reservoir surface area current month reservoir
from:
to:
- 208-
storage
2.7
Model output subroutines
2.7.1 i
i
_
i
SURFWRIT.for iiii
i
2.7.1.1 Writes
i
i
iiii
i
n
i
u
i
i
i
i
n
Ni
Subroutine
|
II.
Illl
i
i
i
i
i
i
u
i
iiii
i
i
i
i
Ilnll I
m
i
III.
|
I
I
IIII ni
I
I
I
I
I
I
I
I
|
I
6_ I
I
MI
I
I
I
wrtonce
the initialization
data to a file
(unit 30)
Variables and agefcri(nd, mo)
parameters : agricultural monthly efficiencies for non-critical years (kdnd, 12), input agefnon(nd, mo) agric monthly efficiencies for non-critical years (kdnd, 12), input agrpat(nd, mo) monthly agricultural demand pattern at a node (kdnd, 12) anagcon(nd) annual agric, contract at a node (kdnd), input anagdem(nd) annual agric, demand at a node (kdnd), input anmicon(nd) annual M&I contract at a node (kdnd), input anmidem(nd) annual M&I demand at a node (kdnd), input begsim (integer) year in which simulation starts begyr (integer) year at beginning of run, (1922) binfil name of binary output file bstor(n(*)) beginning storage for month (kdnd), input capcty(n) capacity of links (kdnd) contag(nd, mo) monthly contracted agricultural deliveries at a node product of anagcon (nd) and agrpat (kdnd, 12) contmi (nd,mo) monthly contracted M&I deliveries at a node product of anmicon (nd) and mnipat (kdnd, 12) dismad(mo) array of monthly fractions of Madera Canal (EXPORT 25) water from Millerton going to node 25, remainder goes to node 35, input (12) ev(nd, mo) reservoir evaporation depth (.01 ft) (kdnd, 12) fkmspl (i) fraction of Class 1 and Class 2 water going to Friant-Kern Canal. remainder goes to Madera Canal (EXPORT 25). input, (5) flodfil name of file with time series of flood control rule storages frusret(j,nd) array of percentage of return from an u/s node going to the current node, (kdusr, kdnd) fsnkcls deficiency factor for Friant-Kern Canal diversions set according to year type (kdnd, 12) fwclas (hd,mo, J5) array of fw req.values at 7 levels (kdnd, 12, 7),input fwfil name of file with F&W data fwequn(nd)
-
fwtrig(nd, i5) gainfil glogfil inffil kfrcst kfwfor knodcp(i) knodcvp(i) knoddm(i) knodfw(i) knodgn(i)
-
array of fw req. "equations" in character variables, (kdnd), input array of fw req. trigger values (kdnd, 7), input name of file with time series of GAINs name of the run log file for the groundwater portion name of file with time series of inflows forecast option for Millerton inflows fish and wildlife water requirements (12) array of nodes with capacities (kdnd) array of nodes with CVP demands (kdnd) array of nodes with demands (kdnd) array of nodes with F&W req. (kdnd) array of nodes with gain (kdnd)
-209 -
knodin(i) knodnp(i) knodpmp(i) knodprj(i) knodpts(i)
-
knodrs(i) knodtul(i) kswgw kswpow kswsmlt (n(*))
-
lastyr isink
-
maxusnd maxusrt
-
miefnon(nd, mo)
-
miefcri(nd, mo) mnipat (nd,mo) ncap ncvpdm ndemd ndnum(i) nfw ngain ninfl nnodes nnpdem npdmfil npefcri(nd, mo)
-
npefnon(nd, mo)
-
nprjdm nprjts npump nres nsink nsource ntuldm nusnod(nd) nusret
-
nwretn nyear pdmfil pdtsfil powrfil pumpfil qpow (nd,mo) resfil rtitle rundate runtime schmfil
-
array of nodes with inflow (kdnd) array of nodes with nonproject demands (kdnd) array of nodes with GW pumping (kdnd) array of nodes with project demands (kdnd) array of nodes with time series of historical GW pumping array of nodes with reservoirs (kdrs) list of node numbers of Tulare DAUs, input, (kdnd) switch to use groundwater model only switch to turn calls to power routines on and off array of binary switches to turn on snowmelt routine (kdnd) last year in simulation node numbers of DAU's getting water from a sink (kdsrc, kdnd) maximum upstream nodes maximum number of nodes with returns immediately upstream from current node monthly M&I efficiency for non-critical years, (kdnd, 12) input M&I efficiency for critical years, (kdnd, 12) input (real) M&I monthly pattern at a node (kdnd, 12), input number of nodes with capacities number of CVP demand nodes number of nodes with demand array of node numbers (kdnd) number of nodes with fish & wild require. (min flow) number of nodes with gains number of nodes with inflow number of nodes in the model number of nonproject demand nodes file containing non-project time series demand data (real) non-project critical year monthly efficiencies (kdnd, 12) (real) non-project non-critical year monthly efficiencies (kdnd, 12) number of nodes with project demands number of nodes with time series of project demands number of nodes with GW pumping number of reservoirs number of DAU's getting water from a sink (kdsrc) number of surface water sources in the Tulare area number of Tulare-area DAUs number of immediately upstream nodes (kdnd) number of immediately u/s nodes with returns going to current node undefined variable number of years in simulation, LASTYR-BEGSIM+I name of file with project demand data name of file with time series of project demands name of file with CVP system power variables name of file with min. and max. GW pumping data release limit for hydropower (kdnd, 12) name of file with reservoir data run title, 80 characters date on which model simulation is run time at which model simulation is run name of file with data from PROSIM
-210-
slogfil srule (nd,mo) starcf (nd, j) stelcf (nd,j) strf (n(*)) tpdem(nd, mo) tpdmag(nd, mo) tpdmmi (hd,mo) tsrcsnk
-
tuldfil usndfil usnode (j,nd)
-
usret(j,nd)
-
wqtar (mo)
-
wyrfil xaggw (nd,mo) xmigw (nd,mo) xnpgw(nd, mo)
-
xppatp(nd, mo,*)
-
xppatnp (nd,mo,*)
-
xpmpnp(nd, *)
-
xpmpp(nd,*)
-
xstor (n (*)) yaggw(nd.mo) ymigw (nd,mo) ynpgw (nd,mo) yppatp(nd, mo,*)
-
yppatnp(nd, mo,*)
-
ypmpnp(nd, mo)
-
ypmpp(nd, lno)
-
yrtype(k) ystor (n (*)) ystrsv (nd,mo)
-
Files none
read
Files
written
tulare.out
name of run log file from surface water model storage rule (kdnd, 12) storage-area curve coefficients (kdnd, 12) storage-elevation curve coeffs. (kdnd, 4) storable inflows to reservoirs (kdnd) target monthly project demand (kdnd, 12) target monthly project agricultural demand (kdnd, 12) target monthly project M&I demand (kdnd, 12) fraction of flow from a source to a DAU for a month and year type, input (kdsrc, kdsnk, 12, 3) name of file with the Tulare data name of file with the upstream node data (integer) node numbers of nodes immediately upstream of current node (kdusn, kdnd) (integer) node numbers of nodes with returns immediately upstream of current node (kdusn, kdnd) monthly water quality target at node 27, Vernalis (mg/l) (12) name of file with year types maximum monthly agricultural GW pumping, (kdnd, 12) maximum monthly M&I groundwater pumping (kdnd, 12) maximum monthly non-project groundwater pumping (kdnd, 12) project groundwater pumping pattern for maximum annual withdrawl (kdnd, 12, 3) non- project groundwater pumping pattern for maximum annual withdrawl (kdnd,12, 3) maximum annual non-project groundwater pumping for a demand node (3 year types input) (kdnd, 3) maximum annual project groundwater pumping for a demand node (3 year types input) (kdnd, 3) maximum reservoir storage (kdnd) minimum monthly groundwater pumping minimum monthly M&I GW pumping, (kdnd, 12) minimum non-project monthly GW pumping (kdnd, 12) project groundwater pumping pattern for minimum annual withdrawl (kdnd, 12, 3) non- project groundwater pumping pattern for minimum annual withdrawl (kdnd, 12, 3) minimum annual non-project groundwater pumping for a demand node (3 year types input) (kdnd, 3) minimum annual project groundwater pumping for a demand node (3 year types input) (kdnd, 3) integer array of year types, input (kdyr) minimum storage (kdnd) mimimum reservoir reserve storage (kdnd, 12)
from:
to: -
output
file designated
-211 -
as unit
30
2.7.1.2
Subroutine
Writes
sltonce
the initialization
Variables and begsim bstor (n (*)) frusret(j,nd) knodcvp(i) knoddm(i) knodgn(i) knodin (i) knocLnp(i) knodpmp(i) knodprj(i) knodpts(i) knodrs(i) knodtul(i) kswgw kswsalt lastyr isink maxusnd maxusrt ncvpdm nnpdem nprjdm nprjts npump nsink nsource ntuldm nusnod(nd) nusret rtitle rundate runtime
-
usret(j,nd)
-
read
Files
written
salt.out
(unit 31)
parameters : (integer) year in which simulation starts beginning storage for month (kdnd), input array of percentage of return from an u/s node going to the current node, (kdusr, kdnd) array of nodes with CVP demands (kdnd) array of nodes with demands (kdnd) array of nodes with gain (kdnd) array of nodes with inflow (kdnd) array of nodes with nonproject demands (kdnd) array of nodes with GW pumping (kdnd) array of nodes with project demands (kdnd) array of nodes with time series of historical GW pumping array of nodes with reservoirs (kdrs) list of node numbers of Tulare DAUs, input, (kdnd) switch to use groundwater model only switch to output sw data for Salt Balance model last year in simulation node numbers of DAU's getting water from a sink (kdsrc, kdnd) maximum upstream nodes maximum number of nodes with returns immediately upstream from current node number of CVP demand nodes number of nonproject demand nodes number of nodes with project demands number of nodes with time series of project demands number of nodes with GW pumping number of DAU's getting water from a sink (kdsrc) number of surface water sources in the Tulare area number of Tulare-area DAUs number of immediately upstream nodes number of immediately u/s nodes with returns going to current node run title, 80 characters date on which model simulation is run time at which model simulation is run
usnode(j,nd)
Files none
data to the salt file
(integer) node numbers of nodes immediately upstream of current node (kdusn, kdnd) (integer) node numbers of nodes with returns immediately upstream of current node (kdusn, kdnd)
from:
to: -
output
file designated
-212-
as unit
31
2.7.1.3 Writes
Subroutine writtim the annual
results
to a binary
file.
Variables and div(is, n(*),mo)
parameters : monthly surface diversion from source to sink (kdsrc, kdnd, 19_ dmcq(*) flow from mendota Pool into node 15 (12) evap(n(*) ,mo) reservoir evaporation (kdnd, 12) export(n(*) ,mo) exports (kdnd, 12) flow flow leaving a node (kdnd, 12) fwreq(n(*),mo) flowby requirements for fish and wildlife (kdnd, 12) gain(n(*) ,mo) gains (kdnd, 12) histsto (n (*),mo) Millerton historic monthly storage (kdnd, 12) inflo(n(*),mo) inflows to reservoirs (kdnd, 12) Jpbexs(mo) remaining monthly flow above 5000 cfs (302 kaf) down the James Bypass (12) knoddrs(i) array of nodes ...... (kdnd) knodfw(i) array of nodes with F&W req. (kdnd) knodgn(i) array of nodes with gain (kdnd) knodin(i) array of nodes with inflow (kdnd) knodnp(i) array of nodes with nonproject demands (kdnd) knodprj(i) array of nodes with project demands (kdnd) knodrs (i) array of nodes with reservoirs (kdrs) knodtul(i) list of node numbers of Tulare DAU's (kdnd) Isink node numbers of DAU's getting water from a sink (kdsrc, 12) nfw number of nodes with fish & wild require. (min flow) ngain number of nodes with gains ngwts number of nodes with time series of GW pumping ninfl nt_nber of nodes with inflow nnpdem number of nonproject demand nodes npinus (n (*),mo) non-project inflow (kdnd, 12) npgnus (n (*),mo) non-project gain (kdnd, 12) npgwus (n (*),mo) non-project groundwater usage (kdnd, 12) npret(n(*),12) non-project surface returns (kdnd, 12) npretus (n (*),mo) non-project return flow usage nprjdm number of nodes with project demands npsht (n (*),mo) non-project shortage (kdnd, 12) nres number of reservoirs nsink number of sinks nsource number of sources ntuldm number of Tulare-area DAUs paggw(n(*),mo) project groundwater used by agriculture (kdnd, 12) pagsht (n (*),mo) project agricultural shortage (kdnd, 12) pagus (n (*),mo) project surface water used by agriculture (kdnd, 12) pdel(n(*),mo) total project deliveries (kdnd, 12) pdelag(n(*),mo) project deliveries to agriculture (kdnd, 12) pdelmi (n (*),mo) project deliveries to M&I (kdnd, 12) pmigw(n(*),mo) project groundwater used for M&I (kdnd, 12) pmisht (n (*),mo) project M&I shortage (kdnd, 12) pmius (n(*) ,mo) project M&I usage (kdnd, 12) pret (n (*),mo) project returns (kdnd, 12) schmflo arra_, of monthly DMC and CAQ deliveries computed in PROSIM (kdnd,12) sdelv(n(*),12) surface water delivery to a node (kdnd, 12) sjqual (mo) San Joaquin River water quality (mg/l TDS) (12) spill (n(10)) spillage at node i0 vqual (mo) Vernalis water quality mg/l TDS (12)
- 213 -
wqrel (mo)
-
wqtar(mo)
-
xstfld(n (*),12)
-
Files none
read
additional water required to meet water at node 125 (12) monthly target water quality objectivej Joaquin River (input) (12) flood control rule (kdnd, 12)
from:
Files written tulare.bin
to: -
output
binary
- 214 -
_1
irl
file designated
as unit
30
quality
target
in the san
2.7.1.4 Writes
Subroutine the annual
salttim
results
to the binary
salt file.
Variables and div(is, n(*),mo)
parameters : monthly surface diversion from source to sink (kdsrc, kdnd, 12) evap(n(*) ,mo) reservoir evaporation (kdnd, 12) export (n(*) ,mo) exports (kdnd, 12) flow flow leaving a node (kdnd, 12) gain(n(*) ,mo) gains (kdnd, 12) histsto (n (*),mo) Millerton historic monthly storage (kdnd, 12) inflo(n(*) ,mo) inflows to reservoirs (kdnd, 12) knodrs (i) array of nodes ...... (kdnd) knodgn(i) array of nodes with gain (kdnd) knodJ n(i) array of nodes with inflow (kdnd) knocb_p(i) array of nodes with nonproject demands (kdnd) _nodtul(i) list of node numbers of Tulare DAU's (kdnd) isink node numbers of DAU's getting water from a sink (kdsrc, 12) ngain number of nodes with gains ngwts number of nodes with time series of GW pumping ninfl number of nodes with inflow nnpdem npinus (n(*) ,mo) npgnus (n (*),mo) npgwus(n(*),mo) npret(n(*),12) npretus (n (*),mo) nprjdm npsht (n (*),mo) nres nsink nsource paggw(n(*),mo) pagus(n(*) ,mo) pmigw (n (*),mo) pmius(n(*),mo) pret (n(*),mo) sdelv (n (*),12) stor (n (*),mo)
Files none
read
-
number of nonproject demand nodes non-projec£ inflow (kdnd, 12) non-project gain (kdnd, 12) non-project groundwater usage (kdnd, 12) non-project surface returns (kdnd, 12) non-project return flow usage number of nodes with project demands non-project shortage (kdnd, 12) number of reservoirs number of sinks number of sources project groundwater used by agriculture (kdnd, 12) project surface water used by agriculture (kdnd, 12) project groundwater used for M&I (kdnd, 12) project M&I usage (kdnd, 12) project returns (kdnd, 12) surface water delivery to a node (kdnd, 12) end of month storage, output (kdnd, 12)
from:
Files written salt.bin
to: -
output
binary
file designated
-215 -
as unit
31
2.7.2
WRITE.for
2.7.2.1 Writes
Subroutine
writonce
the initialization
data to a file
(unit 30)
Variables and agefcri (nd,mo)
parameters : agricultural monthly efficiencies for non-critical years (kdnd, 12), input agefnon(nd, mo) agric monthly efficiencies for non-critical years kdnd, 12), input agrfcri (nd,mo) agricultural water use efficiency for critical years (kdnd, 12 ) input agrpat monthly agricultural demand pattern at a node (kdnd,12) input anagcon(nd) annual agric, contract at a node (kdnd), input anagdem(nd) annual agric, demand at a node (kdnd), input anmicon(nd) annual M&I contract at a node (kdnd), input anmidem(nd) annual M&I demand at a node (kdnd), input begmo (integer) month in which simulation starts begsim (integer) year in which simulation starts begyr (integer) year at beginning of run, (1922) binfil name of binary output file bstor (n(*)) beginning storage for month (kdnd), input capcty(n) capacity of links (kdnd) contag(nd, mo) monthly contracted agricultural deliveries at a node product of anagcon(nd) and agrpat (nd,mo) contmi (hd,mo) monthly contracted M&I deliveries at a node product of anmicon(nd) and mnipat(nd, mo) dismad(mo) array of monthly fractions of Madera Canal (EXPORT 25) water from Millerton going to node 25, remainder goes to node 35, input (12) errfil name of ASCII file containing error statements ev(nd, mo) reservoir evaporation depth (.01 ft) (kdnd, 12) flodfil name of file with time series of flood control rule storages frmspl(i) fraction of Class 1 and Class 2 water frusret(j,nd) array of percentage of return from an u/s node going to the current node, (kdusr, kdnd) fwclas (hd,mo, i5) array of fw req.values at 7 levels (kdnd, 12, 7),input fwfil name of file with F&W data fwequn(nd)
-
fwtrig(nd, i5) gainfil imnode inffil kfrcst kfwfor knodcp(i) knodcvp(i) knoddm(i) knodfw(i) knodgn(i) knodin(i) knodnp(i) knodpmp(i) knodprj(i)
-
array of fw req. "equations" in character variables, (kdnd), input array of fw req. trigger values (kdnd, 7), input name of file with time series of GAINs temporary variable for node number name of file with time series of inflows forecast option for Millerton inflows fish and wildlife water requirements (12) array of nodes with capacities (kdnd) array of nodes with CVP demands (kdnd) array of nodes with demands (kdnd) array of nodes with F&W req. (kdnd) array of nodes with gain (kdnd) array of nodes with inflow (kdnd) array of nodes with nonproject demands (kdnd) array of nodes with GW pumping (kdnd) array of nodes with project demands (kdnd)
-216-
knodpts(i)
-
knodrs(i) knodwr kswgw kswpow kswsmlt (n(*))
-
lastyr maxusnd maxusrt
-
mday mhour miefnon(nd, mo)
-
miefcri (nd,mo) mminut mmonth mnipat (nd,mo) msecs myear ml00th n ncap ncvpdm ndemd ndnum(i) nfw ngain ninfl nnodes nnpdem npefcri (hd,mo)
-
npefnon(nd, mo)
-
nprjdm nprjts npump nres nusnod(nd) nusret
-
nwretn nyear pdmfil pdtsfil powrfil pumpfil qpow (nd,mo) resfil rtitle schmfil srule (nd,mo) starcf (hd, j) stelcf (nd, j) strf (n (*))
-
array of nodes with time series of historical GW pumping array of nodes with reservoirs (kdrs) undefined variable switch to use groundwater model only switch to turn calls to power routines on and off array of binary switches to turn on snowmelt routine (kdnd) last year in simulation maximum upstream nodes maximum number of nodes with returns immediately upstream from current node time in days time in hour s monthly M&I efficiency for non-critical years, (kdnd, 12) input M&I efficiency for critical years, (kdnd, 12), input time in minutes time in months (real) M&I monthly pattern at a node (kdnd, 12), input time in seconds time in years time in 100ths of a second counter variable number of nodes with capacities number of CVP demand nodes number of nodes with demand array of node numbers (kdnd) number of nodes with fish & wild require. (min flow) number of nodes with gains number of nodes with inflow number of nodes in the model number of nonproject demand nodes (real) non-project critical year monthly efficiencies (kdnd, 12) (real) non-project non-critical year monthly efficiencies (kdnd,12) number of nodes with project demands number of nodes with time series of project demands number of nodes with GW pumping number of reservoirs number of immediately upstream nodes number of immediately u/s nodes with returns going to current node undefined variable number of years in simulation, LASTYR-BEGSIM+I name of file with project demand data name of file with time series of project demands name of file with CVP system power variables name of file with min. and max. GW pumping data release limit for hydropower (kdnd, 12) name of file with reservoir data run title, 80 characters name of file with data from PROSIM storage rule (kdnd, 12) storage-area curve coefficients storage-elevation curve coeffs. (kdnd, 4) storable inflows to reservoirs (kdnd)
-217-
tpdem(nd, mo) tpdmag(nd, mo) tpdmmi (nd,mo) usnode(J,nd)
-
usret(j,nd)
-
wqtar(mo)
-
wyrfil xaggw (nd,mo) xmigw (nd,mo) xnpgw(nd, mo)
-
xppatp(nd, mo,*)
-
xppatnp(nd, mo,*)
-
xpmpnp(nd,*)
-
xstor (n (*)) yaggw(nd.mo) ymigw(nd, mo) ynpgw(nd, mo) yppatp (nd,mo, *)
-
yppatnp(nd, mo,*)
-
ypmpnp(nd, mo)
-
ypmpp(nd, mo)
-
yrtype(k) ystor (n (*)) ystrsv(nd, mo)
-
Files none
read
Files
written
tulare.out
target monthly project demand (kdnd, 12) target monthly project agricultural demand (kdnd, 12) target monthly project M&I demand (kdnd, 12) (integer) node numbers of nodes immediately upstream of current node (kdusn, kdnd) (integer) node numbers of nodes with returns immediately upstream of current node (kdusn, kdnd) monthly water quality target at node 27, Vernalis (mg/l) name of file with year types maximum monthly agricultural GW pumping, (kdnd, 12) maximum monthly M&I groundwater pumping (kdnd, 12) maximum monthly non-project groundwater pumping (kdnd, 12) project groundwater pumping pattern for maximum annual withdrawl (kdnd, 12, 3) non- project groundwater pumping pattern for maximum annual withdrawl (kdnd, 12, 3) maximum annual non-project groundwater pumping for a demand node (3 year types input) (kdnd, 3) maximum reservoir storage (kdnd) minimum monthly groundwater pumping minimum monthly M&I GW pumping, (kdnd, 12) minimum non-project monthly GW pumping (kdnd, 12) project groundwater pumping pattern for minimum annual withdrawl (kdnd, 12, 3) non- project groundwater pumping pattern for minimum annual withdrawl (kdnd, 12, 3) minimum annual non-project groundwater pumping for a demand node (3 year types input) (kdnd, 3) minimum annual project groundwater pumping for a demand node (3 year types input) (kdnd, 3) integer array of year types, input (kdyr) minimum storage (kdnd) mimimum reservoir reserve storage (kdnd, 12)
from:
to" -
output
file designated
-218-
as unit
30
2.7.2.2 Writes
Subroutine writtime the annual
results
to a binary
Variables and div(is, n(*),mo)
file.
parameters : monthly surface diversion from source to sink (kdsrc, kdnd, 12) dmcq(*) flow from mendota Pool into node 15 (12) evap(n(*) ,mo) reservoir evaporation (kdnd, 12) export (n (*),mo) exports (kdnd, 12) flow flow leaving a node (kdnd, 12) fwreq(n (*),mo) flowby requirements for fish and wildlife (kdnd, 12) gain(n(*) ,mo) gains (kdnd, 12) histsto (n (*),mo) Millerton historic monthly storage (kdnd, 12) inflo (n (*),mo) inflows to reservoirs (kdnd, 12) jpbexs(mo) remaining monthly flow above 5000 cfs (302 kaf) down the James Bypass (12) knodrs(i) array of nodes with reservoirs (kdnd) knodfw(i) array of nodes with F&W req. (kdnd) knodgn(i) array of nodes with gain (kdnd) knodin(i) array of nodes with inflow (kdnd) knodnp(i) array of nodes with nonproject demands (kdnd) knodprj(i) array of nodes with project demands (kdnd) knodrs(i) array of nodes with reservoirs (kdrs) knodtul(i) list of node numbers of Tulare DAU's (kdnd) isink node numbers of DAU's getting water from a sink (kdsrc, 12 ) mwh (n (*),mo) undefined variable nfw number of nodes with fish & wild req.lire. (min flow) ngain number of nodes with gains ngwts number of nodes with time series of GW pumping ninfl number of nodes with inflow nnpdem number of nonproject demand nodes npinus (n (*),mo) non-project inflow (kdnd, 12) npgnus (n (*),mo) non-project gain (kdnd, 12) npgwus (n (*),mo) non-project groundwater usage (kdnd, 12) npret (n (*),mo) non-project surface returns (kdnd, 12) npretus (n(*),mo) non-project return flow usage nprjdm number of nodes with project demands npsht (n (*),mo) non-project shortage (kdnd, 12) nres number of reservoirs nsink number of sinks nsource number of sources ntuldm number of Tulare-area DAUs paggw (n (*),mo) project groundwater used by agriculture (kdnd, 12) pagsht (n (*),mo) project agricultural shortage (kdnd, 12) pagus (n (*),mo) project surface water used by agriculture (kdnd, 12) pdel(n(*),mo) total project deliveries (kdnd, 12) pdelag(n(*),mo) project deliveries to agriculture (kdnd, 12) pdelmi (n(*) ,mo) project deliveries to M&I (kdnd, 12) pmigw (n (*),mo) project groundwater used for M&I (kdnd, 12) pmisht (n (*),mo) project M&I shortage (kdnd, 12) pmius (n (*),mo) project M&I usage (kdnd, 12) pret (n (*),mo project returns (kdnd, 12) schmflo array of monthly DMC and CAQ deliveries computed in PROSIM (kdnd, 12) sdelv (n (*),mo) surface water delivery to a node (kdnd, 12) sjqual (mo) San Joaquin River water quality (mg/l TDS) (12) spill (n(10)) spillage at node I0
- 219 -
tempdel(n(*),mo)
-
tempfw (n (*),mo)
-
tempmi(n(*),mo)
-
vqual (mo) wqrel (mo)
-
wqtar(mo)
-
xstfld(n(*),mo)
-
Files none
read
temporary variable - total delivery to a node (kdnd, 12 ) temporary variable - fish and wildlife requirements (kdnd, 12) temporary variable - municipal and industrial demands (kdnd, 12) Vernalis water quality mg/l TDS (12) additional water required to meet water quality target at node 125 (12) monthly target water quality objectives in the san Joaquin River (input) (12) flood control rule (kdnd, 12)
from:
Files written tulare.bin
to: -
output
binary
file designated
- 220 -
as unit
30
2.8
BALSHEET.for
Writes the balance sheets for each of the model subregions. BALSHEET prompts for the name of the output control file which contains the information which the balance sheets require as input and the years they are to be written for. Appropriate subroutines are called to write the output. Variables and begsim bstor (n (*)) contfil flow(n(*),mo) frusret (j,nd) ihead inflo(n(*),mo) iperiod iyrend iyrstr ksheet(*)
parameters : (integer) year in which simulation starts beginning storage for month (kdnd) control file flow leaving a node (kdnd, 12) array of percentage of return from an u/s node going to the current node, (kdusr, kdnd) header lines in control file inflow to a reservoir (kdnd, 12) interval between beginning and ending dates to be analyzed with balsheet last year to be included in balsheet starting year for balsheet series of binary switches which call subregion balance subroutines
kyr lastyr ndnum nnodes npgnus (n (*),mo) npgwus (n (*),mo) npinus (n (*),mo) npret (ku,mo) npretus(n(*),mo) npsur(n(*),mo)
-
nres nusnod(nd) nusret
-
paggw (n (*),mo) pagus (n (*),mo) pdel (n(*) ,mo) pdelgr(n(*) ,mo)
-
pdelsu(n(*),mo)
-
pmigw(n(*),mo) pret (ku,mo) return (n (*),mo) rtitle rundate runtime
-
schmflo(*,mo)
-
section(i) stor(n(*),mo) usflow (n (*),mo) usnode(i,nd)
-
usret (i,nd)
-
-
year counter last year in simulation array of node numbers number of nodes in the model non-project gain (kdnd, 12) non-project groundwater use (kdnd, 12) non-project inflow (kdnd, 12) non project returns (kdnd, 12) non-project return flow usage (kdnd, 12) summation of non-project gains, inflows and returns kdnd, 12 ) number of reservoirs number of immediately upstream nodes (kdnd) number of immediately u/s nodes with returns going to current node project groundwater used by agriculture (kdnd, 12) project surface water used by agriculture (kdnd, 12) total project deliveries (kdnd, 12) total project delivery from groundwater sources (kdnd, 12 ) total project delivery from surface water sources (kdnd, 12) project groundwater used for M&I (kdnd, 12) project return flows (kdnd, 12) total project and non-project returns (kdnd, 12) run title, 80 characters date on which model simulation is run time at which model simulation is run
(
array of monthly DMC and CAQ deliveries computed in PROSIM (kdnd, 12) basin section for which data is output (6) end of month storage (kdnd, mo) flow upstream of a node flowing into a node (kdusn, 12) array of node numbers of nodes immediately upstream of current node (kdusn,mo) array of node numbers of nodes with returns immediately upstream of current node (kdusn, 12)
- 221 -
Subroutine ktck(kf,kyr)
calls: -
sjkn(kf, kyr)
-
merc (kf,kyr) tuol (kf,kyr) cast(kf, kyr) tdau(kf, kyr)
-
Files binfil
read
from: -
control
-
imbal.err
-
Files outfil
output routine for the Friant Kern Canal, Kaweah, Tule, Kings River and Cross Valley Canal output routine for the middle San Joaquin River and King' s River output routine for the Merced River output routine for the Tuolomne River output routine for the Calaveras - Stanislaus Rivers output routine for the Tulare basin
written
to: -
-
binary output file containing all the hydrologic output from a SANTUCM scenario run control file containing the switches to create tables of water balances for each sub-basin error file containing the year and the node number where imbalances occur
tables of water balances at each stream node within a sub-basin. Sub-basins defined by unit number variable kf : where kf takes values of 51 - 56. ktck.bas (unit = 51) sjkn.bas (unit = 52) merc.bas (unit = 53) tuol.bas (unit = 54) cast.bas (unit = 55) tdau.bas (unit = 56)
- 222 -
C
BALSHEET.for
]
o o
open file imbal.err read control variables from input balance sheet control file Iiii Read input data files :
read problem initialization data from binary file and write to an output file the appropriate file header and time stamp
begsim Do loop
I
Read
time
to : lastyr
series
data
I
o loop : mo = 1 to l yes
no