37 character(len=LENFTYPE) ::
ftype =
'UZF'
38 character(len=LENPACKAGENAME) ::
text =
' UZF CELLS'
46 integer(I4B),
pointer :: iprwcont => null()
47 integer(I4B),
pointer :: iwcontout => null()
48 integer(I4B),
pointer :: ibudgetout => null()
49 integer(I4B),
pointer :: ibudcsv => null()
50 integer(I4B),
pointer :: ipakcsv => null()
53 integer(I4B),
pointer :: bditems => null()
54 integer(I4B),
pointer :: nbdtxt => null()
55 character(len=LENBUDTXT),
dimension(:),
pointer, &
56 contiguous :: bdtxt => null()
57 character(len=LENBOUNDNAME),
dimension(:),
pointer, &
58 contiguous :: uzfname => null()
67 integer(I4B),
pointer :: gwfiss => null()
68 real(dp),
dimension(:),
pointer,
contiguous :: gwfhcond => null()
71 integer(I4B),
pointer :: nwav_pvar => null()
72 integer(I4B),
pointer :: ntrail_pvar => null()
73 integer(I4B),
pointer :: nsets => null()
74 integer(I4B),
pointer :: nodes => null()
75 integer(I4B),
pointer :: readflag => null()
76 integer(I4B),
pointer :: ietflag => null()
77 integer(I4B),
pointer :: igwetflag => null()
78 integer(I4B),
pointer :: iseepflag => null()
79 integer(I4B),
pointer :: imaxcellcnt => null()
80 integer(I4B),
pointer :: iuzf2uzf => null()
82 integer(I4B),
dimension(:),
pointer,
contiguous :: igwfnode => null()
83 integer(I4B),
dimension(:),
pointer,
contiguous :: ia => null()
84 integer(I4B),
dimension(:),
pointer,
contiguous :: ja => null()
86 real(dp),
dimension(:),
pointer,
contiguous :: appliedinf => null()
87 real(dp),
dimension(:),
pointer,
contiguous :: rejinf => null()
88 real(dp),
dimension(:),
pointer,
contiguous :: rejinf0 => null()
89 real(dp),
dimension(:),
pointer,
contiguous :: rejinftomvr => null()
90 real(dp),
dimension(:),
pointer,
contiguous :: infiltration => null()
91 real(dp),
dimension(:),
pointer,
contiguous :: gwet_pvar => null()
92 real(dp),
dimension(:),
pointer,
contiguous :: uzet => null()
93 real(dp),
dimension(:),
pointer,
contiguous :: gwd => null()
94 real(dp),
dimension(:),
pointer,
contiguous :: gwd0 => null()
95 real(dp),
dimension(:),
pointer,
contiguous :: gwdtomvr => null()
96 real(dp),
dimension(:),
pointer,
contiguous :: rch => null()
97 real(dp),
dimension(:),
pointer,
contiguous :: rch0 => null()
98 real(dp),
dimension(:),
pointer,
contiguous :: qsto => null()
99 real(dp),
dimension(:),
pointer,
contiguous :: wcnew => null()
100 real(dp),
dimension(:),
pointer,
contiguous :: wcold => null()
104 real(dp),
dimension(:),
pointer,
contiguous :: sinf_pvar => null()
105 real(dp),
dimension(:),
pointer,
contiguous :: pet_pvar => null()
106 real(dp),
dimension(:),
pointer,
contiguous :: extdp => null()
107 real(dp),
dimension(:),
pointer,
contiguous :: extwc_pvar => null()
108 real(dp),
dimension(:),
pointer,
contiguous :: ha_pvar => null()
109 real(dp),
dimension(:),
pointer,
contiguous :: hroot_pvar => null()
110 real(dp),
dimension(:),
pointer,
contiguous :: rootact_pvar => null()
113 real(dp),
dimension(:, :),
pointer,
contiguous :: uauxvar => null()
116 integer(I4B),
pointer :: iconvchk => null()
119 real(dp),
dimension(:),
pointer,
contiguous :: deriv => null()
122 real(dp),
pointer :: totfluxtot => null()
123 integer(I4B),
pointer :: issflag => null()
124 integer(I4B),
pointer :: issflagold => null()
125 integer(I4B),
pointer :: istocb => null()
128 integer(I4B),
pointer :: cbcauxitems => null()
129 character(len=16),
dimension(:),
pointer,
contiguous :: cauxcbc => null()
130 real(dp),
dimension(:),
pointer,
contiguous :: qauxcbc => null()
178 subroutine uzf_create(packobj, id, ibcnum, inunit, iout, namemodel, pakname, &
183 class(
bndtype),
pointer :: packobj
184 integer(I4B),
intent(in) :: id
185 integer(I4B),
intent(in) :: ibcnum
186 integer(I4B),
intent(in) :: inunit
187 integer(I4B),
intent(in) :: iout
188 character(len=*),
intent(in) :: namemodel
189 character(len=*),
intent(in) :: pakname
190 character(len=*),
intent(in) :: mempath
192 type(
uzftype),
pointer :: uzfobj
199 call packobj%set_names(ibcnum, namemodel, pakname,
ftype, mempath)
203 call uzfobj%uzf_allocate_scalars()
206 call packobj%pack_initialize()
208 packobj%inunit = inunit
211 packobj%ibcnum = ibcnum
224 class(
uzftype),
intent(inout) :: this
229 call this%obs%obs_ar()
232 call this%BndExtType%allocate_arrays()
240 if (this%inamedbound /= 0)
then
242 this%boundname(n) = this%uzfname(n)
247 call this%copy_boundname()
251 this%nodelist(i) = this%igwfnode(i)
254 call this%uzfobj%sethead(i, hgwf)
258 if (this%imover /= 0)
then
259 allocate (this%pakmvrobj)
260 call this%pakmvrobj%ar(this%maxbound, this%maxbound, this%memoryPath)
268 class(
uzftype),
intent(inout) :: this
277 call mem_allocate(this%igwfnode, this%nodes,
'IGWFNODE', this%memoryPath)
278 call mem_allocate(this%appliedinf, this%nodes,
'APPLIEDINF', this%memoryPath)
279 call mem_allocate(this%rejinf, this%nodes,
'REJINF', this%memoryPath)
280 call mem_allocate(this%rejinf0, this%nodes,
'REJINF0', this%memoryPath)
281 call mem_allocate(this%rejinftomvr, this%nodes,
'REJINFTOMVR', &
283 call mem_allocate(this%infiltration, this%nodes,
'INFILTRATION', &
285 call mem_allocate(this%gwet_pvar, this%nodes,
'GWET_PVAR', this%memoryPath)
286 call mem_allocate(this%uzet, this%nodes,
'UZET', this%memoryPath)
287 call mem_allocate(this%gwd, this%nodes,
'GWD', this%memoryPath)
288 call mem_allocate(this%gwd0, this%nodes,
'GWD0', this%memoryPath)
289 call mem_allocate(this%gwdtomvr, this%nodes,
'GWDTOMVR', this%memoryPath)
290 call mem_allocate(this%rch, this%nodes,
'RCH', this%memoryPath)
291 call mem_allocate(this%rch0, this%nodes,
'RCH0', this%memoryPath)
292 call mem_allocate(this%qsto, this%nodes,
'QSTO', this%memoryPath)
293 call mem_allocate(this%deriv, this%nodes,
'DERIV', this%memoryPath)
296 call mem_allocate(this%ia, this%dis%nodes + 1,
'IA', this%memoryPath)
297 call mem_allocate(this%ja, this%nodes,
'JA', this%memoryPath)
300 call mem_setptr(this%sinf_pvar,
'FINF', this%input_mempath)
301 call mem_setptr(this%pet_pvar,
'PET', this%input_mempath)
302 call mem_setptr(this%extdp,
'EXTDP', this%input_mempath)
303 call mem_setptr(this%extwc_pvar,
'EXTWC', this%input_mempath)
304 call mem_setptr(this%ha_pvar,
'HA', this%input_mempath)
305 call mem_setptr(this%hroot_pvar,
'HROOT', this%input_mempath)
306 call mem_setptr(this%rootact_pvar,
'ROOTACT', this%input_mempath)
307 call mem_setptr(this%uauxvar,
'AUXVAR', this%input_mempath)
311 this%appliedinf(i) =
dzero
312 this%rejinf(i) =
dzero
313 this%rejinf0(i) =
dzero
314 this%rejinftomvr(i) =
dzero
315 this%gwet_pvar(i) =
dzero
319 this%gwdtomvr(i) =
dzero
323 this%deriv(i) =
dzero
329 if (this%iauxmultcol > 0 .and. j == this%iauxmultcol)
then
330 this%uauxvar(j, i) =
done
332 this%uauxvar(j, i) =
dzero
336 do i = 1, this%dis%nodes + 1
341 allocate (this%bdtxt(this%nbdtxt))
342 this%bdtxt(1) =
' UZF-INF'
343 this%bdtxt(2) =
' UZF-GWRCH'
344 this%bdtxt(3) =
' UZF-GWD'
345 this%bdtxt(4) =
' UZF-GWET'
346 this%bdtxt(5) =
' UZF-GWD TO-MVR'
349 call mem_allocate(this%wcnew, this%nodes,
'WCNEW', this%memoryPath)
350 call mem_allocate(this%wcold, this%nodes,
'WCOLD', this%memoryPath)
352 this%wcnew(i) =
dzero
353 this%wcold(i) =
dzero
357 allocate (this%cauxcbc(this%cbcauxitems))
358 allocate (this%uzfname(this%nodes))
361 call mem_allocate(this%qauxcbc, this%cbcauxitems,
'QAUXCBC', this%memoryPath)
362 do i = 1, this%cbcauxitems
363 this%qauxcbc(i) =
dzero
379 class(
uzftype),
intent(inout) :: this
383 'FINF', this%input_mempath,
'6.8.2')
385 'PET', this%input_mempath,
'6.8.2')
387 'EXTDP', this%input_mempath,
'6.8.2')
389 'EXTWC', this%input_mempath,
'6.8.2')
391 'HA', this%input_mempath,
'6.8.2')
393 'HROOT', this%input_mempath,
'6.8.2')
395 this%memoryPath,
'ROOTACT', this%input_mempath, &
400 'AUXVAR', this%input_mempath,
'6.8.2')
412 class(
uzftype),
intent(inout) :: this
415 integer(I4B),
pointer :: ikw => null()
416 character(len=LINELENGTH) :: fname
418 character(len=*),
parameter :: fmtet = &
419 "(4x, 'ET WILL BE SIMULATED WITHIN UZ AND GW ZONES, WITH LINEAR ', &
420 &'GWET IF OPTION NOT SPECIFIED OTHERWISE.')"
421 character(len=*),
parameter :: fmtgwetlin = &
422 &
"(4x, 'GROUNDWATER ET FUNCTION WILL BE LINEAR.')"
423 character(len=*),
parameter :: fmtgwetsquare = &
424 &
"(4x, 'GROUNDWATER ET FUNCTION WILL BE SQUARE WITH SMOOTHING.')"
425 character(len=*),
parameter :: fmtgwseepout = &
426 &
"(4x, 'GROUNDWATER DISCHARGE TO LAND SURFACE WILL BE SIMULATED.')"
427 character(len=*),
parameter :: fmtuzetwc = &
428 &
"(4x, 'UNSATURATED ET FUNCTION OF WATER CONTENT.')"
429 character(len=*),
parameter :: fmtuzetae = &
430 &
"(4x, 'UNSATURATED ET FUNCTION OF AIR ENTRY PRESSURE.')"
431 character(len=*),
parameter :: fmtuzfbin = &
432 "(4x, 'UZF ', 1x, a, 1x, ' WILL BE SAVED TO FILE: ', &
433 &a, /4x, 'OPENED ON UNIT: ', I0)"
437 call this%BndExtType%source_options()
439 write (this%iout,
'(1x,a)') &
440 'PROCESSING '//trim(adjustl(this%text))//
' OPTIONS'
443 call mem_set_value(fname,
'WCFILE', this%input_mempath, found%wcfile)
444 if (found%wcfile)
then
446 call openfile(this%iwcontout, this%iout, fname,
'DATA(BINARY)', &
448 write (this%iout, fmtuzfbin)
'WATER-CONTENT', trim(adjustl(fname)), &
453 call mem_set_value(fname,
'BUDGETFILE', this%input_mempath, found%budgetfile)
454 if (found%budgetfile)
then
455 call assign_iounit(this%ibudgetout, this%inunit,
"BUDGET fileout")
456 call openfile(this%ibudgetout, this%iout, fname,
'DATA(BINARY)', &
458 write (this%iout, fmtuzfbin)
'BUDGET', trim(adjustl(fname)), &
463 call mem_set_value(fname,
'BUDGETCSVFILE', this%input_mempath, &
465 if (found%budgetcsvfile)
then
466 call assign_iounit(this%ibudcsv, this%inunit,
"BUDGETCSV fileout")
467 call openfile(this%ibudcsv, this%iout, fname,
'CSV', filstat_opt=
'REPLACE')
468 write (this%iout, fmtuzfbin)
'BUDGET CSV', trim(adjustl(fname)), &
474 this%input_mempath, found%pkgconvfname)
475 if (found%pkgconvfname)
then
477 call openfile(this%ipakcsv, this%iout, fname,
'CSV', &
478 filstat_opt=
'REPLACE', mode_opt=
mnormal)
479 write (this%iout, fmtuzfbin)
'PACKAGE_CONVERGENCE', &
480 trim(adjustl(fname)), this%ipakcsv
485 call mem_set_value(ikw,
'SIMULATE_ET', this%input_mempath, found%simulate_et)
486 if (found%simulate_et)
then
489 write (this%iout, fmtet)
493 call mem_set_value(ikw,
'LINEAR_GWET', this%input_mempath, found%linear_gwet)
494 if (found%linear_gwet)
then
496 write (this%iout, fmtgwetlin)
500 call mem_set_value(ikw,
'SQUARE_GWET', this%input_mempath, found%square_gwet)
501 if (found%square_gwet)
then
503 write (this%iout, fmtgwetsquare)
507 call mem_set_value(ikw,
'SIMULATE_GWSEEP', this%input_mempath, &
508 found%simulate_gwseep)
509 if (found%simulate_gwseep)
then
511 write (this%iout, fmtgwseepout)
513 'USE DRN PACKAGE TO SIMULATE GROUNDWATER DISCHARGE TO LAND SURFACE '// &
520 call mem_set_value(ikw,
'UNSAT_ETWC', this%input_mempath, found%unsat_etwc)
521 if (found%unsat_etwc)
then
523 write (this%iout, fmtuzetwc)
527 call mem_set_value(ikw,
'UNSAT_ETAE', this%input_mempath, found%unsat_etae)
528 if (found%unsat_etae)
then
530 write (this%iout, fmtuzetae)
534 call mem_set_value(ikw,
'MOVER', this%input_mempath, found%mover)
535 if (found%mover)
then
540 call mem_set_value(ikw,
'ICONVCHK', this%input_mempath, found%iconvchk)
541 if (found%iconvchk)
then
543 write (this%iout,
'(4x,a)') &
544 'A FINAL CONVERGENCE CHECK OF THE CHANGE IN UZF RECHARGE '// &
550 write (this%iout,
'(1x,a)') &
551 'END OF '//trim(adjustl(this%text))//
' OPTIONS'
562 class(
uzftype),
intent(inout) :: this
571 write (this%iout,
'(/1x,a)') &
572 'PROCESSING '//trim(adjustl(this%text))//
' DIMENSIONS'
575 call mem_set_value(this%nodes,
'MAXBOUND', this%input_mempath, &
577 if (found%maxbound)
then
578 write (this%iout,
'(4x,a,i0)')
'NUZFCELLS = ', this%nodes
582 call mem_set_value(this%ntrail_pvar,
'NTRAILWAVES', this%input_mempath, &
584 if (found%ntrailwaves)
then
585 write (this%iout,
'(4x,a,i0)')
'NTRAILWAVES = ', this%ntrail_pvar
589 call mem_set_value(this%nsets,
'NWAVESETS', this%input_mempath, &
591 if (found%nwavesets)
then
592 write (this%iout,
'(4x,a,i0)')
'NTRAILSETS = ', this%nsets
595 write (this%iout,
'(1x,a)') &
596 'END OF '//trim(adjustl(this%text))//
' DIMENSIONS'
599 this%maxbound = this%maxbound + this%nodes
600 this%nbound = this%maxbound
603 if (this%nodes <= 0)
then
605 'NUZFCELLS (MAXBOUND) was not specified or was specified incorrectly.'
608 if (this%ntrail_pvar <= 1)
then
610 'NTRAILWAVES must be greater than 1. A value of 7 is recommended.'
613 if (this%nsets <= 0)
then
615 'NWAVESETS was not specified or was specified incorrectly.'
623 this%nwav_pvar = this%ntrail_pvar * this%nsets
627 call this%define_listlabel()
630 call this%uzf_allocate_arrays()
633 call this%uzf_checkin_deprecated_names()
636 allocate (this%uzfobj)
637 call this%uzfobj%init(this%nodes, this%nwav_pvar, this%memoryPath)
640 call this%uzf_source_packagedata()
643 if (this%iprpak /= 0)
then
644 call this%print_cell_properties()
648 call this%uzf_setup_budobj()
658 class(
uzftype),
intent(inout) :: this
660 integer(I4B),
pointer :: nlist => null()
661 integer(I4B),
dimension(:),
pointer,
contiguous :: ifno => null()
664 character(len=20) :: cellid
665 character(len=LINELENGTH) :: title
666 character(len=LINELENGTH) :: tag
667 integer(I4B) :: ntabrows
668 integer(I4B) :: ntabcols
671 character(len=*),
parameter :: fmtlsp = &
672 &
"(1X,/1X,'REUSING ',A,'S FROM LAST STRESS PERIOD')"
675 this%nbound = this%maxbound
678 this%issflag = this%gwfiss
681 if (this%iper ==
kper)
then
684 call mem_setptr(nlist,
'NBOUND', this%input_mempath)
685 call mem_setptr(ifno,
'IFNO', this%input_mempath)
688 if (this%iprpak /= 0)
then
691 if (this%ietflag /= 0)
then
692 ntabcols = ntabcols + 3
693 if (this%ietflag == 2)
then
694 ntabcols = ntabcols + 3
697 if (this%inamedbound == 1)
then
698 ntabcols = ntabcols + 1
700 title = trim(adjustl(this%text))//
' PACKAGE ('// &
701 trim(adjustl(this%packName))//
') DATA FOR PERIOD'
702 write (title,
'(a,1x,i6)') trim(adjustl(title)),
kper
703 call table_cr(this%inputtab, this%packName, title)
704 call this%inputtab%table_df(ntabrows, ntabcols, this%iout, &
707 call this%inputtab%initialize_column(tag, 10)
709 call this%inputtab%initialize_column(tag, 20, alignment=
tableft)
711 call this%inputtab%initialize_column(tag, 12)
712 if (this%ietflag /= 0)
then
714 call this%inputtab%initialize_column(tag, 12)
716 call this%inputtab%initialize_column(tag, 12)
718 call this%inputtab%initialize_column(tag, 12)
719 if (this%ietflag == 2)
then
721 call this%inputtab%initialize_column(tag, 12)
723 call this%inputtab%initialize_column(tag, 12)
725 call this%inputtab%initialize_column(tag, 12)
728 if (this%inamedbound == 1)
then
730 call this%inputtab%initialize_column(tag,
lenboundname, &
738 if (i < 1 .or. i > this%nodes)
then
739 tag = trim(adjustl(this%text))//
' PACKAGE ('// &
740 trim(adjustl(this%packName))//
') DATA FOR PERIOD'
741 write (tag,
'(a,1x,i0)') trim(adjustl(tag)),
kper
742 write (
errmsg,
'(a,a,i0,1x,a,i0,a)') &
743 trim(adjustl(tag)),
': UZFNO ', i, &
744 'must be greater than 0 and less than or equal to ', this%nodes,
'.'
754 if (this%iprpak /= 0)
then
755 node = this%igwfnode(i)
757 call this%dis%noder_to_string(node, cellid)
761 call this%inputtab%add_term(i)
762 call this%inputtab%add_term(cellid)
763 call this%inputtab%add_term(this%sinf_pvar(i))
764 if (this%ietflag /= 0)
then
765 call this%inputtab%add_term(this%pet_pvar(i))
766 call this%inputtab%add_term(this%extdp(i))
767 call this%inputtab%add_term(this%extwc_pvar(i))
768 if (this%ietflag == 2)
then
769 call this%inputtab%add_term(this%ha_pvar(i))
770 call this%inputtab%add_term(this%hroot_pvar(i))
771 call this%inputtab%add_term(this%rootact_pvar(i))
774 if (this%inamedbound == 1)
then
775 call this%inputtab%add_term(this%boundname(i))
780 if (this%iprpak /= 0)
then
781 call this%inputtab%finalize_table()
789 write (this%iout, fmtlsp) trim(this%filtyp)
796 if ((this%issflag == 0 .AND.
kper == 1) .or. &
797 (
kper == 2 .AND. this%issflagold == 1))
then
799 call this%uzfobj%setwaves(i)
806 this%wcnew(i) = this%uzfobj%get_wcnew(i)
811 this%issflagold = this%issflag
823 integer(I4B) :: ivertflag
824 integer(I4B) :: n, iaux
825 real(DP) :: rval1, rval2, rval3
828 call this%BndExtType%bnd_ad()
837 if (this%naux > 0)
then
838 do n = 1, this%maxbound
839 do iaux = 1, this%naux
840 if (this%noupdateauxvar(iaux) /= 0) cycle
841 this%auxvar(iaux, n) = this%uauxvar(iaux, n)
851 this%wcold(i) = this%wcnew(i)
860 this%wcnew(i) = this%wcold(i)
866 call this%uzfobj%advance(i)
873 ivertflag = this%uzfobj%ivertcon(i)
876 if (this%iauxmultcol > 0)
then
877 rval1 = this%uauxvar(this%iauxmultcol, i)
878 call this%uzfobj%setdatauzfarea(i, rval1)
882 rval1 = this%sinf_pvar(i)
883 call this%uzfobj%setdatafinf(i, rval1)
886 rval1 = this%pet_pvar(i)
887 rval2 = this%extdp(i)
888 call this%uzfobj%setdataet(i, ivertflag, rval1, rval2)
891 rval1 = this%extwc_pvar(i)
892 call this%uzfobj%setdataetwc(i, ivertflag, rval1)
895 rval1 = this%ha_pvar(i)
896 rval2 = this%hroot_pvar(i)
897 rval3 = this%rootact_pvar(i)
898 call this%uzfobj%setdataetha(i, ivertflag, rval1, rval2, rval3)
902 if (this%iauxmultcol > 0)
then
903 call this%check_cell_area()
907 if (this%imover == 1)
then
908 call this%pakmvrobj%ad()
925 if (this%nodes == 0)
return
929 do n = 1, this%maxbound
930 this%rejinf0(n) = this%rejinf(n)
931 this%rch0(n) = this%rch(n)
932 this%gwd0(n) = this%gwd(n)
938 subroutine uzf_fc(this, rhs, ia, idxglo, matrix_sln)
941 real(DP),
dimension(:),
intent(inout) :: rhs
942 integer(I4B),
dimension(:),
intent(in) :: ia
943 integer(I4B),
dimension(:),
intent(in) :: idxglo
946 integer(I4B) :: i, n, ipos
949 if (this%imover == 1)
then
950 call this%pakmvrobj%fc()
955 call this%uzf_solve(reset_state=.true.)
960 rhs(n) = rhs(n) + this%rhs(i)
962 call matrix_sln%add_value_pos(idxglo(ipos), this%hcof(i))
968 subroutine uzf_fn(this, rhs, ia, idxglo, matrix_sln)
971 real(DP),
dimension(:),
intent(inout) :: rhs
972 integer(I4B),
dimension(:),
intent(in) :: ia
973 integer(I4B),
dimension(:),
intent(in) :: idxglo
983 call matrix_sln%add_value_pos(idxglo(ipos), this%deriv(i))
984 rhs(n) = rhs(n) + this%deriv(i) * this%xnew(n)
990 subroutine uzf_cc(this, innertot, kiter, iend, icnvgmod, cpak, ipak, dpak)
994 class(
uzftype),
intent(inout) :: this
995 integer(I4B),
intent(in) :: innertot
996 integer(I4B),
intent(in) :: kiter
997 integer(I4B),
intent(in) :: icnvgmod
998 integer(I4B),
intent(in) :: iend
999 character(len=LENPAKLOC),
intent(inout) :: cpak
1000 integer(I4B),
intent(inout) :: ipak
1001 real(DP),
intent(inout) :: dpak
1003 character(len=LENPAKLOC) :: cloc
1004 character(len=LINELENGTH) :: tag
1005 integer(I4B) :: icheck
1006 integer(I4B) :: ipakfail
1007 integer(I4B) :: locdrejinfmax
1008 integer(I4B) :: locdrchmax
1009 integer(I4B) :: locdseepmax
1010 integer(I4B) :: locdqfrommvrmax
1011 integer(I4B) :: ntabrows
1012 integer(I4B) :: ntabcols
1016 real(DP) :: qtolfact
1018 real(DP) :: drejinfmax
1022 real(DP) :: dseepmax
1023 real(DP) :: dqfrommvr
1024 real(DP) :: dqfrommvrmax
1027 icheck = this%iconvchk
1036 dqfrommvrmax =
dzero
1040 if (this%ipakcsv == 0)
then
1041 if (icnvgmod == 0)
then
1047 if (.not.
associated(this%pakcsvtab))
then
1052 if (this%iseepflag == 1)
then
1053 ntabcols = ntabcols + 2
1055 if (this%imover == 1)
then
1056 ntabcols = ntabcols + 2
1060 call table_cr(this%pakcsvtab, this%packName,
'')
1061 call this%pakcsvtab%table_df(ntabrows, ntabcols, this%ipakcsv, &
1062 lineseparator=.false., separator=
',', &
1066 tag =
'total_inner_iterations'
1067 call this%pakcsvtab%initialize_column(tag, 10, alignment=
tableft)
1069 call this%pakcsvtab%initialize_column(tag, 10, alignment=
tableft)
1071 call this%pakcsvtab%initialize_column(tag, 10, alignment=
tableft)
1073 call this%pakcsvtab%initialize_column(tag, 10, alignment=
tableft)
1075 call this%pakcsvtab%initialize_column(tag, 10, alignment=
tableft)
1077 call this%pakcsvtab%initialize_column(tag, 15, alignment=
tableft)
1078 tag =
'drejinfmax_loc'
1079 call this%pakcsvtab%initialize_column(tag, 15, alignment=
tableft)
1081 call this%pakcsvtab%initialize_column(tag, 15, alignment=
tableft)
1083 call this%pakcsvtab%initialize_column(tag, 15, alignment=
tableft)
1084 if (this%iseepflag == 1)
then
1086 call this%pakcsvtab%initialize_column(tag, 15, alignment=
tableft)
1087 tag =
'dseepmax_loc'
1088 call this%pakcsvtab%initialize_column(tag, 15, alignment=
tableft)
1090 if (this%imover == 1)
then
1091 tag =
'dqfrommvrmax'
1092 call this%pakcsvtab%initialize_column(tag, 15, alignment=
tableft)
1093 tag =
'dqfrommvrmax_loc'
1094 call this%pakcsvtab%initialize_column(tag, 16, alignment=
tableft)
1100 if (icheck /= 0)
then
1101 final_check:
do n = 1, this%nodes
1104 qtolfact =
delt / this%uzfobj%uzfarea(n)
1107 drejinf = qtolfact * (this%rejinf0(n) - this%rejinf(n))
1110 drch = qtolfact * (this%rch0(n) - this%rch(n))
1114 if (this%iseepflag == 1)
then
1115 dseep = qtolfact * (this%gwd0(n) - this%gwd(n))
1120 if (this%imover == 1)
then
1121 q = this%pakmvrobj%get_qfrommvr(n)
1122 q0 = this%pakmvrobj%get_qfrommvr0(n)
1123 dqfrommvr = qtolfact * (q0 - q)
1128 drejinfmax = drejinf
1134 dqfrommvrmax = dqfrommvr
1137 if (abs(drejinf) > abs(drejinfmax))
then
1138 drejinfmax = drejinf
1141 if (abs(drch) > abs(drchmax))
then
1145 if (abs(dseep) > abs(dseepmax))
then
1149 if (abs(dqfrommvr) > abs(dqfrommvrmax))
then
1150 dqfrommvrmax = dqfrommvr
1157 if (abs(drejinfmax) > abs(dpak))
then
1158 ipak = locdrejinfmax
1160 write (cloc,
"(a,'-',a)") trim(this%packName),
'rejinf'
1163 if (abs(drchmax) > abs(dpak))
then
1166 write (cloc,
"(a,'-',a)") trim(this%packName),
'rech'
1169 if (this%iseepflag == 1)
then
1170 if (abs(dseepmax) > abs(dpak))
then
1173 write (cloc,
"(a,'-',a)") trim(this%packName),
'seep'
1177 if (this%imover == 1)
then
1178 if (abs(dqfrommvrmax) > abs(dpak))
then
1179 ipak = locdqfrommvrmax
1181 write (cloc,
"(a,'-',a)") trim(this%packName),
'qfrommvr'
1187 if (this%ipakcsv /= 0)
then
1190 call this%pakcsvtab%add_term(innertot)
1191 call this%pakcsvtab%add_term(
totim)
1192 call this%pakcsvtab%add_term(
kper)
1193 call this%pakcsvtab%add_term(
kstp)
1194 call this%pakcsvtab%add_term(kiter)
1195 call this%pakcsvtab%add_term(drejinfmax)
1196 call this%pakcsvtab%add_term(locdrejinfmax)
1197 call this%pakcsvtab%add_term(drchmax)
1198 call this%pakcsvtab%add_term(locdrchmax)
1199 if (this%iseepflag == 1)
then
1200 call this%pakcsvtab%add_term(dseepmax)
1201 call this%pakcsvtab%add_term(locdseepmax)
1203 if (this%imover == 1)
then
1204 call this%pakcsvtab%add_term(dqfrommvrmax)
1205 call this%pakcsvtab%add_term(locdqfrommvrmax)
1210 call this%pakcsvtab%finalize_table()
1224 class(
uzftype),
intent(inout) :: this
1225 real(DP),
dimension(:),
intent(in) :: x
1226 real(DP),
dimension(:),
contiguous,
intent(inout) :: flowja
1227 integer(I4B),
optional,
intent(in) :: iadv
1237 character(len=*),
parameter :: fmttkk = &
1238 &
"(1X,/1X,A,' PERIOD ',I0,' STEP ',I0)"
1242 call this%uzf_solve(reset_state=.true.)
1246 call this%BndType%bnd_cq(x, flowja, iadv=1)
1249 do i = 1, this%nodes
1252 n = this%nodelist(i)
1255 if (this%ibound(n) < 1) cycle
1258 this%appliedinf(i) = this%uzfobj%sinf(i) * this%uzfobj%uzfarea(i)
1259 this%infiltration(i) = this%uzfobj%surflux(i) * this%uzfobj%uzfarea(i)
1262 qout = this%rejinf(i) + this%uzfobj%surfseep(i)
1264 if (this%imover == 1)
then
1265 qtomvr = this%pakmvrobj%get_qtomvr(i)
1270 if (qout >
dzero)
then
1271 qfact = this%rejinf(i) / qout
1274 this%rejinftomvr(i) = qfact * qtomvr
1277 q = q - this%rejinftomvr(i)
1287 this%gwd(i) = this%uzfobj%surfseep(i)
1289 if (qout >
dzero)
then
1290 qfact = this%gwd(i) / qout
1293 this%gwdtomvr(i) = qfact * qtomvr
1296 q = q - this%gwdtomvr(i)
1306 this%gwet_pvar(i) = this%uzfobj%gwet(i)
1307 this%uzet(i) = this%uzfobj%etact(i) * this%uzfobj%uzfarea(i) /
delt
1314 call this%uzf_fill_budobj()
1318 thtr, delt, iss)
result(qsto)
1320 real(dp),
intent(in) :: top
1321 real(dp),
intent(in) :: bot
1322 real(dp),
intent(in) :: hold
1323 real(dp),
intent(in) :: hnew
1324 real(dp),
intent(in) :: wcold
1325 real(dp),
intent(in) :: wcnew
1326 real(dp),
intent(in) :: thtr
1327 real(dp),
intent(in) :: carea
1328 real(dp),
intent(in) :: delt
1336 thknew = top - max(bot, hnew)
1337 thkold = top - max(bot, hold)
1339 if (thknew >
dzero)
then
1340 qsto = qsto + thknew * (wcnew - thtr)
1342 if (thkold >
dzero)
then
1343 qsto = qsto - thkold * (wcold - thtr)
1345 qsto = qsto * carea / delt
1358 type(
budgettype),
intent(inout) :: model_budget
1361 integer(I4B) :: isuppress_output
1362 isuppress_output = 0
1366 call model_budget%addentry(ratin, ratout,
delt, this%bdtxt(2), &
1367 isuppress_output, this%packName)
1370 if (this%iseepflag == 1)
then
1372 call model_budget%addentry(ratin, ratout,
delt, this%bdtxt(3), &
1373 isuppress_output, this%packName)
1374 if (this%imover == 1)
then
1376 call model_budget%addentry(ratin, ratout,
delt, this%bdtxt(5), &
1377 isuppress_output, this%packName)
1382 if (this%igwetflag /= 0)
then
1384 call model_budget%addentry(ratin, ratout,
delt, this%bdtxt(4), &
1385 isuppress_output, this%packName)
1397 integer(I4B),
intent(in) :: icbcfl
1398 integer(I4B),
intent(in) :: ibudfl
1399 integer(I4B),
intent(in) :: icbcun
1400 integer(I4B),
dimension(:),
optional,
intent(in) :: imap
1402 character(len=LINELENGTH) :: title
1403 integer(I4B) :: itxt
1407 title = trim(adjustl(this%bdtxt(itxt)))//
' PACKAGE ('// &
1408 trim(this%packName)//
') FLOW RATES'
1410 this%outputtab, this%nbound, this%nodelist, &
1411 this%rch, this%ibound, title, this%bdtxt(itxt), &
1412 this%ipakcb, this%dis, this%naux, &
1413 this%name_model, this%name_model, &
1414 this%name_model, this%packName, this%auxname, &
1415 this%auxvar, this%iout, this%inamedbound, &
1419 if (this%iseepflag == 1)
then
1421 title = trim(adjustl(this%bdtxt(itxt)))//
' PACKAGE ('// &
1422 trim(this%packName)//
') FLOW RATES'
1424 this%outputtab, this%nbound, this%nodelist, &
1425 -this%gwd, this%ibound, title, &
1426 this%bdtxt(itxt), this%ipakcb, this%dis, &
1427 this%naux, this%name_model, this%name_model, &
1428 this%name_model, this%packName, this%auxname, &
1429 this%auxvar, this%iout, this%inamedbound, &
1433 if (this%imover == 1)
then
1435 title = trim(adjustl(this%bdtxt(itxt)))//
' PACKAGE ('// &
1436 trim(this%packName)//
') FLOW RATES'
1438 this%outputtab, this%nbound, this%nodelist, &
1439 -this%gwdtomvr, this%ibound, title, &
1440 this%bdtxt(itxt), this%ipakcb, this%dis, &
1441 this%naux, this%name_model, this%name_model, &
1442 this%name_model, this%packName, &
1443 this%auxname, this%auxvar, this%iout, &
1444 this%inamedbound, this%boundname)
1449 if (this%igwetflag /= 0)
then
1451 title = trim(adjustl(this%bdtxt(itxt)))//
' PACKAGE ('// &
1452 trim(this%packName)//
') FLOW RATES'
1454 this%outputtab, this%nbound, this%nodelist, &
1455 -this%gwet_pvar, this%ibound, title, &
1456 this%bdtxt(itxt), this%ipakcb, this%dis, &
1457 this%naux, this%name_model, this%name_model, &
1458 this%name_model, this%packName, this%auxname, &
1459 this%auxvar, this%iout, this%inamedbound, &
1471 integer(I4B),
intent(in) :: icbcfl
1472 integer(I4B),
intent(in) :: ibudfl
1473 integer(I4B) :: ibinun
1477 if (this%ibudgetout /= 0)
then
1478 ibinun = this%ibudgetout
1480 if (icbcfl == 0) ibinun = 0
1481 if (ibinun > 0)
then
1482 call this%budobj%save_flows(this%dis, ibinun,
kstp,
kper,
delt, &
1487 if (ibudfl /= 0 .and. this%iprflow /= 0)
then
1488 call this%budobj%write_flowtable(this%dis,
kstp,
kper)
1500 integer(I4B),
intent(in) :: idvsave
1501 integer(I4B),
intent(in) :: idvprint
1503 integer(I4B) :: ibinun
1507 if (this%iwcontout /= 0)
then
1508 ibinun = this%iwcontout
1510 if (idvsave == 0) ibinun = 0
1513 if (ibinun > 0)
then
1515 totim, this%nodes, 1, 1, ibinun)
1526 integer(I4B),
intent(in) :: kstp
1527 integer(I4B),
intent(in) :: kper
1528 integer(I4B),
intent(in) :: iout
1529 integer(I4B),
intent(in) :: ibudfl
1531 call this%budobj%write_budtable(kstp, kper, iout, ibudfl,
totim,
delt)
1539 logical,
intent(in) :: reset_state
1543 integer(I4B) :: i, ivertflag
1544 integer(I4B) :: n, m, ierr
1545 real(DP) :: trhs1, thcof1, trhs2, thcof2
1546 real(DP) :: hgwf, uzderiv, derivgwet
1547 real(DP) :: qfrommvr
1550 real(DP) :: watabold
1554 do i = 1, this%nodes
1555 this%uzfobj%pet(i) = this%uzfobj%petmax(i)
1559 do i = 1, this%nodes
1562 this%hcof(i) =
dzero
1572 n = this%nodelist(i)
1573 ivertflag = this%uzfobj%ivertcon(i)
1574 watabold = this%uzfobj%watabold(i)
1576 if (this%ibound(n) > 0)
then
1581 if (this%imover == 1)
then
1582 qfrommvr = this%pakmvrobj%get_qfrommvr(i)
1589 call this%uzfobj%solve(ivertflag, i, &
1590 this%totfluxtot, this%ietflag, &
1591 this%issflag, this%iseepflag, hgwf, &
1593 reset_state=reset_state, &
1594 trhs=trhs1, thcof=thcof1, deriv=uzderiv, &
1600 errmsg =
'UZF variable NWAVESETS needs to be increased.'
1605 if (this%igwetflag > 0)
then
1606 call this%uzfobj%setgwpet(i)
1607 call this%uzfobj%simgwet(this%igwetflag, i, hgwf, trhs2, thcof2, &
1612 if (this%ietflag > 0)
then
1613 if (this%uzfobj%ivertcon(i) > 0)
then
1614 call this%uzfobj%setbelowpet(i, ivertflag)
1619 this%deriv(i) = uzderiv + derivgwet
1623 this%rejinf(i) = this%uzfobj%finf_rej(i) * this%uzfobj%uzfarea(i)
1624 this%rch(i) = this%uzfobj%totflux(i) * this%uzfobj%uzfarea(i) /
delt
1625 this%gwd(i) = this%uzfobj%surfseep(i)
1628 this%hcof(i) = thcof1 + thcof2
1629 this%rhs(i) = -trhs1 + trhs2
1632 if (this%imover == 1)
then
1633 qformvr = this%gwd(i) + this%rejinf(i)
1634 call this%pakmvrobj%accumulate_qformvr(i, qformvr)
1642 this%uzfobj%celbot(i), &
1643 this%uzfobj%uzfarea(i), &
1645 this%uzfobj%watab(i), &
1646 this%wcold(i), this%wcnew(i), &
1647 this%uzfobj%thtr(i),
delt, this%issflag)
1658 class(
uzftype),
intent(inout) :: this
1661 this%listlabel = trim(this%filtyp)//
' NO.'
1662 if (this%dis%ndim == 3)
then
1663 write (this%listlabel,
'(a, a7)') trim(this%listlabel),
'LAYER'
1664 write (this%listlabel,
'(a, a7)') trim(this%listlabel),
'ROW'
1665 write (this%listlabel,
'(a, a7)') trim(this%listlabel),
'COL'
1666 elseif (this%dis%ndim == 2)
then
1667 write (this%listlabel,
'(a, a7)') trim(this%listlabel),
'LAYER'
1668 write (this%listlabel,
'(a, a7)') trim(this%listlabel),
'CELL2D'
1670 write (this%listlabel,
'(a, a7)') trim(this%listlabel),
'NODE'
1672 write (this%listlabel,
'(a, a16)') trim(this%listlabel),
'STRESS RATE'
1673 if (this%inamedbound == 1)
then
1674 write (this%listlabel,
'(a, a16)') trim(this%listlabel),
'BOUNDARY NAME'
1683 integer(I4B),
intent(in) :: n
1684 integer(I4B),
intent(inout) :: nml
1686 integer(I4B) :: m, ipos
1690 do ipos = this%dis%con%ia(n) + 1, this%dis%con%ia(n + 1) - 1
1691 m = this%dis%con%ja(ipos)
1692 if (this%dis%con%ihc(ipos) /= 0)
then
1709 class(
uzftype),
intent(inout) :: this
1711 integer(I4B),
dimension(:),
pointer,
contiguous :: ifno => null()
1712 integer(I4B),
dimension(:, :),
pointer,
contiguous :: cellid_idm => null()
1713 integer(I4B),
dimension(:),
pointer,
contiguous :: landflag => null()
1714 integer(I4B),
dimension(:),
pointer,
contiguous :: ivertcon => null()
1715 real(DP),
dimension(:),
pointer,
contiguous :: surfdep => null()
1716 real(DP),
dimension(:),
pointer,
contiguous :: vks => null()
1717 real(DP),
dimension(:),
pointer,
contiguous :: thtr => null()
1718 real(DP),
dimension(:),
pointer,
contiguous :: thts => null()
1719 real(DP),
dimension(:),
pointer,
contiguous :: thti => null()
1720 real(DP),
dimension(:),
pointer,
contiguous :: eps => null()
1723 character(len=LINELENGTH) :: cellid_str
1724 integer(I4B) :: ierr
1725 integer(I4B) :: i, igwf, n
1726 integer(I4B) :: j, jcol
1727 integer(I4B),
dimension(:),
allocatable :: rowmaxnnz
1729 integer(I4B),
dimension(:),
allocatable :: nboundchk
1731 write (this%iout,
'(/1x,3a)')
'PROCESSING ', trim(adjustl(this%text)), &
1735 call mem_setptr(ifno,
'PACKAGEDATA_IFNO', this%input_mempath)
1736 call mem_setptr(cellid_idm,
'CELLID', this%input_mempath)
1737 call mem_setptr(landflag,
'LANDFLAG', this%input_mempath)
1738 call mem_setptr(ivertcon,
'IVERTCON', this%input_mempath)
1739 call mem_setptr(surfdep,
'SURFDEP', this%input_mempath)
1740 call mem_setptr(vks,
'VKS', this%input_mempath)
1741 call mem_setptr(thtr,
'THTR', this%input_mempath)
1742 call mem_setptr(thts,
'THTS', this%input_mempath)
1743 call mem_setptr(thti,
'THTI', this%input_mempath)
1744 call mem_setptr(eps,
'EPS', this%input_mempath)
1745 if (this%inamedbound /= 0)
then
1746 call mem_setptr(bndname,
'BOUNDNAME', this%input_mempath)
1750 allocate (rowmaxnnz(this%dis%nodes))
1751 do n = 1, this%dis%nodes
1754 allocate (nboundchk(this%nodes))
1755 do n = 1, this%nodes
1760 do n = 1, this%nodes
1761 i = this%validate_ifno(ifno(n), this%nodes, nboundchk, &
1762 'IUZNO',
'PACKAGEDATA')
1766 write (cellid_str,
'(10(i0,1x))') cellid_idm(1:this%dis%ndim, n)
1767 igwf = this%dis%noder_from_cellid(cellid_str, this%inunit, this%iout)
1768 this%igwfnode(i) = igwf
1769 rowmaxnnz(igwf) = rowmaxnnz(igwf) + 1
1772 if (landflag(n) < 0 .OR. landflag(n) > 1)
then
1773 write (
errmsg,
'(a,1x,i0,1x,a,1x,i0,a)') &
1774 'LANDFLAG for uzf cell', i, &
1775 'must be 0 or 1 (specified value is', landflag(n),
').'
1780 if (ivertcon(n) < 0 .OR. ivertcon(n) > this%nodes)
then
1781 write (
errmsg,
'(a,1x,i0,1x,a,1x,i0,a)') &
1782 'IVERTCON for uzf cell', i, &
1783 'must be 0 or less than NUZFCELLS (specified value is', &
1789 if (surfdep(n) <=
dzero .and. landflag(n) > 0)
then
1790 write (
errmsg,
'(a,1x,i0,1x,a,1x,g0,a)') &
1791 'SURFDEP for uzf cell', i, &
1792 'must be greater than 0 (specified value is', surfdep(n),
').'
1795 if (surfdep(n) >= this%dis%top(igwf) - this%dis%bot(igwf))
then
1796 write (
errmsg,
'(a,1x,i0,1x,a)') &
1797 'SURFDEP for uzf cell', i, &
1798 'cannot be greater than the cell thickness.'
1803 if (vks(n) <=
dzero)
then
1804 write (
errmsg,
'(a,1x,i0,1x,a,1x,g0,a)') &
1805 'VKS for uzf cell', i, &
1806 'must be greater than 0 (specified value ia', vks(n),
').'
1811 if (thtr(n) <=
dzero)
then
1812 write (
errmsg,
'(a,1x,i0,1x,a,1x,g0,a)') &
1813 'THTR for uzf cell', i, &
1814 'must be greater than 0 (specified value is', thtr(n),
').'
1819 if (thts(n) <= thtr(n))
then
1820 write (
errmsg,
'(a,1x,i0,1x,a,1x,g0,a)') &
1821 'THTS for uzf cell', i, &
1822 'must be greater than THTR (specified value is', thts(n),
').'
1827 if (thti(n) < thtr(n) .OR. thti(n) > thts(n))
then
1828 write (
errmsg,
'(a,1x,i0,1x,a,1x,a,1x,g0,a)') &
1829 'THTI for uzf cell', i, &
1830 'must be greater than or equal to THTR AND less than THTS', &
1831 '(specified value is', thti(n),
').'
1836 if (eps(n) < 3.5 .OR. eps(n) > 14)
then
1837 write (
errmsg,
'(a,1x,i0,1x,a,1x,g0,a)') &
1838 'EPSILON for uzf cell', i, &
1839 'must be between 3.5 and 14.0 (specified value is', eps(n),
').'
1844 if (this%inamedbound == 1)
then
1845 this%uzfname(i) = bndname(n)
1850 call this%uzfobj%setdata(i, this%dis%area(igwf), &
1851 this%dis%top(igwf), this%dis%bot(igwf), &
1852 surfdep(n), vks(n), thtr(n), thts(n), &
1853 thti(n), eps(n), this%ntrail_pvar, &
1854 landflag(n), ivertcon(n))
1855 if (ivertcon(n) > 0)
then
1860 write (this%iout,
'(1x,3a)') &
1861 'END OF ', trim(adjustl(this%text)),
' PACKAGEDATA'
1864 call this%report_ifno_coverage(nboundchk, this%nodes,
'uzf cell', &
1872 call sparse%init(this%dis%nodes, this%dis%nodes, rowmaxnnz)
1873 do i = 1, this%nodes
1874 igwf = this%igwfnode(i)
1875 call sparse%addconnection(igwf, i, 1)
1879 call sparse%filliaja(this%ia, this%ja, ierr)
1882 do i = 1, this%dis%nodes
1884 do j = this%ia(i), this%ia(i + 1) - 1
1887 if (jcol > this%imaxcellcnt)
then
1888 this%imaxcellcnt = jcol
1892 if (this%imaxcellcnt > 1 .and. this%iauxmultcol < 1)
then
1893 call this%check_cell_area()
1896 deallocate (rowmaxnnz)
1897 deallocate (nboundchk)
1917 class(
uzftype),
intent(inout) :: this
1919 character(len=20) :: cellid
1920 character(len=LINELENGTH) :: title
1921 character(len=LINELENGTH) :: tag
1922 integer(I4B) :: ntabrows
1923 integer(I4B) :: ntabcols
1925 integer(I4B) :: node
1930 ntabrows = this%nodes
1932 if (this%inamedbound == 1)
then
1933 ntabcols = ntabcols + 1
1937 title = trim(adjustl(this%text))//
' PACKAGE ('// &
1938 trim(adjustl(this%packName))//
') STATIC UZF CELL DATA'
1939 call table_cr(this%inputtab, this%packName, title)
1940 call this%inputtab%table_df(ntabrows, ntabcols, this%iout)
1942 call this%inputtab%initialize_column(tag, 10)
1944 call this%inputtab%initialize_column(tag, 20, alignment=
tableft)
1946 call this%inputtab%initialize_column(tag, 12)
1948 call this%inputtab%initialize_column(tag, 12)
1950 call this%inputtab%initialize_column(tag, 12)
1952 call this%inputtab%initialize_column(tag, 12)
1954 call this%inputtab%initialize_column(tag, 12)
1956 call this%inputtab%initialize_column(tag, 12)
1958 call this%inputtab%initialize_column(tag, 12)
1960 call this%inputtab%initialize_column(tag, 12)
1961 if (this%inamedbound == 1)
then
1967 do i = 1, this%nodes
1970 node = this%igwfnode(i)
1972 call this%dis%noder_to_string(node, cellid)
1978 call this%inputtab%add_term(i)
1979 call this%inputtab%add_term(cellid)
1980 call this%inputtab%add_term(this%uzfobj%landflag(i))
1981 call this%inputtab%add_term(this%uzfobj%ivertcon(i))
1982 call this%inputtab%add_term(this%uzfobj%surfdep(i))
1983 call this%inputtab%add_term(this%uzfobj%vks(i))
1984 call this%inputtab%add_term(this%uzfobj%thtr(i))
1985 call this%inputtab%add_term(this%uzfobj%thts(i))
1986 call this%inputtab%add_term(this%uzfobj%thti(i))
1987 call this%inputtab%add_term(this%uzfobj%eps(i))
1988 if (this%inamedbound == 1)
then
1989 call this%inputtab%add_term(this%uzfname(i))
2003 character(len=16) :: cuzf
2004 character(len=20) :: cellid
2005 character(len=LINELENGTH) :: cuzfcells
2015 real(DP) :: cellarea
2019 do i = 1, this%nodes
2022 i2 = this%uzfobj%ivertcon(i)
2023 area = this%uzfobj%uzfarea(i)
2027 area2 = this%uzfobj%uzfarea(i2)
2028 d = abs(area - area2)
2030 write (
errmsg,
'(2(a,1x,g0,1x,a,1x,i0,1x),a)') &
2031 'UZF cell area (', area,
') for cell ', i, &
2032 'does not equal uzf cell area (', area2,
') for cell ', i2,
'.'
2040 do n = 1, this%dis%nodes
2044 if ((i1 - i0) < 1) cycle
2050 write (cuzf,
'(i0)') i
2051 cuzfcells = trim(adjustl(cuzfcells))//
' '//trim(adjustl(cuzf))
2052 sumarea = sumarea + this%uzfobj%uzfarea(i)
2053 cellarea = this%uzfobj%cellarea(i)
2056 d = sumarea - cellarea
2058 call this%dis%noder_to_string(n, cellid)
2059 write (
errmsg,
'(a,1x,g0,1x,a,1x,g0,1x,a,1x,a,1x,a,a,a)') &
2060 'Total uzf cell area (', sumarea, &
2061 ') exceeds the gwf cell area (', cellarea,
') of cell', cellid, &
2062 'which includes uzf cell(s): ', trim(adjustl(cuzfcells)),
'.'
2095 integer(I4B) :: indx
2100 call this%obs%StoreObsType(
'uzf-gwrch', .true., indx)
2104 call this%obs%StoreObsType(
'uzf-gwd', .true., indx)
2108 call this%obs%StoreObsType(
'uzf-gwd-to-mvr', .true., indx)
2112 call this%obs%StoreObsType(
'uzf-gwet', .true., indx)
2116 call this%obs%StoreObsType(
'infiltration', .true., indx)
2120 call this%obs%StoreObsType(
'from-mvr', .true., indx)
2124 call this%obs%StoreObsType(
'rej-inf', .true., indx)
2128 call this%obs%StoreObsType(
'rej-inf-to-mvr', .true., indx)
2132 call this%obs%StoreObsType(
'uzet', .true., indx)
2136 call this%obs%StoreObsType(
'storage', .true., indx)
2140 call this%obs%StoreObsType(
'net-infiltration', .true., indx)
2144 call this%obs%StoreObsType(
'water-content', .false., indx)
2164 call this%uzf_solve(reset_state=.false.)
2167 if (this%obs%npakobs > 0)
then
2168 call this%obs%obs_bd_clear()
2169 do i = 1, this%obs%npakobs
2170 obsrv => this%obs%pakobs(i)%obsrv
2171 do ii = 1, obsrv%indxbnds_count
2172 n = obsrv%indxbnds(ii)
2174 select case (obsrv%ObsTypeId)
2182 case (
'UZF-GWD-TO-MVR')
2183 if (this%imover == 1)
then
2184 v = this%gwdtomvr(n)
2190 if (this%igwetflag > 0)
then
2191 v = this%gwet_pvar(n)
2196 case (
'INFILTRATION')
2197 v = this%appliedinf(n)
2199 if (this%imover == 1)
then
2200 v = this%pakmvrobj%get_qfrommvr(n)
2207 case (
'REJ-INF-TO-MVR')
2208 if (this%imover == 1)
then
2209 v = this%rejinftomvr(n)
2215 if (this%ietflag /= 0)
then
2223 case (
'NET-INFILTRATION')
2224 v = this%infiltration(n)
2225 case (
'WATER-CONTENT')
2226 v = this%uzfobj%get_water_content_at_depth(n, obsrv%obsDepth)
2228 errmsg =
'Unrecognized observation type: '//trim(obsrv%ObsTypeId)
2231 call this%obs%SaveOneSimval(obsrv, v)
2251 class(
uzftype),
intent(inout) :: this
2257 integer(I4B) :: iuzid
2258 real(DP) :: obsdepth
2260 character(len=LENBOUNDNAME) :: bname
2263 10
format(
'Boundary "', a,
'" for observation "', a, &
2264 '" is invalid in package "', a,
'"')
2265 60
format(
'Invalid node number in OBS input: ', i0)
2268 do i = 1, this%obs%npakobs
2269 obsrv => this%obs%pakobs(i)%obsrv
2272 nn = obsrv%NodeNumber
2274 bname = obsrv%FeatureName
2279 if (this%inamedbound /= 0)
then
2280 do j = 1, this%nodes
2281 if (this%boundname(j) == bname)
then
2282 obsrv%BndFound = .true.
2283 obsrv%CurrentTimeStepEndValue =
dzero
2284 call obsrv%AddObsIndex(j)
2285 if (obsrv%indxbnds_count == 1)
then
2294 if (.not. obsrv%BndFound)
then
2295 write (
errmsg, 10) trim(bname), trim(obsrv%Name), trim(this%packName)
2302 nn = obsrv%NodeNumber
2307 if (nn < 1 .or. nn > this%nodes)
then
2311 obsrv%BndFound = .true.
2313 obsrv%CurrentTimeStepEndValue =
dzero
2314 call obsrv%AddObsIndex(nn)
2319 if (obsrv%ObsTypeId ==
'WATER-CONTENT')
then
2320 n = obsrv%indxbnds_count
2322 write (
errmsg,
'(a,3(1x,a))') &
2323 trim(adjustl(obsrv%ObsTypeId)),
'for observation', &
2324 trim(adjustl(obsrv%Name)), &
2325 'must be assigned to a UZF cell with a unique boundname.'
2330 obsdepth = obsrv%Obsdepth
2333 obsrv%dblPak1 = obsdepth
2338 iuzid = obsrv%intPak1
2339 dmax = this%uzfobj%celtop(iuzid) - this%uzfobj%celbot(iuzid)
2345 if (obsdepth <=
dzero .or. obsdepth > dmax)
then
2346 write (
errmsg,
'(a,3(1x,a),1x,g0,1x,a,1x,g0,a)') &
2347 trim(adjustl(obsrv%ObsTypeId)),
'for observation', &
2348 trim(adjustl(obsrv%Name)),
'specified depth (', obsdepth, &
2349 ') must be greater than 0.0 and less than ', dmax,
'.'
2353 do j = 1, obsrv%indxbnds_count
2354 nn = obsrv%indxbnds(j)
2355 if (nn < 1 .or. nn > this%maxbound)
then
2356 write (
errmsg,
'(a,2(1x,a),1x,i0,1x,a,1x,i0,a)') &
2357 trim(adjustl(obsrv%ObsTypeId)),
'uzfno must be greater than 0 ', &
2358 'and less than or equal to', this%maxbound, &
2359 '(specified value is ', nn,
').'
2385 integer(I4B),
intent(in) :: inunitobs
2386 integer(I4B),
intent(in) :: iout
2388 integer(I4B) :: n, nn
2389 real(DP) :: obsdepth
2390 integer(I4B) :: icol, istart, istop, istat
2392 character(len=LINELENGTH) :: string
2396 string = obsrv%IDstring
2402 call urword(string, icol, istart, istop, 1, n, r, iout, inunitobs)
2403 read (string(istart:istop), 30, iostat=istat) nn
2404 if (istat == 0)
then
2406 obsrv%NodeNumber = nn
2410 obsrv%FeatureName = string(istart:istop)
2419 if (obsrv%ObsTypeId ==
'WATER-CONTENT')
then
2420 call urword(string, icol, istart, istop, 3, n, r, iout, inunitobs)
2423 obsrv%Obsdepth = obsdepth
2436 call this%BndExtType%allocate_scalars()
2439 call mem_allocate(this%iprwcont,
'IPRWCONT', this%memoryPath)
2440 call mem_allocate(this%iwcontout,
'IWCONTOUT', this%memoryPath)
2441 call mem_allocate(this%ibudgetout,
'IBUDGETOUT', this%memoryPath)
2442 call mem_allocate(this%ibudcsv,
'IBUDCSV', this%memoryPath)
2443 call mem_allocate(this%ipakcsv,
'IPAKCSV', this%memoryPath)
2444 call mem_allocate(this%ntrail_pvar,
'NTRAIL_PVAR', this%memoryPath)
2445 call mem_allocate(this%nsets,
'NSETS', this%memoryPath)
2446 call mem_allocate(this%nodes,
'NODES', this%memoryPath)
2447 call mem_allocate(this%istocb,
'ISTOCB', this%memoryPath)
2448 call mem_allocate(this%nwav_pvar,
'NWAV_PVAR', this%memoryPath)
2449 call mem_allocate(this%totfluxtot,
'TOTFLUXTOT', this%memoryPath)
2450 call mem_allocate(this%bditems,
'BDITEMS', this%memoryPath)
2451 call mem_allocate(this%nbdtxt,
'NBDTXT', this%memoryPath)
2452 call mem_allocate(this%issflag,
'ISSFLAG', this%memoryPath)
2453 call mem_allocate(this%issflagold,
'ISSFLAGOLD', this%memoryPath)
2454 call mem_allocate(this%readflag,
'READFLAG', this%memoryPath)
2455 call mem_allocate(this%iseepflag,
'ISEEPFLAG', this%memoryPath)
2456 call mem_allocate(this%imaxcellcnt,
'IMAXCELLCNT', this%memoryPath)
2457 call mem_allocate(this%ietflag,
'IETFLAG', this%memoryPath)
2458 call mem_allocate(this%igwetflag,
'IGWETFLAG', this%memoryPath)
2459 call mem_allocate(this%iuzf2uzf,
'IUZF2UZF', this%memoryPath)
2460 call mem_allocate(this%cbcauxitems,
'CBCAUXITEMS', this%memoryPath)
2462 call mem_allocate(this%iconvchk,
'ICONVCHK', this%memoryPath)
2478 this%imaxcellcnt = 0
2480 this%cbcauxitems = 1
2496 call this%uzfobj%dealloc()
2497 deallocate (this%uzfobj)
2498 nullify (this%uzfobj)
2500 call this%budobj%budgetobject_da()
2501 deallocate (this%budobj)
2502 nullify (this%budobj)
2505 deallocate (this%bdtxt)
2506 deallocate (this%cauxcbc)
2507 deallocate (this%uzfname)
2510 if (this%ipakcsv > 0)
then
2511 if (
associated(this%pakcsvtab))
then
2512 call this%pakcsvtab%table_da()
2513 deallocate (this%pakcsvtab)
2514 nullify (this%pakcsvtab)
2573 call this%BndExtType%bnd_da()
2587 integer(I4B) :: nbudterm
2588 integer(I4B) :: maxlist, naux
2590 integer(I4B) :: nlen
2591 integer(I4B) :: n, n1, n2
2592 integer(I4B) :: ivertflag
2594 character(len=LENBUDTXT) :: text
2595 character(len=LENBUDTXT),
dimension(1) :: auxtxt
2599 do n = 1, this%nodes
2600 ivertflag = this%uzfobj%ivertcon(n)
2601 if (ivertflag > 0)
then
2611 if (nlen > 0) nbudterm = nbudterm + 1
2612 if (this%ietflag /= 0) nbudterm = nbudterm + 1
2613 if (this%imover == 1) nbudterm = nbudterm + 2
2614 if (this%naux > 0) nbudterm = nbudterm + 1
2618 call this%budobj%budgetobject_df(this%maxbound, nbudterm, 0, 0, &
2619 ibudcsv=this%ibudcsv)
2623 text =
' FLOW-JA-FACE'
2628 auxtxt(1) =
' FLOW-AREA'
2629 call this%budobj%budterm(idx)%initialize(text, &
2634 maxlist, .false., .false., &
2635 naux, auxtxt, ordered_id1=.false.)
2638 call this%budobj%budterm(idx)%reset(nlen * 2)
2640 do n = 1, this%nodes
2641 ivertflag = this%uzfobj%ivertcon(n)
2642 if (ivertflag > 0)
then
2645 call this%budobj%budterm(idx)%update_term(n1, n2, q)
2646 call this%budobj%budterm(idx)%update_term(n2, n1, -q)
2654 maxlist = this%nodes
2656 auxtxt(1) =
' FLOW-AREA'
2657 call this%budobj%budterm(idx)%initialize(text, &
2662 maxlist, .false., .true., &
2664 call this%budobj%budterm(idx)%reset(this%nodes)
2666 do n = 1, this%nodes
2667 n2 = this%igwfnode(n)
2668 this%qauxcbc(1) = this%uzfobj%uzfarea(n)
2669 call this%budobj%budterm(idx)%update_term(n, n2, q, this%qauxcbc)
2673 text =
' INFILTRATION'
2675 maxlist = this%nodes
2677 call this%budobj%budterm(idx)%initialize(text, &
2682 maxlist, .false., .false., &
2688 maxlist = this%nodes
2690 call this%budobj%budterm(idx)%initialize(text, &
2695 maxlist, .false., .false., &
2700 if (this%ietflag /= 0)
then
2702 maxlist = this%maxbound
2704 call this%budobj%budterm(idx)%initialize(text, &
2709 maxlist, .false., .false., &
2716 maxlist = this%nodes
2718 auxtxt(1) =
' VOLUME'
2719 call this%budobj%budterm(idx)%initialize(text, &
2724 maxlist, .false., .false., &
2728 if (this%imover == 1)
then
2733 maxlist = this%nodes
2735 call this%budobj%budterm(idx)%initialize(text, &
2740 maxlist, .false., .false., &
2744 text =
' REJ-INF-TO-MVR'
2746 maxlist = this%nodes
2748 call this%budobj%budterm(idx)%initialize(text, &
2753 maxlist, .false., .false., &
2764 maxlist = this%maxbound
2765 call this%budobj%budterm(idx)%initialize(text, &
2770 maxlist, .false., .false., &
2775 if (this%iprflow /= 0)
then
2776 call this%budobj%flowtable_df(this%iout, cellids=
'GWF')
2786 integer(I4B) :: naux
2787 integer(I4B) :: nlen
2788 integer(I4B) :: ivertflag
2789 integer(I4B) :: n, n1, n2
2804 do n = 1, this%nodes
2805 ivertflag = this%uzfobj%ivertcon(n)
2806 if (ivertflag > 0)
then
2812 call this%budobj%budterm(idx)%reset(nlen * 2)
2813 do n = 1, this%nodes
2814 ivertflag = this%uzfobj%ivertcon(n)
2815 if (ivertflag > 0)
then
2816 a = this%uzfobj%uzfarea(n)
2817 q = this%uzfobj%surfluxbelow(n) * a
2824 call this%budobj%budterm(idx)%update_term(n1, n2, q, this%qauxcbc)
2825 call this%budobj%budterm(idx)%update_term(n2, n1, -q, this%qauxcbc)
2832 call this%budobj%budterm(idx)%reset(this%nodes)
2833 do n = 1, this%nodes
2834 this%qauxcbc(1) = this%uzfobj%uzfarea(n)
2835 n2 = this%igwfnode(n)
2837 call this%budobj%budterm(idx)%update_term(n, n2, q, this%qauxcbc)
2842 call this%budobj%budterm(idx)%reset(this%nodes)
2843 do n = 1, this%nodes
2844 q = this%appliedinf(n)
2845 call this%budobj%budterm(idx)%update_term(n, n, q)
2850 call this%budobj%budterm(idx)%reset(this%nodes)
2851 do n = 1, this%nodes
2856 call this%budobj%budterm(idx)%update_term(n, n, q)
2860 if (this%ietflag /= 0)
then
2862 call this%budobj%budterm(idx)%reset(this%nodes)
2863 do n = 1, this%nodes
2868 call this%budobj%budterm(idx)%update_term(n, n, q)
2874 call this%budobj%budterm(idx)%reset(this%nodes)
2875 do n = 1, this%nodes
2877 top = this%uzfobj%celtop(n)
2878 bot = this%uzfobj%watab(n)
2880 if (thick >
dzero)
then
2881 fm = thick * (this%wcnew(n) - this%uzfobj%thtr(n))
2882 v = fm * this%uzfobj%uzfarea(n)
2888 call this%budobj%budterm(idx)%update_term(n, n, q, this%qauxcbc)
2892 if (this%imover == 1)
then
2896 call this%budobj%budterm(idx)%reset(this%nodes)
2897 do n = 1, this%nodes
2898 q = this%pakmvrobj%get_qfrommvr(n)
2899 call this%budobj%budterm(idx)%update_term(n, n, q)
2904 call this%budobj%budterm(idx)%reset(this%nodes)
2905 do n = 1, this%nodes
2906 q = this%rejinftomvr(n)
2910 call this%budobj%budterm(idx)%update_term(n, n, q)
2919 call this%budobj%budterm(idx)%reset(this%nodes)
2920 do n = 1, this%nodes
2922 call this%budobj%budterm(idx)%update_term(n, n, q, this%auxvar(:, n))
2927 call this%budobj%accumulate_terms()
This module contains the extended boundary package.
This module contains the base boundary package.
subroutine, public save_print_model_flows(icbcfl, ibudfl, icbcun, iprflow, outputtab, nbound, nodelist, flow, ibound, title, text, ipakcb, dis, naux, textmodel, textpackage, dstmodel, dstpackage, auxname, auxvar, iout, inamedbound, boundname, imap)
Save and/or print flows for a package.
This module contains the BudgetModule.
subroutine, public rate_accumulator(flow, rin, rout)
@ brief Rate accumulator subroutine
subroutine, public budgetobject_cr(this, name)
Create a new budget object.
This module contains simulation constants.
integer(i4b), parameter linelength
maximum length of a standard line
real(dp), parameter dhdry
real dry cell constant
@ tabcenter
centered table column
@ tabright
right justified table column
@ tableft
left justified table column
@ mnormal
normal output mode
@ tabucstring
upper case string table data
@ tabstring
string table data
@ tabinteger
integer table data
integer(i4b), parameter lenpackagename
maximum length of the package name
integer(i4b), parameter namedboundflag
named bound flag
real(dp), parameter dnodata
real no data constant
real(dp), parameter dhnoflo
real no flow constant
real(dp), parameter dhundred
real constant 100
integer(i4b), parameter lenpakloc
maximum length of a package location
real(dp), parameter dem1
real constant 1e-1
real(dp), parameter dhalf
real constant 1/2
integer(i4b), parameter lenftype
maximum length of a package type (DIS, WEL, OC, etc.)
integer(i4b), parameter lenboundname
maximum length of a bound name
real(dp), parameter dem4
real constant 1e-4
real(dp), parameter dem6
real constant 1e-6
real(dp), parameter dzero
real constant zero
integer(i4b), parameter maxcharlen
maximum length of char string
real(dp), parameter dem2
real constant 1e-2
integer(i4b), parameter lenbudtxt
maximum length of a budget component names
real(dp), parameter done
real constant 1
This module defines variable data types.
Previous variable names checked in as deprecated aliases.
character(len=lenmempath) function create_mem_path(component, subcomponent, context)
returns the path to the memory object
subroutine, public memorystore_release(varname, memory_path)
Release a single variable from the memory store.
This module contains the derived types ObserveType and ObsDataType.
This module contains the derived type ObsType.
This module contains simulation methods.
subroutine, public store_error(msg, terminate)
Store an error message.
integer(i4b) function, public count_errors()
Return number of errors.
subroutine, public deprecation_warning(cblock, cvar, cver, endmsg, iunit)
Store deprecation warning message.
subroutine, public store_error_filename(filename, terminate)
Store the erroring file name.
This module contains simulation variables.
character(len=maxcharlen) errmsg
error message string
integer(i4b) ifailedstepretry
current retry for this time step
character(len=maxcharlen) warnmsg
warning message string
subroutine, public table_cr(this, name, title)
real(dp), pointer, public pertim
time relative to start of stress period
real(dp), pointer, public totim
time relative to start of simulation
integer(i4b), pointer, public kstp
current time step number
integer(i4b), pointer, public kper
current stress period number
real(dp), pointer, public delt
length of the current time step
subroutine uzf_source_packagedata(this)
Source PACKAGEDATA block from input context.
subroutine uzf_ar(this)
Allocate and Read.
subroutine uzf_fc(this, rhs, ia, idxglo, matrix_sln)
Copy rhs and hcof into solution rhs and amat.
subroutine uzf_ot_dv(this, idvsave, idvprint)
Save UZF-calculated values to binary file.
subroutine define_listlabel(this)
Define the list heading that is written to iout when PRINT_INPUT option is used.
subroutine uzf_da(this)
Deallocate objects.
logical function uzf_obs_supported(this)
Return true because uzf package supports observations.
subroutine uzf_setup_budobj(this)
Set up the budget object that stores all the uzf flows.
subroutine uzf_checkin_deprecated_names(this)
Alias deprecated UZF variable names to their current storage.
subroutine uzf_cq(this, x, flowja, iadv)
Calculate flows.
subroutine uzf_allocate_arrays(this)
Allocate arrays used for uzf.
character(len=lenftype) ftype
subroutine uzf_ot_bdsummary(this, kstp, kper, iout, ibudfl)
Write UZF budget to listing file.
subroutine uzf_process_obsid(obsrv, dis, inunitobs, iout)
This procedure is pointed to by ObsDataTypeProcesssIdPtr.
subroutine uzf_rp_obs(this)
Process each observation.
real(dp) function get_storage_change(top, bot, carea, hold, hnew, wcold, wcnew, thtr, delt, iss)
subroutine uzf_source_dimensions(this)
Source DIMENSIONS block from input context.
subroutine uzf_cf(this)
Formulate the HCOF and RHS terms.
subroutine uzf_fn(this, rhs, ia, idxglo, matrix_sln)
Fill newton terms.
subroutine uzf_fill_budobj(this)
Copy flow terms into thisbudobj.
subroutine uzf_df_obs(this)
Implements bnd_df_obs.
subroutine uzf_ot_model_flows(this, icbcfl, ibudfl, icbcun, imap)
Write flows to binary file and/or print flows to budget.
subroutine findcellabove(this, n, nml)
Identify overlying cell ID based on user-specified mapping.
subroutine print_cell_properties(this)
Read UZF cell properties and set them for UZFCellGroup type.
subroutine uzf_bd(this, model_budget)
Add package ratin/ratout to model budget.
subroutine uzf_allocate_scalars(this)
Allocate scalar members.
subroutine uzf_rp(this)
Read stress data from input context.
subroutine uzf_cc(this, innertot, kiter, iend, icnvgmod, cpak, ipak, dpak)
Final convergence check for package.
subroutine, public uzf_create(packobj, id, ibcnum, inunit, iout, namemodel, pakname, mempath)
Create a New UZF Package and point packobj to the new package.
subroutine check_cell_area(this)
Check UZF cell areas.
subroutine uzf_bd_obs(this)
Calculate observations this time step and call ObsTypeSaveOneSimval for each UzfType observation.
character(len=lenpackagename) text
subroutine uzf_ot_package_flows(this, icbcfl, ibudfl)
Output UZF package flow terms.
subroutine uzf_solve(this, reset_state)
Formulate the HCOF and RHS terms.
subroutine uzf_ad(this)
Advance UZF Package.
subroutine uzf_source_options(this)
Source OPTIONS block from input context.
Derived type for the Budget object.
This class is used to store a single deferred-length character string. It was designed to work in an ...