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)
109 courant = celerity *
delt / this%length(n)
113 qlat = qlat / this%length(n)
115 number_picard = this%maxsfrpicard
116 if (igwfconn == 1)
then
117 number_picard = this%maxsfrpicard
122 kinematicpicard:
do i = 1, number_picard
123 if (igwfconn == 1)
then
124 q = qu + qi + qr - qe + qro + qfrommvr
125 call this%sfr_calc_qgwf(n, d1, hgwf, qgwf)
132 qsrc = qlat - qgwf / this%length(n)
134 newton:
do j = 1, this%maxsfrit
136 call this%sfr_calc_reach_depth(n, qd2, dd2)
137 ad2 = this%calc_area_wet(n, dd2)
140 xsa_a, xsa_b, xsa_c, ad, &
141 qsrc, this%length(n), weight,
delt, &
145 xsa_a, xsa_b, xsa_c, ad2, &
146 qsrc, this%length(n), weight,
delt, &
148 qderv = (residual2 - residual) / dq
149 if (qderv > dzero)
then
150 delq = -residual / qderv
155 if (qd + delq < dem30)
then
161 call this%sfr_calc_reach_depth(n, qd, dd)
162 ad = this%calc_area_wet(n, dd)
164 xsa_a, xsa_b, xsa_c, ad, &
165 qsrc, this%length(n), weight,
delt, &
168 if (abs(delq) < qtol .and. abs(residual_final) < qtol)
then
175 d1 = (dc + dd) * dhalf
178 if (i > 1 .and. abs(delh) < this%dmaxchg)
then
182 end do kinematicpicard
185 this%length(n),
delt, &
188 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