39 real(dp),
pointer,
dimension(:),
contiguous :: depth => null()
40 real(dp),
pointer,
dimension(:),
contiguous :: theta => null()
41 real(dp),
pointer,
dimension(:),
contiguous :: flux => null()
42 real(dp),
pointer,
dimension(:),
contiguous :: speed => null()
43 integer(I4B),
pointer :: nwaves => null()
50 real(dp),
dimension(:, :),
pointer,
contiguous :: wave_depth => null()
51 real(dp),
dimension(:, :),
pointer,
contiguous :: wave_theta => null()
52 real(dp),
dimension(:, :),
pointer,
contiguous :: wave_flux => null()
53 real(dp),
dimension(:, :),
pointer,
contiguous :: wave_speed => null()
54 integer(I4B),
pointer,
dimension(:),
contiguous :: nwaves => null()
55 integer(I4B),
pointer :: nwaves_max => null()
56 integer(I4B),
pointer :: ntrailwaves => null()
59 real(dp),
pointer,
dimension(:),
contiguous :: theta_res => null()
60 real(dp),
pointer,
dimension(:),
contiguous :: theta_sat => null()
61 real(dp),
pointer,
dimension(:),
contiguous :: theta_init => null()
62 real(dp),
pointer,
dimension(:),
contiguous :: bc_eps => null()
63 real(dp),
pointer,
dimension(:),
contiguous :: vks => null()
66 real(dp),
pointer,
dimension(:),
contiguous :: celtop => null()
67 real(dp),
pointer,
dimension(:),
contiguous :: celbot => null()
68 real(dp),
pointer,
dimension(:),
contiguous :: landtop => null()
69 real(dp),
pointer,
dimension(:),
contiguous :: surfdep => null()
70 real(dp),
pointer,
dimension(:),
contiguous :: cellarea => null()
71 real(dp),
pointer,
dimension(:),
contiguous :: uzfarea => null()
72 integer(I4B),
pointer,
dimension(:),
contiguous :: landflag => null()
73 integer(I4B),
pointer,
dimension(:),
contiguous :: cell_below => null()
76 real(dp),
pointer,
dimension(:),
contiguous :: water_table => null()
77 real(dp),
pointer,
dimension(:),
contiguous :: water_table_old => null()
80 real(dp),
pointer,
dimension(:),
contiguous :: finf_spec => null()
81 real(dp),
pointer,
dimension(:),
contiguous :: finf => null()
82 real(dp),
pointer,
dimension(:),
contiguous :: finf_rej => null()
83 real(dp),
pointer,
dimension(:),
contiguous :: surf_infil => null()
84 real(dp),
pointer,
dimension(:),
contiguous :: surf_infil_below => null()
85 real(dp),
pointer,
dimension(:),
contiguous :: surf_seep => null()
86 real(dp),
pointer,
dimension(:),
contiguous :: flux_to_wt => null()
89 real(dp),
pointer,
dimension(:),
contiguous :: pet => null()
90 real(dp),
pointer,
dimension(:),
contiguous :: pet_max => null()
91 real(dp),
pointer,
dimension(:),
contiguous :: gw_pet => null()
92 real(dp),
pointer,
dimension(:),
contiguous :: gwet => null()
93 real(dp),
pointer,
dimension(:),
contiguous :: et_uz => null()
94 real(dp),
pointer,
dimension(:),
contiguous :: ext_depth => null()
95 real(dp),
pointer,
dimension(:),
contiguous :: ext_depth_uz => null()
96 real(dp),
pointer,
dimension(:),
contiguous :: theta_ext => null()
97 real(dp),
pointer,
dimension(:),
contiguous :: air_entry => null()
98 real(dp),
pointer,
dimension(:),
contiguous :: root_pot => null()
99 real(dp),
pointer,
dimension(:),
contiguous :: root_act => null()
106 real(dp),
pointer,
dimension(:),
contiguous :: overtake_time => null()
107 integer(I4B),
pointer,
dimension(:),
contiguous :: wave_merges => null()
119 procedure :: setwaves
120 procedure :: shift_waves
121 procedure :: store_waves
122 procedure :: load_waves
123 procedure :: routewaves
126 procedure :: trailwav
130 procedure :: unsat_stor
131 procedure :: update_wav
134 procedure :: rate_et_z
139 procedure :: setbelowpet
140 procedure :: setgwpet
143 procedure :: get_water_content_at_depth
144 procedure :: get_wcnew
149 module subroutine setwaves(this, icell)
150 class(uzfcellgrouptype) :: this
151 integer(I4B),
intent(in) :: icell
152 end subroutine setwaves
154 module subroutine routewaves(this, totfluxtot,
delt, ietflag, icell, ierr)
155 class(uzfcellgrouptype) :: this
156 real(dp),
intent(inout) :: totfluxtot
157 real(dp),
intent(in) ::
delt
158 integer(I4B),
intent(in) :: ietflag
159 integer(I4B),
intent(in) :: icell
160 integer(I4B),
intent(inout) :: ierr
161 end subroutine routewaves
163 module subroutine shift_waves(this, icell, shft, strt, stp, cntr)
164 class(uzfcellgrouptype) :: this
165 integer(I4B),
intent(in) :: icell
166 integer(I4B),
intent(in) :: shft
167 integer(I4B),
intent(in) :: strt
168 integer(I4B),
intent(in) :: stp
169 integer(I4B),
intent(in) :: cntr
170 end subroutine shift_waves
172 module subroutine store_waves(this, icell, store)
173 class(uzfcellgrouptype) :: this
174 integer(I4B),
intent(in) :: icell
175 type(uzfwavestoretype),
intent(inout) :: store
176 end subroutine store_waves
178 module subroutine load_waves(this, icell, store)
179 class(uzfcellgrouptype) :: this
180 integer(I4B),
intent(in) :: icell
181 type(uzfwavestoretype),
intent(in) :: store
182 end subroutine load_waves
184 module subroutine uzflow(this, thick, thickold,
delt, ietflag, icell, ierr)
185 class(uzfcellgrouptype) :: this
186 real(dp),
intent(inout) :: thickold
187 real(dp),
intent(inout) :: thick
188 real(dp),
intent(in) ::
delt
189 integer(I4B),
intent(in) :: ietflag
190 integer(I4B),
intent(in) :: icell
191 integer(I4B),
intent(inout) :: ierr
192 end subroutine uzflow
194 module subroutine factors(eps_thick, eps_flux)
195 real(dp),
intent(out) :: eps_thick
196 real(dp),
intent(out) :: eps_flux
197 end subroutine factors
199 module subroutine trailwav(this, icell, ierr)
200 class(uzfcellgrouptype) :: this
201 integer(I4B),
intent(in) :: icell
202 integer(I4B),
intent(inout) :: ierr
203 end subroutine trailwav
205 module subroutine leadwav(this, time, single_wave, trail_added, thetab, &
206 fluxb, dflux_surf, eps_flux,
delt, icell)
207 class(uzfcellgrouptype) :: this
208 real(dp),
intent(inout) :: thetab
209 real(dp),
intent(inout) :: fluxb
210 real(dp),
intent(in) :: eps_flux
211 real(dp),
intent(inout) :: time
212 integer(I4B),
intent(inout) :: single_wave
213 integer(I4B),
intent(inout) :: trail_added
214 real(dp),
intent(inout) :: dflux_surf
215 real(dp),
intent(in) ::
delt
216 integer(I4B),
intent(in) :: icell
217 end subroutine leadwav
219 module function unsat_stor(this, icell, d1)
220 real(dp) :: unsat_stor
221 class(uzfcellgrouptype) :: this
222 integer(I4B),
intent(in) :: icell
223 real(dp),
intent(inout) :: d1
224 end function unsat_stor
226 module subroutine update_wav(this, icell,
delt, iss, itest)
227 class(uzfcellgrouptype) :: this
228 integer(I4B),
intent(in) :: icell
229 integer(I4B),
intent(in) :: itest
230 integer(I4B),
intent(in) :: iss
231 real(dp),
intent(in) ::
delt
232 end subroutine update_wav
234 module subroutine uz_rise(this, icell, totfluxtot)
235 class(uzfcellgrouptype) :: this
236 integer(I4B),
intent(in) :: icell
237 real(dp),
intent(inout) :: totfluxtot
238 end subroutine uz_rise
240 module function get_water_content_at_depth(this, icell, &
241 depth) result(theta_at_depth)
242 class(uzfcellgrouptype) :: this
243 integer(I4B),
intent(in) :: icell
244 real(dp),
intent(in) :: depth
245 real(dp) :: theta_at_depth
246 end function get_water_content_at_depth
248 module function get_wcnew(this, icell) result(watercontent)
249 class(uzfcellgrouptype) :: this
250 integer(I4B),
intent(in) :: icell
251 real(dp) :: watercontent
252 end function get_wcnew
254 module function leadspeed(theta1, theta2, flux1, flux2, thts, thtr, eps, vks)
255 real(dp) :: leadspeed
256 real(dp),
intent(in) :: theta1
257 real(dp),
intent(in) :: theta2
258 real(dp),
intent(in) :: flux1
259 real(dp),
intent(inout) :: flux2
260 real(dp),
intent(in) :: thts
261 real(dp),
intent(in) :: thtr
262 real(dp),
intent(in) :: eps
263 real(dp),
intent(in) :: vks
264 end function leadspeed
266 module subroutine setgwpet(this, icell)
267 class(uzfcellgrouptype) :: this
268 integer(I4B),
intent(in) :: icell
269 end subroutine setgwpet
271 module subroutine setbelowpet(this, icell, jbelow)
272 class(uzfcellgrouptype) :: this
273 integer(I4B),
intent(in) :: icell
274 integer(I4B),
intent(in) :: jbelow
275 end subroutine setbelowpet
277 module subroutine simgwet(this, igwetflag, icell, hgwf, trhs, thcof, det)
278 class(uzfcellgrouptype) :: this
279 integer(I4B),
intent(in) :: igwetflag
280 integer(I4B),
intent(in) :: icell
281 real(dp),
intent(in) :: hgwf
282 real(dp),
intent(inout) :: trhs
283 real(dp),
intent(inout) :: thcof
284 real(dp),
intent(inout) :: det
285 end subroutine simgwet
287 module subroutine uzet(this, icell,
delt, ietflag, ierr)
288 class(uzfcellgrouptype) :: this
289 integer(I4B),
intent(in) :: icell
290 real(dp),
intent(in) ::
delt
291 integer(I4B),
intent(in) :: ietflag
292 integer(I4B),
intent(inout) :: ierr
295 module function caph(this, icell, tho)
297 class(uzfcellgrouptype) :: this
298 integer(I4B),
intent(in) :: icell
299 real(dp),
intent(in) :: tho
302 module function rate_et_z(this, icell, factor, fktho, h)
303 real(dp) :: rate_et_z
304 class(uzfcellgrouptype) :: this
305 integer(I4B),
intent(in) :: icell
306 real(dp),
intent(in) :: factor, fktho, h
307 end function rate_et_z
315 subroutine init(this, ncells, nwav, memory_path)
319 class(uzfcellgrouptype) :: this
320 integer(I4B),
intent(in) :: ncells
321 integer(I4B),
intent(in) :: nwav
322 character(len=*),
intent(in) :: memory_path
324 integer(I4B) :: icell
328 call mem_allocate(this%wave_depth, nwav, ncells,
'WAVE_DEPTH', memory_path)
329 call mem_allocate(this%wave_theta, nwav, ncells,
'WAVE_THETA', memory_path)
330 call mem_allocate(this%wave_flux, nwav, ncells,
'WAVE_FLUX', memory_path)
331 call mem_allocate(this%wave_speed, nwav, ncells,
'WAVE_SPEED', memory_path)
332 call mem_allocate(this%nwaves, ncells,
'NWAVES', memory_path)
333 call mem_allocate(this%nwaves_max,
'NWAVES_MAX', memory_path)
334 call mem_allocate(this%ntrailwaves,
'NTRAILWAVES', memory_path)
337 call mem_allocate(this%theta_res, ncells,
'THETA_RES', memory_path)
338 call mem_allocate(this%theta_sat, ncells,
'THETA_SAT', memory_path)
339 call mem_allocate(this%theta_init, ncells,
'THETA_INIT', memory_path)
340 call mem_allocate(this%bc_eps, ncells,
'BC_EPS', memory_path)
341 call mem_allocate(this%air_entry, ncells,
'AIR_ENTRY', memory_path)
342 call mem_allocate(this%root_pot, ncells,
'ROOT_POT', memory_path)
343 call mem_allocate(this%root_act, ncells,
'ROOT_ACT', memory_path)
344 call mem_allocate(this%theta_ext, ncells,
'THETA_EXT', memory_path)
345 call mem_allocate(this%et_uz, ncells,
'ET_UZ', memory_path)
346 call mem_allocate(this%flux_to_wt, ncells,
'FLUX_TO_WT', memory_path)
347 call mem_allocate(this%finf_spec, ncells,
'FINF_SPEC', memory_path)
348 call mem_allocate(this%finf, ncells,
'FINF', memory_path)
349 call mem_allocate(this%finf_rej, ncells,
'FINF_REJ', memory_path)
350 call mem_allocate(this%gwet, ncells,
'GWET', memory_path)
351 call mem_allocate(this%uzfarea, ncells,
'UZFAREA', memory_path)
352 call mem_allocate(this%cellarea, ncells,
'CELLAREA', memory_path)
353 call mem_allocate(this%celtop, ncells,
'CELTOP', memory_path)
354 call mem_allocate(this%celbot, ncells,
'CELBOT', memory_path)
355 call mem_allocate(this%landtop, ncells,
'LANDTOP', memory_path)
356 call mem_allocate(this%water_table, ncells,
'WATER_TABLE', memory_path)
357 call mem_allocate(this%water_table_old, ncells,
'WATER_TABLE_OLD', &
359 call mem_allocate(this%surfdep, ncells,
'SURFDEP', memory_path)
361 call mem_allocate(this%surf_infil, ncells,
'SURF_INFIL', memory_path)
362 call mem_allocate(this%surf_infil_below, ncells,
'SURF_INFIL_BELOW', &
364 call mem_allocate(this%surf_seep, ncells,
'SURF_SEEP', memory_path)
365 call mem_allocate(this%gw_pet, ncells,
'GW_PET', memory_path)
367 call mem_allocate(this%pet_max, ncells,
'PET_MAX', memory_path)
368 call mem_allocate(this%ext_depth, ncells,
'EXT_DEPTH', memory_path)
369 call mem_allocate(this%ext_depth_uz, ncells,
'EXT_DEPTH_UZ', memory_path)
370 call mem_allocate(this%landflag, ncells,
'LANDFLAG', memory_path)
371 call mem_allocate(this%cell_below, ncells,
'CELL_BELOW', memory_path)
374 call mem_allocate(this%wavsav%depth, nwav,
'WSAV_DEPTH', memory_path)
375 call mem_allocate(this%wavsav%theta, nwav,
'WSAV_THETA', memory_path)
376 call mem_allocate(this%wavsav%flux, nwav,
'WSAV_FLUX', memory_path)
377 call mem_allocate(this%wavsav%speed, nwav,
'WSAV_SPEED', memory_path)
378 call mem_allocate(this%wavsav%nwaves,
'WSAV_NWAVES', memory_path)
379 call mem_allocate(this%etsav%depth, nwav,
'ETSAV_DEPTH', memory_path)
380 call mem_allocate(this%etsav%theta, nwav,
'ETSAV_THETA', memory_path)
381 call mem_allocate(this%etsav%flux, nwav,
'ETSAV_FLUX', memory_path)
382 call mem_allocate(this%etsav%speed, nwav,
'ETSAV_SPEED', memory_path)
383 call mem_allocate(this%etsav%nwaves,
'ETSAV_NWAVES', memory_path)
384 call mem_allocate(this%overtake_time, nwav,
'OVERTAKE_TIME', memory_path)
385 call mem_allocate(this%wave_merges, nwav,
'WAVE_MERGES', memory_path)
388 this%nwaves_max = nwav
390 this%wavsav%nwaves = 0
391 this%etsav%nwaves = 0
393 this%wavsav%depth(j) =
dzero
394 this%wavsav%theta(j) =
dzero
395 this%wavsav%flux(j) =
dzero
396 this%wavsav%speed(j) =
dzero
397 this%etsav%depth(j) =
dzero
398 this%etsav%theta(j) =
dzero
399 this%etsav%flux(j) =
dzero
400 this%etsav%speed(j) =
dzero
401 this%overtake_time(j) =
dzero
402 this%wave_merges(j) = 0
406 this%wave_depth(j, icell) =
dzero
407 this%wave_theta(j, icell) =
dzero
408 this%wave_flux(j, icell) =
dzero
409 this%wave_speed(j, icell) =
dzero
411 this%nwaves(icell) = 1
412 this%theta_res(icell) =
dzero
413 this%theta_sat(icell) =
dzero
414 this%theta_init(icell) =
dzero
415 this%bc_eps(icell) =
dzero
416 this%air_entry(icell) =
dzero
417 this%root_pot(icell) =
dzero
418 this%root_act(icell) =
dzero
419 this%theta_ext(icell) =
dzero
420 this%et_uz(icell) =
dzero
421 this%flux_to_wt(icell) =
dzero
422 this%finf_spec(icell) =
dzero
423 this%finf(icell) =
dzero
424 this%finf_rej(icell) =
dzero
425 this%gwet(icell) =
dzero
426 this%uzfarea(icell) =
dzero
427 this%cellarea(icell) =
dzero
428 this%celtop(icell) =
dzero
429 this%celbot(icell) =
dzero
430 this%landtop(icell) =
dzero
431 this%water_table(icell) =
dzero
432 this%water_table_old(icell) =
dzero
433 this%surfdep(icell) =
dzero
434 this%vks(icell) =
dzero
435 this%surf_infil(icell) =
dzero
436 this%surf_infil_below(icell) =
dzero
437 this%surf_seep(icell) =
dzero
438 this%gw_pet(icell) =
dzero
439 this%pet(icell) =
dzero
440 this%pet_max(icell) =
dzero
441 this%ext_depth(icell) =
dzero
442 this%ext_depth_uz(icell) =
dzero
443 this%landflag(icell) = 0
444 this%cell_below(icell) = 0
448 call this%checkin_deprecated_names(memory_path)
457 subroutine checkin_deprecated_names(this, memory_path)
461 class(uzfcellgrouptype) :: this
462 character(len=*),
intent(in) :: memory_path
464 character(len=*),
parameter :: version =
'6.9.0'
469 'WAVE_DEPTH', memory_path, version)
471 'WAVE_THETA', memory_path, version)
473 'WAVE_FLUX', memory_path, version)
475 'WAVE_SPEED', memory_path, version)
477 memory_path, version)
479 'NWAVES_MAX', memory_path, version)
482 'THETA_RES', memory_path, version)
484 'THETA_SAT', memory_path, version)
486 'THETA_INIT', memory_path, version)
488 memory_path, version)
490 memory_path, version)
492 memory_path, version)
494 'ROOT_ACT', memory_path, version)
496 'THETA_EXT', memory_path, version)
498 memory_path, version)
500 'FLUX_TO_WT', memory_path, version)
502 'FINF_SPEC', memory_path, version)
504 memory_path, version)
506 memory_path, version)
508 memory_path, version)
510 'EXT_DEPTH', memory_path, version)
512 'EXT_DEPTH_UZ', memory_path, version)
514 'WATER_TABLE', memory_path, version)
516 'WATER_TABLE_OLD', memory_path, version)
518 'SURF_INFIL', memory_path, version)
520 memory_path,
'SURF_INFIL_BELOW', memory_path, &
523 'SURF_SEEP', memory_path, version)
525 'CELL_BELOW', memory_path, version)
526 end subroutine checkin_deprecated_names
530 subroutine dealloc(this)
534 class(uzfcellgrouptype) :: this
588 end subroutine dealloc
592 subroutine setdata(this, icell, area, top, bot, surfdep, vks, thtr, thts, &
593 thti, eps, ntrail, landflag, ivertcon)
595 class(uzfcellgrouptype) :: this
596 integer(I4B),
intent(in) :: icell
597 real(DP),
intent(in) :: area
598 real(DP),
intent(in) :: top
599 real(DP),
intent(in) :: bot
600 real(DP),
intent(in) :: surfdep
601 real(DP),
intent(in) :: vks
602 real(DP),
intent(in) :: thtr
603 real(DP),
intent(in) :: thts
604 real(DP),
intent(in) :: thti
605 real(DP),
intent(in) :: eps
606 integer(I4B),
intent(in) :: ntrail
607 integer(I4B),
intent(in) :: landflag
608 integer(I4B),
intent(in) :: ivertcon
611 this%landflag(icell) = landflag
612 this%cell_below(icell) = ivertcon
613 this%surfdep(icell) = surfdep
614 this%uzfarea(icell) = area
615 this%cellarea(icell) = area
616 if (this%landflag(icell) == 1)
then
617 this%celtop(icell) = top -
dhalf * this%surfdep(icell)
619 this%celtop(icell) = top
621 this%celbot(icell) = bot
622 this%vks(icell) = vks
623 this%theta_res(icell) = thtr
624 this%theta_sat(icell) = thts
625 this%theta_init(icell) = thti
626 this%bc_eps(icell) = eps
627 this%ntrailwaves = ntrail
628 this%pet(icell) =
dzero
629 this%ext_depth(icell) =
dzero
630 this%theta_ext(icell) =
dzero
631 this%air_entry(icell) =
dzero
632 this%root_pot(icell) =
dzero
633 end subroutine setdata
637 subroutine sethead(this, icell, hgwf)
639 class(uzfcellgrouptype) :: this
640 integer(I4B),
intent(in) :: icell
641 real(DP),
intent(in) :: hgwf
644 this%water_table(icell) = this%celbot(icell)
645 if (hgwf > this%celbot(icell)) this%water_table(icell) = hgwf
646 if (this%water_table(icell) > this%celtop(icell)) &
647 this%water_table(icell) = this%celtop(icell)
648 this%water_table_old(icell) = this%water_table(icell)
649 end subroutine sethead
653 subroutine setdatafinf(this, icell, finf)
655 class(uzfcellgrouptype) :: this
656 integer(I4B),
intent(in) :: icell
657 real(DP),
intent(in) :: finf
659 if (this%landflag(icell) == 1)
then
660 this%finf_spec(icell) = finf
661 this%finf(icell) = finf
663 this%finf_spec(icell) =
dzero
664 this%finf(icell) =
dzero
666 this%finf_rej(icell) =
dzero
667 this%surf_infil(icell) =
dzero
668 this%surf_infil_below(icell) =
dzero
669 end subroutine setdatafinf
673 subroutine setdatauzfarea(this, icell, areamult)
675 class(uzfcellgrouptype) :: this
676 integer(I4B),
intent(in) :: icell
677 real(DP),
intent(in) :: areamult
680 this%uzfarea(icell) = this%cellarea(icell) * areamult
681 end subroutine setdatauzfarea
685 subroutine setdataet(this, icell, jbelow, pet, extdp)
687 class(uzfcellgrouptype) :: this
688 integer(I4B),
intent(in) :: icell
689 integer(I4B),
intent(in) :: jbelow
690 real(DP),
intent(in) :: pet
691 real(DP),
intent(in) :: extdp
695 if (this%landflag(icell) == 1)
then
696 this%pet(icell) = pet
697 this%gw_pet(icell) = pet
699 this%pet(icell) =
dzero
700 this%gw_pet(icell) =
dzero
702 thick = this%celtop(icell) - this%celbot(icell)
703 this%ext_depth(icell) = extdp
704 if (this%landflag(icell) > 0)
then
705 this%landtop(icell) = this%celtop(icell)
706 this%pet_max(icell) = this%pet(icell)
710 if (this%landtop(icell) - this%ext_depth(icell) < this%celbot(icell))
then
711 this%ext_depth_uz(icell) = thick
713 this%ext_depth_uz(icell) = this%celtop(icell) - &
714 (this%landtop(icell) - this%ext_depth(icell))
716 if (this%ext_depth_uz(icell) <
dzero) this%ext_depth_uz(icell) =
dzero
717 if (this%ext_depth_uz(icell) >
dem7 .and. this%ext_depth(icell) <
dem7) &
718 this%ext_depth(icell) = this%ext_depth_uz(icell)
722 this%landtop(jbelow) = this%landtop(icell)
723 this%pet_max(jbelow) = this%pet_max(icell)
725 end subroutine setdataet
729 subroutine setdataetwc(this, icell, jbelow, extwc)
731 class(uzfcellgrouptype) :: this
732 integer(I4B),
intent(in) :: icell
733 integer(I4B),
intent(in) :: jbelow
734 real(DP),
intent(in) :: extwc
737 this%theta_ext(icell) = extwc
738 if (jbelow > 0) this%theta_ext(jbelow) = extwc
739 end subroutine setdataetwc
743 subroutine setdataetha(this, icell, jbelow, ha, hroot, rootact)
745 class(uzfcellgrouptype) :: this
746 integer(I4B),
intent(in) :: icell
747 integer(I4B),
intent(in) :: jbelow
748 real(DP),
intent(in) :: ha
749 real(DP),
intent(in) :: hroot
750 real(DP),
intent(in) :: rootact
753 this%air_entry(icell) = ha
754 this%root_pot(icell) = hroot
755 this%root_act(icell) = rootact
757 this%air_entry(jbelow) = ha
758 this%root_pot(jbelow) = hroot
759 this%root_act(jbelow) = rootact
761 end subroutine setdataetha
765 subroutine advance(this, icell)
767 class(uzfcellgrouptype) :: this
768 integer(I4B),
intent(in) :: icell
771 this%surf_seep(icell) =
dzero
772 end subroutine advance
780 subroutine solve(this, jbelow, icell, totfluxtot, ietflag, &
781 issflag, iseepflag, hgwf, qfrommvr, ierr, &
782 reset_state, trhs, thcof, deriv, watercontent)
786 class(uzfcellgrouptype) :: this
787 integer(I4B),
intent(in) :: jbelow
788 integer(I4B),
intent(in) :: icell
789 real(DP),
intent(inout) :: totfluxtot
790 integer(I4B),
intent(in) :: ietflag
791 integer(I4B),
intent(in) :: issflag
792 integer(I4B),
intent(in) :: iseepflag
793 real(DP),
intent(in) :: hgwf
794 real(DP),
intent(in) :: qfrommvr
795 integer(I4B),
intent(inout) :: ierr
796 logical,
intent(in) :: reset_state
797 real(DP),
intent(inout),
optional :: trhs
798 real(DP),
intent(inout),
optional :: thcof
799 real(DP),
intent(inout),
optional :: deriv
800 real(DP),
intent(inout),
optional :: watercontent
806 real(DP) :: derivfinf
808 real(DP) :: thcoffinf
810 real(DP) :: thcofseep
820 this%finf_rej(icell) =
dzero
821 this%surf_infil(icell) = this%finf(icell) + qfrommvr / this%uzfarea(icell)
822 this%water_table(icell) = hgwf
823 this%surf_seep(icell) =
dzero
826 this%et_uz(icell) =
dzero
827 this%surf_infil_below(icell) =
dzero
828 if (this%cell_below(icell) > 0)
then
829 this%finf(jbelow) =
dzero
831 if (this%water_table(icell) < this%celbot(icell)) &
832 this%water_table(icell) = this%celbot(icell)
840 if (reset_state)
then
841 call this%store_waves(icell, this%wavsav)
844 if (this%water_table(icell) > this%celtop(icell)) &
845 this%water_table(icell) = this%celtop(icell)
848 if (this%surf_infil(icell) > this%vks(icell))
then
849 this%surf_infil(icell) = this%vks(icell)
853 if (this%landflag(icell) == 1)
then
854 call this%rejfinf(icell, deriv1, hgwf, trhsfinf, thcoffinf, finfact)
855 this%surf_infil(icell) = finfact
859 this%finf_rej(icell) = this%finf(icell) + &
860 (qfrommvr / this%uzfarea(icell)) &
861 - this%surf_infil(icell)
864 if (iseepflag > 0 .and. this%landflag(icell) == 1)
then
865 call this%gwseep(icell, deriv2, scale, hgwf, trhsseep, thcofseep, seep)
866 this%surf_seep(icell) = seep
870 test = this%water_table(icell)
871 if (this%water_table_old(icell) - test < -
dem15) &
872 test = this%water_table_old(icell)
873 if (this%celtop(icell) - test >
dem15)
then
874 if (issflag == 0)
then
875 call this%routewaves(totfluxtot,
delt, ietflag, icell, ierr)
878 call this%load_waves(icell, this%wavsav)
881 call this%uz_rise(icell, totfluxtot)
882 this%flux_to_wt(icell) = totfluxtot
883 if (this%cell_below(icell) > 0)
then
884 call this%addrech(icell, jbelow, hgwf, trhsfinf, thcoffinf, &
888 this%flux_to_wt(icell) = this%surf_infil(icell) *
delt
889 totfluxtot = this%surf_infil(icell) *
delt
892 trhsfinf = this%flux_to_wt(icell) * this%uzfarea(icell) /
delt
893 if (.not. reset_state)
then
894 call this%update_wav(icell,
delt, issflag, 0)
897 this%flux_to_wt(icell) = this%surf_infil(icell) *
delt
898 totfluxtot = this%surf_infil(icell) *
delt
899 if (.not. reset_state)
then
900 call this%update_wav(icell,
delt, issflag, 1)
905 if (
present(deriv)) deriv = deriv1 + deriv2 + derivfinf
906 if (
present(trhs)) trhs = trhsfinf + trhsseep
907 if (
present(thcof)) thcof = thcoffinf + thcofseep
910 if (
present(watercontent))
then
911 watercontent = this%get_wcnew(icell)
915 if (reset_state)
then
916 call this%load_waves(icell, this%wavsav)
922 subroutine addrech(this, icell, jbelow, hgwf, trhs, thcof, deriv, delt)
924 class(uzfcellgrouptype) :: this
925 integer(I4B),
intent(in) :: icell
926 integer(I4B),
intent(in) :: jbelow
927 real(DP),
intent(inout) :: trhs
928 real(DP),
intent(inout) :: thcof
929 real(DP),
intent(inout) :: deriv
930 real(DP),
intent(in) :: delt
931 real(DP),
intent(in) :: hgwf
934 real(DP) :: x, scale, range
940 trhs = this%uzfarea(icell) * this%flux_to_wt(icell) / delt
941 if (this%flux_to_wt(icell) <
dem14)
return
945 x = hgwf - (this%celbot(icell) - range)
946 call sscurve(x, range, deriv, scale)
947 deriv = this%uzfarea(icell) * deriv * this%flux_to_wt(icell) / delt
948 this%finf(jbelow) = (
done - scale) * this%flux_to_wt(icell) / delt
949 fcheck = this%finf(jbelow) - this%vks(jbelow)
953 this%finf(jbelow) = this%finf(jbelow) - fcheck
954 this%surf_infil_below(icell) = this%finf(jbelow)
955 this%flux_to_wt(icell) = scale * this%flux_to_wt(icell) + fcheck * delt
956 trhs = this%uzfarea(icell) * this%flux_to_wt(icell) / delt
957 end subroutine addrech
961 subroutine rejfinf(this, icell, deriv, hgwf, trhs, thcof, finfact)
963 class(uzfcellgrouptype) :: this
964 integer(I4B),
intent(in) :: icell
965 real(DP),
intent(inout) :: deriv
966 real(DP),
intent(inout) :: finfact
967 real(DP),
intent(inout) :: thcof
968 real(DP),
intent(inout) :: trhs
969 real(DP),
intent(in) :: hgwf
971 real(DP) :: x, range, scale, q
973 range = this%surfdep(icell)
974 q = this%surf_infil(icell)
976 trhs = finfact * this%uzfarea(icell)
977 x = this%celtop(icell) - hgwf
978 call slinear(x, range, deriv, scale)
979 deriv = -q * deriv * this%uzfarea(icell) * scale
980 if (scale <
done)
then
982 trhs = finfact * this%uzfarea(icell) * this%celtop(icell) / range
983 thcof = finfact * this%uzfarea(icell) / range
985 end subroutine rejfinf
989 subroutine gwseep(this, icell, deriv, scale, hgwf, trhs, thcof, seep)
991 class(uzfcellgrouptype) :: this
992 integer(I4B),
intent(in) :: icell
993 real(DP),
intent(inout) :: deriv
994 real(DP),
intent(inout) :: trhs
995 real(DP),
intent(inout) :: thcof
996 real(DP),
intent(inout) :: seep
997 real(DP),
intent(out) :: scale
998 real(DP),
intent(in) :: hgwf
1000 real(DP) :: x, range, y, deriv1, d1, d2, Q
1008 q = this%uzfarea(icell) * this%vks(icell)
1009 range = this%surfdep(icell)
1010 x = hgwf - this%celtop(icell)
1013 seep = scale * q * (hgwf - this%celtop(icell)) / range
1014 trhs = scale * q * this%celtop(icell) / range
1015 thcof = -scale * q / range
1016 d1 = -deriv1 * q * x / range
1017 d2 = -scale * q / range
1019 if (seep <
dzero)
then
1025 end subroutine gwseep
This module contains simulation constants.
real(dp), parameter dem12
real constant 1e-12
real(dp), parameter dem20
real constant 1e-20
real(dp), parameter dem10
real constant 1e-10
real(dp), parameter dem7
real constant 1e-7
real(dp), parameter dep20
real constant 1e20
real(dp), parameter dem14
real constant 1e-14
real(dp), parameter dhalf
real constant 1/2
real(dp), parameter dem3
real constant 1e-3
real(dp), parameter dem4
real constant 1e-4
real(dp), parameter dem30
real constant 1e-30
real(dp), parameter dem6
real constant 1e-6
real(dp), parameter dzero
real constant zero
real(dp), parameter dem5
real constant 1e-5
real(dp), parameter dem9
real constant 1e-9
real(dp), parameter dem15
real constant 1e-15
real(dp), parameter dtwo
real constant 2
real(dp), parameter dthree
real constant 3
real(dp), parameter done
real constant 1
This module defines variable data types.
Previous variable names checked in as deprecated aliases.
subroutine slinear(x, range, dydx, y)
sLinear
subroutine scubiclinear(x, range, dydx, y)
sCubicLinear
subroutine sscurve(x, range, dydx, y)
SCurve.
integer(i4b), pointer, public itmuni
flag indicating time units
integer(i4b), pointer, public kper
current stress period number
real(dp), pointer, public delt
length of the current time step
Unsaturated zone flow by the method of characteristics.
subroutine advance(this, icell)
Set variables to advance to new time step. nothing yet.
subroutine gwseep(this, icell, deriv, scale, hgwf, trhs, thcof, seep)
Calculate groundwater discharge to land surface.
subroutine sethead(this, icell, hgwf)
Set initial head for uzf object.
subroutine init(this, ncells, nwav, memory_path)
Allocate and set uzf object variables.
subroutine setdatauzfarea(this, icell, areamult)
Set uzfarea using cellarea and areamult.
subroutine setdataetha(this, icell, jbelow, ha, hroot, rootact)
Set variables for head-based unsaturated flow.
subroutine addrech(this, icell, jbelow, hgwf, trhs, thcof, deriv, delt)
Add recharge or infiltration to cells.
subroutine setdata(this, icell, area, top, bot, surfdep, vks, thtr, thts, thti, eps, ntrail, landflag, ivertcon)
Set uzf object material properties.
subroutine rejfinf(this, icell, deriv, hgwf, trhs, thcof, finfact)
Reject applied infiltration due to low vks.
subroutine solve(this, jbelow, icell, totfluxtot, ietflag, issflag, iseepflag, hgwf, qfrommvr, ierr, reset_state, trhs, thcof, deriv, watercontent)
Route water through one uzf cell and form its gwf equation terms.
subroutine setdataet(this, icell, jbelow, pet, extdp)
Set unsaturated ET-related variables.
subroutine dealloc(this)
Deallocate uzf object variables.
subroutine checkin_deprecated_names(this, memory_path)
Alias the previous names of the renamed uzf variables.
subroutine setdataetwc(this, icell, jbelow, extwc)
Set extinction water content.
subroutine setdatafinf(this, icell, finf)
Set infiltration.
real(dp) function, public etfunc_lin(efflndsrf, extdp, resid_pet, deriv_et, trhs, thcof, hgwf, celtop, celbot)
Calculate gwf ET using linear decay ET function from mf-2005.
real(dp) function, public etfunc_nlin(efflndsrf, extdp, resid_pet, deriv_et, trhs, thcof, hgwf)
Calculate gwf ET using a square decay ET function with smoothing at the specified extinction depth.
Snapshot of one cell's wave train.