10 module procedure sfr_calc_transient
13 integer(I4B) :: igwfconn
14 integer(I4B) :: number_picard
17 real(DP) :: kinematic_residual
18 real(DP) :: kinematic_storage
48 real(DP) :: residual_final
54 weight = this%storage_weight
63 this%usinflow(n) = qu + qi + qfrommvr
65 qa = this%usinflowold(n)
66 qb = this%dsflowold(n)
67 call this%sfr_calc_reach_depth(n, qa, da)
68 call this%sfr_calc_reach_depth(n, qb, db)
71 call this%sfr_calc_reach_depth(n, qc, dc)
73 xsa_a = this%calc_area_wet(n, da)
74 xsa_b = this%calc_area_wet(n, db)
75 xsa_c = this%calc_area_wet(n, dc)
80 qd = (qc + qb) * dhalf
82 call this%sfr_calc_reach_depth(n, qd, dd)
83 ad = this%calc_area_wet(n, dd)
86 d1 = (dc + dd) * dhalf
90 igwfconn = this%sfr_gwf_conn(n)
91 if (igwfconn == 1)
then
92 q = qu + qi + qr - qe + qro + qfrommvr
93 call this%sfr_calc_qgwf(n, d1, hgwf, qgwf)
102 call this%sfr_calc_reach_depth(n, q, d)
103 a = this%calc_area_wet(n, d)
106 call this%sfr_calc_reach_depth(n, q2, d2)
107 a2 = this%calc_area_wet(n, d2)
108 celerity = (q2 - q) / (a2 - a)
112 courant = celerity *
delt / this%length(n)
114 qlat = qlat / this%length(n)
116 number_picard = this%maxsfrpicard
117 if (igwfconn == 1)
then
118 number_picard = this%maxsfrpicard
123 kinematicpicard:
do i = 1, number_picard
124 if (igwfconn == 1)
then
125 q = qu + qi + qr - qe + qro + qfrommvr
126 call this%sfr_calc_qgwf(n, d1, hgwf, qgwf)
133 qsrc = qlat - qgwf / this%length(n)
135 newton:
do j = 1, this%maxsfrit
137 call this%sfr_calc_reach_depth(n, qd2, dd2)
138 ad2 = this%calc_area_wet(n, dd2)
141 xsa_a, xsa_b, xsa_c, ad, &
142 qsrc, this%length(n), weight,
delt, &
146 xsa_a, xsa_b, xsa_c, ad2, &
147 qsrc, this%length(n), weight,
delt, &
149 qderv = (residual2 - residual) / dq
150 if (qderv > dzero)
then
151 delq = -residual / qderv
156 if (qd + delq < dem30)
then
162 call this%sfr_calc_reach_depth(n, qd, dd)
163 ad = this%calc_area_wet(n, dd)
165 xsa_a, xsa_b, xsa_c, ad, &
166 qsrc, this%length(n), weight,
delt, &
169 if (abs(delq) < qtol .and. abs(residual_final) < qtol)
then
176 d1 = (dc + dd) * dhalf
179 if (i > 1 .and. abs(delh) < this%dmaxchg)
then
183 end do kinematicpicard
186 this%length(n),
delt, &
189 end procedure sfr_calc_transient
real(dp) function kinematic_storage(aa, ab, ac, ad, length, delt, courant)
Kinematic routing equation storage term.
real(dp) function kinematic_residual(qa, qb, qc, qd, aa, ab, ac, ad, qsrc, length, weight, delt, courant)
Kinematic routing equation residual.
This module contains the SFR package methods.
real(dp), pointer, public delt
length of the current time step