45 character(len=*),
parameter ::
ftype =
'UZE'
46 character(len=*),
parameter ::
flowtype =
'UZF'
47 character(len=16) ::
text =
' UZE'
53 integer(I4B),
pointer :: idxbudinfl => null()
54 integer(I4B),
pointer :: idxbudrinf => null()
55 integer(I4B),
pointer :: idxbuduzet => null()
56 integer(I4B),
pointer :: idxbudritm => null()
57 integer(I4B),
pointer :: idxbudtheq => null()
59 real(dp),
dimension(:),
pointer,
contiguous :: tempinfl => null()
60 real(dp),
dimension(:),
pointer,
contiguous :: tempuzet => null()
94 subroutine uze_create(packobj, id, ibcnum, inunit, iout, namemodel, pakname, &
95 fmi, eqnsclfac, gwecommon, dvt, dvu, dvua)
97 class(
bndtype),
pointer :: packobj
98 integer(I4B),
intent(in) :: id
99 integer(I4B),
intent(in) :: ibcnum
100 integer(I4B),
intent(in) :: inunit
101 integer(I4B),
intent(in) :: iout
102 character(len=*),
intent(in) :: namemodel
103 character(len=*),
intent(in) :: pakname
105 real(dp),
intent(in),
pointer :: eqnsclfac
107 character(len=*),
intent(in) :: dvt
108 character(len=*),
intent(in) :: dvu
109 character(len=*),
intent(in) :: dvua
118 call packobj%set_names(ibcnum, namemodel, pakname,
ftype)
122 call uzeobj%allocate_scalars()
125 call packobj%pack_initialize()
127 packobj%inunit = inunit
130 packobj%ibcnum = ibcnum
140 uzeobj%eqnsclfac => eqnsclfac
145 uzeobj%gwecommon => gwecommon
148 uzeobj%depvartype = dvt
149 uzeobj%depvarunit = dvu
150 uzeobj%depvarunitabbrev = dvua
162 class(
bndtype),
pointer :: packobj
163 integer(I4B) :: ip, icount
164 integer(I4B) :: nbudterm
174 if (this%fmi%flows_from_file)
then
175 call this%fmi%set_aptbudobj_pointer(this%flowpackagename, this%flowbudptr)
176 if (
associated(this%flowbudptr))
then
181 if (
associated(this%fmi%gwfbndlist))
then
184 do ip = 1, this%fmi%gwfbndlist%Count()
186 if (packobj%packName == this%flowpackagename)
then
191 this%flowpackagebnd => packobj
192 select type (packobj)
194 this%flowbudptr => packobj%budobj
203 if (.not. found)
then
204 write (
errmsg,
'(a)')
'Could not find flow package with name '&
205 &//trim(adjustl(this%flowpackagename))//
'.'
207 call this%parser%StoreErrorUnit()
212 nbudterm = this%flowbudptr%nbudterm
213 call mem_allocate(this%idxbudssm, nbudterm,
'IDXBUDSSM', this%memoryPath)
216 write (this%iout,
'(/, a, a)') &
217 'PROCESSING '//
ftype//
' INFORMATION FOR ', this%packName
218 write (this%iout,
'(a)')
' IDENTIFYING FLOW TERMS IN '//
flowtype//
' PACKAGE'
219 write (this%iout,
'(a, i0)') &
220 ' NUMBER OF '//
flowtype//
' = ', this%flowbudptr%ncv
222 do ip = 1, this%flowbudptr%nbudterm
223 select case (trim(adjustl(this%flowbudptr%budterm(ip)%flowtype)))
224 case (
'FLOW-JA-FACE')
226 this%idxbudssm(ip) = 0
229 this%idxbudssm(ip) = 0
232 this%idxbudssm(ip) = 0
233 case (
'INFILTRATION')
235 this%idxbudssm(ip) = 0
238 this%idxbudssm(ip) = 0
241 this%idxbudssm(ip) = 0
242 case (
'REJ-INF-TO-MVR')
244 this%idxbudssm(ip) = 0
247 this%idxbudssm(ip) = 0
250 this%idxbudssm(ip) = 0
253 this%idxbudssm(ip) = 0
258 this%idxbudssm(ip) = icount
262 write (this%iout,
'(a, i0, " = ", a,/, a, i0)') &
263 ' TERM ', ip, trim(adjustl(this%flowbudptr%budterm(ip)%flowtype)), &
264 ' MAX NO. OF ENTRIES = ', this%flowbudptr%budterm(ip)%maxlist
266 write (this%iout,
'(a, //)')
'DONE PROCESSING '//
ftype//
' INFORMATION'
269 this%idxbudtheq = this%flowbudptr%nbudterm + 1
283 integer(I4B),
intent(in) :: moffset
286 integer(I4B) :: i, ii
292 integer(I4B) :: idxjj
293 integer(I4B) :: idxnglo
294 integer(I4B) :: idxjglo
297 if (this%imatrows /= 0)
then
301 nglo = moffset + this%dis%nodes + this%ioffset + n
302 call sparse%addconnection(nglo, nglo, 1)
308 do i = 1, this%flowbudptr%budterm(this%idxbudgwf)%nlist
309 n = this%flowbudptr%budterm(this%idxbudgwf)%id1(i)
310 jj = this%flowbudptr%budterm(this%idxbudgwf)%id2(i)
311 nglo = moffset + this%dis%nodes + this%ioffset + n
313 call sparse%addconnection(nglo, jglo, 1)
314 call sparse%addconnection(jglo, nglo, 1)
322 if (this%idxbudfjf /= 0)
then
323 do i = 1, this%flowbudptr%budterm(this%idxbudfjf)%maxlist
324 n = this%flowbudptr%budterm(this%idxbudfjf)%id1(i)
325 jj = this%flowbudptr%budterm(this%idxbudfjf)%id2(i)
326 nglo = moffset + this%dis%nodes + this%ioffset + n
327 jglo = moffset + this%dis%nodes + this%ioffset + jj
330 do ii = 1, this%flowbudptr%budterm(this%idxbudgwf)%nlist
331 idxn = this%flowbudptr%budterm(this%idxbudgwf)%id1(ii)
332 idxjj = this%flowbudptr%budterm(this%idxbudgwf)%id2(ii)
333 idxnglo = moffset + this%dis%nodes + this%ioffset + idxn
334 idxjglo = moffset + idxjj
335 if (nglo == idxnglo)
exit
337 call sparse%addconnection(idxjglo, jglo, 1)
345 subroutine uze_mc(this, moffset, matrix_sln)
349 integer(I4B),
intent(in) :: moffset
352 integer(I4B) :: n, j, iglo, jglo
353 integer(I4B) :: idxn, idxj, idxiglo, idxjglo
354 integer(I4B) :: ipos, idxpos
357 call this%apt_allocate_index_arrays()
360 if (this%imatrows /= 0)
then
369 iglo = moffset + this%dis%nodes + this%ioffset + n
370 this%idxpakdiag(n) = matrix_sln%get_position_diag(iglo)
374 do ipos = 1, this%flowbudptr%budterm(this%idxbudgwf)%nlist
375 n = this%flowbudptr%budterm(this%idxbudgwf)%id1(ipos)
376 j = this%flowbudptr%budterm(this%idxbudgwf)%id2(ipos)
377 iglo = moffset + this%dis%nodes + this%ioffset + n
382 this%idxlocnode(n) = j
386 this%idxdglo(ipos) = matrix_sln%get_position_diag(iglo)
387 this%idxoffdglo(ipos) = matrix_sln%get_position(iglo, jglo)
391 do ipos = 1, this%flowbudptr%budterm(this%idxbudgwf)%nlist
392 n = this%flowbudptr%budterm(this%idxbudgwf)%id1(ipos)
393 j = this%flowbudptr%budterm(this%idxbudgwf)%id2(ipos)
395 jglo = moffset + this%dis%nodes + this%ioffset + n
399 this%idxsymdglo(ipos) = matrix_sln%get_position_diag(iglo)
400 this%idxsymoffdglo(ipos) = matrix_sln%get_position(iglo, jglo)
404 if (this%idxbudfjf /= 0)
then
405 do ipos = 1, this%flowbudptr%budterm(this%idxbudfjf)%nlist
406 n = this%flowbudptr%budterm(this%idxbudfjf)%id1(ipos)
407 j = this%flowbudptr%budterm(this%idxbudfjf)%id2(ipos)
408 iglo = moffset + this%dis%nodes + this%ioffset + n
409 jglo = moffset + this%dis%nodes + this%ioffset + j
412 do idxpos = 1, this%flowbudptr%budterm(this%idxbudgwf)%nlist
413 idxn = this%flowbudptr%budterm(this%idxbudgwf)%id1(idxpos)
414 idxj = this%flowbudptr%budterm(this%idxbudgwf)%id2(idxpos)
415 idxjglo = moffset + this%dis%nodes + this%ioffset + idxn
416 idxiglo = moffset + idxj
417 if (idxjglo == iglo)
exit
423 this%idxfjfdglo(ipos) = matrix_sln%get_position_diag(idxiglo)
424 this%idxfjfoffdglo(ipos) = matrix_sln%get_position(idxiglo, jglo)
438 real(DP),
dimension(:),
intent(inout) :: rhs
439 integer(I4B),
dimension(:),
intent(in) :: ia
440 integer(I4B),
dimension(:),
intent(in) :: idxglo
443 integer(I4B) :: j, n, n1, n2
445 integer(I4B) :: iposd, iposoffd
446 integer(I4B) :: ipossymoffd
458 if (this%idxbudinfl /= 0)
then
459 do j = 1, this%flowbudptr%budterm(this%idxbudinfl)%nlist
460 call this%uze_infl_term(j, n1, n2, rrate, rhsval, hcofval)
461 iloc = this%idxlocnode(n1)
462 ipossymoffd = this%idxsymoffdglo(j)
463 call matrix_sln%add_value_pos(ipossymoffd, hcofval)
464 rhs(iloc) = rhs(iloc) + rhsval
469 if (this%idxbudrinf /= 0)
then
470 do j = 1, this%flowbudptr%budterm(this%idxbudrinf)%nlist
471 call this%uze_rinf_term(j, n1, n2, rrate, rhsval, hcofval)
472 iloc = this%idxlocnode(n1)
473 ipossymoffd = this%idxsymoffdglo(j)
474 call matrix_sln%add_value_pos(ipossymoffd, hcofval)
475 rhs(iloc) = rhs(iloc) + rhsval
480 if (this%idxbuduzet /= 0)
then
481 do j = 1, this%flowbudptr%budterm(this%idxbuduzet)%nlist
482 call this%uze_uzet_term(j, n1, n2, rrate, rhsval, hcofval)
483 iloc = this%idxlocnode(n1)
484 ipossymoffd = this%idxsymoffdglo(j)
485 call matrix_sln%add_value_pos(ipossymoffd, hcofval)
486 rhs(iloc) = rhs(iloc) + rhsval
491 if (this%idxbudritm /= 0)
then
492 do j = 1, this%flowbudptr%budterm(this%idxbudritm)%nlist
493 call this%uze_ritm_term(j, n1, n2, rrate, rhsval, hcofval)
494 iloc = this%idxlocnode(n1)
495 ipossymoffd = this%idxsymoffdglo(j)
496 call matrix_sln%add_value_pos(ipossymoffd, hcofval)
497 rhs(iloc) = rhs(iloc) + rhsval
506 cold = this%xoldpak(n)
507 iloc = this%idxlocnode(n)
508 ipossymoffd = this%idxsymoffdglo(n)
509 call this%apt_stor_term(n, n1, n2, rrate, rhsval, hcofval)
510 call matrix_sln%add_value_pos(ipossymoffd, hcofval)
511 rhs(iloc) = rhs(iloc) + rhsval
515 if (this%idxbudtmvr /= 0)
then
516 do j = 1, this%flowbudptr%budterm(this%idxbudtmvr)%nlist
517 call this%apt_tmvr_term(j, n1, n2, rrate, rhsval, hcofval)
518 iloc = this%idxlocnode(n1)
519 ipossymoffd = this%idxsymoffdglo(j)
520 call matrix_sln%add_value_pos(ipossymoffd, hcofval)
521 rhs(iloc) = rhs(iloc) + rhsval
526 if (this%idxbudfmvr /= 0)
then
528 rhsval = this%qmfrommvr(n)
529 iloc = this%idxlocnode(n)
530 rhs(iloc) = rhs(iloc) - rhsval
535 do j = 1, this%flowbudptr%budterm(this%idxbudgwf)%nlist
538 n = this%flowbudptr%budterm(this%idxbudgwf)%id1(j)
539 if (this%iboundpak(n) /= 0)
then
543 iposd = this%idxdglo(j)
544 iposoffd = this%idxoffdglo(j)
545 call matrix_sln%add_value_pos(iposd,
done)
546 call matrix_sln%add_value_pos(iposoffd, -
done)
551 if (this%idxbudfjf /= 0)
then
552 do j = 1, this%flowbudptr%budterm(this%idxbudfjf)%nlist
553 n1 = this%flowbudptr%budterm(this%idxbudfjf)%id1(j)
554 n2 = this%flowbudptr%budterm(this%idxbudfjf)%id2(j)
555 qbnd = this%flowbudptr%budterm(this%idxbudfjf)%flow(j)
556 if (qbnd <=
dzero)
then
561 iposd = this%idxfjfdglo(j)
562 iposoffd = this%idxfjfoffdglo(j)
563 call matrix_sln%add_value_pos(iposd, omega * qbnd * this%eqnsclfac)
564 call matrix_sln%add_value_pos(iposoffd, &
565 (
done - omega) * qbnd * this%eqnsclfac)
580 integer(I4B) :: n1, n2
584 if (this%idxbudinfl /= 0)
then
585 do j = 1, this%flowbudptr%budterm(this%idxbudinfl)%nlist
586 call this%uze_infl_term(j, n1, n2, rrate)
587 this%dbuff(n1) = this%dbuff(n1) + rrate
592 if (this%idxbudrinf /= 0)
then
593 do j = 1, this%flowbudptr%budterm(this%idxbudrinf)%nlist
594 call this%uze_rinf_term(j, n1, n2, rrate)
595 this%dbuff(n1) = this%dbuff(n1) + rrate
600 if (this%idxbuduzet /= 0)
then
601 do j = 1, this%flowbudptr%budterm(this%idxbuduzet)%nlist
602 call this%uze_uzet_term(j, n1, n2, rrate)
603 this%dbuff(n1) = this%dbuff(n1) + rrate
608 if (this%idxbudritm /= 0)
then
609 do j = 1, this%flowbudptr%budterm(this%idxbudritm)%nlist
610 call this%uze_ritm_term(j, n1, n2, rrate)
611 this%dbuff(n1) = this%dbuff(n1) + rrate
625 integer(I4B) :: nbudterms
629 if (this%idxbudinfl /= 0) nbudterms = nbudterms + 1
630 if (this%idxbudrinf /= 0) nbudterms = nbudterms + 1
631 if (this%idxbuduzet /= 0) nbudterms = nbudterms + 1
632 if (this%idxbudritm /= 0) nbudterms = nbudterms + 1
633 if (this%idxbudtheq /= 0) nbudterms = nbudterms + 1
660 integer(I4B),
intent(inout) :: idx
662 integer(I4B) :: maxlist, naux
663 character(len=LENBUDTXT) :: text
666 text =
' INFILTRATION'
668 maxlist = this%flowbudptr%budterm(this%idxbudinfl)%maxlist
670 call this%budobj%budterm(idx)%initialize(text, &
675 maxlist, .false., .false., &
679 if (this%idxbudrinf /= 0)
then
682 maxlist = this%flowbudptr%budterm(this%idxbudrinf)%maxlist
684 call this%budobj%budterm(idx)%initialize(text, &
689 maxlist, .false., .false., &
694 if (this%idxbuduzet /= 0)
then
697 maxlist = this%flowbudptr%budterm(this%idxbuduzet)%maxlist
699 call this%budobj%budterm(idx)%initialize(text, &
704 maxlist, .false., .false., &
709 if (this%idxbudritm /= 0)
then
710 text =
' INF-REJ-TO-MVR'
712 maxlist = this%flowbudptr%budterm(this%idxbudritm)%maxlist
714 call this%budobj%budterm(idx)%initialize(text, &
719 maxlist, .false., .false., &
724 text =
' THERMAL-EQUIL'
727 maxlist = this%flowbudptr%budterm(this%idxbudgwf)%maxlist
729 call this%budobj%budterm(idx)%initialize(text, &
734 maxlist, .false., .false., &
746 integer(I4B),
intent(inout) :: idx
747 real(DP),
dimension(:),
intent(in) :: x
748 real(DP),
dimension(:),
contiguous,
intent(inout) :: flowja
749 real(DP),
intent(inout) :: ccratin
750 real(DP),
intent(inout) :: ccratout
752 integer(I4B) :: j, n1, n2, indx
753 integer(I4B) :: nlist, nlen
754 integer(I4B) :: igwfnode
755 integer(I4B) :: idiag
757 real(DP),
dimension(:),
allocatable :: budresid
759 allocate (budresid(this%ncv))
768 if (this%idxbudfjf /= 0)
then
769 nlen = this%flowbudptr%budterm(this%idxbudfjf)%maxlist
773 nlist = this%budobj%budterm(indx)%nlist
775 n1 = this%budobj%budterm(indx)%id1(j)
776 n2 = this%budobj%budterm(indx)%id2(j)
778 q = this%budobj%budterm(indx)%flow(j)
779 budresid(n1) = budresid(n1) + q
780 budresid(n2) = budresid(n2) - q
787 nlist = this%budobj%budterm(indx)%nlist
789 n1 = this%budobj%budterm(indx)%id1(j)
790 q = this%budobj%budterm(indx)%flow(j)
791 budresid(n1) = budresid(n1) + q
795 indx = this%idxlastpak
800 q = this%budobj%budterm(indx)%flow(n1)
801 budresid(n1) = budresid(n1) + q
805 if (this%idxbudtmvr /= 0)
then
807 nlist = this%budobj%budterm(indx)%nlist
809 n1 = this%budobj%budterm(indx)%id1(j)
810 q = this%budobj%budterm(indx)%flow(j)
811 budresid(n1) = budresid(n1) + q
816 if (this%idxbudfmvr /= 0)
then
818 nlist = this%budobj%budterm(indx)%nlist
820 n1 = this%budobj%budterm(indx)%id1(j)
821 q = this%budobj%budterm(indx)%flow(j)
822 budresid(n1) = budresid(n1) + q
829 q = this%budobj%budterm(indx)%flow(n1)
830 budresid(n1) = budresid(n1) + q
840 nlist = this%flowbudptr%budterm(this%idxbudinfl)%nlist
841 call this%budobj%budterm(idx)%reset(nlist)
843 call this%uze_infl_term(j, n1, n2, q)
844 call this%budobj%budterm(idx)%update_term(n1, n2, q)
845 call this%apt_accumulate_ccterm(n1, q, ccratin, ccratout)
846 budresid(n1) = budresid(n1) + q
850 if (this%idxbudrinf /= 0)
then
852 nlist = this%flowbudptr%budterm(this%idxbudrinf)%nlist
853 call this%budobj%budterm(idx)%reset(nlist)
855 call this%uze_rinf_term(j, n1, n2, q)
856 call this%budobj%budterm(idx)%update_term(n1, n2, q)
857 call this%apt_accumulate_ccterm(n1, q, ccratin, ccratout)
858 budresid(n1) = budresid(n1) + q
863 if (this%idxbuduzet /= 0)
then
865 nlist = this%flowbudptr%budterm(this%idxbuduzet)%nlist
866 call this%budobj%budterm(idx)%reset(nlist)
868 call this%uze_uzet_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
876 if (this%idxbudritm /= 0)
then
878 nlist = this%flowbudptr%budterm(this%idxbudritm)%nlist
879 call this%budobj%budterm(idx)%reset(nlist)
881 call this%uze_ritm_term(j, n1, n2, q)
882 call this%budobj%budterm(idx)%update_term(n1, n2, q)
883 call this%apt_accumulate_ccterm(n1, q, ccratin, ccratout)
884 budresid(n1) = budresid(n1) + q
891 nlist = this%flowbudptr%budterm(this%idxbudgwf)%nlist
892 call this%budobj%budterm(idx)%reset(nlist)
894 n1 = this%flowbudptr%budterm(this%idxbudgwf)%id1(j)
895 igwfnode = this%flowbudptr%budterm(this%idxbudgwf)%id2(j)
897 call this%uze_theq_term(j, n1, igwfnode, q)
898 call this%budobj%budterm(idx)%update_term(n1, igwfnode, q)
899 call this%apt_accumulate_ccterm(n1, q, ccratin, ccratout)
900 if (this%iboundpak(n1) /= 0)
then
902 this%simvals(n1) = this%simvals(n1) - q
903 idiag = this%dis%con%ia(igwfnode)
904 flowja(idiag) = flowja(idiag) - q
908 deallocate (budresid)
923 call this%TspAptType%allocate_scalars()
926 call mem_allocate(this%idxbudinfl,
'IDXBUDINFL', this%memoryPath)
927 call mem_allocate(this%idxbudrinf,
'IDXBUDRINF', this%memoryPath)
928 call mem_allocate(this%idxbuduzet,
'IDXBUDUZET', this%memoryPath)
929 call mem_allocate(this%idxbudritm,
'IDXBUDRITM', this%memoryPath)
930 call mem_allocate(this%idxbudtheq,
'IDXBUDTHEQ', this%memoryPath)
953 call mem_allocate(this%tempinfl, this%ncv,
'TEMPINFL', this%memoryPath)
954 call mem_allocate(this%tempuzet, this%ncv,
'TEMPUZET', this%memoryPath)
957 call this%TspAptType%apt_allocate_arrays()
961 this%tempinfl(n) =
dzero
962 this%tempuzet(n) =
dzero
986 call this%TspAptType%bnd_da()
998 integer(I4B),
intent(in) :: ientry
999 integer(I4B),
intent(inout) :: n1
1000 integer(I4B),
intent(inout) :: n2
1001 real(DP),
intent(inout),
optional :: rrate
1002 real(DP),
intent(inout),
optional :: rhsval
1003 real(DP),
intent(inout),
optional :: hcofval
1009 n1 = this%flowbudptr%budterm(this%idxbudinfl)%id1(ientry)
1010 n2 = this%flowbudptr%budterm(this%idxbudinfl)%id2(ientry)
1013 qbnd = this%flowbudptr%budterm(this%idxbudinfl)%flow(ientry)
1014 if (qbnd <
dzero)
then
1015 ctmp = this%xnewpak(n1)
1019 ctmp = this%tempinfl(n1)
1023 if (
present(rrate)) rrate = qbnd * ctmp * this%eqnsclfac
1024 if (
present(rhsval)) rhsval = r * this%eqnsclfac
1025 if (
present(hcofval)) hcofval = h * this%eqnsclfac
1039 integer(I4B),
intent(in) :: ientry
1040 integer(I4B),
intent(inout) :: n1
1041 integer(I4B),
intent(inout) :: n2
1042 real(DP),
intent(inout),
optional :: rrate
1043 real(DP),
intent(inout),
optional :: rhsval
1044 real(DP),
intent(inout),
optional :: hcofval
1049 n1 = this%flowbudptr%budterm(this%idxbudrinf)%id1(ientry)
1050 n2 = this%flowbudptr%budterm(this%idxbudrinf)%id2(ientry)
1051 qbnd = this%flowbudptr%budterm(this%idxbudrinf)%flow(ientry)
1052 ctmp = this%tempinfl(n1)
1053 if (
present(rrate)) rrate = ctmp * qbnd * this%eqnsclfac
1054 if (
present(rhsval)) rhsval =
dzero
1055 if (
present(hcofval)) hcofval = qbnd * this%eqnsclfac
1067 integer(I4B),
intent(in) :: ientry
1068 integer(I4B),
intent(inout) :: n1
1069 integer(I4B),
intent(inout) :: n2
1070 real(DP),
intent(inout),
optional :: rrate
1071 real(DP),
intent(inout),
optional :: rhsval
1072 real(DP),
intent(inout),
optional :: hcofval
1078 n1 = this%flowbudptr%budterm(this%idxbuduzet)%id1(ientry)
1079 n2 = this%flowbudptr%budterm(this%idxbuduzet)%id2(ientry)
1081 qbnd = this%flowbudptr%budterm(this%idxbuduzet)%flow(ientry)
1082 ctmp = this%tempuzet(n1)
1083 if (this%xnewpak(n1) < ctmp)
then
1088 if (
present(rrate)) &
1089 rrate = (omega * qbnd * this%xnewpak(n1) + &
1090 (
done - omega) * qbnd * ctmp) * this%eqnsclfac
1091 if (
present(rhsval)) rhsval = -(
done - omega) * qbnd * ctmp * this%eqnsclfac
1092 if (
present(hcofval)) hcofval = omega * qbnd * this%eqnsclfac
1106 integer(I4B),
intent(in) :: ientry
1107 integer(I4B),
intent(inout) :: n1
1108 integer(I4B),
intent(inout) :: n2
1109 real(DP),
intent(inout),
optional :: rrate
1110 real(DP),
intent(inout),
optional :: rhsval
1111 real(DP),
intent(inout),
optional :: hcofval
1116 n1 = this%flowbudptr%budterm(this%idxbudritm)%id1(ientry)
1117 n2 = this%flowbudptr%budterm(this%idxbudritm)%id2(ientry)
1118 qbnd = this%flowbudptr%budterm(this%idxbudritm)%flow(ientry)
1119 ctmp = this%tempinfl(n1)
1120 if (
present(rrate)) rrate = ctmp * qbnd * this%eqnsclfac
1121 if (
present(rhsval)) rhsval =
dzero
1122 if (
present(hcofval)) hcofval = qbnd * this%eqnsclfac
1135 integer(I4B),
intent(in) :: ientry
1136 integer(I4B),
intent(inout) :: n1
1137 integer(I4B),
intent(inout) :: n2
1138 real(DP),
intent(inout) :: rrate
1142 character(len=LENBUDTXT) :: flowtype
1145 n1 = this%flowbudptr%budterm(this%idxbudgwf)%id1(ientry)
1146 n2 = this%flowbudptr%budterm(this%idxbudgwf)%id2(ientry)
1147 if (this%iboundpak(n1) /= 0)
then
1148 do i = 1, this%budobj%nbudterm
1149 flowtype = this%budobj%budterm(i)%flowtype
1150 select case (trim(adjustl(flowtype)))
1151 case (
'THERMAL-EQUIL')
1155 r = r - this%budobj%budterm(i)%flow(ientry)
1172 integer(I4B) :: indx
1176 call this%obs%StoreObsType(
'temperature', .false., indx)
1181 call this%obs%StoreObsType(
'flow-ja-face', .true., indx)
1186 call this%obs%StoreObsType(
'from-mvr', .true., indx)
1195 call this%obs%StoreObsType(
'storage', .true., indx)
1200 call this%obs%StoreObsType(
'constant', .true., indx)
1205 call this%obs%StoreObsType(
'uze', .true., indx)
1210 call this%obs%StoreObsType(
'infiltration', .true., indx)
1215 call this%obs%StoreObsType(
'rej-inf', .true., indx)
1220 call this%obs%StoreObsType(
'uzet', .true., indx)
1225 call this%obs%StoreObsType(
'rej-inf-to-mvr', .true., indx)
1230 call this%obs%StoreObsType(
'thermal-equil', .true., indx)
1242 logical,
intent(inout) :: found
1245 select case (obsrv%ObsTypeId)
1246 case (
'INFILTRATION')
1247 call this%rp_obs_byfeature(obsrv)
1249 call this%rp_obs_byfeature(obsrv)
1251 call this%rp_obs_byfeature(obsrv)
1252 case (
'REJ-INF-TO-MVR')
1253 call this%rp_obs_byfeature(obsrv)
1254 case (
'THERMAL-EQUIL')
1255 call this%rp_obs_byfeature(obsrv)
1266 character(len=*),
intent(in) :: obstypeid
1267 real(DP),
intent(inout) :: v
1268 integer(I4B),
intent(in) :: jj
1269 logical,
intent(inout) :: found
1271 integer(I4B) :: n1, n2
1274 select case (obstypeid)
1275 case (
'INFILTRATION')
1276 if (this%iboundpak(jj) /= 0 .and. this%idxbudinfl > 0)
then
1277 call this%uze_infl_term(jj, n1, n2, v)
1280 if (this%iboundpak(jj) /= 0 .and. this%idxbudrinf > 0)
then
1281 call this%uze_rinf_term(jj, n1, n2, v)
1284 if (this%iboundpak(jj) /= 0 .and. this%idxbuduzet > 0)
then
1285 call this%uze_uzet_term(jj, n1, n2, v)
1287 case (
'REJ-INF-TO-MVR')
1288 if (this%iboundpak(jj) /= 0 .and. this%idxbudritm > 0)
then
1289 call this%uze_ritm_term(jj, n1, n2, v)
1291 case (
'THERMAL-EQUIL')
1292 if (this%iboundpak(jj) /= 0 .and. this%idxbudtheq > 0)
then
1293 call this%uze_theq_term(jj, n1, n2, v)
1317 integer(I4B) :: igwfnode
1321 nuz = this%flowbudptr%budterm(this%idxbudgwf)%maxlist
1326 igwfnode = this%flowbudptr%budterm(this%idxbudgwf)%id2(n)
1327 carea = this%dis%area(igwfnode)
1328 uzarea = this%flowbudptr%budterm(this%idxbudgwf)%auxvar(1, n)
1330 if (.not.
is_close(carea, uzarea))
then
1331 call this%area_error(igwfnode)
1335 call this%parser%StoreErrorUnit()
1347 integer(I4B) :: iloc
1349 character(len=30) :: nodestr
1351 call this%dis%noder_to_string(iloc, nodestr)
1353 'In a GWE model, the area of every UZF object must be equal to that of &
1354 &the host cell. This condition is violated in cell ', &
1355 trim(adjustl(nodestr)),
'. Check use of AUXMULTNAME option in UZF &
1367 integer(I4B),
intent(in) :: itemno
1368 character(len=*),
intent(in) :: keyword
1369 logical,
intent(inout) :: found
1371 character(len=LINELENGTH) :: temp_text
1372 integer(I4B) :: ierr
1374 real(DP),
pointer :: bndElem => null()
1380 select case (keyword)
1381 case (
'INFILTRATION')
1382 ierr = this%apt_check_valid(itemno)
1386 call this%parser%GetString(temp_text)
1388 bndelem => this%tempinfl(itemno)
1390 this%packName,
'BND', this%tsManager, &
1391 this%iprpak,
'INFILTRATION')
1393 ierr = this%apt_check_valid(itemno)
1397 call this%parser%GetString(temp_text)
1399 bndelem => this%tempuzet(itemno)
1401 this%packName,
'BND', this%tsManager, &
1402 this%iprpak,
'UZET')
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
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 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_set_stressperiod(this, itemno, keyword, found)
Sets the stress period attributes for keyword use.
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, public uze_create(packobj, id, ibcnum, inunit, iout, namemodel, pakname, fmi, eqnsclfac, gwecommon, dvt, dvu, dvua)
Create a new UZE package.
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.
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.
This module contains simulation variables.
character(len=maxcharlen) errmsg
error message string
subroutine, public read_value_or_time_series_adv(textInput, ii, jj, bndElem, pkgName, auxOrBnd, tsManager, iprpak, varName)
Call this subroutine from advanced packages to define timeseries link for a variable (varName).
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.