MODFLOW 6 version 6.9.0.dev0
USGS Modular Hydrologic Model
Loading...
Searching...
No Matches
uzfcellgroupmodule Module Reference

Unsaturated zone flow by the method of characteristics. More...

Data Types

type  uzfwavestoretype
 Snapshot of one cell's wave train. More...
type  uzfcellgrouptype

Functions/Subroutines

subroutine init (this, ncells, nwav, memory_path)
 Allocate and set uzf object variables.
subroutine checkin_deprecated_names (this, memory_path)
 Alias the previous names of the renamed uzf variables.
subroutine dealloc (this)
 Deallocate uzf object variables.
subroutine setdata (this, icell, area, top, bot, surfdep, vks, thtr, thts, thti, eps, ntrail, landflag, ivertcon)
 Set uzf object material properties.
subroutine sethead (this, icell, hgwf)
 Set initial head for uzf object.
subroutine setdatafinf (this, icell, finf)
 Set infiltration.
subroutine setdatauzfarea (this, icell, areamult)
 Set uzfarea using cellarea and areamult.
subroutine setdataet (this, icell, jbelow, pet, extdp)
 Set unsaturated ET-related variables.
subroutine setdataetwc (this, icell, jbelow, extwc)
 Set extinction water content.
subroutine setdataetha (this, icell, jbelow, ha, hroot, rootact)
 Set variables for head-based unsaturated flow.
subroutine advance (this, icell)
 Set variables to advance to new time step. nothing yet.
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 addrech (this, icell, jbelow, hgwf, trhs, thcof, deriv, delt)
 Add recharge or infiltration to cells.
subroutine rejfinf (this, icell, deriv, hgwf, trhs, thcof, finfact)
 Reject applied infiltration due to low vks.
subroutine gwseep (this, icell, deriv, scale, hgwf, trhs, thcof, seep)
 Calculate groundwater discharge to land surface.

Detailed Description

Water moves through the unsaturated zone as a train of kinematic waves, after Smith (1983) and the MODFLOW-2005 UZF1 Package (Niswonger and others, 2006). A wave is a step change in water content moving down at speed dflux/dtheta, with flux given by the Brooks-Corey relation flux = vks * ((theta - theta_res) / (theta_sat - theta_res))**bc_eps.

The waves of one cell are held in columns of wave_depth, wave_theta, wave_flux and wave_speed, packed into positions 1 to nwaves(icell). The train is ordered so that wave 1 is deepest, depth decreases with index, and the wave at nwaves is the one at the land surface. Increasing infiltration adds a lead wave at the surface; decreasing infiltration adds a set of ntrailwaves trailing waves. Waves are routed until one reaches the bottom of the unsaturated zone, where it becomes recharge, or overtakes the wave ahead of it, where the two merge. Both events remove a wave and compact the train.

Function/Subroutine Documentation

◆ addrech()

subroutine uzfcellgroupmodule::addrech ( class(uzfcellgrouptype) this,
integer(i4b), intent(in) icell,
integer(i4b), intent(in) jbelow,
real(dp), intent(in) hgwf,
real(dp), intent(inout) trhs,
real(dp), intent(inout) thcof,
real(dp), intent(inout) deriv,
real(dp), intent(in) delt )
private

Definition at line 922 of file UzfCellGroup.f90.

923 ! -- dummy
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
932 ! -- local
933 real(DP) :: fcheck
934 real(DP) :: x, scale, range
935 !
936 ! -- initialize
937 range = dem5
938 deriv = dzero
939 thcof = dzero
940 trhs = this%uzfarea(icell) * this%flux_to_wt(icell) / delt
941 if (this%flux_to_wt(icell) < dem14) return
942 scale = done
943 !
944 ! -- smoothly reduce flow between cells when head close to cell top
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)
950 !
951 ! -- reduce flow between cells when vks is too small
952 if (fcheck < dem14) fcheck = dzero
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
Here is the call graph for this function:

◆ advance()

subroutine uzfcellgroupmodule::advance ( class(uzfcellgrouptype) this,
integer(i4b), intent(in) icell )
private

Definition at line 765 of file UzfCellGroup.f90.

766 ! -- dummy
767 class(UzfCellGroupType) :: this
768 integer(I4B), intent(in) :: icell
769 !
770 ! -- set variables
771 this%surf_seep(icell) = dzero

◆ checkin_deprecated_names()

subroutine uzfcellgroupmodule::checkin_deprecated_names ( class(uzfcellgrouptype) this,
character(len=*), intent(in) memory_path )
private

The aliases share memory with the renamed arrays so that programs using the previous names through the API still resolve them; each use is reported as deprecated.

Definition at line 457 of file UzfCellGroup.f90.

458 ! -- modules
460 ! -- dummy
461 class(UzfCellGroupType) :: this
462 character(len=*), intent(in) :: memory_path
463 ! -- local
464 character(len=*), parameter :: version = '6.9.0' !< deprecation version
465 ! -- code
466 !
467 ! -- wave state
468 call mem_alias_deprecated(this%wave_depth, 'UZDPST', memory_path, &
469 'WAVE_DEPTH', memory_path, version)
470 call mem_alias_deprecated(this%wave_theta, 'UZTHST', memory_path, &
471 'WAVE_THETA', memory_path, version)
472 call mem_alias_deprecated(this%wave_flux, 'UZFLST', memory_path, &
473 'WAVE_FLUX', memory_path, version)
474 call mem_alias_deprecated(this%wave_speed, 'UZSPST', memory_path, &
475 'WAVE_SPEED', memory_path, version)
476 call mem_alias_deprecated(this%nwaves, 'NWAVST', memory_path, 'NWAVES', &
477 memory_path, version)
478 call mem_alias_deprecated(this%nwaves_max, 'NWAV_PVAR', memory_path, &
479 'NWAVES_MAX', memory_path, version)
480 ! -- cell properties and state
481 call mem_alias_deprecated(this%theta_res, 'THTR', memory_path, &
482 'THETA_RES', memory_path, version)
483 call mem_alias_deprecated(this%theta_sat, 'THTS', memory_path, &
484 'THETA_SAT', memory_path, version)
485 call mem_alias_deprecated(this%theta_init, 'THTI', memory_path, &
486 'THETA_INIT', memory_path, version)
487 call mem_alias_deprecated(this%bc_eps, 'EPS', memory_path, 'BC_EPS', &
488 memory_path, version)
489 call mem_alias_deprecated(this%air_entry, 'HA', memory_path, 'AIR_ENTRY', &
490 memory_path, version)
491 call mem_alias_deprecated(this%root_pot, 'HROOT', memory_path, 'ROOT_POT', &
492 memory_path, version)
493 call mem_alias_deprecated(this%root_act, 'ROOTACT', memory_path, &
494 'ROOT_ACT', memory_path, version)
495 call mem_alias_deprecated(this%theta_ext, 'EXTWC', memory_path, &
496 'THETA_EXT', memory_path, version)
497 call mem_alias_deprecated(this%et_uz, 'ETACT', memory_path, 'ET_UZ', &
498 memory_path, version)
499 call mem_alias_deprecated(this%flux_to_wt, 'TOTFLUX', memory_path, &
500 'FLUX_TO_WT', memory_path, version)
501 call mem_alias_deprecated(this%finf_spec, 'SINF', memory_path, &
502 'FINF_SPEC', memory_path, version)
503 call mem_alias_deprecated(this%gwet, 'GWET_PVAR', memory_path, 'GWET', &
504 memory_path, version)
505 call mem_alias_deprecated(this%pet_max, 'PETMAX', memory_path, 'PET_MAX', &
506 memory_path, version)
507 call mem_alias_deprecated(this%gw_pet, 'GWPET', memory_path, 'GW_PET', &
508 memory_path, version)
509 call mem_alias_deprecated(this%ext_depth, 'EXTDP', memory_path, &
510 'EXT_DEPTH', memory_path, version)
511 call mem_alias_deprecated(this%ext_depth_uz, 'EXTDPUZ', memory_path, &
512 'EXT_DEPTH_UZ', memory_path, version)
513 call mem_alias_deprecated(this%water_table, 'WATAB', memory_path, &
514 'WATER_TABLE', memory_path, version)
515 call mem_alias_deprecated(this%water_table_old, 'WATABOLD', memory_path, &
516 'WATER_TABLE_OLD', memory_path, version)
517 call mem_alias_deprecated(this%surf_infil, 'SURFLUX', memory_path, &
518 'SURF_INFIL', memory_path, version)
519 call mem_alias_deprecated(this%surf_infil_below, 'SURFLUXBELOW', &
520 memory_path, 'SURF_INFIL_BELOW', memory_path, &
521 version)
522 call mem_alias_deprecated(this%surf_seep, 'SURFSEEP', memory_path, &
523 'SURF_SEEP', memory_path, version)
524 call mem_alias_deprecated(this%cell_below, 'IVERTCON', memory_path, &
525 'CELL_BELOW', memory_path, version)
Previous variable names checked in as deprecated aliases.

◆ dealloc()

subroutine uzfcellgroupmodule::dealloc ( class(uzfcellgrouptype) this)
private

Definition at line 530 of file UzfCellGroup.f90.

531 ! -- modules
533 ! -- dummy
534 class(UzfCellGroupType) :: this
535 !
536 call mem_deallocate(this%wave_depth)
537 call mem_deallocate(this%wave_theta)
538 call mem_deallocate(this%wave_flux)
539 call mem_deallocate(this%wave_speed)
540 call mem_deallocate(this%nwaves)
541 call mem_deallocate(this%nwaves_max)
542 call mem_deallocate(this%ntrailwaves)
543 call mem_deallocate(this%theta_res)
544 call mem_deallocate(this%theta_sat)
545 call mem_deallocate(this%theta_init)
546 call mem_deallocate(this%bc_eps)
547 call mem_deallocate(this%air_entry)
548 call mem_deallocate(this%root_pot)
549 call mem_deallocate(this%root_act)
550 call mem_deallocate(this%theta_ext)
551 call mem_deallocate(this%et_uz)
552 call mem_deallocate(this%flux_to_wt)
553 call mem_deallocate(this%finf_spec)
554 call mem_deallocate(this%finf)
555 call mem_deallocate(this%finf_rej)
556 call mem_deallocate(this%gwet)
557 call mem_deallocate(this%uzfarea)
558 call mem_deallocate(this%cellarea)
559 call mem_deallocate(this%celtop)
560 call mem_deallocate(this%celbot)
561 call mem_deallocate(this%landtop)
562 call mem_deallocate(this%water_table)
563 call mem_deallocate(this%water_table_old)
564 call mem_deallocate(this%surfdep)
565 call mem_deallocate(this%vks)
566 call mem_deallocate(this%surf_infil)
567 call mem_deallocate(this%surf_infil_below)
568 call mem_deallocate(this%surf_seep)
569 call mem_deallocate(this%gw_pet)
570 call mem_deallocate(this%pet)
571 call mem_deallocate(this%pet_max)
572 call mem_deallocate(this%ext_depth)
573 call mem_deallocate(this%ext_depth_uz)
574 call mem_deallocate(this%landflag)
575 call mem_deallocate(this%cell_below)
576 call mem_deallocate(this%wavsav%depth)
577 call mem_deallocate(this%wavsav%theta)
578 call mem_deallocate(this%wavsav%flux)
579 call mem_deallocate(this%wavsav%speed)
580 call mem_deallocate(this%wavsav%nwaves)
581 call mem_deallocate(this%etsav%depth)
582 call mem_deallocate(this%etsav%theta)
583 call mem_deallocate(this%etsav%flux)
584 call mem_deallocate(this%etsav%speed)
585 call mem_deallocate(this%etsav%nwaves)
586 call mem_deallocate(this%overtake_time)
587 call mem_deallocate(this%wave_merges)

◆ gwseep()

subroutine uzfcellgroupmodule::gwseep ( class(uzfcellgrouptype) this,
integer(i4b), intent(in) icell,
real(dp), intent(inout) deriv,
real(dp), intent(out) scale,
real(dp), intent(in) hgwf,
real(dp), intent(inout) trhs,
real(dp), intent(inout) thcof,
real(dp), intent(inout) seep )
private

Definition at line 989 of file UzfCellGroup.f90.

990 ! -- dummy
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
999 ! -- local
1000 real(DP) :: x, range, y, deriv1, d1, d2, Q
1001 !
1002 seep = dzero
1003 deriv = dzero
1004 deriv1 = dzero
1005 d1 = dzero
1006 d2 = dzero
1007 scale = dzero
1008 q = this%uzfarea(icell) * this%vks(icell)
1009 range = this%surfdep(icell)
1010 x = hgwf - this%celtop(icell)
1011 call scubiclinear(x, range, deriv1, y)
1012 scale = y
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
1018 deriv = d1 + d2
1019 if (seep < dzero) then
1020 seep = dzero
1021 deriv = dzero
1022 trhs = dzero
1023 thcof = dzero
1024 end if
Here is the call graph for this function:

◆ init()

subroutine uzfcellgroupmodule::init ( class(uzfcellgrouptype) this,
integer(i4b), intent(in) ncells,
integer(i4b), intent(in) nwav,
character(len=*), intent(in) memory_path )

Definition at line 315 of file UzfCellGroup.f90.

316 ! -- modules
318 ! -- dummy
319 class(UzfCellGroupType) :: this
320 integer(I4B), intent(in) :: ncells
321 integer(I4B), intent(in) :: nwav
322 character(len=*), intent(in) :: memory_path
323 ! -- local
324 integer(I4B) :: icell
325 integer(I4B) :: j
326 !
327 ! -- wave state, one column per cell
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)
335 !
336 ! -- cell properties and state
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', &
358 memory_path)
359 call mem_allocate(this%surfdep, ncells, 'SURFDEP', memory_path)
360 call mem_allocate(this%vks, ncells, 'VKS', 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', &
363 memory_path)
364 call mem_allocate(this%surf_seep, ncells, 'SURF_SEEP', memory_path)
365 call mem_allocate(this%gw_pet, ncells, 'GW_PET', memory_path)
366 call mem_allocate(this%pet, ncells, '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)
372 !
373 ! -- wave snapshots and leadwav work arrays, one cell wide
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)
386 !
387 ! -- wave capacity and trailing wave count are the same for every cell
388 this%nwaves_max = nwav
389 this%ntrailwaves = 0
390 this%wavsav%nwaves = 0
391 this%etsav%nwaves = 0
392 do j = 1, nwav
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
403 end do
404 do icell = 1, ncells
405 do j = 1, nwav
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
410 end do
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
445 end do
446 !
447 ! -- check in the pre-refactor variable names
448 call this%checkin_deprecated_names(memory_path)

◆ rejfinf()

subroutine uzfcellgroupmodule::rejfinf ( class(uzfcellgrouptype) this,
integer(i4b), intent(in) icell,
real(dp), intent(inout) deriv,
real(dp), intent(in) hgwf,
real(dp), intent(inout) trhs,
real(dp), intent(inout) thcof,
real(dp), intent(inout) finfact )
private

Definition at line 961 of file UzfCellGroup.f90.

962 ! -- dummy
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
970 ! -- local
971 real(DP) :: x, range, scale, q
972 !
973 range = this%surfdep(icell)
974 q = this%surf_infil(icell)
975 finfact = q
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
981 finfact = q * scale
982 trhs = finfact * this%uzfarea(icell) * this%celtop(icell) / range
983 thcof = finfact * this%uzfarea(icell) / range
984 end if
Here is the call graph for this function:

◆ setdata()

subroutine uzfcellgroupmodule::setdata ( class(uzfcellgrouptype) this,
integer(i4b), intent(in) icell,
real(dp), intent(in) area,
real(dp), intent(in) top,
real(dp), intent(in) bot,
real(dp), intent(in) surfdep,
real(dp), intent(in) vks,
real(dp), intent(in) thtr,
real(dp), intent(in) thts,
real(dp), intent(in) thti,
real(dp), intent(in) eps,
integer(i4b), intent(in) ntrail,
integer(i4b), intent(in) landflag,
integer(i4b), intent(in) ivertcon )
private

Definition at line 592 of file UzfCellGroup.f90.

594 ! -- dummy
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
609 !
610 ! -- set the values for uzf cell icell
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)
618 else
619 this%celtop(icell) = top
620 end if
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

◆ setdataet()

subroutine uzfcellgroupmodule::setdataet ( class(uzfcellgrouptype) this,
integer(i4b), intent(in) icell,
integer(i4b), intent(in) jbelow,
real(dp), intent(in) pet,
real(dp), intent(in) extdp )
private

Definition at line 685 of file UzfCellGroup.f90.

686 ! -- dummy
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
692 ! -- local
693 real(DP) :: thick
694 !
695 if (this%landflag(icell) == 1) then
696 this%pet(icell) = pet
697 this%gw_pet(icell) = pet
698 else
699 this%pet(icell) = dzero
700 this%gw_pet(icell) = dzero
701 end if
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)
707 end if
708 !
709 ! -- set uz extinction depth
710 if (this%landtop(icell) - this%ext_depth(icell) < this%celbot(icell)) then
711 this%ext_depth_uz(icell) = thick
712 else
713 this%ext_depth_uz(icell) = this%celtop(icell) - &
714 (this%landtop(icell) - this%ext_depth(icell))
715 end if
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)
719 !
720 ! -- set pet for underlying cell
721 if (jbelow > 0) then
722 this%landtop(jbelow) = this%landtop(icell)
723 this%pet_max(jbelow) = this%pet_max(icell)
724 end if

◆ setdataetha()

subroutine uzfcellgroupmodule::setdataetha ( class(uzfcellgrouptype) this,
integer(i4b), intent(in) icell,
integer(i4b), intent(in) jbelow,
real(dp), intent(in) ha,
real(dp), intent(in) hroot,
real(dp), intent(in) rootact )
private

Definition at line 743 of file UzfCellGroup.f90.

744 ! -- dummy
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
751 !
752 ! -- set variables
753 this%air_entry(icell) = ha
754 this%root_pot(icell) = hroot
755 this%root_act(icell) = rootact
756 if (jbelow > 0) then
757 this%air_entry(jbelow) = ha
758 this%root_pot(jbelow) = hroot
759 this%root_act(jbelow) = rootact
760 end if

◆ setdataetwc()

subroutine uzfcellgroupmodule::setdataetwc ( class(uzfcellgrouptype) this,
integer(i4b), intent(in) icell,
integer(i4b), intent(in) jbelow,
real(dp), intent(in) extwc )
private

Definition at line 729 of file UzfCellGroup.f90.

730 ! -- dummy
731 class(UzfCellGroupType) :: this
732 integer(I4B), intent(in) :: icell
733 integer(I4B), intent(in) :: jbelow
734 real(DP), intent(in) :: extwc
735 !
736 ! -- set extinction water content
737 this%theta_ext(icell) = extwc
738 if (jbelow > 0) this%theta_ext(jbelow) = extwc

◆ setdatafinf()

subroutine uzfcellgroupmodule::setdatafinf ( class(uzfcellgrouptype) this,
integer(i4b), intent(in) icell,
real(dp), intent(in) finf )
private

Definition at line 653 of file UzfCellGroup.f90.

654 ! -- dummy
655 class(UzfCellGroupType) :: this
656 integer(I4B), intent(in) :: icell
657 real(DP), intent(in) :: finf
658 !
659 if (this%landflag(icell) == 1) then
660 this%finf_spec(icell) = finf
661 this%finf(icell) = finf
662 else
663 this%finf_spec(icell) = dzero
664 this%finf(icell) = dzero
665 end if
666 this%finf_rej(icell) = dzero
667 this%surf_infil(icell) = dzero
668 this%surf_infil_below(icell) = dzero

◆ setdatauzfarea()

subroutine uzfcellgroupmodule::setdatauzfarea ( class(uzfcellgrouptype) this,
integer(i4b), intent(in) icell,
real(dp), intent(in) areamult )
private

Definition at line 673 of file UzfCellGroup.f90.

674 ! -- dummy
675 class(UzfCellGroupType) :: this
676 integer(I4B), intent(in) :: icell
677 real(DP), intent(in) :: areamult
678 !
679 ! -- set uzf area
680 this%uzfarea(icell) = this%cellarea(icell) * areamult

◆ sethead()

subroutine uzfcellgroupmodule::sethead ( class(uzfcellgrouptype) this,
integer(i4b), intent(in) icell,
real(dp), intent(in) hgwf )
private

Definition at line 637 of file UzfCellGroup.f90.

638 ! -- dummy
639 class(UzfCellGroupType) :: this
640 integer(I4B), intent(in) :: icell
641 real(DP), intent(in) :: hgwf
642 !
643 ! -- set initial head
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)

◆ solve()

subroutine uzfcellgroupmodule::solve ( class(uzfcellgrouptype) this,
integer(i4b), intent(in) jbelow,
integer(i4b), intent(in) icell,
real(dp), intent(inout) totfluxtot,
integer(i4b), intent(in) ietflag,
integer(i4b), intent(in) issflag,
integer(i4b), intent(in) iseepflag,
real(dp), intent(in) hgwf,
real(dp), intent(in) qfrommvr,
integer(i4b), intent(inout) ierr,
logical, intent(in) reset_state,
real(dp), intent(inout), optional trhs,
real(dp), intent(inout), optional thcof,
real(dp), intent(inout), optional deriv,
real(dp), intent(inout), optional watercontent )
private

With reset_state, the wave train is saved on entry and restored on exit, so a trial solution leaves no trace; only the final call of the time step, with reset_state false, commits the new waves through update_wav.

Parameters
[in]jbelownumber of underlying uzf object or 0 if none
[in]icellnumber of this uzf object
[in]ietflaget is off (0) or based one water content (1) or pressure (2)
[in]issflagsteady state flag
[in]iseepflagdischarge to land is active (1) or not (0)
[in]hgwfhead for cell icell
[in]qfrommvrwater inflow from mover
[in,out]ierrflag indicating not enough waves
[in]reset_stateflag indicating that waves should be reset after solution
[in,out]trhstotal uzf rhs contribution to GWF model
[in,out]thcoftotal uzf hcof contribution to GWF model
[in,out]derivderivate term for contribution to GWF model
[in,out]watercontentcalculated water content

Definition at line 780 of file UzfCellGroup.f90.

783 ! -- modules
784 use tdismodule, only: delt
785 ! -- dummy
786 class(UzfCellGroupType) :: this
787 integer(I4B), intent(in) :: jbelow !< number of underlying uzf object or 0 if none
788 integer(I4B), intent(in) :: icell !< number of this uzf object
789 real(DP), intent(inout) :: totfluxtot !<
790 integer(I4B), intent(in) :: ietflag !< et is off (0) or based one water content (1) or pressure (2)
791 integer(I4B), intent(in) :: issflag !< steady state flag
792 integer(I4B), intent(in) :: iseepflag !< discharge to land is active (1) or not (0)
793 real(DP), intent(in) :: hgwf !< head for cell icell
794 real(DP), intent(in) :: qfrommvr !< water inflow from mover
795 integer(I4B), intent(inout) :: ierr !< flag indicating not enough waves
796 logical, intent(in) :: reset_state !< flag indicating that waves should be reset after solution
797 real(DP), intent(inout), optional :: trhs !< total uzf rhs contribution to GWF model
798 real(DP), intent(inout), optional :: thcof !< total uzf hcof contribution to GWF model
799 real(DP), intent(inout), optional :: deriv !< derivate term for contribution to GWF model
800 real(DP), intent(inout), optional :: watercontent !< calculated water content
801 ! -- local
802 real(DP) :: test
803 real(DP) :: scale
804 real(DP) :: seep
805 real(DP) :: finfact
806 real(DP) :: derivfinf
807 real(DP) :: trhsfinf
808 real(DP) :: thcoffinf
809 real(DP) :: trhsseep
810 real(DP) :: thcofseep
811 real(DP) :: deriv1
812 real(DP) :: deriv2
813 !
814 ! -- initialize variables
815 totfluxtot = dzero
816 trhsfinf = dzero
817 thcoffinf = dzero
818 trhsseep = dzero
819 thcofseep = dzero
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
824 seep = dzero
825 finfact = 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
830 end if
831 if (this%water_table(icell) < this%celbot(icell)) &
832 this%water_table(icell) = this%celbot(icell)
833 !
834 ! -- initialize derivative variables
835 deriv1 = dzero
836 deriv2 = dzero
837 derivfinf = dzero
838 !
839 ! -- save wave states for resetting after iteration.
840 if (reset_state) then
841 call this%store_waves(icell, this%wavsav)
842 end if
843 !
844 if (this%water_table(icell) > this%celtop(icell)) &
845 this%water_table(icell) = this%celtop(icell)
846 !
847 ! -- add water from mover to applied infiltration.
848 if (this%surf_infil(icell) > this%vks(icell)) then
849 this%surf_infil(icell) = this%vks(icell)
850 end if
851 !
852 ! -- saturation excess rejected infiltration
853 if (this%landflag(icell) == 1) then
854 call this%rejfinf(icell, deriv1, hgwf, trhsfinf, thcoffinf, finfact)
855 this%surf_infil(icell) = finfact
856 end if
857 !
858 ! -- calculate rejected infiltration
859 this%finf_rej(icell) = this%finf(icell) + &
860 (qfrommvr / this%uzfarea(icell)) &
861 - this%surf_infil(icell)
862 !
863 ! -- calculate groundwater discharge
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
867 end if
868 !
869 ! -- route water through unsat zone, calc. storage change and recharge
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)
876 if (ierr > 0) then
877 if (reset_state) &
878 call this%load_waves(icell, this%wavsav)
879 return
880 end if
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, &
885 derivfinf, delt)
886 end if
887 else
888 this%flux_to_wt(icell) = this%surf_infil(icell) * delt
889 totfluxtot = this%surf_infil(icell) * delt
890 end if
891 thcoffinf = dzero
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)
895 end if
896 else
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)
901 end if
902 end if
903 !
904 ! -- If formulating, then these variables will be present
905 if (present(deriv)) deriv = deriv1 + deriv2 + derivfinf
906 if (present(trhs)) trhs = trhsfinf + trhsseep
907 if (present(thcof)) thcof = thcoffinf + thcofseep
908 !
909 ! -- Assign water content prior to resetting waves
910 if (present(watercontent)) then
911 watercontent = this%get_wcnew(icell)
912 end if
913 !
914 ! -- reset waves to previous state for next iteration
915 if (reset_state) then
916 call this%load_waves(icell, this%wavsav)
917 end if
real(dp), pointer, public delt
length of the current time step
Definition tdis.f90:32