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()
177 subroutine uzf_create(packobj, id, ibcnum, inunit, iout, namemodel, pakname, &
182 class(
bndtype),
pointer :: packobj
183 integer(I4B),
intent(in) :: id
184 integer(I4B),
intent(in) :: ibcnum
185 integer(I4B),
intent(in) :: inunit
186 integer(I4B),
intent(in) :: iout
187 character(len=*),
intent(in) :: namemodel
188 character(len=*),
intent(in) :: pakname
189 character(len=*),
intent(in) :: mempath
191 type(
uzftype),
pointer :: uzfobj
198 call packobj%set_names(ibcnum, namemodel, pakname,
ftype, mempath)
202 call uzfobj%uzf_allocate_scalars()
205 call packobj%pack_initialize()
207 packobj%inunit = inunit
210 packobj%ibcnum = ibcnum
223 class(
uzftype),
intent(inout) :: this
228 call this%obs%obs_ar()
231 call this%BndExtType%allocate_arrays()
239 if (this%inamedbound /= 0)
then
241 this%boundname(n) = this%uzfname(n)
246 call this%copy_boundname()
250 this%nodelist(i) = this%igwfnode(i)
253 call this%uzfobj%sethead(i, hgwf)
257 if (this%imover /= 0)
then
258 allocate (this%pakmvrobj)
259 call this%pakmvrobj%ar(this%maxbound, this%maxbound, this%memoryPath)
267 class(
uzftype),
intent(inout) :: this
276 call mem_allocate(this%igwfnode, this%nodes,
'IGWFNODE', this%memoryPath)
277 call mem_allocate(this%appliedinf, this%nodes,
'APPLIEDINF', this%memoryPath)
278 call mem_allocate(this%rejinf, this%nodes,
'REJINF', this%memoryPath)
279 call mem_allocate(this%rejinf0, this%nodes,
'REJINF0', this%memoryPath)
280 call mem_allocate(this%rejinftomvr, this%nodes,
'REJINFTOMVR', &
282 call mem_allocate(this%infiltration, this%nodes,
'INFILTRATION', &
284 call mem_allocate(this%gwet_pvar, this%nodes,
'GWET_PVAR', this%memoryPath)
285 call mem_allocate(this%uzet, this%nodes,
'UZET', this%memoryPath)
286 call mem_allocate(this%gwd, this%nodes,
'GWD', this%memoryPath)
287 call mem_allocate(this%gwd0, this%nodes,
'GWD0', this%memoryPath)
288 call mem_allocate(this%gwdtomvr, this%nodes,
'GWDTOMVR', this%memoryPath)
289 call mem_allocate(this%rch, this%nodes,
'RCH', this%memoryPath)
290 call mem_allocate(this%rch0, this%nodes,
'RCH0', this%memoryPath)
291 call mem_allocate(this%qsto, this%nodes,
'QSTO', this%memoryPath)
292 call mem_allocate(this%deriv, this%nodes,
'DERIV', this%memoryPath)
295 call mem_allocate(this%ia, this%dis%nodes + 1,
'IA', this%memoryPath)
296 call mem_allocate(this%ja, this%nodes,
'JA', this%memoryPath)
299 call mem_setptr(this%sinf_pvar,
'FINF', this%input_mempath)
300 call mem_setptr(this%pet_pvar,
'PET', this%input_mempath)
301 call mem_setptr(this%extdp,
'EXTDP', this%input_mempath)
302 call mem_setptr(this%extwc_pvar,
'EXTWC', this%input_mempath)
303 call mem_setptr(this%ha_pvar,
'HA', this%input_mempath)
304 call mem_setptr(this%hroot_pvar,
'HROOT', this%input_mempath)
305 call mem_setptr(this%rootact_pvar,
'ROOTACT', this%input_mempath)
306 call mem_setptr(this%uauxvar,
'AUXVAR', this%input_mempath)
310 this%appliedinf(i) =
dzero
311 this%rejinf(i) =
dzero
312 this%rejinf0(i) =
dzero
313 this%rejinftomvr(i) =
dzero
314 this%gwet_pvar(i) =
dzero
318 this%gwdtomvr(i) =
dzero
322 this%deriv(i) =
dzero
328 if (this%iauxmultcol > 0 .and. j == this%iauxmultcol)
then
329 this%uauxvar(j, i) =
done
331 this%uauxvar(j, i) =
dzero
335 do i = 1, this%dis%nodes + 1
340 allocate (this%bdtxt(this%nbdtxt))
341 this%bdtxt(1) =
' UZF-INF'
342 this%bdtxt(2) =
' UZF-GWRCH'
343 this%bdtxt(3) =
' UZF-GWD'
344 this%bdtxt(4) =
' UZF-GWET'
345 this%bdtxt(5) =
' UZF-GWD TO-MVR'
348 call mem_allocate(this%wcnew, this%nodes,
'WCNEW', this%memoryPath)
349 call mem_allocate(this%wcold, this%nodes,
'WCOLD', this%memoryPath)
351 this%wcnew(i) =
dzero
352 this%wcold(i) =
dzero
356 allocate (this%cauxcbc(this%cbcauxitems))
357 allocate (this%uzfname(this%nodes))
360 call mem_allocate(this%qauxcbc, this%cbcauxitems,
'QAUXCBC', this%memoryPath)
361 do i = 1, this%cbcauxitems
362 this%qauxcbc(i) =
dzero
375 class(
uzftype),
intent(inout) :: this
378 integer(I4B),
pointer :: ikw => null()
379 character(len=LINELENGTH) :: fname
381 character(len=*),
parameter :: fmtet = &
382 "(4x, 'ET WILL BE SIMULATED WITHIN UZ AND GW ZONES, WITH LINEAR ', &
383 &'GWET IF OPTION NOT SPECIFIED OTHERWISE.')"
384 character(len=*),
parameter :: fmtgwetlin = &
385 &
"(4x, 'GROUNDWATER ET FUNCTION WILL BE LINEAR.')"
386 character(len=*),
parameter :: fmtgwetsquare = &
387 &
"(4x, 'GROUNDWATER ET FUNCTION WILL BE SQUARE WITH SMOOTHING.')"
388 character(len=*),
parameter :: fmtgwseepout = &
389 &
"(4x, 'GROUNDWATER DISCHARGE TO LAND SURFACE WILL BE SIMULATED.')"
390 character(len=*),
parameter :: fmtuzetwc = &
391 &
"(4x, 'UNSATURATED ET FUNCTION OF WATER CONTENT.')"
392 character(len=*),
parameter :: fmtuzetae = &
393 &
"(4x, 'UNSATURATED ET FUNCTION OF AIR ENTRY PRESSURE.')"
394 character(len=*),
parameter :: fmtuzfbin = &
395 "(4x, 'UZF ', 1x, a, 1x, ' WILL BE SAVED TO FILE: ', &
396 &a, /4x, 'OPENED ON UNIT: ', I0)"
400 call this%BndExtType%source_options()
402 write (this%iout,
'(1x,a)') &
403 'PROCESSING '//trim(adjustl(this%text))//
' OPTIONS'
406 call mem_set_value(fname,
'WCFILE', this%input_mempath, found%wcfile)
407 if (found%wcfile)
then
409 call openfile(this%iwcontout, this%iout, fname,
'DATA(BINARY)', &
411 write (this%iout, fmtuzfbin)
'WATER-CONTENT', trim(adjustl(fname)), &
416 call mem_set_value(fname,
'BUDGETFILE', this%input_mempath, found%budgetfile)
417 if (found%budgetfile)
then
418 call assign_iounit(this%ibudgetout, this%inunit,
"BUDGET fileout")
419 call openfile(this%ibudgetout, this%iout, fname,
'DATA(BINARY)', &
421 write (this%iout, fmtuzfbin)
'BUDGET', trim(adjustl(fname)), &
426 call mem_set_value(fname,
'BUDGETCSVFILE', this%input_mempath, &
428 if (found%budgetcsvfile)
then
429 call assign_iounit(this%ibudcsv, this%inunit,
"BUDGETCSV fileout")
430 call openfile(this%ibudcsv, this%iout, fname,
'CSV', filstat_opt=
'REPLACE')
431 write (this%iout, fmtuzfbin)
'BUDGET CSV', trim(adjustl(fname)), &
437 this%input_mempath, found%pkgconvfname)
438 if (found%pkgconvfname)
then
440 call openfile(this%ipakcsv, this%iout, fname,
'CSV', &
441 filstat_opt=
'REPLACE', mode_opt=
mnormal)
442 write (this%iout, fmtuzfbin)
'PACKAGE_CONVERGENCE', &
443 trim(adjustl(fname)), this%ipakcsv
448 call mem_set_value(ikw,
'SIMULATE_ET', this%input_mempath, found%simulate_et)
449 if (found%simulate_et)
then
452 write (this%iout, fmtet)
456 call mem_set_value(ikw,
'LINEAR_GWET', this%input_mempath, found%linear_gwet)
457 if (found%linear_gwet)
then
459 write (this%iout, fmtgwetlin)
463 call mem_set_value(ikw,
'SQUARE_GWET', this%input_mempath, found%square_gwet)
464 if (found%square_gwet)
then
466 write (this%iout, fmtgwetsquare)
470 call mem_set_value(ikw,
'SIMULATE_GWSEEP', this%input_mempath, &
471 found%simulate_gwseep)
472 if (found%simulate_gwseep)
then
474 write (this%iout, fmtgwseepout)
476 'USE DRN PACKAGE TO SIMULATE GROUNDWATER DISCHARGE TO LAND SURFACE '// &
483 call mem_set_value(ikw,
'UNSAT_ETWC', this%input_mempath, found%unsat_etwc)
484 if (found%unsat_etwc)
then
486 write (this%iout, fmtuzetwc)
490 call mem_set_value(ikw,
'UNSAT_ETAE', this%input_mempath, found%unsat_etae)
491 if (found%unsat_etae)
then
493 write (this%iout, fmtuzetae)
497 call mem_set_value(ikw,
'MOVER', this%input_mempath, found%mover)
498 if (found%mover)
then
503 call mem_set_value(ikw,
'ICONVCHK', this%input_mempath, found%iconvchk)
504 if (found%iconvchk)
then
506 write (this%iout,
'(4x,a)') &
507 'A FINAL CONVERGENCE CHECK OF THE CHANGE IN UZF RECHARGE '// &
513 write (this%iout,
'(1x,a)') &
514 'END OF '//trim(adjustl(this%text))//
' OPTIONS'
525 class(
uzftype),
intent(inout) :: this
534 write (this%iout,
'(/1x,a)') &
535 'PROCESSING '//trim(adjustl(this%text))//
' DIMENSIONS'
538 call mem_set_value(this%nodes,
'MAXBOUND', this%input_mempath, &
540 if (found%maxbound)
then
541 write (this%iout,
'(4x,a,i0)')
'NUZFCELLS = ', this%nodes
545 call mem_set_value(this%ntrail_pvar,
'NTRAILWAVES', this%input_mempath, &
547 if (found%ntrailwaves)
then
548 write (this%iout,
'(4x,a,i0)')
'NTRAILWAVES = ', this%ntrail_pvar
552 call mem_set_value(this%nsets,
'NWAVESETS', this%input_mempath, &
554 if (found%nwavesets)
then
555 write (this%iout,
'(4x,a,i0)')
'NTRAILSETS = ', this%nsets
558 write (this%iout,
'(1x,a)') &
559 'END OF '//trim(adjustl(this%text))//
' DIMENSIONS'
562 this%maxbound = this%maxbound + this%nodes
563 this%nbound = this%maxbound
566 if (this%nodes <= 0)
then
568 'NUZFCELLS (MAXBOUND) was not specified or was specified incorrectly.'
571 if (this%ntrail_pvar <= 1)
then
573 'NTRAILWAVES must be greater than 1. A value of 7 is recommended.'
576 if (this%nsets <= 0)
then
578 'NWAVESETS was not specified or was specified incorrectly.'
586 this%nwav_pvar = this%ntrail_pvar * this%nsets
590 call this%define_listlabel()
593 call this%uzf_allocate_arrays()
596 allocate (this%uzfobj)
597 call this%uzfobj%init(this%nodes, this%nwav_pvar, this%memoryPath)
600 call this%uzf_source_packagedata()
603 if (this%iprpak /= 0)
then
604 call this%print_cell_properties()
608 call this%uzf_setup_budobj()
618 class(
uzftype),
intent(inout) :: this
620 integer(I4B),
pointer :: nlist => null()
621 integer(I4B),
dimension(:),
pointer,
contiguous :: ifno => null()
624 character(len=20) :: cellid
625 character(len=LINELENGTH) :: title
626 character(len=LINELENGTH) :: tag
627 integer(I4B) :: ntabrows
628 integer(I4B) :: ntabcols
631 character(len=*),
parameter :: fmtlsp = &
632 &
"(1X,/1X,'REUSING ',A,'S FROM LAST STRESS PERIOD')"
635 this%nbound = this%maxbound
638 this%issflag = this%gwfiss
641 if (this%iper ==
kper)
then
644 call mem_setptr(nlist,
'NBOUND', this%input_mempath)
645 call mem_setptr(ifno,
'IFNO', this%input_mempath)
648 if (this%iprpak /= 0)
then
651 if (this%ietflag /= 0)
then
652 ntabcols = ntabcols + 3
653 if (this%ietflag == 2)
then
654 ntabcols = ntabcols + 3
657 if (this%inamedbound == 1)
then
658 ntabcols = ntabcols + 1
660 title = trim(adjustl(this%text))//
' PACKAGE ('// &
661 trim(adjustl(this%packName))//
') DATA FOR PERIOD'
662 write (title,
'(a,1x,i6)') trim(adjustl(title)),
kper
663 call table_cr(this%inputtab, this%packName, title)
664 call this%inputtab%table_df(ntabrows, ntabcols, this%iout, &
667 call this%inputtab%initialize_column(tag, 10)
669 call this%inputtab%initialize_column(tag, 20, alignment=
tableft)
671 call this%inputtab%initialize_column(tag, 12)
672 if (this%ietflag /= 0)
then
674 call this%inputtab%initialize_column(tag, 12)
676 call this%inputtab%initialize_column(tag, 12)
678 call this%inputtab%initialize_column(tag, 12)
679 if (this%ietflag == 2)
then
681 call this%inputtab%initialize_column(tag, 12)
683 call this%inputtab%initialize_column(tag, 12)
685 call this%inputtab%initialize_column(tag, 12)
688 if (this%inamedbound == 1)
then
690 call this%inputtab%initialize_column(tag,
lenboundname, &
698 if (i < 1 .or. i > this%nodes)
then
699 tag = trim(adjustl(this%text))//
' PACKAGE ('// &
700 trim(adjustl(this%packName))//
') DATA FOR PERIOD'
701 write (tag,
'(a,1x,i0)') trim(adjustl(tag)),
kper
702 write (
errmsg,
'(a,a,i0,1x,a,i0,a)') &
703 trim(adjustl(tag)),
': UZFNO ', i, &
704 'must be greater than 0 and less than or equal to ', this%nodes,
'.'
714 if (this%iprpak /= 0)
then
715 node = this%igwfnode(i)
717 call this%dis%noder_to_string(node, cellid)
721 call this%inputtab%add_term(i)
722 call this%inputtab%add_term(cellid)
723 call this%inputtab%add_term(this%sinf_pvar(i))
724 if (this%ietflag /= 0)
then
725 call this%inputtab%add_term(this%pet_pvar(i))
726 call this%inputtab%add_term(this%extdp(i))
727 call this%inputtab%add_term(this%extwc_pvar(i))
728 if (this%ietflag == 2)
then
729 call this%inputtab%add_term(this%ha_pvar(i))
730 call this%inputtab%add_term(this%hroot_pvar(i))
731 call this%inputtab%add_term(this%rootact_pvar(i))
734 if (this%inamedbound == 1)
then
735 call this%inputtab%add_term(this%boundname(i))
740 if (this%iprpak /= 0)
then
741 call this%inputtab%finalize_table()
749 write (this%iout, fmtlsp) trim(this%filtyp)
756 if ((this%issflag == 0 .AND.
kper == 1) .or. &
757 (
kper == 2 .AND. this%issflagold == 1))
then
759 call this%uzfobj%setwaves(i)
766 this%wcnew(i) = this%uzfobj%get_wcnew(i)
771 this%issflagold = this%issflag
783 integer(I4B) :: ivertflag
784 integer(I4B) :: n, iaux
785 real(DP) :: rval1, rval2, rval3
788 call this%BndExtType%bnd_ad()
797 if (this%naux > 0)
then
798 do n = 1, this%maxbound
799 do iaux = 1, this%naux
800 if (this%noupdateauxvar(iaux) /= 0) cycle
801 this%auxvar(iaux, n) = this%uauxvar(iaux, n)
811 this%wcold(i) = this%wcnew(i)
820 this%wcnew(i) = this%wcold(i)
826 call this%uzfobj%advance(i)
833 ivertflag = this%uzfobj%ivertcon(i)
836 if (this%iauxmultcol > 0)
then
837 rval1 = this%uauxvar(this%iauxmultcol, i)
838 call this%uzfobj%setdatauzfarea(i, rval1)
842 rval1 = this%sinf_pvar(i)
843 call this%uzfobj%setdatafinf(i, rval1)
846 rval1 = this%pet_pvar(i)
847 rval2 = this%extdp(i)
848 call this%uzfobj%setdataet(i, ivertflag, rval1, rval2)
851 rval1 = this%extwc_pvar(i)
852 call this%uzfobj%setdataetwc(i, ivertflag, rval1)
855 rval1 = this%ha_pvar(i)
856 rval2 = this%hroot_pvar(i)
857 rval3 = this%rootact_pvar(i)
858 call this%uzfobj%setdataetha(i, ivertflag, rval1, rval2, rval3)
862 if (this%iauxmultcol > 0)
then
863 call this%check_cell_area()
867 if (this%imover == 1)
then
868 call this%pakmvrobj%ad()
885 if (this%nodes == 0)
return
889 do n = 1, this%maxbound
890 this%rejinf0(n) = this%rejinf(n)
891 this%rch0(n) = this%rch(n)
892 this%gwd0(n) = this%gwd(n)
898 subroutine uzf_fc(this, rhs, ia, idxglo, matrix_sln)
901 real(DP),
dimension(:),
intent(inout) :: rhs
902 integer(I4B),
dimension(:),
intent(in) :: ia
903 integer(I4B),
dimension(:),
intent(in) :: idxglo
906 integer(I4B) :: i, n, ipos
909 if (this%imover == 1)
then
910 call this%pakmvrobj%fc()
915 call this%uzf_solve(reset_state=.true.)
920 rhs(n) = rhs(n) + this%rhs(i)
922 call matrix_sln%add_value_pos(idxglo(ipos), this%hcof(i))
928 subroutine uzf_fn(this, rhs, ia, idxglo, matrix_sln)
931 real(DP),
dimension(:),
intent(inout) :: rhs
932 integer(I4B),
dimension(:),
intent(in) :: ia
933 integer(I4B),
dimension(:),
intent(in) :: idxglo
943 call matrix_sln%add_value_pos(idxglo(ipos), this%deriv(i))
944 rhs(n) = rhs(n) + this%deriv(i) * this%xnew(n)
950 subroutine uzf_cc(this, innertot, kiter, iend, icnvgmod, cpak, ipak, dpak)
954 class(
uzftype),
intent(inout) :: this
955 integer(I4B),
intent(in) :: innertot
956 integer(I4B),
intent(in) :: kiter
957 integer(I4B),
intent(in) :: icnvgmod
958 integer(I4B),
intent(in) :: iend
959 character(len=LENPAKLOC),
intent(inout) :: cpak
960 integer(I4B),
intent(inout) :: ipak
961 real(DP),
intent(inout) :: dpak
963 character(len=LENPAKLOC) :: cloc
964 character(len=LINELENGTH) :: tag
965 integer(I4B) :: icheck
966 integer(I4B) :: ipakfail
967 integer(I4B) :: locdrejinfmax
968 integer(I4B) :: locdrchmax
969 integer(I4B) :: locdseepmax
970 integer(I4B) :: locdqfrommvrmax
971 integer(I4B) :: ntabrows
972 integer(I4B) :: ntabcols
978 real(DP) :: drejinfmax
983 real(DP) :: dqfrommvr
984 real(DP) :: dqfrommvrmax
987 icheck = this%iconvchk
1000 if (this%ipakcsv == 0)
then
1001 if (icnvgmod == 0)
then
1007 if (.not.
associated(this%pakcsvtab))
then
1012 if (this%iseepflag == 1)
then
1013 ntabcols = ntabcols + 2
1015 if (this%imover == 1)
then
1016 ntabcols = ntabcols + 2
1020 call table_cr(this%pakcsvtab, this%packName,
'')
1021 call this%pakcsvtab%table_df(ntabrows, ntabcols, this%ipakcsv, &
1022 lineseparator=.false., separator=
',', &
1026 tag =
'total_inner_iterations'
1027 call this%pakcsvtab%initialize_column(tag, 10, alignment=
tableft)
1029 call this%pakcsvtab%initialize_column(tag, 10, alignment=
tableft)
1031 call this%pakcsvtab%initialize_column(tag, 10, alignment=
tableft)
1033 call this%pakcsvtab%initialize_column(tag, 10, alignment=
tableft)
1035 call this%pakcsvtab%initialize_column(tag, 10, alignment=
tableft)
1037 call this%pakcsvtab%initialize_column(tag, 15, alignment=
tableft)
1038 tag =
'drejinfmax_loc'
1039 call this%pakcsvtab%initialize_column(tag, 15, alignment=
tableft)
1041 call this%pakcsvtab%initialize_column(tag, 15, alignment=
tableft)
1043 call this%pakcsvtab%initialize_column(tag, 15, alignment=
tableft)
1044 if (this%iseepflag == 1)
then
1046 call this%pakcsvtab%initialize_column(tag, 15, alignment=
tableft)
1047 tag =
'dseepmax_loc'
1048 call this%pakcsvtab%initialize_column(tag, 15, alignment=
tableft)
1050 if (this%imover == 1)
then
1051 tag =
'dqfrommvrmax'
1052 call this%pakcsvtab%initialize_column(tag, 15, alignment=
tableft)
1053 tag =
'dqfrommvrmax_loc'
1054 call this%pakcsvtab%initialize_column(tag, 16, alignment=
tableft)
1060 if (icheck /= 0)
then
1061 final_check:
do n = 1, this%nodes
1064 qtolfact =
delt / this%uzfobj%uzfarea(n)
1067 drejinf = qtolfact * (this%rejinf0(n) - this%rejinf(n))
1070 drch = qtolfact * (this%rch0(n) - this%rch(n))
1074 if (this%iseepflag == 1)
then
1075 dseep = qtolfact * (this%gwd0(n) - this%gwd(n))
1080 if (this%imover == 1)
then
1081 q = this%pakmvrobj%get_qfrommvr(n)
1082 q0 = this%pakmvrobj%get_qfrommvr0(n)
1083 dqfrommvr = qtolfact * (q0 - q)
1088 drejinfmax = drejinf
1094 dqfrommvrmax = dqfrommvr
1097 if (abs(drejinf) > abs(drejinfmax))
then
1098 drejinfmax = drejinf
1101 if (abs(drch) > abs(drchmax))
then
1105 if (abs(dseep) > abs(dseepmax))
then
1109 if (abs(dqfrommvr) > abs(dqfrommvrmax))
then
1110 dqfrommvrmax = dqfrommvr
1117 if (abs(drejinfmax) > abs(dpak))
then
1118 ipak = locdrejinfmax
1120 write (cloc,
"(a,'-',a)") trim(this%packName),
'rejinf'
1123 if (abs(drchmax) > abs(dpak))
then
1126 write (cloc,
"(a,'-',a)") trim(this%packName),
'rech'
1129 if (this%iseepflag == 1)
then
1130 if (abs(dseepmax) > abs(dpak))
then
1133 write (cloc,
"(a,'-',a)") trim(this%packName),
'seep'
1137 if (this%imover == 1)
then
1138 if (abs(dqfrommvrmax) > abs(dpak))
then
1139 ipak = locdqfrommvrmax
1141 write (cloc,
"(a,'-',a)") trim(this%packName),
'qfrommvr'
1147 if (this%ipakcsv /= 0)
then
1150 call this%pakcsvtab%add_term(innertot)
1151 call this%pakcsvtab%add_term(
totim)
1152 call this%pakcsvtab%add_term(
kper)
1153 call this%pakcsvtab%add_term(
kstp)
1154 call this%pakcsvtab%add_term(kiter)
1155 call this%pakcsvtab%add_term(drejinfmax)
1156 call this%pakcsvtab%add_term(locdrejinfmax)
1157 call this%pakcsvtab%add_term(drchmax)
1158 call this%pakcsvtab%add_term(locdrchmax)
1159 if (this%iseepflag == 1)
then
1160 call this%pakcsvtab%add_term(dseepmax)
1161 call this%pakcsvtab%add_term(locdseepmax)
1163 if (this%imover == 1)
then
1164 call this%pakcsvtab%add_term(dqfrommvrmax)
1165 call this%pakcsvtab%add_term(locdqfrommvrmax)
1170 call this%pakcsvtab%finalize_table()
1184 class(
uzftype),
intent(inout) :: this
1185 real(DP),
dimension(:),
intent(in) :: x
1186 real(DP),
dimension(:),
contiguous,
intent(inout) :: flowja
1187 integer(I4B),
optional,
intent(in) :: iadv
1197 character(len=*),
parameter :: fmttkk = &
1198 &
"(1X,/1X,A,' PERIOD ',I0,' STEP ',I0)"
1202 call this%uzf_solve(reset_state=.true.)
1206 call this%BndType%bnd_cq(x, flowja, iadv=1)
1209 do i = 1, this%nodes
1212 n = this%nodelist(i)
1215 if (this%ibound(n) < 1) cycle
1218 this%appliedinf(i) = this%uzfobj%sinf(i) * this%uzfobj%uzfarea(i)
1219 this%infiltration(i) = this%uzfobj%surflux(i) * this%uzfobj%uzfarea(i)
1222 qout = this%rejinf(i) + this%uzfobj%surfseep(i)
1224 if (this%imover == 1)
then
1225 qtomvr = this%pakmvrobj%get_qtomvr(i)
1230 if (qout >
dzero)
then
1231 qfact = this%rejinf(i) / qout
1234 this%rejinftomvr(i) = qfact * qtomvr
1237 q = q - this%rejinftomvr(i)
1247 this%gwd(i) = this%uzfobj%surfseep(i)
1249 if (qout >
dzero)
then
1250 qfact = this%gwd(i) / qout
1253 this%gwdtomvr(i) = qfact * qtomvr
1256 q = q - this%gwdtomvr(i)
1266 this%gwet_pvar(i) = this%uzfobj%gwet(i)
1267 this%uzet(i) = this%uzfobj%etact(i) * this%uzfobj%uzfarea(i) /
delt
1274 call this%uzf_fill_budobj()
1278 thtr, delt, iss)
result(qsto)
1280 real(dp),
intent(in) :: top
1281 real(dp),
intent(in) :: bot
1282 real(dp),
intent(in) :: hold
1283 real(dp),
intent(in) :: hnew
1284 real(dp),
intent(in) :: wcold
1285 real(dp),
intent(in) :: wcnew
1286 real(dp),
intent(in) :: thtr
1287 real(dp),
intent(in) :: carea
1288 real(dp),
intent(in) :: delt
1296 thknew = top - max(bot, hnew)
1297 thkold = top - max(bot, hold)
1299 if (thknew >
dzero)
then
1300 qsto = qsto + thknew * (wcnew - thtr)
1302 if (thkold >
dzero)
then
1303 qsto = qsto - thkold * (wcold - thtr)
1305 qsto = qsto * carea / delt
1318 type(
budgettype),
intent(inout) :: model_budget
1321 integer(I4B) :: isuppress_output
1322 isuppress_output = 0
1326 call model_budget%addentry(ratin, ratout,
delt, this%bdtxt(2), &
1327 isuppress_output, this%packName)
1330 if (this%iseepflag == 1)
then
1332 call model_budget%addentry(ratin, ratout,
delt, this%bdtxt(3), &
1333 isuppress_output, this%packName)
1334 if (this%imover == 1)
then
1336 call model_budget%addentry(ratin, ratout,
delt, this%bdtxt(5), &
1337 isuppress_output, this%packName)
1342 if (this%igwetflag /= 0)
then
1344 call model_budget%addentry(ratin, ratout,
delt, this%bdtxt(4), &
1345 isuppress_output, this%packName)
1357 integer(I4B),
intent(in) :: icbcfl
1358 integer(I4B),
intent(in) :: ibudfl
1359 integer(I4B),
intent(in) :: icbcun
1360 integer(I4B),
dimension(:),
optional,
intent(in) :: imap
1362 character(len=LINELENGTH) :: title
1363 integer(I4B) :: itxt
1367 title = trim(adjustl(this%bdtxt(itxt)))//
' PACKAGE ('// &
1368 trim(this%packName)//
') FLOW RATES'
1370 this%outputtab, this%nbound, this%nodelist, &
1371 this%rch, this%ibound, title, this%bdtxt(itxt), &
1372 this%ipakcb, this%dis, this%naux, &
1373 this%name_model, this%name_model, &
1374 this%name_model, this%packName, this%auxname, &
1375 this%auxvar, this%iout, this%inamedbound, &
1379 if (this%iseepflag == 1)
then
1381 title = trim(adjustl(this%bdtxt(itxt)))//
' PACKAGE ('// &
1382 trim(this%packName)//
') FLOW RATES'
1384 this%outputtab, this%nbound, this%nodelist, &
1385 -this%gwd, this%ibound, title, &
1386 this%bdtxt(itxt), this%ipakcb, this%dis, &
1387 this%naux, this%name_model, this%name_model, &
1388 this%name_model, this%packName, this%auxname, &
1389 this%auxvar, this%iout, this%inamedbound, &
1393 if (this%imover == 1)
then
1395 title = trim(adjustl(this%bdtxt(itxt)))//
' PACKAGE ('// &
1396 trim(this%packName)//
') FLOW RATES'
1398 this%outputtab, this%nbound, this%nodelist, &
1399 -this%gwdtomvr, this%ibound, title, &
1400 this%bdtxt(itxt), this%ipakcb, this%dis, &
1401 this%naux, this%name_model, this%name_model, &
1402 this%name_model, this%packName, &
1403 this%auxname, this%auxvar, this%iout, &
1404 this%inamedbound, this%boundname)
1409 if (this%igwetflag /= 0)
then
1411 title = trim(adjustl(this%bdtxt(itxt)))//
' PACKAGE ('// &
1412 trim(this%packName)//
') FLOW RATES'
1414 this%outputtab, this%nbound, this%nodelist, &
1415 -this%gwet_pvar, this%ibound, title, &
1416 this%bdtxt(itxt), this%ipakcb, this%dis, &
1417 this%naux, this%name_model, this%name_model, &
1418 this%name_model, this%packName, this%auxname, &
1419 this%auxvar, this%iout, this%inamedbound, &
1431 integer(I4B),
intent(in) :: icbcfl
1432 integer(I4B),
intent(in) :: ibudfl
1433 integer(I4B) :: ibinun
1437 if (this%ibudgetout /= 0)
then
1438 ibinun = this%ibudgetout
1440 if (icbcfl == 0) ibinun = 0
1441 if (ibinun > 0)
then
1442 call this%budobj%save_flows(this%dis, ibinun,
kstp,
kper,
delt, &
1447 if (ibudfl /= 0 .and. this%iprflow /= 0)
then
1448 call this%budobj%write_flowtable(this%dis,
kstp,
kper)
1460 integer(I4B),
intent(in) :: idvsave
1461 integer(I4B),
intent(in) :: idvprint
1463 integer(I4B) :: ibinun
1467 if (this%iwcontout /= 0)
then
1468 ibinun = this%iwcontout
1470 if (idvsave == 0) ibinun = 0
1473 if (ibinun > 0)
then
1475 totim, this%nodes, 1, 1, ibinun)
1486 integer(I4B),
intent(in) :: kstp
1487 integer(I4B),
intent(in) :: kper
1488 integer(I4B),
intent(in) :: iout
1489 integer(I4B),
intent(in) :: ibudfl
1491 call this%budobj%write_budtable(kstp, kper, iout, ibudfl,
totim,
delt)
1499 logical,
intent(in) :: reset_state
1503 integer(I4B) :: i, ivertflag
1504 integer(I4B) :: n, m, ierr
1505 real(DP) :: trhs1, thcof1, trhs2, thcof2
1506 real(DP) :: hgwf, uzderiv, derivgwet
1507 real(DP) :: qfrommvr
1510 real(DP) :: watabold
1514 do i = 1, this%nodes
1515 this%uzfobj%pet(i) = this%uzfobj%petmax(i)
1519 do i = 1, this%nodes
1522 this%hcof(i) =
dzero
1532 n = this%nodelist(i)
1533 ivertflag = this%uzfobj%ivertcon(i)
1534 watabold = this%uzfobj%watabold(i)
1536 if (this%ibound(n) > 0)
then
1541 if (this%imover == 1)
then
1542 qfrommvr = this%pakmvrobj%get_qfrommvr(i)
1549 call this%uzfobj%solve(ivertflag, i, &
1550 this%totfluxtot, this%ietflag, &
1551 this%issflag, this%iseepflag, hgwf, &
1553 reset_state=reset_state, &
1554 trhs=trhs1, thcof=thcof1, deriv=uzderiv, &
1560 errmsg =
'UZF variable NWAVESETS needs to be increased.'
1565 if (this%igwetflag > 0)
then
1566 call this%uzfobj%setgwpet(i)
1567 call this%uzfobj%simgwet(this%igwetflag, i, hgwf, trhs2, thcof2, &
1572 if (this%ietflag > 0)
then
1573 if (this%uzfobj%ivertcon(i) > 0)
then
1574 call this%uzfobj%setbelowpet(i, ivertflag)
1579 this%deriv(i) = uzderiv + derivgwet
1583 this%rejinf(i) = this%uzfobj%finf_rej(i) * this%uzfobj%uzfarea(i)
1584 this%rch(i) = this%uzfobj%totflux(i) * this%uzfobj%uzfarea(i) /
delt
1585 this%gwd(i) = this%uzfobj%surfseep(i)
1588 this%hcof(i) = thcof1 + thcof2
1589 this%rhs(i) = -trhs1 + trhs2
1592 if (this%imover == 1)
then
1593 qformvr = this%gwd(i) + this%rejinf(i)
1594 call this%pakmvrobj%accumulate_qformvr(i, qformvr)
1602 this%uzfobj%celbot(i), &
1603 this%uzfobj%uzfarea(i), &
1605 this%uzfobj%watab(i), &
1606 this%wcold(i), this%wcnew(i), &
1607 this%uzfobj%thtr(i),
delt, this%issflag)
1618 class(
uzftype),
intent(inout) :: this
1621 this%listlabel = trim(this%filtyp)//
' NO.'
1622 if (this%dis%ndim == 3)
then
1623 write (this%listlabel,
'(a, a7)') trim(this%listlabel),
'LAYER'
1624 write (this%listlabel,
'(a, a7)') trim(this%listlabel),
'ROW'
1625 write (this%listlabel,
'(a, a7)') trim(this%listlabel),
'COL'
1626 elseif (this%dis%ndim == 2)
then
1627 write (this%listlabel,
'(a, a7)') trim(this%listlabel),
'LAYER'
1628 write (this%listlabel,
'(a, a7)') trim(this%listlabel),
'CELL2D'
1630 write (this%listlabel,
'(a, a7)') trim(this%listlabel),
'NODE'
1632 write (this%listlabel,
'(a, a16)') trim(this%listlabel),
'STRESS RATE'
1633 if (this%inamedbound == 1)
then
1634 write (this%listlabel,
'(a, a16)') trim(this%listlabel),
'BOUNDARY NAME'
1643 integer(I4B),
intent(in) :: n
1644 integer(I4B),
intent(inout) :: nml
1646 integer(I4B) :: m, ipos
1650 do ipos = this%dis%con%ia(n) + 1, this%dis%con%ia(n + 1) - 1
1651 m = this%dis%con%ja(ipos)
1652 if (this%dis%con%ihc(ipos) /= 0)
then
1669 class(
uzftype),
intent(inout) :: this
1671 integer(I4B),
dimension(:),
pointer,
contiguous :: ifno => null()
1672 integer(I4B),
dimension(:, :),
pointer,
contiguous :: cellid_idm => null()
1673 integer(I4B),
dimension(:),
pointer,
contiguous :: landflag => null()
1674 integer(I4B),
dimension(:),
pointer,
contiguous :: ivertcon => null()
1675 real(DP),
dimension(:),
pointer,
contiguous :: surfdep => null()
1676 real(DP),
dimension(:),
pointer,
contiguous :: vks => null()
1677 real(DP),
dimension(:),
pointer,
contiguous :: thtr => null()
1678 real(DP),
dimension(:),
pointer,
contiguous :: thts => null()
1679 real(DP),
dimension(:),
pointer,
contiguous :: thti => null()
1680 real(DP),
dimension(:),
pointer,
contiguous :: eps => null()
1683 character(len=LINELENGTH) :: cellid_str
1684 integer(I4B) :: ierr
1685 integer(I4B) :: i, igwf, n
1686 integer(I4B) :: j, jcol
1687 integer(I4B),
dimension(:),
allocatable :: rowmaxnnz
1689 integer(I4B),
dimension(:),
allocatable :: nboundchk
1691 write (this%iout,
'(/1x,3a)')
'PROCESSING ', trim(adjustl(this%text)), &
1695 call mem_setptr(ifno,
'PACKAGEDATA_IFNO', this%input_mempath)
1696 call mem_setptr(cellid_idm,
'CELLID', this%input_mempath)
1697 call mem_setptr(landflag,
'LANDFLAG', this%input_mempath)
1698 call mem_setptr(ivertcon,
'IVERTCON', this%input_mempath)
1699 call mem_setptr(surfdep,
'SURFDEP', this%input_mempath)
1700 call mem_setptr(vks,
'VKS', this%input_mempath)
1701 call mem_setptr(thtr,
'THTR', this%input_mempath)
1702 call mem_setptr(thts,
'THTS', this%input_mempath)
1703 call mem_setptr(thti,
'THTI', this%input_mempath)
1704 call mem_setptr(eps,
'EPS', this%input_mempath)
1705 if (this%inamedbound /= 0)
then
1706 call mem_setptr(bndname,
'BOUNDNAME', this%input_mempath)
1710 allocate (rowmaxnnz(this%dis%nodes))
1711 do n = 1, this%dis%nodes
1714 allocate (nboundchk(this%nodes))
1715 do n = 1, this%nodes
1720 do n = 1, this%nodes
1721 i = this%validate_ifno(ifno(n), this%nodes, nboundchk, &
1722 'IUZNO',
'PACKAGEDATA')
1726 write (cellid_str,
'(10(i0,1x))') cellid_idm(1:this%dis%ndim, n)
1727 igwf = this%dis%noder_from_cellid(cellid_str, this%inunit, this%iout)
1728 this%igwfnode(i) = igwf
1729 rowmaxnnz(igwf) = rowmaxnnz(igwf) + 1
1732 if (landflag(n) < 0 .OR. landflag(n) > 1)
then
1733 write (
errmsg,
'(a,1x,i0,1x,a,1x,i0,a)') &
1734 'LANDFLAG for uzf cell', i, &
1735 'must be 0 or 1 (specified value is', landflag(n),
').'
1740 if (ivertcon(n) < 0 .OR. ivertcon(n) > this%nodes)
then
1741 write (
errmsg,
'(a,1x,i0,1x,a,1x,i0,a)') &
1742 'IVERTCON for uzf cell', i, &
1743 'must be 0 or less than NUZFCELLS (specified value is', &
1749 if (surfdep(n) <=
dzero .and. landflag(n) > 0)
then
1750 write (
errmsg,
'(a,1x,i0,1x,a,1x,g0,a)') &
1751 'SURFDEP for uzf cell', i, &
1752 'must be greater than 0 (specified value is', surfdep(n),
').'
1755 if (surfdep(n) >= this%dis%top(igwf) - this%dis%bot(igwf))
then
1756 write (
errmsg,
'(a,1x,i0,1x,a)') &
1757 'SURFDEP for uzf cell', i, &
1758 'cannot be greater than the cell thickness.'
1763 if (vks(n) <=
dzero)
then
1764 write (
errmsg,
'(a,1x,i0,1x,a,1x,g0,a)') &
1765 'VKS for uzf cell', i, &
1766 'must be greater than 0 (specified value ia', vks(n),
').'
1771 if (thtr(n) <=
dzero)
then
1772 write (
errmsg,
'(a,1x,i0,1x,a,1x,g0,a)') &
1773 'THTR for uzf cell', i, &
1774 'must be greater than 0 (specified value is', thtr(n),
').'
1779 if (thts(n) <= thtr(n))
then
1780 write (
errmsg,
'(a,1x,i0,1x,a,1x,g0,a)') &
1781 'THTS for uzf cell', i, &
1782 'must be greater than THTR (specified value is', thts(n),
').'
1787 if (thti(n) < thtr(n) .OR. thti(n) > thts(n))
then
1788 write (
errmsg,
'(a,1x,i0,1x,a,1x,a,1x,g0,a)') &
1789 'THTI for uzf cell', i, &
1790 'must be greater than or equal to THTR AND less than THTS', &
1791 '(specified value is', thti(n),
').'
1796 if (eps(n) < 3.5 .OR. eps(n) > 14)
then
1797 write (
errmsg,
'(a,1x,i0,1x,a,1x,g0,a)') &
1798 'EPSILON for uzf cell', i, &
1799 'must be between 3.5 and 14.0 (specified value is', eps(n),
').'
1804 if (this%inamedbound == 1)
then
1805 this%uzfname(i) = bndname(n)
1810 call this%uzfobj%setdata(i, this%dis%area(igwf), &
1811 this%dis%top(igwf), this%dis%bot(igwf), &
1812 surfdep(n), vks(n), thtr(n), thts(n), &
1813 thti(n), eps(n), this%ntrail_pvar, &
1814 landflag(n), ivertcon(n))
1815 if (ivertcon(n) > 0)
then
1820 write (this%iout,
'(1x,3a)') &
1821 'END OF ', trim(adjustl(this%text)),
' PACKAGEDATA'
1824 call this%report_ifno_coverage(nboundchk, this%nodes,
'uzf cell', &
1832 call sparse%init(this%dis%nodes, this%dis%nodes, rowmaxnnz)
1833 do i = 1, this%nodes
1834 igwf = this%igwfnode(i)
1835 call sparse%addconnection(igwf, i, 1)
1839 call sparse%filliaja(this%ia, this%ja, ierr)
1842 do i = 1, this%dis%nodes
1844 do j = this%ia(i), this%ia(i + 1) - 1
1847 if (jcol > this%imaxcellcnt)
then
1848 this%imaxcellcnt = jcol
1852 if (this%imaxcellcnt > 1 .and. this%iauxmultcol < 1)
then
1853 call this%check_cell_area()
1856 deallocate (rowmaxnnz)
1857 deallocate (nboundchk)
1877 class(
uzftype),
intent(inout) :: this
1879 character(len=20) :: cellid
1880 character(len=LINELENGTH) :: title
1881 character(len=LINELENGTH) :: tag
1882 integer(I4B) :: ntabrows
1883 integer(I4B) :: ntabcols
1885 integer(I4B) :: node
1890 ntabrows = this%nodes
1892 if (this%inamedbound == 1)
then
1893 ntabcols = ntabcols + 1
1897 title = trim(adjustl(this%text))//
' PACKAGE ('// &
1898 trim(adjustl(this%packName))//
') STATIC UZF CELL DATA'
1899 call table_cr(this%inputtab, this%packName, title)
1900 call this%inputtab%table_df(ntabrows, ntabcols, this%iout)
1902 call this%inputtab%initialize_column(tag, 10)
1904 call this%inputtab%initialize_column(tag, 20, alignment=
tableft)
1906 call this%inputtab%initialize_column(tag, 12)
1908 call this%inputtab%initialize_column(tag, 12)
1910 call this%inputtab%initialize_column(tag, 12)
1912 call this%inputtab%initialize_column(tag, 12)
1914 call this%inputtab%initialize_column(tag, 12)
1916 call this%inputtab%initialize_column(tag, 12)
1918 call this%inputtab%initialize_column(tag, 12)
1920 call this%inputtab%initialize_column(tag, 12)
1921 if (this%inamedbound == 1)
then
1927 do i = 1, this%nodes
1930 node = this%igwfnode(i)
1932 call this%dis%noder_to_string(node, cellid)
1938 call this%inputtab%add_term(i)
1939 call this%inputtab%add_term(cellid)
1940 call this%inputtab%add_term(this%uzfobj%landflag(i))
1941 call this%inputtab%add_term(this%uzfobj%ivertcon(i))
1942 call this%inputtab%add_term(this%uzfobj%surfdep(i))
1943 call this%inputtab%add_term(this%uzfobj%vks(i))
1944 call this%inputtab%add_term(this%uzfobj%thtr(i))
1945 call this%inputtab%add_term(this%uzfobj%thts(i))
1946 call this%inputtab%add_term(this%uzfobj%thti(i))
1947 call this%inputtab%add_term(this%uzfobj%eps(i))
1948 if (this%inamedbound == 1)
then
1949 call this%inputtab%add_term(this%uzfname(i))
1963 character(len=16) :: cuzf
1964 character(len=20) :: cellid
1965 character(len=LINELENGTH) :: cuzfcells
1975 real(DP) :: cellarea
1979 do i = 1, this%nodes
1982 i2 = this%uzfobj%ivertcon(i)
1983 area = this%uzfobj%uzfarea(i)
1987 area2 = this%uzfobj%uzfarea(i2)
1988 d = abs(area - area2)
1990 write (
errmsg,
'(2(a,1x,g0,1x,a,1x,i0,1x),a)') &
1991 'UZF cell area (', area,
') for cell ', i, &
1992 'does not equal uzf cell area (', area2,
') for cell ', i2,
'.'
2000 do n = 1, this%dis%nodes
2004 if ((i1 - i0) < 1) cycle
2010 write (cuzf,
'(i0)') i
2011 cuzfcells = trim(adjustl(cuzfcells))//
' '//trim(adjustl(cuzf))
2012 sumarea = sumarea + this%uzfobj%uzfarea(i)
2013 cellarea = this%uzfobj%cellarea(i)
2016 d = sumarea - cellarea
2018 call this%dis%noder_to_string(n, cellid)
2019 write (
errmsg,
'(a,1x,g0,1x,a,1x,g0,1x,a,1x,a,1x,a,a,a)') &
2020 'Total uzf cell area (', sumarea, &
2021 ') exceeds the gwf cell area (', cellarea,
') of cell', cellid, &
2022 'which includes uzf cell(s): ', trim(adjustl(cuzfcells)),
'.'
2055 integer(I4B) :: indx
2060 call this%obs%StoreObsType(
'uzf-gwrch', .true., indx)
2064 call this%obs%StoreObsType(
'uzf-gwd', .true., indx)
2068 call this%obs%StoreObsType(
'uzf-gwd-to-mvr', .true., indx)
2072 call this%obs%StoreObsType(
'uzf-gwet', .true., indx)
2076 call this%obs%StoreObsType(
'infiltration', .true., indx)
2080 call this%obs%StoreObsType(
'from-mvr', .true., indx)
2084 call this%obs%StoreObsType(
'rej-inf', .true., indx)
2088 call this%obs%StoreObsType(
'rej-inf-to-mvr', .true., indx)
2092 call this%obs%StoreObsType(
'uzet', .true., indx)
2096 call this%obs%StoreObsType(
'storage', .true., indx)
2100 call this%obs%StoreObsType(
'net-infiltration', .true., indx)
2104 call this%obs%StoreObsType(
'water-content', .false., indx)
2124 call this%uzf_solve(reset_state=.false.)
2127 if (this%obs%npakobs > 0)
then
2128 call this%obs%obs_bd_clear()
2129 do i = 1, this%obs%npakobs
2130 obsrv => this%obs%pakobs(i)%obsrv
2131 do ii = 1, obsrv%indxbnds_count
2132 n = obsrv%indxbnds(ii)
2134 select case (obsrv%ObsTypeId)
2142 case (
'UZF-GWD-TO-MVR')
2143 if (this%imover == 1)
then
2144 v = this%gwdtomvr(n)
2150 if (this%igwetflag > 0)
then
2151 v = this%gwet_pvar(n)
2156 case (
'INFILTRATION')
2157 v = this%appliedinf(n)
2159 if (this%imover == 1)
then
2160 v = this%pakmvrobj%get_qfrommvr(n)
2167 case (
'REJ-INF-TO-MVR')
2168 if (this%imover == 1)
then
2169 v = this%rejinftomvr(n)
2175 if (this%ietflag /= 0)
then
2183 case (
'NET-INFILTRATION')
2184 v = this%infiltration(n)
2185 case (
'WATER-CONTENT')
2186 v = this%uzfobj%get_water_content_at_depth(n, obsrv%obsDepth)
2188 errmsg =
'Unrecognized observation type: '//trim(obsrv%ObsTypeId)
2191 call this%obs%SaveOneSimval(obsrv, v)
2211 class(
uzftype),
intent(inout) :: this
2217 integer(I4B) :: iuzid
2218 real(DP) :: obsdepth
2220 character(len=LENBOUNDNAME) :: bname
2223 60
format(
'Invalid node number in OBS input: ', i0)
2226 do i = 1, this%obs%npakobs
2227 obsrv => this%obs%pakobs(i)%obsrv
2230 nn = obsrv%NodeNumber
2232 bname = obsrv%FeatureName
2237 do j = 1, this%nodes
2238 if (this%boundname(j) == bname)
then
2239 obsrv%BndFound = .true.
2240 obsrv%CurrentTimeStepEndValue =
dzero
2241 call obsrv%AddObsIndex(j)
2242 if (obsrv%indxbnds_count == 1)
then
2253 nn = obsrv%NodeNumber
2258 if (nn < 1 .or. nn > this%nodes)
then
2262 obsrv%BndFound = .true.
2264 obsrv%CurrentTimeStepEndValue =
dzero
2265 call obsrv%AddObsIndex(nn)
2270 if (obsrv%ObsTypeId ==
'WATER-CONTENT')
then
2271 n = obsrv%indxbnds_count
2273 write (
errmsg,
'(a,3(1x,a))') &
2274 trim(adjustl(obsrv%ObsTypeId)),
'for observation', &
2275 trim(adjustl(obsrv%Name)), &
2276 'must be assigned to a UZF cell with a unique boundname.'
2281 obsdepth = obsrv%Obsdepth
2284 obsrv%dblPak1 = obsdepth
2289 iuzid = obsrv%intPak1
2290 dmax = this%uzfobj%celtop(iuzid) - this%uzfobj%celbot(iuzid)
2296 if (obsdepth <=
dzero .or. obsdepth > dmax)
then
2297 write (
errmsg,
'(a,3(1x,a),1x,g0,1x,a,1x,g0,a)') &
2298 trim(adjustl(obsrv%ObsTypeId)),
'for observation', &
2299 trim(adjustl(obsrv%Name)),
'specified depth (', obsdepth, &
2300 ') must be greater than 0.0 and less than ', dmax,
'.'
2304 do j = 1, obsrv%indxbnds_count
2305 nn = obsrv%indxbnds(j)
2306 if (nn < 1 .or. nn > this%maxbound)
then
2307 write (
errmsg,
'(a,2(1x,a),1x,i0,1x,a,1x,i0,a)') &
2308 trim(adjustl(obsrv%ObsTypeId)),
'uzfno must be greater than 0 ', &
2309 'and less than or equal to', this%maxbound, &
2310 '(specified value is ', nn,
').'
2336 integer(I4B),
intent(in) :: inunitobs
2337 integer(I4B),
intent(in) :: iout
2339 integer(I4B) :: n, nn
2340 real(DP) :: obsdepth
2341 integer(I4B) :: icol, istart, istop, istat
2343 character(len=LINELENGTH) :: string
2347 string = obsrv%IDstring
2353 call urword(string, icol, istart, istop, 1, n, r, iout, inunitobs)
2354 read (string(istart:istop), 30, iostat=istat) nn
2355 if (istat == 0)
then
2357 obsrv%NodeNumber = nn
2361 obsrv%FeatureName = string(istart:istop)
2370 if (obsrv%ObsTypeId ==
'WATER-CONTENT')
then
2371 call urword(string, icol, istart, istop, 3, n, r, iout, inunitobs)
2374 obsrv%Obsdepth = obsdepth
2387 call this%BndExtType%allocate_scalars()
2390 call mem_allocate(this%iprwcont,
'IPRWCONT', this%memoryPath)
2391 call mem_allocate(this%iwcontout,
'IWCONTOUT', this%memoryPath)
2392 call mem_allocate(this%ibudgetout,
'IBUDGETOUT', this%memoryPath)
2393 call mem_allocate(this%ibudcsv,
'IBUDCSV', this%memoryPath)
2394 call mem_allocate(this%ipakcsv,
'IPAKCSV', this%memoryPath)
2395 call mem_allocate(this%ntrail_pvar,
'NTRAIL_PVAR', this%memoryPath)
2396 call mem_allocate(this%nsets,
'NSETS', this%memoryPath)
2397 call mem_allocate(this%nodes,
'NODES', this%memoryPath)
2398 call mem_allocate(this%istocb,
'ISTOCB', this%memoryPath)
2399 call mem_allocate(this%nwav_pvar,
'NWAV_PVAR', this%memoryPath)
2400 call mem_allocate(this%totfluxtot,
'TOTFLUXTOT', this%memoryPath)
2401 call mem_allocate(this%bditems,
'BDITEMS', this%memoryPath)
2402 call mem_allocate(this%nbdtxt,
'NBDTXT', this%memoryPath)
2403 call mem_allocate(this%issflag,
'ISSFLAG', this%memoryPath)
2404 call mem_allocate(this%issflagold,
'ISSFLAGOLD', this%memoryPath)
2405 call mem_allocate(this%readflag,
'READFLAG', this%memoryPath)
2406 call mem_allocate(this%iseepflag,
'ISEEPFLAG', this%memoryPath)
2407 call mem_allocate(this%imaxcellcnt,
'IMAXCELLCNT', this%memoryPath)
2408 call mem_allocate(this%ietflag,
'IETFLAG', this%memoryPath)
2409 call mem_allocate(this%igwetflag,
'IGWETFLAG', this%memoryPath)
2410 call mem_allocate(this%iuzf2uzf,
'IUZF2UZF', this%memoryPath)
2411 call mem_allocate(this%cbcauxitems,
'CBCAUXITEMS', this%memoryPath)
2413 call mem_allocate(this%iconvchk,
'ICONVCHK', this%memoryPath)
2429 this%imaxcellcnt = 0
2431 this%cbcauxitems = 1
2447 call this%uzfobj%dealloc()
2448 deallocate (this%uzfobj)
2449 nullify (this%uzfobj)
2451 call this%budobj%budgetobject_da()
2452 deallocate (this%budobj)
2453 nullify (this%budobj)
2456 deallocate (this%bdtxt)
2457 deallocate (this%cauxcbc)
2458 deallocate (this%uzfname)
2461 if (this%ipakcsv > 0)
then
2462 if (
associated(this%pakcsvtab))
then
2463 call this%pakcsvtab%table_da()
2464 deallocate (this%pakcsvtab)
2465 nullify (this%pakcsvtab)
2524 call this%BndExtType%bnd_da()
2538 integer(I4B) :: nbudterm
2539 integer(I4B) :: maxlist, naux
2541 integer(I4B) :: nlen
2542 integer(I4B) :: n, n1, n2
2543 integer(I4B) :: ivertflag
2545 character(len=LENBUDTXT) :: text
2546 character(len=LENBUDTXT),
dimension(1) :: auxtxt
2550 do n = 1, this%nodes
2551 ivertflag = this%uzfobj%ivertcon(n)
2552 if (ivertflag > 0)
then
2562 if (nlen > 0) nbudterm = nbudterm + 1
2563 if (this%ietflag /= 0) nbudterm = nbudterm + 1
2564 if (this%imover == 1) nbudterm = nbudterm + 2
2565 if (this%naux > 0) nbudterm = nbudterm + 1
2569 call this%budobj%budgetobject_df(this%maxbound, nbudterm, 0, 0, &
2570 ibudcsv=this%ibudcsv)
2574 text =
' FLOW-JA-FACE'
2579 auxtxt(1) =
' FLOW-AREA'
2580 call this%budobj%budterm(idx)%initialize(text, &
2585 maxlist, .false., .false., &
2586 naux, auxtxt, ordered_id1=.false.)
2589 call this%budobj%budterm(idx)%reset(nlen * 2)
2591 do n = 1, this%nodes
2592 ivertflag = this%uzfobj%ivertcon(n)
2593 if (ivertflag > 0)
then
2596 call this%budobj%budterm(idx)%update_term(n1, n2, q)
2597 call this%budobj%budterm(idx)%update_term(n2, n1, -q)
2605 maxlist = this%nodes
2607 auxtxt(1) =
' FLOW-AREA'
2608 call this%budobj%budterm(idx)%initialize(text, &
2613 maxlist, .false., .true., &
2615 call this%budobj%budterm(idx)%reset(this%nodes)
2617 do n = 1, this%nodes
2618 n2 = this%igwfnode(n)
2619 this%qauxcbc(1) = this%uzfobj%uzfarea(n)
2620 call this%budobj%budterm(idx)%update_term(n, n2, q, this%qauxcbc)
2624 text =
' INFILTRATION'
2626 maxlist = this%nodes
2628 call this%budobj%budterm(idx)%initialize(text, &
2633 maxlist, .false., .false., &
2639 maxlist = this%nodes
2641 call this%budobj%budterm(idx)%initialize(text, &
2646 maxlist, .false., .false., &
2651 if (this%ietflag /= 0)
then
2653 maxlist = this%maxbound
2655 call this%budobj%budterm(idx)%initialize(text, &
2660 maxlist, .false., .false., &
2667 maxlist = this%nodes
2669 auxtxt(1) =
' VOLUME'
2670 call this%budobj%budterm(idx)%initialize(text, &
2675 maxlist, .false., .false., &
2679 if (this%imover == 1)
then
2684 maxlist = this%nodes
2686 call this%budobj%budterm(idx)%initialize(text, &
2691 maxlist, .false., .false., &
2695 text =
' REJ-INF-TO-MVR'
2697 maxlist = this%nodes
2699 call this%budobj%budterm(idx)%initialize(text, &
2704 maxlist, .false., .false., &
2715 maxlist = this%maxbound
2716 call this%budobj%budterm(idx)%initialize(text, &
2721 maxlist, .false., .false., &
2726 if (this%iprflow /= 0)
then
2727 call this%budobj%flowtable_df(this%iout, cellids=
'GWF')
2737 integer(I4B) :: naux
2738 integer(I4B) :: nlen
2739 integer(I4B) :: ivertflag
2740 integer(I4B) :: n, n1, n2
2755 do n = 1, this%nodes
2756 ivertflag = this%uzfobj%ivertcon(n)
2757 if (ivertflag > 0)
then
2763 call this%budobj%budterm(idx)%reset(nlen * 2)
2764 do n = 1, this%nodes
2765 ivertflag = this%uzfobj%ivertcon(n)
2766 if (ivertflag > 0)
then
2767 a = this%uzfobj%uzfarea(n)
2768 q = this%uzfobj%surfluxbelow(n) * a
2775 call this%budobj%budterm(idx)%update_term(n1, n2, q, this%qauxcbc)
2776 call this%budobj%budterm(idx)%update_term(n2, n1, -q, this%qauxcbc)
2783 call this%budobj%budterm(idx)%reset(this%nodes)
2784 do n = 1, this%nodes
2785 this%qauxcbc(1) = this%uzfobj%uzfarea(n)
2786 n2 = this%igwfnode(n)
2788 call this%budobj%budterm(idx)%update_term(n, n2, q, this%qauxcbc)
2793 call this%budobj%budterm(idx)%reset(this%nodes)
2794 do n = 1, this%nodes
2795 q = this%appliedinf(n)
2796 call this%budobj%budterm(idx)%update_term(n, n, q)
2801 call this%budobj%budterm(idx)%reset(this%nodes)
2802 do n = 1, this%nodes
2807 call this%budobj%budterm(idx)%update_term(n, n, q)
2811 if (this%ietflag /= 0)
then
2813 call this%budobj%budterm(idx)%reset(this%nodes)
2814 do n = 1, this%nodes
2819 call this%budobj%budterm(idx)%update_term(n, n, q)
2825 call this%budobj%budterm(idx)%reset(this%nodes)
2826 do n = 1, this%nodes
2828 top = this%uzfobj%celtop(n)
2829 bot = this%uzfobj%watab(n)
2831 if (thick >
dzero)
then
2832 fm = thick * (this%wcnew(n) - this%uzfobj%thtr(n))
2833 v = fm * this%uzfobj%uzfarea(n)
2839 call this%budobj%budterm(idx)%update_term(n, n, q, this%qauxcbc)
2843 if (this%imover == 1)
then
2847 call this%budobj%budterm(idx)%reset(this%nodes)
2848 do n = 1, this%nodes
2849 q = this%pakmvrobj%get_qfrommvr(n)
2850 call this%budobj%budterm(idx)%update_term(n, n, q)
2855 call this%budobj%budterm(idx)%reset(this%nodes)
2856 do n = 1, this%nodes
2857 q = this%rejinftomvr(n)
2861 call this%budobj%budterm(idx)%update_term(n, n, q)
2870 call this%budobj%budterm(idx)%reset(this%nodes)
2871 do n = 1, this%nodes
2873 call this%budobj%budterm(idx)%update_term(n, n, q, this%auxvar(:, n))
2878 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.
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.
subroutine, public store_error_unit(iunit, terminate)
Store the file unit number.
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_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 ...