10 module procedure sfr_calc_steady
12 integer(I4B) :: isolve
57 qc = qu + qi + qr - qe + qro + qfrommvr
61 qsrcmp = qu + qi + qfrommvr + dhalf * (qr - qe + qro)
65 call this%sfr_calc_reach_depth(n, qmp, d1)
69 call this%sfr_calc_qsource(n, d1, qsrc)
74 bt = tp - this%bthick(n)
80 if (hsfr <= tp .and. hgwf <= tp) isolve = 0
81 if (hgwf <= tp .and. qc < dem30) isolve = 0
82 if (this%sfr_gwf_conn(n) == 0) isolve = 0
85 calc_solution:
if (isolve /= 0)
then
90 if ((tp - hgwf) > dem30)
then
93 en2 = d1p1 * d1 - (tp - hgwf)
95 else if ((tp - hgwf) > dem30)
then
98 en2 = dp99 * (hgwf - tp)
104 call this%sfr_calc_qgwf(n, dzero, hgwf, qgwf1)
106 qen1 = qmp - dhalf * qgwf1
112 call this%sfr_calc_qgwf(n, en2, hgwf, qgwf2)
115 call this%sfr_calc_qgwf(n, en2, bt, qgwf2)
118 if (qgwf2 > qsrc) qgwf2 = qsrc
121 call this%sfr_calc_reach_depth(n, (qsrcmp - dhalf * qgwf1), d1)
122 call this%sfr_calc_reach_depth(n, (qsrcmp - dhalf * qgwf2), d2)
133 if (f2 < dem30) en2 = d2
140 dpp = dhalf * (en1 + en2)
149 do i = 1, this%maxsfrit
152 d2 = d1 + dtwo * this%deps
154 call this%sfr_calc_qman(n, d1, q1)
155 call this%sfr_calc_qman(n, d2, q2)
157 call this%sfr_calc_qgwf(n, d1, hgwf, qgwf1)
159 call this%sfr_calc_qgwf(n, d2, hgwf, qgwf2)
162 if (qgwf1 >= qsrc)
then
164 dpp = dhalf * (en1 + en2)
165 call this%sfr_calc_qgwf(n, dpp, hgwf, qgwfp)
167 if (qgwfp > qsrc) qgwfp = qsrc
168 call this%sfr_calc_reach_depth(n, (qsrcmp - dhalf * qgwfp), dx)
171 fhstr1 = (qsrcmp - dhalf * qgwf1) - q1
172 fhstr2 = (qsrcmp - dhalf * qgwf2) - q2
177 if (abs(d1 - d2) > dzero)
then
178 derv = (fhstr1 - fhstr2) / (d1 - d2)
180 if (abs(derv) > dem30)
then
188 if ((dpp >= en2) .or. (dpp <= en1))
then
189 if (abs(dlh) > abs(dlhold) .or. dpp < dem30)
then
191 dpp = dhalf * (en1 + en2)
198 if (qgwf1 * qgwfold < dem30)
then
203 if (qgwf1 < dem30)
then
208 if (dlh * dlhold < dem30 .or. abs(dlh) > abs(dlhold))
then
212 if (iic3 > 7 .and. iic > 12)
then
218 if (iic2 > 7 .or. iic > 12 .or. iic4 == 1)
then
220 dpp = dhalf * (en1 + en2)
224 call this%sfr_calc_qgwf(n, dpp, hgwf, qgwfp)
226 if (qgwfp > qsrc)
then
228 if (abs(en1 - en2) < this%dmaxchg * dem6)
then
229 call this%sfr_calc_reach_depth(n, (qsrcmp - dhalf * qgwfp), dpp)
232 call this%sfr_calc_reach_depth(n, (qsrcmp - dhalf * qgwfp), dx)
241 if (f1 * fp < dzero)
then
249 err = min(abs(fp), abs(en2 - en1))
255 if (err < this%dmaxchg)
then
274 call this%sfr_calc_qgwf(n, d1, hgwf, qgwf)
278 if (qgwf > qsrc)
then
280 call this%sfr_calc_qsource(n, d1, qsrc)
286 end procedure sfr_calc_steady
This module contains the SFR package methods.