45 character(len=*),
parameter ::
ftype =
'UZT'
46 character(len=*),
parameter ::
flowtype =
'UZF'
47 character(len=16) ::
text =
' UZT'
51 integer(I4B),
pointer :: idxbudinfl => null()
52 integer(I4B),
pointer :: idxbudrinf => null()
53 integer(I4B),
pointer :: idxbuduzet => null()
54 integer(I4B),
pointer :: idxbudritm => null()
55 real(dp),
dimension(:),
pointer,
contiguous :: concinfl => null()
56 real(dp),
dimension(:),
pointer,
contiguous :: concuzet => null()
85 subroutine uzt_create(packobj, id, ibcnum, inunit, iout, namemodel, pakname, &
86 mempath, fmi, eqnsclfac, dvt, dvu, dvua)
88 class(
bndtype),
pointer :: packobj
89 integer(I4B),
intent(in) :: id
90 integer(I4B),
intent(in) :: ibcnum
91 integer(I4B),
intent(in) :: inunit
92 integer(I4B),
intent(in) :: iout
93 character(len=*),
intent(in) :: namemodel
94 character(len=*),
intent(in) :: pakname
95 character(len=*),
intent(in) :: mempath
97 real(dp),
intent(in),
pointer :: eqnsclfac
98 character(len=*),
intent(in) :: dvt
99 character(len=*),
intent(in) :: dvu
100 character(len=*),
intent(in) :: dvua
109 call packobj%set_names(ibcnum, namemodel, pakname,
ftype, mempath)
113 call uztobj%allocate_scalars()
116 call packobj%pack_initialize()
118 packobj%inunit = inunit
121 packobj%ibcnum = ibcnum
132 uztobj%eqnsclfac => eqnsclfac
135 uztobj%depvartype = dvt
136 uztobj%depvarunit = dvu
137 uztobj%depvarunitabbrev = dvua
148 character(len=LINELENGTH) :: errmsg
149 class(
bndtype),
pointer :: packobj
150 integer(I4B) :: ip, icount
151 integer(I4B) :: nbudterm
161 if (this%fmi%flows_from_file)
then
162 call this%fmi%set_aptbudobj_pointer(this%flowpackagename, this%flowbudptr)
163 if (
associated(this%flowbudptr)) found = .true.
166 if (
associated(this%fmi%gwfbndlist))
then
169 do ip = 1, this%fmi%gwfbndlist%Count()
171 if (packobj%packName == this%flowpackagename)
then
176 this%flowpackagebnd => packobj
177 select type (packobj)
179 this%flowbudptr => packobj%budobj
188 if (.not. found)
then
189 write (errmsg,
'(a)')
'Could not find flow package with name '&
190 &//trim(adjustl(this%flowpackagename))//
'.'
197 nbudterm = this%flowbudptr%nbudterm
198 call mem_allocate(this%idxbudssm, nbudterm,
'IDXBUDSSM', this%memoryPath)
201 write (this%iout,
'(/, a, a)') &
202 'PROCESSING '//
ftype//
' INFORMATION FOR ', this%packName
203 write (this%iout,
'(a)')
' IDENTIFYING FLOW TERMS IN '//
flowtype//
' PACKAGE'
204 write (this%iout,
'(a, i0)') &
205 ' NUMBER OF '//
flowtype//
' = ', this%flowbudptr%ncv
207 do ip = 1, this%flowbudptr%nbudterm
208 select case (trim(adjustl(this%flowbudptr%budterm(ip)%flowtype)))
209 case (
'FLOW-JA-FACE')
211 this%idxbudssm(ip) = 0
214 this%idxbudssm(ip) = 0
217 this%idxbudssm(ip) = 0
218 case (
'INFILTRATION')
220 this%idxbudssm(ip) = 0
223 this%idxbudssm(ip) = 0
226 this%idxbudssm(ip) = 0
227 case (
'REJ-INF-TO-MVR')
229 this%idxbudssm(ip) = 0
232 this%idxbudssm(ip) = 0
235 this%idxbudssm(ip) = 0
238 this%idxbudssm(ip) = 0
243 this%idxbudssm(ip) = icount
246 write (this%iout,
'(a, i0, " = ", a,/, a, i0)') &
247 ' TERM ', ip, trim(adjustl(this%flowbudptr%budterm(ip)%flowtype)), &
248 ' MAX NO. OF ENTRIES = ', this%flowbudptr%budterm(ip)%maxlist
250 write (this%iout,
'(a, //)')
'DONE PROCESSING '//
ftype//
' INFORMATION'
261 integer(I4B),
intent(in) :: itemno
262 character(len=*),
intent(in) :: key
266 select case (trim(key))
267 case (
'INFILTRATION')
268 val = this%concinfl(itemno)
270 val = this%concuzet(itemno)
283 real(DP),
dimension(:),
intent(inout) :: rhs
284 integer(I4B),
dimension(:),
intent(in) :: ia
285 integer(I4B),
dimension(:),
intent(in) :: idxglo
288 integer(I4B) :: j, n1, n2
290 integer(I4B) :: iposd
296 if (this%idxbudinfl /= 0)
then
297 do j = 1, this%flowbudptr%budterm(this%idxbudinfl)%nlist
298 call this%uzt_infl_term(j, n1, n2, rrate, rhsval, hcofval)
299 iloc = this%idxlocnode(n1)
300 iposd = this%idxpakdiag(n1)
301 call matrix_sln%add_value_pos(iposd, hcofval)
302 rhs(iloc) = rhs(iloc) + rhsval
307 if (this%idxbudrinf /= 0)
then
308 do j = 1, this%flowbudptr%budterm(this%idxbudrinf)%nlist
309 call this%uzt_rinf_term(j, n1, n2, rrate, rhsval, hcofval)
310 iloc = this%idxlocnode(n1)
311 iposd = this%idxpakdiag(n1)
312 call matrix_sln%add_value_pos(iposd, hcofval)
313 rhs(iloc) = rhs(iloc) + rhsval
318 if (this%idxbuduzet /= 0)
then
319 do j = 1, this%flowbudptr%budterm(this%idxbuduzet)%nlist
320 call this%uzt_uzet_term(j, n1, n2, rrate, rhsval, hcofval)
321 iloc = this%idxlocnode(n1)
322 iposd = this%idxpakdiag(n1)
323 call matrix_sln%add_value_pos(iposd, hcofval)
324 rhs(iloc) = rhs(iloc) + rhsval
329 if (this%idxbudritm /= 0)
then
330 do j = 1, this%flowbudptr%budterm(this%idxbudritm)%nlist
331 call this%uzt_ritm_term(j, n1, n2, rrate, rhsval, hcofval)
332 iloc = this%idxlocnode(n1)
333 iposd = this%idxpakdiag(n1)
334 call matrix_sln%add_value_pos(iposd, hcofval)
335 rhs(iloc) = rhs(iloc) + rhsval
349 integer(I4B) :: n1, n2
353 if (this%idxbudinfl /= 0)
then
354 do j = 1, this%flowbudptr%budterm(this%idxbudinfl)%nlist
355 call this%uzt_infl_term(j, n1, n2, rrate)
356 this%dbuff(n1) = this%dbuff(n1) + rrate
361 if (this%idxbudrinf /= 0)
then
362 do j = 1, this%flowbudptr%budterm(this%idxbudrinf)%nlist
363 call this%uzt_rinf_term(j, n1, n2, rrate)
364 this%dbuff(n1) = this%dbuff(n1) + rrate
369 if (this%idxbuduzet /= 0)
then
370 do j = 1, this%flowbudptr%budterm(this%idxbuduzet)%nlist
371 call this%uzt_uzet_term(j, n1, n2, rrate)
372 this%dbuff(n1) = this%dbuff(n1) + rrate
377 if (this%idxbudritm /= 0)
then
378 do j = 1, this%flowbudptr%budterm(this%idxbudritm)%nlist
379 call this%uzt_ritm_term(j, n1, n2, rrate)
380 this%dbuff(n1) = this%dbuff(n1) + rrate
394 integer(I4B) :: nbudterms
399 if (this%idxbudinfl /= 0) nbudterms = nbudterms + 1
400 if (this%idxbudrinf /= 0) nbudterms = nbudterms + 1
401 if (this%idxbuduzet /= 0) nbudterms = nbudterms + 1
402 if (this%idxbudritm /= 0) nbudterms = nbudterms + 1
426 integer(I4B),
intent(inout) :: idx
428 integer(I4B) :: maxlist, naux
429 character(len=LENBUDTXT) :: text
432 text =
' INFILTRATION'
434 maxlist = this%flowbudptr%budterm(this%idxbudinfl)%maxlist
436 call this%budobj%budterm(idx)%initialize(text, &
441 maxlist, .false., .false., &
445 if (this%idxbudrinf /= 0)
then
448 maxlist = this%flowbudptr%budterm(this%idxbudrinf)%maxlist
450 call this%budobj%budterm(idx)%initialize(text, &
455 maxlist, .false., .false., &
460 if (this%idxbuduzet /= 0)
then
463 maxlist = this%flowbudptr%budterm(this%idxbuduzet)%maxlist
465 call this%budobj%budterm(idx)%initialize(text, &
470 maxlist, .false., .false., &
475 if (this%idxbudritm /= 0)
then
476 text =
' INF-REJ-TO-MVR'
478 maxlist = this%flowbudptr%budterm(this%idxbudritm)%maxlist
480 call this%budobj%budterm(idx)%initialize(text, &
485 maxlist, .false., .false., &
495 integer(I4B),
intent(inout) :: idx
496 real(DP),
dimension(:),
intent(in) :: x
497 real(DP),
dimension(:),
contiguous,
intent(inout) :: flowja
498 real(DP),
intent(inout) :: ccratin
499 real(DP),
intent(inout) :: ccratout
501 integer(I4B) :: j, n1, n2
502 integer(I4B) :: nlist
508 nlist = this%flowbudptr%budterm(this%idxbudinfl)%nlist
509 call this%budobj%budterm(idx)%reset(nlist)
511 call this%uzt_infl_term(j, n1, n2, q)
512 call this%budobj%budterm(idx)%update_term(n1, n2, q)
513 call this%apt_accumulate_ccterm(n1, q, ccratin, ccratout)
517 if (this%idxbudrinf /= 0)
then
519 nlist = this%flowbudptr%budterm(this%idxbudrinf)%nlist
520 call this%budobj%budterm(idx)%reset(nlist)
522 call this%uzt_rinf_term(j, n1, n2, q)
523 call this%budobj%budterm(idx)%update_term(n1, n2, q)
524 call this%apt_accumulate_ccterm(n1, q, ccratin, ccratout)
529 if (this%idxbuduzet /= 0)
then
531 nlist = this%flowbudptr%budterm(this%idxbuduzet)%nlist
532 call this%budobj%budterm(idx)%reset(nlist)
534 call this%uzt_uzet_term(j, n1, n2, q)
535 call this%budobj%budterm(idx)%update_term(n1, n2, q)
536 call this%apt_accumulate_ccterm(n1, q, ccratin, ccratout)
541 if (this%idxbudritm /= 0)
then
543 nlist = this%flowbudptr%budterm(this%idxbudritm)%nlist
544 call this%budobj%budterm(idx)%reset(nlist)
546 call this%uzt_ritm_term(j, n1, n2, q)
547 call this%budobj%budterm(idx)%update_term(n1, n2, q)
548 call this%apt_accumulate_ccterm(n1, q, ccratin, ccratout)
565 call this%TspAptType%allocate_scalars()
568 call mem_allocate(this%idxbudinfl,
'IDXBUDINFL', this%memoryPath)
569 call mem_allocate(this%idxbudrinf,
'IDXBUDRINF', this%memoryPath)
570 call mem_allocate(this%idxbuduzet,
'IDXBUDUZET', this%memoryPath)
571 call mem_allocate(this%idxbudritm,
'IDXBUDRITM', this%memoryPath)
592 call mem_setptr(this%concinfl,
'INFILTRATION', this%input_mempath)
593 call mem_setptr(this%concuzet,
'UZET', this%input_mempath)
596 call this%TspAptType%apt_allocate_arrays()
618 nullify (this%concinfl)
619 nullify (this%concuzet)
622 call this%TspAptType%bnd_da()
634 integer(I4B),
intent(in) :: ientry
635 integer(I4B),
intent(inout) :: n1
636 integer(I4B),
intent(inout) :: n2
637 real(DP),
intent(inout),
optional :: rrate
638 real(DP),
intent(inout),
optional :: rhsval
639 real(DP),
intent(inout),
optional :: hcofval
645 n1 = this%flowbudptr%budterm(this%idxbudinfl)%id1(ientry)
646 n2 = this%flowbudptr%budterm(this%idxbudinfl)%id2(ientry)
648 qbnd = this%flowbudptr%budterm(this%idxbudinfl)%flow(ientry)
649 if (qbnd <
dzero)
then
650 ctmp = this%xnewpak(n1)
654 ctmp = this%concinfl(n1)
658 if (
present(rrate)) rrate = qbnd * ctmp
659 if (
present(rhsval)) rhsval = r
660 if (
present(hcofval)) hcofval = h
674 integer(I4B),
intent(in) :: ientry
675 integer(I4B),
intent(inout) :: n1
676 integer(I4B),
intent(inout) :: n2
677 real(DP),
intent(inout),
optional :: rrate
678 real(DP),
intent(inout),
optional :: rhsval
679 real(DP),
intent(inout),
optional :: hcofval
684 n1 = this%flowbudptr%budterm(this%idxbudrinf)%id1(ientry)
685 n2 = this%flowbudptr%budterm(this%idxbudrinf)%id2(ientry)
686 qbnd = this%flowbudptr%budterm(this%idxbudrinf)%flow(ientry)
687 ctmp = this%concinfl(n1)
688 if (
present(rrate)) rrate = ctmp * qbnd
689 if (
present(rhsval)) rhsval =
dzero
690 if (
present(hcofval)) hcofval = qbnd
702 integer(I4B),
intent(in) :: ientry
703 integer(I4B),
intent(inout) :: n1
704 integer(I4B),
intent(inout) :: n2
705 real(DP),
intent(inout),
optional :: rrate
706 real(DP),
intent(inout),
optional :: rhsval
707 real(DP),
intent(inout),
optional :: hcofval
713 n1 = this%flowbudptr%budterm(this%idxbuduzet)%id1(ientry)
714 n2 = this%flowbudptr%budterm(this%idxbuduzet)%id2(ientry)
716 qbnd = this%flowbudptr%budterm(this%idxbuduzet)%flow(ientry)
717 ctmp = this%concuzet(n1)
718 if (this%xnewpak(n1) < ctmp)
then
723 if (
present(rrate)) &
724 rrate = omega * qbnd * this%xnewpak(n1) + &
725 (
done - omega) * qbnd * ctmp
726 if (
present(rhsval)) rhsval = -(
done - omega) * qbnd * ctmp
727 if (
present(hcofval)) hcofval = omega * qbnd
741 integer(I4B),
intent(in) :: ientry
742 integer(I4B),
intent(inout) :: n1
743 integer(I4B),
intent(inout) :: n2
744 real(DP),
intent(inout),
optional :: rrate
745 real(DP),
intent(inout),
optional :: rhsval
746 real(DP),
intent(inout),
optional :: hcofval
751 n1 = this%flowbudptr%budterm(this%idxbudritm)%id1(ientry)
752 n2 = this%flowbudptr%budterm(this%idxbudritm)%id2(ientry)
753 qbnd = this%flowbudptr%budterm(this%idxbudritm)%flow(ientry)
754 ctmp = this%concinfl(n1)
755 if (
present(rrate)) rrate = ctmp * qbnd
756 if (
present(rhsval)) rhsval =
dzero
757 if (
present(hcofval)) hcofval = qbnd
775 call this%obs%StoreObsType(
'concentration', .false., indx)
780 call this%obs%StoreObsType(
'flow-ja-face', .true., indx)
785 call this%obs%StoreObsType(
'from-mvr', .true., indx)
794 call this%obs%StoreObsType(
'storage', .true., indx)
799 call this%obs%StoreObsType(
'constant', .true., indx)
804 call this%obs%StoreObsType(
'uzt', .true., indx)
809 call this%obs%StoreObsType(
'infiltration', .true., indx)
814 call this%obs%StoreObsType(
'rej-inf', .true., indx)
819 call this%obs%StoreObsType(
'uzet', .true., indx)
824 call this%obs%StoreObsType(
'rej-inf-to-mvr', .true., indx)
836 logical,
intent(inout) :: found
840 select case (obsrv%ObsTypeId)
841 case (
'INFILTRATION')
842 call this%rp_obs_byfeature(obsrv)
844 call this%rp_obs_byfeature(obsrv)
846 call this%rp_obs_byfeature(obsrv)
847 case (
'REJ-INF-TO-MVR')
848 call this%rp_obs_byfeature(obsrv)
859 character(len=*),
intent(in) :: obstypeid
860 real(DP),
intent(inout) :: v
861 integer(I4B),
intent(in) :: jj
862 logical,
intent(inout) :: found
864 integer(I4B) :: n1, n2
867 select case (obstypeid)
868 case (
'INFILTRATION')
869 if (this%iboundpak(jj) /= 0 .and. this%idxbudinfl > 0)
then
870 call this%uzt_infl_term(jj, n1, n2, v)
873 if (this%iboundpak(jj) /= 0 .and. this%idxbudrinf > 0)
then
874 call this%uzt_rinf_term(jj, n1, n2, v)
877 if (this%iboundpak(jj) /= 0 .and. this%idxbuduzet > 0)
then
878 call this%uzt_uzet_term(jj, n1, n2, v)
880 case (
'REJ-INF-TO-MVR')
881 if (this%iboundpak(jj) /= 0 .and. this%idxbudritm > 0)
then
882 call this%uzt_ritm_term(jj, n1, n2, v)
This module contains the base boundary package.
class(bndtype) function, pointer, public getbndfromlist(list, idx)
Get boundary from package list.
This module contains simulation constants.
integer(i4b), parameter linelength
maximum length of a standard line
real(dp), parameter dnodata
real no data constant
integer(i4b), parameter lenvarname
maximum length of a variable name
real(dp), parameter dzero
real constant zero
integer(i4b), parameter lenbudtxt
maximum length of a budget component names
real(dp), parameter done
real constant 1
subroutine uzt_ritm_term(this, ientry, n1, n2, rrate, rhsval, hcofval)
Rejected infiltration to MVR/MVT term.
subroutine uzt_rp_obs(this, obsrv, found)
Process package specific obs.
subroutine uzt_solve(this)
Explicit solve.
integer(i4b) function uzt_get_nbudterms(this)
Function that returns the number of budget terms for this package.
subroutine uzt_df_obs(this)
Define UZT Observation.
subroutine uzt_da(this)
Deallocate memory.
character(len= *), parameter flowtype
real(dp) function, dimension(:), pointer, contiguous get_mvr_depvar(this)
Override similarly named function in APT.
subroutine allocate_scalars(this)
Allocate scalar variables for package.
subroutine uzt_allocate_arrays(this)
Allocate arrays for package.
subroutine uzt_setup_budobj(this, idx)
Set up the budget object that stores all the unsaturated-zone flows.
subroutine uzt_infl_term(this, ientry, n1, n2, rrate, rhsval, hcofval)
Infiltration term.
subroutine uzt_rinf_term(this, ientry, n1, n2, rrate, rhsval, hcofval)
Rejected infiltration term.
subroutine uzt_fc_expanded(this, rhs, ia, idxglo, matrix_sln)
Add matrix terms related to UZT.
subroutine uzt_fill_budobj(this, idx, x, flowja, ccratin, ccratout)
Copy flow terms into thisbudobj.
real(dp) function uzt_setting_value(this, itemno, key)
Value for a package-specific PERIOD setting.
subroutine uzt_bd_obs(this, obstypeid, jj, v, found)
Calculate observation value and pass it back to APT.
character(len= *), parameter ftype
subroutine uzt_uzet_term(this, ientry, n1, n2, rrate, rhsval, hcofval)
Evapotranspiration from the unsaturated-zone term.
subroutine, public uzt_create(packobj, id, ibcnum, inunit, iout, namemodel, pakname, mempath, fmi, eqnsclfac, dvt, dvu, dvua)
Create a new UZT package.
subroutine find_uzt_package(this)
Find corresponding uzt package.
This module defines variable data types.
This module contains the derived types ObserveType and ObsDataType.
This module contains simulation methods.
subroutine, public store_error(msg, terminate)
Store an error message.
subroutine, public store_error_filename(filename, terminate)
Store the erroring file name.
subroutine, public apt_process_obsid(obsrv, dis, inunitobs, iout)
Process observation IDs for an advanced package.
subroutine, public apt_process_obsid12(obsrv, dis, inunitobs, iout)
Process observation IDs for a package.
This class is used to store a single deferred-length character string. It was designed to work in an ...