8 module procedure setgwpet
17 pet = this%pet(icell) - this%et_uz(icell) /
delt
18 if (pet < dzero) pet = dzero
19 this%gw_pet(icell) = pet
20 end procedure setgwpet
24 module procedure setbelowpet
34 if (this%ext_depth_uz(jbelow) > dem3)
then
35 pet = this%pet(icell) - this%et_uz(icell) /
delt - &
36 this%gwet(icell) / this%uzfarea(icell)
37 if (pet < dzero) pet = dzero
39 this%pet(jbelow) = pet
40 end procedure setbelowpet
44 module procedure simgwet
46 real(DP) :: s, x, c, b, et
48 this%gwet(icell) = dzero
52 s = this%landtop(icell)
53 x = this%ext_depth(icell)
54 c = this%gw_pet(icell)
55 b = this%celbot(icell)
58 if (igwetflag == 1)
then
59 et = etfunc_lin(s, x, c, det, trhs, thcof, hgwf, &
60 this%celtop(icell), this%celbot(icell))
61 else if (igwetflag == 2)
then
62 et = etfunc_nlin(s, x, c, det, trhs, thcof, hgwf)
65 trhs = trhs * this%uzfarea(icell)
66 thcof = thcof * this%uzfarea(icell)
67 this%gwet(icell) = trhs - (thcof * hgwf)
79 real(DP) :: dtheta_inv
80 real(DP) :: epsfksthts
99 integer(I4B) :: numadd
102 integer(I4B) :: itest
104 logical(LGP) :: hasprev
106 this%et_uz(icell) = dzero
107 if (this%ext_depth_uz(icell) < dem7)
return
108 petsub = this%root_act(icell) * this%pet(icell) * &
109 this%ext_depth_uz(icell) / this%ext_depth(icell)
110 thetaout =
delt * petsub / this%ext_depth(icell)
111 if (ietflag == 1) thetaout =
delt * this%pet(icell) / this%ext_depth(icell)
112 if (thetaout < dem10)
return
113 depth = this%wave_depth(1, icell)
114 st = this%unsat_stor(icell, depth)
115 if (st < dem4)
return
118 nwv = this%nwaves(icell)
120 call this%store_waves(icell, this%etsav)
122 this%et_uz(icell) = dzero
123 if (this%theta_sat(icell) - this%theta_res(icell) < dem7)
then
124 dtheta_inv = 1.0 / dem7
126 dtheta_inv = done / (this%theta_sat(icell) - this%theta_res(icell))
128 epsfksthts = this%bc_eps(icell) * this%vks(icell) * dtheta_inv
129 this%et_uz(icell) = dzero
131 extwc1 = this%theta_ext(icell) - this%theta_res(icell)
132 if (extwc1 < dem6) extwc1 = dem7
136 theta_min = this%theta_res(icell) + extwc1
142 do while (itest == 0)
144 if (k > 1 .AND. abs(fmp - petsub) > dem5 * petsub)
then
145 factor = factor / (fm / petsub)
149 if (this%nwaves(icell) == 1 .AND. &
150 this%wave_depth(1, icell) <= this%ext_depth_uz(icell))
then
151 if (ietflag == 2)
then
152 tho = this%wave_theta(1, icell)
153 fktho = this%wave_flux(1, icell)
154 hcap = this%caph(icell, tho)
155 thetaout = this%rate_et_z(icell, factor, fktho, hcap)
157 if ((this%wave_theta(1, icell) - thetaout) > theta_min)
then
158 this%wave_theta(1, icell) = this%wave_theta(1, icell) - thetaout
159 sat = (this%wave_theta(1, icell) - this%theta_res(icell)) * dtheta_inv
160 this%wave_flux(1, icell) = this%vks(icell) * (sat**this%bc_eps(icell))
161 else if (this%wave_theta(1, icell) > theta_min)
then
162 this%wave_theta(1, icell) = theta_min
163 sat = (this%wave_theta(1, icell) - this%theta_res(icell)) * dtheta_inv
164 this%wave_flux(1, icell) = this%vks(icell) * (sat**this%bc_eps(icell))
168 else if (this%nwaves(icell) > 1 .AND. &
169 this%wave_depth(this%nwaves(icell), &
170 icell) > this%ext_depth_uz(icell))
then
171 if (ietflag == 2)
then
172 tho = this%wave_theta(this%nwaves(icell), icell)
173 fktho = this%wave_flux(this%nwaves(icell), icell)
174 hcap = this%caph(icell, tho)
175 thetaout = this%rate_et_z(icell, factor, fktho, hcap)
177 if (this%nwaves(icell) + 1 > this%nwaves_max)
then
183 if (this%wave_theta(this%nwaves(icell), icell) - thetaout > &
185 this%wave_theta(this%nwaves(icell) + 1, icell) = &
186 this%wave_theta(this%nwaves(icell), icell) - thetaout
188 else if (this%wave_theta(this%nwaves(icell), icell) > &
190 this%wave_theta(this%nwaves(icell) + 1, icell) = theta_min
193 if (numadd == 1)
then
194 this%wave_flux(this%nwaves(icell) + 1, icell) = &
196 (((this%wave_theta(this%nwaves(icell) + 1, icell) - &
197 this%theta_res(icell)) * dtheta_inv)**this%bc_eps(icell))
198 theta2 = this%wave_theta(this%nwaves(icell) + 1, icell)
199 flux2 = this%wave_flux(this%nwaves(icell) + 1, icell)
200 flux1 = this%wave_flux(this%nwaves(icell), icell)
201 theta1 = this%wave_theta(this%nwaves(icell), icell)
202 this%wave_speed(this%nwaves(icell) + 1, icell) = &
203 leadspeed(theta1, theta2, flux1, flux2, this%theta_sat(icell), &
204 this%theta_res(icell), this%bc_eps(icell), this%vks(icell))
205 this%wave_depth(this%nwaves(icell) + 1, icell) = this%ext_depth_uz(icell)
206 this%nwaves(icell) = this%nwaves(icell) + 1
207 if (this%nwaves(icell) > this%nwaves_max)
then
218 else if (this%nwaves(icell) == 1)
then
219 if (this%nwaves(icell) + 1 > this%nwaves_max)
then
225 if (ietflag == 2)
then
226 tho = this%wave_theta(1, icell)
227 fktho = this%wave_flux(1, icell)
228 hcap = this%caph(icell, tho)
229 thetaout = this%rate_et_z(icell, factor, fktho, hcap)
231 if ((this%wave_theta(1, icell) - thetaout) > theta_min)
then
232 if (thetaout > dem30)
then
233 this%wave_theta(2, icell) = this%wave_theta(1, icell) - thetaout
234 sat = (this%wave_theta(2, icell) - this%theta_res(icell)) * dtheta_inv
235 this%wave_flux(2, icell) = this%vks(icell) * (sat**this%bc_eps(icell))
236 this%wave_depth(2, icell) = this%ext_depth_uz(icell)
237 theta2 = this%wave_theta(2, icell)
238 flux2 = this%wave_flux(2, icell)
239 flux1 = this%wave_flux(1, icell)
240 theta1 = this%wave_theta(1, icell)
241 this%wave_speed(2, icell) = &
242 leadspeed(theta1, theta2, flux1, flux2, this%theta_sat(icell), &
243 this%theta_res(icell), this%bc_eps(icell), this%vks(icell))
244 this%nwaves(icell) = this%nwaves(icell) + 1
245 if (this%nwaves(icell) > this%nwaves_max)
then
252 else if (this%wave_theta(1, icell) > theta_min)
then
253 if (thetaout > dem30)
then
254 this%wave_theta(2, icell) = theta_min
255 sat = (this%wave_theta(2, icell) - this%theta_res(icell)) * dtheta_inv
256 this%wave_flux(2, icell) = this%vks(icell) * (sat**this%bc_eps(icell))
257 this%wave_depth(2, icell) = this%ext_depth_uz(icell)
258 theta2 = this%wave_theta(2, icell)
259 flux2 = this%wave_flux(2, icell)
260 flux1 = this%wave_flux(1, icell)
261 theta1 = this%wave_theta(1, icell)
262 this%wave_speed(2, icell) = &
263 leadspeed(theta1, theta2, flux1, flux2, this%theta_sat(icell), &
264 this%theta_res(icell), this%bc_eps(icell), this%vks(icell))
265 this%nwaves(icell) = this%nwaves(icell) + 1
266 if (this%nwaves(icell) > this%nwaves_max)
then
277 if (this%wave_depth(1, icell) - this%ext_depth_uz(icell) > dem7)
then
282 do while (found == 0)
283 diff = this%wave_depth(jext, icell) - this%ext_depth_uz(icell)
284 if (diff > dzero)
then
291 if (this%wave_theta(jext, icell) > theta_min)
then
294 if (abs(diff) > dem5)
then
295 if (this%nwaves(icell) + 1 > this%nwaves_max)
then
301 call this%shift_waves(icell, -1, &
302 this%nwaves(icell) + 1, jext, -1)
303 this%wave_depth(jext, icell) = this%ext_depth_uz(icell)
304 this%nwaves(icell) = this%nwaves(icell) + 1
305 if (this%nwaves(icell) > this%nwaves_max)
then
314 jwet = this%nwaves(icell)
316 do while (j < this%nwaves(icell))
317 if (this%wave_theta(j, icell) > theta_min)
then
319 j = this%nwaves(icell) + 1
333 do while (j <= this%nwaves(icell))
334 if (ietflag == 2)
then
335 tho = this%wave_theta(j, icell)
336 fktho = this%wave_flux(j, icell)
337 hcap = this%caph(icell, tho)
338 thetaout = this%rate_et_z(icell, factor, fktho, hcap)
340 if (this%wave_theta(j, icell) > theta_min)
then
341 if (this%wave_theta(j, icell) - thetaout > &
343 this%wave_theta(j, icell) = this%wave_theta(j, icell) - thetaout
344 else if (this%wave_theta(j, icell) > theta_min)
then
345 this%wave_theta(j, icell) = theta_min
348 this%wave_flux(j, icell) = &
350 (((this%wave_theta(j, icell) - &
351 this%theta_res(icell)) * dtheta_inv)**this%bc_eps(icell))
352 fluxprev = this%wave_flux(j, icell)
358 sat = (this%wave_theta(j - 1, icell) - this%theta_res(icell)) * &
360 flux1 = this%vks(icell) * sat**this%bc_eps(icell)
362 sat = (this%wave_theta(j, icell) - this%theta_res(icell)) * dtheta_inv
363 flux2 = this%vks(icell) * sat**this%bc_eps(icell)
364 this%wave_flux(j, icell) = flux2
366 theta2 = this%wave_theta(j, icell)
367 theta1 = this%wave_theta(j - 1, icell)
368 this%wave_speed(j, icell) = &
369 leadspeed(theta1, theta2, flux1, flux2, this%theta_sat(icell), &
370 this%theta_res(icell), this%bc_eps(icell), &
383 do while (j <= this%nwaves(icell) - 1)
384 if (abs(this%wave_theta(j, icell) - this%wave_theta(j + 1, &
386 call this%shift_waves(icell, 1, j + 1, &
387 this%nwaves(icell) - 1, 1)
389 this%nwaves(icell) = this%nwaves(icell) - 1
393 depth = this%wave_depth(1, icell)
394 fm = this%unsat_stor(icell, depth)
395 this%et_uz(icell) = st - fm
396 fm = this%et_uz(icell) /
delt
397 if (this%et_uz(icell) < dzero)
then
398 call this%load_waves(icell, this%etsav)
399 this%nwaves(icell) = nwv
400 this%et_uz(icell) = dzero
401 elseif (petsub - fm < -dem15 .AND. ietflag == 2)
then
404 call this%load_waves(icell, this%etsav)
405 this%nwaves(icell) = nwv
406 this%et_uz(icell) = dzero
415 elseif (ietflag < 2)
then
425 module procedure caph
431 star = (tho - this%theta_res(icell)) / &
432 (this%theta_sat(icell) - this%theta_res(icell))
433 if (star < dem15) star = dem15
434 lambda = dtwo / (this%bc_eps(icell) - dthree)
435 if (star > dem15)
then
436 if (tho - this%theta_sat(icell) < dem15)
then
437 caph = this%air_entry(icell) * star**(-done / lambda)
446 module procedure rate_et_z
447 rate_et_z = factor * fktho * (h - this%root_pot(icell))
448 if (rate_et_z < dzero) rate_et_z = dzero
449 end procedure rate_et_z
451end submodule uzfcellgroupet
real(dp), pointer, public delt
length of the current time step
Unsaturated zone flow by the method of characteristics.