47 character(len=*),
parameter ::
ftype =
'UZE'
48 character(len=*),
parameter ::
flowtype =
'UZF'
49 character(len=16) ::
text =
' UZE'
55 integer(I4B),
pointer :: idxbudinfl => null()
56 integer(I4B),
pointer :: idxbudrinf => null()
57 integer(I4B),
pointer :: idxbuduzet => null()
58 integer(I4B),
pointer :: idxbudritm => null()
59 integer(I4B),
pointer :: idxbudtheq => null()
61 real(dp),
dimension(:),
pointer,
contiguous :: tempinfl => null()
62 real(dp),
dimension(:),
pointer,
contiguous :: tempuzet => null()
96 subroutine uze_create(packobj, id, ibcnum, inunit, iout, namemodel, pakname, &
97 mempath, fmi, eqnsclfac, gwecommon, dvt, dvu, dvua)
99 class(
bndtype),
pointer :: packobj
100 integer(I4B),
intent(in) :: id
101 integer(I4B),
intent(in) :: ibcnum
102 integer(I4B),
intent(in) :: inunit
103 integer(I4B),
intent(in) :: iout
104 character(len=*),
intent(in) :: namemodel
105 character(len=*),
intent(in) :: pakname
106 character(len=*),
intent(in) :: mempath
108 real(dp),
intent(in),
pointer :: eqnsclfac
110 character(len=*),
intent(in) :: dvt
111 character(len=*),
intent(in) :: dvu
112 character(len=*),
intent(in) :: dvua
121 call packobj%set_names(ibcnum, namemodel, pakname,
ftype, mempath)
125 call uzeobj%allocate_scalars()
128 call packobj%pack_initialize()
130 packobj%inunit = inunit
133 packobj%ibcnum = ibcnum
144 uzeobj%eqnsclfac => eqnsclfac
149 uzeobj%gwecommon => gwecommon
152 uzeobj%depvartype = dvt
153 uzeobj%depvarunit = dvu
154 uzeobj%depvarunitabbrev = dvua
166 class(
bndtype),
pointer :: packobj
167 integer(I4B) :: ip, icount
168 integer(I4B) :: nbudterm
178 if (this%fmi%flows_from_file)
then
179 call this%fmi%set_aptbudobj_pointer(this%flowpackagename, this%flowbudptr)
180 if (
associated(this%flowbudptr))
then
185 if (
associated(this%fmi%gwfbndlist))
then
188 do ip = 1, this%fmi%gwfbndlist%Count()
190 if (packobj%packName == this%flowpackagename)
then
195 this%flowpackagebnd => packobj
196 select type (packobj)
198 this%flowbudptr => packobj%budobj
207 if (.not. found)
then
208 write (
errmsg,
'(a)')
'Could not find flow package with name '&
209 &//trim(adjustl(this%flowpackagename))//
'.'
216 nbudterm = this%flowbudptr%nbudterm
217 call mem_allocate(this%idxbudssm, nbudterm,
'IDXBUDSSM', this%memoryPath)
220 write (this%iout,
'(/, a, a)') &
221 'PROCESSING '//
ftype//
' INFORMATION FOR ', this%packName
222 write (this%iout,
'(a)')
' IDENTIFYING FLOW TERMS IN '//
flowtype//
' PACKAGE'
223 write (this%iout,
'(a, i0)') &
224 ' NUMBER OF '//
flowtype//
' = ', this%flowbudptr%ncv
226 do ip = 1, this%flowbudptr%nbudterm
227 select case (trim(adjustl(this%flowbudptr%budterm(ip)%flowtype)))
228 case (
'FLOW-JA-FACE')
230 this%idxbudssm(ip) = 0
233 this%idxbudssm(ip) = 0
236 this%idxbudssm(ip) = 0
237 case (
'INFILTRATION')
239 this%idxbudssm(ip) = 0
242 this%idxbudssm(ip) = 0
245 this%idxbudssm(ip) = 0
246 case (
'REJ-INF-TO-MVR')
248 this%idxbudssm(ip) = 0
251 this%idxbudssm(ip) = 0
254 this%idxbudssm(ip) = 0
257 this%idxbudssm(ip) = 0
262 this%idxbudssm(ip) = icount
266 write (this%iout,
'(a, i0, " = ", a,/, a, i0)') &
267 ' TERM ', ip, trim(adjustl(this%flowbudptr%budterm(ip)%flowtype)), &
268 ' MAX NO. OF ENTRIES = ', this%flowbudptr%budterm(ip)%maxlist
270 write (this%iout,
'(a, //)')
'DONE PROCESSING '//
ftype//
' INFORMATION'
273 this%idxbudtheq = this%flowbudptr%nbudterm + 1
284 integer(I4B),
intent(in) :: itemno
285 character(len=*),
intent(in) :: key
289 select case (trim(key))
290 case (
'INFILTRATION')
291 val = this%tempinfl(itemno)
293 val = this%tempuzet(itemno)
308 integer(I4B),
intent(in) :: moffset
311 integer(I4B) :: i, ii
317 integer(I4B) :: idxjj
318 integer(I4B) :: idxnglo
319 integer(I4B) :: idxjglo
322 if (this%imatrows /= 0)
then
326 nglo = moffset + this%dis%nodes + this%ioffset + n
327 call sparse%addconnection(nglo, nglo, 1)
333 do i = 1, this%flowbudptr%budterm(this%idxbudgwf)%nlist
334 n = this%flowbudptr%budterm(this%idxbudgwf)%id1(i)
335 jj = this%flowbudptr%budterm(this%idxbudgwf)%id2(i)
336 nglo = moffset + this%dis%nodes + this%ioffset + n
338 call sparse%addconnection(nglo, jglo, 1)
339 call sparse%addconnection(jglo, nglo, 1)
347 if (this%idxbudfjf /= 0)
then
348 do i = 1, this%flowbudptr%budterm(this%idxbudfjf)%maxlist
349 n = this%flowbudptr%budterm(this%idxbudfjf)%id1(i)
350 jj = this%flowbudptr%budterm(this%idxbudfjf)%id2(i)
351 nglo = moffset + this%dis%nodes + this%ioffset + n
352 jglo = moffset + this%dis%nodes + this%ioffset + jj
355 do ii = 1, this%flowbudptr%budterm(this%idxbudgwf)%nlist
356 idxn = this%flowbudptr%budterm(this%idxbudgwf)%id1(ii)
357 idxjj = this%flowbudptr%budterm(this%idxbudgwf)%id2(ii)
358 idxnglo = moffset + this%dis%nodes + this%ioffset + idxn
359 idxjglo = moffset + idxjj
360 if (nglo == idxnglo)
exit
362 call sparse%addconnection(idxjglo, jglo, 1)
370 subroutine uze_mc(this, moffset, matrix_sln)
374 integer(I4B),
intent(in) :: moffset
377 integer(I4B) :: n, j, iglo, jglo
378 integer(I4B) :: idxn, idxj, idxiglo, idxjglo
379 integer(I4B) :: ipos, idxpos
382 call this%apt_allocate_index_arrays()
385 if (this%imatrows /= 0)
then
394 iglo = moffset + this%dis%nodes + this%ioffset + n
395 this%idxpakdiag(n) = matrix_sln%get_position_diag(iglo)
399 do ipos = 1, this%flowbudptr%budterm(this%idxbudgwf)%nlist
400 n = this%flowbudptr%budterm(this%idxbudgwf)%id1(ipos)
401 j = this%flowbudptr%budterm(this%idxbudgwf)%id2(ipos)
402 iglo = moffset + this%dis%nodes + this%ioffset + n
407 this%idxlocnode(n) = j
411 this%idxdglo(ipos) = matrix_sln%get_position_diag(iglo)
412 this%idxoffdglo(ipos) = matrix_sln%get_position(iglo, jglo)
416 do ipos = 1, this%flowbudptr%budterm(this%idxbudgwf)%nlist
417 n = this%flowbudptr%budterm(this%idxbudgwf)%id1(ipos)
418 j = this%flowbudptr%budterm(this%idxbudgwf)%id2(ipos)
420 jglo = moffset + this%dis%nodes + this%ioffset + n
424 this%idxsymdglo(ipos) = matrix_sln%get_position_diag(iglo)
425 this%idxsymoffdglo(ipos) = matrix_sln%get_position(iglo, jglo)
429 if (this%idxbudfjf /= 0)
then
430 do ipos = 1, this%flowbudptr%budterm(this%idxbudfjf)%nlist
431 n = this%flowbudptr%budterm(this%idxbudfjf)%id1(ipos)
432 j = this%flowbudptr%budterm(this%idxbudfjf)%id2(ipos)
433 iglo = moffset + this%dis%nodes + this%ioffset + n
434 jglo = moffset + this%dis%nodes + this%ioffset + j
437 do idxpos = 1, this%flowbudptr%budterm(this%idxbudgwf)%nlist
438 idxn = this%flowbudptr%budterm(this%idxbudgwf)%id1(idxpos)
439 idxj = this%flowbudptr%budterm(this%idxbudgwf)%id2(idxpos)
440 idxjglo = moffset + this%dis%nodes + this%ioffset + idxn
441 idxiglo = moffset + idxj
442 if (idxjglo == iglo)
exit
448 this%idxfjfdglo(ipos) = matrix_sln%get_position_diag(idxiglo)
449 this%idxfjfoffdglo(ipos) = matrix_sln%get_position(idxiglo, jglo)
463 real(DP),
dimension(:),
intent(inout) :: rhs
464 integer(I4B),
dimension(:),
intent(in) :: ia
465 integer(I4B),
dimension(:),
intent(in) :: idxglo
468 integer(I4B) :: j, n, n1, n2
470 integer(I4B) :: iposd, iposoffd
471 integer(I4B) :: ipossymoffd
483 if (this%idxbudinfl /= 0)
then
484 do j = 1, this%flowbudptr%budterm(this%idxbudinfl)%nlist
485 call this%uze_infl_term(j, n1, n2, rrate, rhsval, hcofval)
486 iloc = this%idxlocnode(n1)
487 ipossymoffd = this%idxsymoffdglo(j)
488 call matrix_sln%add_value_pos(ipossymoffd, hcofval)
489 rhs(iloc) = rhs(iloc) + rhsval
494 if (this%idxbudrinf /= 0)
then
495 do j = 1, this%flowbudptr%budterm(this%idxbudrinf)%nlist
496 call this%uze_rinf_term(j, n1, n2, rrate, rhsval, hcofval)
497 iloc = this%idxlocnode(n1)
498 ipossymoffd = this%idxsymoffdglo(j)
499 call matrix_sln%add_value_pos(ipossymoffd, hcofval)
500 rhs(iloc) = rhs(iloc) + rhsval
505 if (this%idxbuduzet /= 0)
then
506 do j = 1, this%flowbudptr%budterm(this%idxbuduzet)%nlist
507 call this%uze_uzet_term(j, n1, n2, rrate, rhsval, hcofval)
508 iloc = this%idxlocnode(n1)
509 ipossymoffd = this%idxsymoffdglo(j)
510 call matrix_sln%add_value_pos(ipossymoffd, hcofval)
511 rhs(iloc) = rhs(iloc) + rhsval
516 if (this%idxbudritm /= 0)
then
517 do j = 1, this%flowbudptr%budterm(this%idxbudritm)%nlist
518 call this%uze_ritm_term(j, n1, n2, rrate, rhsval, hcofval)
519 iloc = this%idxlocnode(n1)
520 ipossymoffd = this%idxsymoffdglo(j)
521 call matrix_sln%add_value_pos(ipossymoffd, hcofval)
522 rhs(iloc) = rhs(iloc) + rhsval
531 cold = this%xoldpak(n)
532 iloc = this%idxlocnode(n)
533 ipossymoffd = this%idxsymoffdglo(n)
534 call this%apt_stor_term(n, n1, n2, rrate, rhsval, hcofval)
535 call matrix_sln%add_value_pos(ipossymoffd, hcofval)
536 rhs(iloc) = rhs(iloc) + rhsval
540 if (this%idxbudtmvr /= 0)
then
541 do j = 1, this%flowbudptr%budterm(this%idxbudtmvr)%nlist
542 call this%apt_tmvr_term(j, n1, n2, rrate, rhsval, hcofval)
543 iloc = this%idxlocnode(n1)
544 ipossymoffd = this%idxsymoffdglo(j)
545 call matrix_sln%add_value_pos(ipossymoffd, hcofval)
546 rhs(iloc) = rhs(iloc) + rhsval
551 if (this%idxbudfmvr /= 0)
then
553 rhsval = this%qmfrommvr(n)
554 iloc = this%idxlocnode(n)
555 rhs(iloc) = rhs(iloc) - rhsval
560 do j = 1, this%flowbudptr%budterm(this%idxbudgwf)%nlist
563 n = this%flowbudptr%budterm(this%idxbudgwf)%id1(j)
564 if (this%iboundpak(n) /= 0)
then
568 iposd = this%idxdglo(j)
569 iposoffd = this%idxoffdglo(j)
570 call matrix_sln%add_value_pos(iposd,
done)
571 call matrix_sln%add_value_pos(iposoffd, -
done)
576 if (this%idxbudfjf /= 0)
then
577 do j = 1, this%flowbudptr%budterm(this%idxbudfjf)%nlist
578 n1 = this%flowbudptr%budterm(this%idxbudfjf)%id1(j)
579 n2 = this%flowbudptr%budterm(this%idxbudfjf)%id2(j)
580 qbnd = this%flowbudptr%budterm(this%idxbudfjf)%flow(j)
581 if (qbnd <=
dzero)
then
586 iposd = this%idxfjfdglo(j)
587 iposoffd = this%idxfjfoffdglo(j)
588 call matrix_sln%add_value_pos(iposd, omega * qbnd * this%eqnsclfac)
589 call matrix_sln%add_value_pos(iposoffd, &
590 (
done - omega) * qbnd * this%eqnsclfac)
605 integer(I4B) :: n1, n2
609 if (this%idxbudinfl /= 0)
then
610 do j = 1, this%flowbudptr%budterm(this%idxbudinfl)%nlist
611 call this%uze_infl_term(j, n1, n2, rrate)
612 this%dbuff(n1) = this%dbuff(n1) + rrate
617 if (this%idxbudrinf /= 0)
then
618 do j = 1, this%flowbudptr%budterm(this%idxbudrinf)%nlist
619 call this%uze_rinf_term(j, n1, n2, rrate)
620 this%dbuff(n1) = this%dbuff(n1) + rrate
625 if (this%idxbuduzet /= 0)
then
626 do j = 1, this%flowbudptr%budterm(this%idxbuduzet)%nlist
627 call this%uze_uzet_term(j, n1, n2, rrate)
628 this%dbuff(n1) = this%dbuff(n1) + rrate
633 if (this%idxbudritm /= 0)
then
634 do j = 1, this%flowbudptr%budterm(this%idxbudritm)%nlist
635 call this%uze_ritm_term(j, n1, n2, rrate)
636 this%dbuff(n1) = this%dbuff(n1) + rrate
650 integer(I4B) :: nbudterms
654 if (this%idxbudinfl /= 0) nbudterms = nbudterms + 1
655 if (this%idxbudrinf /= 0) nbudterms = nbudterms + 1
656 if (this%idxbuduzet /= 0) nbudterms = nbudterms + 1
657 if (this%idxbudritm /= 0) nbudterms = nbudterms + 1
658 if (this%idxbudtheq /= 0) nbudterms = nbudterms + 1
685 integer(I4B),
intent(inout) :: idx
687 integer(I4B) :: maxlist, naux
688 character(len=LENBUDTXT) :: text
691 text =
' INFILTRATION'
693 maxlist = this%flowbudptr%budterm(this%idxbudinfl)%maxlist
695 call this%budobj%budterm(idx)%initialize(text, &
700 maxlist, .false., .false., &
704 if (this%idxbudrinf /= 0)
then
707 maxlist = this%flowbudptr%budterm(this%idxbudrinf)%maxlist
709 call this%budobj%budterm(idx)%initialize(text, &
714 maxlist, .false., .false., &
719 if (this%idxbuduzet /= 0)
then
722 maxlist = this%flowbudptr%budterm(this%idxbuduzet)%maxlist
724 call this%budobj%budterm(idx)%initialize(text, &
729 maxlist, .false., .false., &
734 if (this%idxbudritm /= 0)
then
735 text =
' INF-REJ-TO-MVR'
737 maxlist = this%flowbudptr%budterm(this%idxbudritm)%maxlist
739 call this%budobj%budterm(idx)%initialize(text, &
744 maxlist, .false., .false., &
749 text =
' THERMAL-EQUIL'
752 maxlist = this%flowbudptr%budterm(this%idxbudgwf)%maxlist
754 call this%budobj%budterm(idx)%initialize(text, &
759 maxlist, .false., .false., &
771 integer(I4B),
intent(inout) :: idx
772 real(DP),
dimension(:),
intent(in) :: x
773 real(DP),
dimension(:),
contiguous,
intent(inout) :: flowja
774 real(DP),
intent(inout) :: ccratin
775 real(DP),
intent(inout) :: ccratout
777 integer(I4B) :: j, n1, n2, indx
778 integer(I4B) :: nlist, nlen
779 integer(I4B) :: igwfnode
780 integer(I4B) :: idiag
782 real(DP),
dimension(:),
allocatable :: budresid
784 allocate (budresid(this%ncv))
793 if (this%idxbudfjf /= 0)
then
794 nlen = this%flowbudptr%budterm(this%idxbudfjf)%maxlist
798 nlist = this%budobj%budterm(indx)%nlist
800 n1 = this%budobj%budterm(indx)%id1(j)
801 n2 = this%budobj%budterm(indx)%id2(j)
803 q = this%budobj%budterm(indx)%flow(j)
804 budresid(n1) = budresid(n1) + q
805 budresid(n2) = budresid(n2) - q
812 nlist = this%budobj%budterm(indx)%nlist
814 n1 = this%budobj%budterm(indx)%id1(j)
815 q = this%budobj%budterm(indx)%flow(j)
816 budresid(n1) = budresid(n1) + q
820 indx = this%idxlastpak
825 q = this%budobj%budterm(indx)%flow(n1)
826 budresid(n1) = budresid(n1) + q
830 if (this%idxbudtmvr /= 0)
then
832 nlist = this%budobj%budterm(indx)%nlist
834 n1 = this%budobj%budterm(indx)%id1(j)
835 q = this%budobj%budterm(indx)%flow(j)
836 budresid(n1) = budresid(n1) + q
841 if (this%idxbudfmvr /= 0)
then
843 nlist = this%budobj%budterm(indx)%nlist
845 n1 = this%budobj%budterm(indx)%id1(j)
846 q = this%budobj%budterm(indx)%flow(j)
847 budresid(n1) = budresid(n1) + q
854 q = this%budobj%budterm(indx)%flow(n1)
855 budresid(n1) = budresid(n1) + q
865 nlist = this%flowbudptr%budterm(this%idxbudinfl)%nlist
866 call this%budobj%budterm(idx)%reset(nlist)
868 call this%uze_infl_term(j, n1, n2, q)
869 call this%budobj%budterm(idx)%update_term(n1, n2, q)
870 call this%apt_accumulate_ccterm(n1, q, ccratin, ccratout)
871 budresid(n1) = budresid(n1) + q
875 if (this%idxbudrinf /= 0)
then
877 nlist = this%flowbudptr%budterm(this%idxbudrinf)%nlist
878 call this%budobj%budterm(idx)%reset(nlist)
880 call this%uze_rinf_term(j, n1, n2, q)
881 call this%budobj%budterm(idx)%update_term(n1, n2, q)
882 call this%apt_accumulate_ccterm(n1, q, ccratin, ccratout)
883 budresid(n1) = budresid(n1) + q
888 if (this%idxbuduzet /= 0)
then
890 nlist = this%flowbudptr%budterm(this%idxbuduzet)%nlist
891 call this%budobj%budterm(idx)%reset(nlist)
893 call this%uze_uzet_term(j, n1, n2, q)
894 call this%budobj%budterm(idx)%update_term(n1, n2, q)
895 call this%apt_accumulate_ccterm(n1, q, ccratin, ccratout)
896 budresid(n1) = budresid(n1) + q
901 if (this%idxbudritm /= 0)
then
903 nlist = this%flowbudptr%budterm(this%idxbudritm)%nlist
904 call this%budobj%budterm(idx)%reset(nlist)
906 call this%uze_ritm_term(j, n1, n2, q)
907 call this%budobj%budterm(idx)%update_term(n1, n2, q)
908 call this%apt_accumulate_ccterm(n1, q, ccratin, ccratout)
909 budresid(n1) = budresid(n1) + q
916 nlist = this%flowbudptr%budterm(this%idxbudgwf)%nlist
917 call this%budobj%budterm(idx)%reset(nlist)
919 n1 = this%flowbudptr%budterm(this%idxbudgwf)%id1(j)
920 igwfnode = this%flowbudptr%budterm(this%idxbudgwf)%id2(j)
922 call this%uze_theq_term(j, n1, igwfnode, q)
923 call this%budobj%budterm(idx)%update_term(n1, igwfnode, q)
924 call this%apt_accumulate_ccterm(n1, q, ccratin, ccratout)
925 if (this%iboundpak(n1) /= 0)
then
927 this%simvals(n1) = this%simvals(n1) - q
928 idiag = this%dis%con%ia(igwfnode)
929 flowja(idiag) = flowja(idiag) - q
933 deallocate (budresid)
948 call this%TspAptType%allocate_scalars()
951 call mem_allocate(this%idxbudinfl,
'IDXBUDINFL', this%memoryPath)
952 call mem_allocate(this%idxbudrinf,
'IDXBUDRINF', this%memoryPath)
953 call mem_allocate(this%idxbuduzet,
'IDXBUDUZET', this%memoryPath)
954 call mem_allocate(this%idxbudritm,
'IDXBUDRITM', this%memoryPath)
955 call mem_allocate(this%idxbudtheq,
'IDXBUDTHEQ', this%memoryPath)
977 call mem_setptr(this%tempinfl,
'INFILTRATION', this%input_mempath)
978 call mem_setptr(this%tempuzet,
'UZET', this%input_mempath)
981 call this%TspAptType%apt_allocate_arrays()
1001 nullify (this%tempinfl)
1002 nullify (this%tempuzet)
1005 call this%TspAptType%bnd_da()
1017 integer(I4B),
intent(in) :: ientry
1018 integer(I4B),
intent(inout) :: n1
1019 integer(I4B),
intent(inout) :: n2
1020 real(DP),
intent(inout),
optional :: rrate
1021 real(DP),
intent(inout),
optional :: rhsval
1022 real(DP),
intent(inout),
optional :: hcofval
1028 n1 = this%flowbudptr%budterm(this%idxbudinfl)%id1(ientry)
1029 n2 = this%flowbudptr%budterm(this%idxbudinfl)%id2(ientry)
1032 qbnd = this%flowbudptr%budterm(this%idxbudinfl)%flow(ientry)
1033 if (qbnd <
dzero)
then
1034 ctmp = this%xnewpak(n1)
1038 ctmp = this%tempinfl(n1)
1042 if (
present(rrate)) rrate = qbnd * ctmp * this%eqnsclfac
1043 if (
present(rhsval)) rhsval = r * this%eqnsclfac
1044 if (
present(hcofval)) hcofval = h * this%eqnsclfac
1058 integer(I4B),
intent(in) :: ientry
1059 integer(I4B),
intent(inout) :: n1
1060 integer(I4B),
intent(inout) :: n2
1061 real(DP),
intent(inout),
optional :: rrate
1062 real(DP),
intent(inout),
optional :: rhsval
1063 real(DP),
intent(inout),
optional :: hcofval
1068 n1 = this%flowbudptr%budterm(this%idxbudrinf)%id1(ientry)
1069 n2 = this%flowbudptr%budterm(this%idxbudrinf)%id2(ientry)
1070 qbnd = this%flowbudptr%budterm(this%idxbudrinf)%flow(ientry)
1071 ctmp = this%tempinfl(n1)
1072 if (
present(rrate)) rrate = ctmp * qbnd * this%eqnsclfac
1073 if (
present(rhsval)) rhsval =
dzero
1074 if (
present(hcofval)) hcofval = qbnd * this%eqnsclfac
1086 integer(I4B),
intent(in) :: ientry
1087 integer(I4B),
intent(inout) :: n1
1088 integer(I4B),
intent(inout) :: n2
1089 real(DP),
intent(inout),
optional :: rrate
1090 real(DP),
intent(inout),
optional :: rhsval
1091 real(DP),
intent(inout),
optional :: hcofval
1097 n1 = this%flowbudptr%budterm(this%idxbuduzet)%id1(ientry)
1098 n2 = this%flowbudptr%budterm(this%idxbuduzet)%id2(ientry)
1100 qbnd = this%flowbudptr%budterm(this%idxbuduzet)%flow(ientry)
1101 ctmp = this%tempuzet(n1)
1102 if (this%xnewpak(n1) < ctmp)
then
1107 if (
present(rrate)) &
1108 rrate = (omega * qbnd * this%xnewpak(n1) + &
1109 (
done - omega) * qbnd * ctmp) * this%eqnsclfac
1110 if (
present(rhsval)) rhsval = -(
done - omega) * qbnd * ctmp * this%eqnsclfac
1111 if (
present(hcofval)) hcofval = omega * qbnd * this%eqnsclfac
1125 integer(I4B),
intent(in) :: ientry
1126 integer(I4B),
intent(inout) :: n1
1127 integer(I4B),
intent(inout) :: n2
1128 real(DP),
intent(inout),
optional :: rrate
1129 real(DP),
intent(inout),
optional :: rhsval
1130 real(DP),
intent(inout),
optional :: hcofval
1135 n1 = this%flowbudptr%budterm(this%idxbudritm)%id1(ientry)
1136 n2 = this%flowbudptr%budterm(this%idxbudritm)%id2(ientry)
1137 qbnd = this%flowbudptr%budterm(this%idxbudritm)%flow(ientry)
1138 ctmp = this%tempinfl(n1)
1139 if (
present(rrate)) rrate = ctmp * qbnd * this%eqnsclfac
1140 if (
present(rhsval)) rhsval =
dzero
1141 if (
present(hcofval)) hcofval = qbnd * this%eqnsclfac
1154 integer(I4B),
intent(in) :: ientry
1155 integer(I4B),
intent(inout) :: n1
1156 integer(I4B),
intent(inout) :: n2
1157 real(DP),
intent(inout) :: rrate
1161 character(len=LENBUDTXT) :: flowtype
1164 n1 = this%flowbudptr%budterm(this%idxbudgwf)%id1(ientry)
1165 n2 = this%flowbudptr%budterm(this%idxbudgwf)%id2(ientry)
1166 if (this%iboundpak(n1) /= 0)
then
1167 do i = 1, this%budobj%nbudterm
1168 flowtype = this%budobj%budterm(i)%flowtype
1169 select case (trim(adjustl(flowtype)))
1170 case (
'THERMAL-EQUIL')
1174 r = r - this%budobj%budterm(i)%flow(ientry)
1191 integer(I4B) :: indx
1195 call this%obs%StoreObsType(
'temperature', .false., indx)
1200 call this%obs%StoreObsType(
'flow-ja-face', .true., indx)
1205 call this%obs%StoreObsType(
'from-mvr', .true., indx)
1214 call this%obs%StoreObsType(
'storage', .true., indx)
1219 call this%obs%StoreObsType(
'constant', .true., indx)
1224 call this%obs%StoreObsType(
'uze', .true., indx)
1229 call this%obs%StoreObsType(
'infiltration', .true., indx)
1234 call this%obs%StoreObsType(
'rej-inf', .true., indx)
1239 call this%obs%StoreObsType(
'uzet', .true., indx)
1244 call this%obs%StoreObsType(
'rej-inf-to-mvr', .true., indx)
1249 call this%obs%StoreObsType(
'thermal-equil', .true., indx)
1261 logical,
intent(inout) :: found
1264 select case (obsrv%ObsTypeId)
1265 case (
'INFILTRATION')
1266 call this%rp_obs_byfeature(obsrv)
1268 call this%rp_obs_byfeature(obsrv)
1270 call this%rp_obs_byfeature(obsrv)
1271 case (
'REJ-INF-TO-MVR')
1272 call this%rp_obs_byfeature(obsrv)
1273 case (
'THERMAL-EQUIL')
1274 call this%rp_obs_byfeature(obsrv)
1285 character(len=*),
intent(in) :: obstypeid
1286 real(DP),
intent(inout) :: v
1287 integer(I4B),
intent(in) :: jj
1288 logical,
intent(inout) :: found
1290 integer(I4B) :: n1, n2
1293 select case (obstypeid)
1294 case (
'INFILTRATION')
1295 if (this%iboundpak(jj) /= 0 .and. this%idxbudinfl > 0)
then
1296 call this%uze_infl_term(jj, n1, n2, v)
1299 if (this%iboundpak(jj) /= 0 .and. this%idxbudrinf > 0)
then
1300 call this%uze_rinf_term(jj, n1, n2, v)
1303 if (this%iboundpak(jj) /= 0 .and. this%idxbuduzet > 0)
then
1304 call this%uze_uzet_term(jj, n1, n2, v)
1306 case (
'REJ-INF-TO-MVR')
1307 if (this%iboundpak(jj) /= 0 .and. this%idxbudritm > 0)
then
1308 call this%uze_ritm_term(jj, n1, n2, v)
1310 case (
'THERMAL-EQUIL')
1311 if (this%iboundpak(jj) /= 0 .and. this%idxbudtheq > 0)
then
1312 call this%uze_theq_term(jj, n1, n2, v)
1336 integer(I4B) :: igwfnode
1340 nuz = this%flowbudptr%budterm(this%idxbudgwf)%maxlist
1345 igwfnode = this%flowbudptr%budterm(this%idxbudgwf)%id2(n)
1346 carea = this%dis%area(igwfnode)
1347 uzarea = this%flowbudptr%budterm(this%idxbudgwf)%auxvar(1, n)
1349 if (.not.
is_close(carea, uzarea))
then
1350 call this%area_error(igwfnode)
1354 call store_error_filename(this%input_fname)
1366 integer(I4B) :: iloc
1368 character(len=30) :: nodestr
1370 call this%dis%noder_to_string(iloc, nodestr)
1372 'In a GWE model, the area of every UZF object must be equal to that of &
1373 &the host cell. This condition is violated in cell ', &
1374 trim(adjustl(nodestr)),
'. Check use of AUXMULTNAME option in UZF &
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
integer(i4b), parameter izero
integer constant zero
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 uze_ad_chk(this)
Check if UZF object area is not equal to the cell area.
subroutine uze_rp_obs(this, obsrv, found)
Process package specific obs.
character(len= *), parameter ftype
subroutine uze_mc(this, moffset, matrix_sln)
Map package connection to matrix.
subroutine uze_ac(this, moffset, sparse)
Add package connection to matrix.
subroutine allocate_scalars(this)
Allocate scalars.
subroutine, public uze_create(packobj, id, ibcnum, inunit, iout, namemodel, pakname, mempath, fmi, eqnsclfac, gwecommon, dvt, dvu, dvua)
Create a new UZE package.
subroutine uze_setup_budobj(this, idx)
Setup budget object.
subroutine uze_ritm_term(this, ientry, n1, n2, rrate, rhsval, hcofval)
Rejected infiltration to MVR/MVT term.
subroutine uze_df_obs(this)
Define UZE Observation.
subroutine uze_bd_obs(this, obstypeid, jj, v, found)
Calculate observation value and pass it back to APT.
subroutine uze_fc_expanded(this, rhs, ia, idxglo, matrix_sln)
Add matrix terms related to UZE.
subroutine uze_theq_term(this, ientry, n1, n2, rrate)
Heat transferred through thermal equilibrium with the solid phase.
subroutine uze_rinf_term(this, ientry, n1, n2, rrate, rhsval, hcofval)
Rejected infiltration term.
integer(i4b) function uze_get_nbudterms(this)
Return the number of UZE-specific budget terms.
subroutine uze_solve(this)
Explicit solve.
character(len= *), parameter flowtype
subroutine uze_da(this)
Deallocate memory.
real(dp) function, dimension(:), pointer, contiguous get_mvr_depvar(this)
Override similarly named function in APT.
subroutine find_uze_package(this)
Find corresponding uze package.
subroutine uze_fill_budobj(this, idx, x, flowja, ccratin, ccratout)
Fill UZE budget object.
subroutine uze_allocate_arrays(this)
Allocate arrays.
subroutine area_error(this, iloc)
Print and store error msg indicating area of UZF object is not equal to that of the host cell.
subroutine uze_infl_term(this, ientry, n1, n2, rrate, rhsval, hcofval)
Infiltration term.
subroutine uze_uzet_term(this, ientry, n1, n2, rrate, rhsval, hcofval)
Evapotranspiration from the unsaturated-zone term.
real(dp) function uze_setting_value(this, itemno, key)
Value for a package-specific PERIOD setting.
This module defines variable data types.
pure logical function, public is_close(a, b, rtol, atol, symmetric)
Check if a real value is approximately equal to another.
This module contains the derived types ObserveType and ObsDataType.
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 store_error_filename(filename, terminate)
Store the erroring file name.
This module contains simulation variables.
character(len=maxcharlen) errmsg
error message string
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 ...