39 character(len=LENFTYPE) ::
ftype =
'MAW'
40 character(len=LENPACKAGENAME) ::
text =
' MAW'
50 character(len=LENBUDTXT),
dimension(:),
pointer, &
51 contiguous :: cmawbudget => null()
52 character(len=LENAUXNAME),
dimension(:),
pointer, &
53 contiguous :: cauxcbc => null()
56 logical(LGP),
pointer :: correct_flow => null()
59 integer(I4B),
pointer :: iprhed => null()
60 integer(I4B),
pointer :: iheadout => null()
61 integer(I4B),
pointer :: ibudgetout => null()
62 integer(I4B),
pointer :: ibudcsv => null()
63 integer(I4B),
pointer :: cbcauxitems => null()
64 integer(I4B),
pointer :: iflowingwells => null()
65 integer(I4B),
pointer :: imawiss => null()
66 integer(I4B),
pointer :: imawissopt => null()
67 integer(I4B),
pointer :: nmawwells => null()
68 integer(I4B),
pointer :: check_attr => null()
69 integer(I4B),
pointer :: ishutoffcnt => null()
70 integer(I4B),
pointer :: ieffradopt => null()
71 integer(I4B),
pointer :: inonvert => null()
72 integer(I4B),
pointer :: ioutredflowcsv => null()
73 real(dp),
pointer :: satomega => null()
76 real(dp),
pointer :: theta => null()
77 real(dp),
pointer :: kappa => null()
80 character(len=8),
dimension(:),
pointer,
contiguous :: status => null()
81 integer(I4B),
dimension(:),
pointer,
contiguous :: ngwfnodes => null()
82 integer(I4B),
dimension(:),
pointer,
contiguous :: ieqn => null()
83 integer(I4B),
dimension(:),
pointer,
contiguous :: ishutoff => null()
84 integer(I4B),
dimension(:),
pointer,
contiguous :: ifwdischarge => null()
85 real(dp),
dimension(:),
pointer,
contiguous :: strt => null()
86 real(dp),
dimension(:),
pointer,
contiguous :: radius => null()
87 real(dp),
dimension(:),
pointer,
contiguous :: area => null()
88 real(dp),
dimension(:),
pointer,
contiguous :: pumpelev => null()
89 real(dp),
dimension(:),
pointer,
contiguous :: bot => null()
90 real(dp),
dimension(:),
pointer,
contiguous :: ratesim => null()
91 real(dp),
dimension(:),
pointer,
contiguous :: reduction_length => null()
92 real(dp),
dimension(:),
pointer,
contiguous :: fwelev => null()
93 real(dp),
dimension(:),
pointer,
contiguous :: fwcond => null()
94 real(dp),
dimension(:),
pointer,
contiguous :: fwrlen => null()
95 real(dp),
dimension(:),
pointer,
contiguous :: fwcondsim => null()
96 real(dp),
dimension(:),
pointer,
contiguous :: xsto => null()
97 real(dp),
dimension(:),
pointer,
contiguous :: xoldsto => null()
98 real(dp),
dimension(:),
pointer,
contiguous :: shutoffmin => null()
99 real(dp),
dimension(:),
pointer,
contiguous :: shutoffmax => null()
100 real(dp),
dimension(:),
pointer,
contiguous :: shutofflevel => null()
101 real(dp),
dimension(:),
pointer,
contiguous :: shutoffweight => null()
102 real(dp),
dimension(:),
pointer,
contiguous :: shutoffdq => null()
103 real(dp),
dimension(:),
pointer,
contiguous :: shutoffqold => null()
104 character(len=LENBOUNDNAME),
dimension(:),
pointer, &
105 contiguous :: cmawname => null()
108 real(dp),
dimension(:),
pointer,
contiguous :: rate => null()
109 real(dp),
dimension(:),
pointer,
contiguous :: well_head => null()
110 real(dp),
dimension(:, :),
pointer,
contiguous :: mauxvar => null()
113 integer(I4B),
dimension(:),
pointer,
contiguous :: iaconn => null()
116 integer(I4B),
dimension(:),
pointer,
contiguous :: gwfnodes => null()
117 real(dp),
dimension(:),
pointer,
contiguous :: sradius => null()
118 real(dp),
dimension(:),
pointer,
contiguous :: hk => null()
119 real(dp),
dimension(:),
pointer,
contiguous :: satcond => null()
120 real(dp),
dimension(:),
pointer,
contiguous :: simcond => null()
121 real(dp),
dimension(:),
pointer,
contiguous :: topscrn => null()
122 real(dp),
dimension(:),
pointer,
contiguous :: botscrn => null()
123 real(dp),
dimension(:),
pointer,
contiguous :: angle => null()
124 real(dp),
dimension(:),
pointer,
contiguous :: connlen => null()
125 real(dp),
dimension(:),
pointer,
contiguous :: usrtopscrn => null()
126 real(dp),
dimension(:),
pointer,
contiguous :: usrbotscrn => null()
129 integer(I4B),
dimension(:),
pointer,
contiguous :: imap => null()
132 real(dp),
dimension(:),
pointer,
contiguous :: qauxcbc => null()
133 real(dp),
dimension(:),
pointer,
contiguous :: dbuff => null()
134 real(dp),
dimension(:),
pointer,
contiguous :: qleak => null()
135 real(dp),
dimension(:),
pointer,
contiguous :: qout => null()
136 real(dp),
dimension(:),
pointer,
contiguous :: qfw => null()
137 real(dp),
dimension(:),
pointer,
contiguous :: qsto => null()
138 real(dp),
dimension(:),
pointer,
contiguous :: qconst => null()
141 integer(I4B),
pointer :: bditems => null()
148 integer(I4B),
pointer :: gwfiss => null()
149 real(dp),
dimension(:),
pointer,
contiguous :: gwfk11 => null()
150 real(dp),
dimension(:),
pointer,
contiguous :: gwfk22 => null()
151 integer(I4B),
pointer :: gwfik22 => null()
152 real(dp),
dimension(:),
pointer,
contiguous :: gwfsat => null()
155 integer(I4B),
dimension(:),
pointer,
contiguous :: idxlocnode => null()
156 integer(I4B),
dimension(:),
pointer,
contiguous :: idxdglo => null()
157 integer(I4B),
dimension(:),
pointer,
contiguous :: idxoffdglo => null()
158 integer(I4B),
dimension(:),
pointer,
contiguous :: idxsymdglo => null()
159 integer(I4B),
dimension(:),
pointer,
contiguous :: idxsymoffdglo => null()
160 integer(I4B),
dimension(:),
pointer,
contiguous :: iboundpak => null()
161 real(dp),
dimension(:),
pointer,
contiguous :: xnewpak => null()
162 real(dp),
dimension(:),
pointer,
contiguous :: xoldpak => null()
165 integer(I4B),
pointer :: idense
166 real(dp),
dimension(:, :),
pointer,
contiguous :: denseterms => null()
169 real(dp),
dimension(:, :),
pointer,
contiguous :: viscratios => null()
240 subroutine maw_create(packobj, id, ibcnum, inunit, iout, namemodel, pakname)
242 class(
bndtype),
pointer :: packobj
243 integer(I4B),
intent(in) :: id
244 integer(I4B),
intent(in) :: ibcnum
245 integer(I4B),
intent(in) :: inunit
246 integer(I4B),
intent(in) :: iout
247 character(len=*),
intent(in) :: namemodel
248 character(len=*),
intent(in) :: pakname
249 type(
mawtype),
pointer :: mawobj
256 call packobj%set_names(ibcnum, namemodel, pakname,
ftype)
260 call mawobj%maw_allocate_scalars()
263 call packobj%pack_initialize()
265 packobj%inunit = inunit
268 packobj%ibcnum = ibcnum
281 class(
mawtype),
intent(inout) :: this
284 call this%BndType%allocate_scalars()
287 call mem_allocate(this%correct_flow,
'CORRECT_FLOW', this%memoryPath)
288 call mem_allocate(this%iprhed,
'IPRHED', this%memoryPath)
289 call mem_allocate(this%iheadout,
'IHEADOUT', this%memoryPath)
290 call mem_allocate(this%ibudgetout,
'IBUDGETOUT', this%memoryPath)
291 call mem_allocate(this%ibudcsv,
'IBUDCSV', this%memoryPath)
292 call mem_allocate(this%iflowingwells,
'IFLOWINGWELLS', this%memoryPath)
293 call mem_allocate(this%imawiss,
'IMAWISS', this%memoryPath)
294 call mem_allocate(this%imawissopt,
'IMAWISSOPT', this%memoryPath)
295 call mem_allocate(this%nmawwells,
'NMAWWELLS', this%memoryPath)
296 call mem_allocate(this%check_attr,
'CHECK_ATTR', this%memoryPath)
297 call mem_allocate(this%ishutoffcnt,
'ISHUTOFFCNT', this%memoryPath)
298 call mem_allocate(this%ieffradopt,
'IEFFRADOPT', this%memoryPath)
299 call mem_allocate(this%inonvert,
'INONVERT', this%memoryPath)
300 call mem_allocate(this%ioutredflowcsv,
'IOUTREDFLOWCSV', this%memoryPath)
301 call mem_allocate(this%satomega,
'SATOMEGA', this%memoryPath)
302 call mem_allocate(this%bditems,
'BDITEMS', this%memoryPath)
305 call mem_allocate(this%cbcauxitems,
'CBCAUXITEMS', this%memoryPath)
306 call mem_allocate(this%idense,
'IDENSE', this%memoryPath)
309 this%correct_flow = .false.
315 this%iflowingwells = 0
320 this%ioutredflowcsv = 0
321 this%satomega =
dzero
336 class(
mawtype),
intent(inout) :: this
347 this%cmawbudget(1) =
' GWF'
348 this%cmawbudget(2) =
' RATE'
349 this%cmawbudget(3) =
' STORAGE'
350 this%cmawbudget(4) =
' CONSTANT'
351 this%cmawbudget(5) =
' FW-RATE'
352 this%cmawbudget(6) =
' FROM-MVR'
353 this%cmawbudget(7) =
' RATE-TO-MVR'
354 this%cmawbudget(8) =
' FW-RATE-TO-MVR'
359 call mem_allocate(this%status, 8, this%nmawwells,
'STATUS', this%memoryPath)
362 call mem_allocate(this%ngwfnodes, this%nmawwells,
'NGWFNODES', &
364 call mem_allocate(this%ieqn, this%nmawwells,
'IEQN', this%memoryPath)
365 call mem_allocate(this%ishutoff, this%nmawwells,
'ISHUTOFF', this%memoryPath)
366 call mem_allocate(this%ifwdischarge, this%nmawwells,
'IFWDISCHARGE', &
368 call mem_allocate(this%strt, this%nmawwells,
'STRT', this%memoryPath)
369 call mem_allocate(this%radius, this%nmawwells,
'RADIUS', this%memoryPath)
370 call mem_allocate(this%area, this%nmawwells,
'AREA', this%memoryPath)
371 call mem_allocate(this%pumpelev, this%nmawwells,
'PUMPELEV', this%memoryPath)
372 call mem_allocate(this%bot, this%nmawwells,
'BOT', this%memoryPath)
373 call mem_allocate(this%ratesim, this%nmawwells,
'RATESIM', this%memoryPath)
374 call mem_allocate(this%reduction_length, this%nmawwells,
'REDUCTION_LENGTH', &
376 call mem_allocate(this%fwelev, this%nmawwells,
'FWELEV', this%memoryPath)
377 call mem_allocate(this%fwcond, this%nmawwells,
'FWCONDS', this%memoryPath)
378 call mem_allocate(this%fwrlen, this%nmawwells,
'FWRLEN', this%memoryPath)
379 call mem_allocate(this%fwcondsim, this%nmawwells,
'FWCONDSIM', &
381 call mem_allocate(this%xsto, this%nmawwells,
'XSTO', this%memoryPath)
382 call mem_allocate(this%xoldsto, this%nmawwells,
'XOLDSTO', this%memoryPath)
383 call mem_allocate(this%shutoffmin, this%nmawwells,
'SHUTOFFMIN', &
385 call mem_allocate(this%shutoffmax, this%nmawwells,
'SHUTOFFMAX', &
387 call mem_allocate(this%shutofflevel, this%nmawwells,
'SHUTOFFLEVEL', &
389 call mem_allocate(this%shutoffweight, this%nmawwells,
'SHUTOFFWEIGHT', &
391 call mem_allocate(this%shutoffdq, this%nmawwells,
'SHUTOFFDQ', &
393 call mem_allocate(this%shutoffqold, this%nmawwells,
'SHUTOFFQOLD', &
397 call mem_allocate(this%rate, this%nmawwells,
'RATE', this%memoryPath)
398 call mem_allocate(this%well_head, this%nmawwells,
'WELL_HEAD', &
400 if (this%naux > 0)
then
405 call mem_allocate(this%mauxvar, jj, this%nmawwells,
'MAUXVAR', &
409 if (this%iheadout > 0)
then
410 call mem_allocate(this%dbuff, this%nmawwells,
'DBUFF', this%memoryPath)
412 call mem_allocate(this%dbuff, 0,
'DBUFF', this%memoryPath)
416 call mem_allocate(this%iaconn, this%nmawwells + 1,
'IACONN', this%memoryPath)
419 call mem_allocate(this%imap, this%MAXBOUND,
'IMAP', this%memoryPath)
422 call mem_allocate(this%gwfnodes, this%maxbound,
'GWFNODES', this%memoryPath)
423 call mem_allocate(this%sradius, this%maxbound,
'SRADIUS', this%memoryPath)
424 call mem_allocate(this%hk, this%maxbound,
'HK', this%memoryPath)
425 call mem_allocate(this%satcond, this%maxbound,
'SATCOND', this%memoryPath)
426 call mem_allocate(this%simcond, this%maxbound,
'SIMCOND', this%memoryPath)
427 call mem_allocate(this%topscrn, this%maxbound,
'TOPSCRN', this%memoryPath)
428 call mem_allocate(this%botscrn, this%maxbound,
'BOTSCRN', this%memoryPath)
429 call mem_allocate(this%angle, this%maxbound,
'ANGLE', this%memoryPath)
430 call mem_allocate(this%connlen, this%maxbound,
'CONNLEN', this%memoryPath)
431 call mem_allocate(this%usrtopscrn, this%maxbound,
'USRTOPSCRN', &
433 call mem_allocate(this%usrbotscrn, this%maxbound,
'USRBOTSCRN', &
437 call mem_allocate(this%qleak, this%maxbound,
'QLEAK', this%memoryPath)
440 do n = 1, this%nmawwells
441 this%status(n) =
'ACTIVE'
442 this%ngwfnodes(n) = 0
445 this%ifwdischarge(n) = 0
447 this%radius(n) =
dep20
449 this%pumpelev(n) =
dep20
451 this%ratesim(n) =
dzero
452 this%reduction_length(n) =
dep20
453 this%fwelev(n) =
dzero
454 this%fwcond(n) =
dzero
455 this%fwrlen(n) =
dzero
456 this%fwcondsim(n) =
dzero
458 this%xoldsto(n) =
dzero
459 this%shutoffmin(n) =
dzero
460 this%shutoffmax(n) =
dzero
461 this%shutofflevel(n) =
dep20
462 this%shutoffweight(n) =
done
463 this%shutoffdq(n) =
done
464 this%shutoffqold(n) =
done
468 this%well_head(n) =
dzero
469 do jj = 1, max(1, this%naux)
470 this%mauxvar(jj, n) =
dzero
474 if (this%iheadout > 0)
then
475 this%dbuff(n) =
dzero
480 do n = 1, this%nmawwells + 1
489 call mem_allocate(this%qauxcbc, this%cbcauxitems,
'QAUXCBC', this%memoryPath)
490 do j = 1, this%cbcauxitems
491 this%qauxcbc(j) =
dzero
495 if (this%iflowingwells /= 0)
then
496 call mem_allocate(this%qfw, this%nmawwells,
'QFW', this%memoryPath)
500 call mem_allocate(this%qout, this%nmawwells,
'QOUT', this%memoryPath)
501 call mem_allocate(this%qsto, this%nmawwells,
'QSTO', this%memoryPath)
502 call mem_allocate(this%qconst, this%nmawwells,
'QCONST', this%memoryPath)
505 do n = 1, this%nmawwells
506 if (this%iflowingwells > 0)
then
510 this%qconst(n) =
dzero
514 do j = 1, this%maxbound
517 this%sradius(j) =
dzero
519 this%satcond(j) =
dzero
520 this%simcond(j) =
dzero
521 this%topscrn(j) =
dzero
522 this%botscrn(j) =
dzero
523 this%angle(j) =
dzero
524 this%connlen(j) =
dzero
525 this%usrtopscrn(j) =
dzero
526 this%usrbotscrn(j) =
dzero
527 this%qleak(j) =
dzero
531 call mem_allocate(this%denseterms, 3, 0,
'DENSETERMS', this%memoryPath)
534 call mem_allocate(this%viscratios, 2, 0,
'VISCRATIOS', this%memoryPath)
543 class(
mawtype),
intent(inout) :: this
547 call this%BndType%allocate_arrays()
556 class(
mawtype),
intent(inout) :: this
558 character(len=LINELENGTH) :: text
559 character(len=LINELENGTH) :: keyword
560 character(len=LINELENGTH) :: cstr
561 character(len=LENBOUNDNAME) :: bndName
562 character(len=LENBOUNDNAME) :: bndNameTemp
563 character(len=9) :: cno
565 logical :: endOfBlock
576 real(DP),
pointer :: bndElem => null()
578 character(len=LINELENGTH),
dimension(:),
allocatable :: strttext
579 character(len=LENBOUNDNAME),
dimension(:),
allocatable :: nametxt
580 character(len=50),
dimension(:, :),
allocatable :: caux
581 integer(I4B),
dimension(:),
allocatable :: nboundchk
582 integer(I4B),
dimension(:),
allocatable :: wellieqn
583 integer(I4B),
dimension(:),
allocatable :: ngwfnodes
584 real(DP),
dimension(:),
allocatable :: radius
585 real(DP),
dimension(:),
allocatable :: bottom
587 character(len=*),
parameter :: fmthdbot = &
588 "('well head (', G0, ') must be greater than or equal to the &
589 &BOTTOM_ELEVATION (', G0, ').')"
592 allocate (strttext(this%nmawwells))
593 allocate (nametxt(this%nmawwells))
594 if (this%naux > 0)
then
595 allocate (caux(this%naux, this%nmawwells))
597 allocate (nboundchk(this%nmawwells))
598 allocate (wellieqn(this%nmawwells))
599 allocate (ngwfnodes(this%nmawwells))
600 allocate (radius(this%nmawwells))
601 allocate (bottom(this%nmawwells))
604 do n = 1, this%nmawwells
612 this%npakeq = this%nmawwells
616 call this%parser%GetBlock(
'PACKAGEDATA', isfound, ierr, &
617 supportopenclose=.true.)
621 write (this%iout,
'(/1x,a)') &
622 'PROCESSING '//trim(adjustl(this%text))//
' PACKAGEDATA'
624 call this%parser%GetNextLine(endofblock)
626 ival = this%parser%GetInteger()
629 if (n < 1 .or. n > this%nmawwells)
then
630 write (
errmsg,
'(a,1x,i0,a)') &
631 'IMAW must be greater than 0 and less than or equal to', &
638 nboundchk(n) = nboundchk(n) + 1
641 rval = this%parser%GetDouble()
642 if (rval <= dzero)
then
643 write (
errmsg,
'(a,1x,i0,1x,a)') &
644 'Radius for well', n,
'must be greater than zero.'
650 bottom(n) = this%parser%GetDouble()
653 call this%parser%GetString(strttext(n))
656 call this%parser%GetStringCaps(keyword)
657 if (keyword ==
'SPECIFIED')
then
659 else if (keyword ==
'THIEM')
then
661 else if (keyword ==
'THEIM')
then
663 write (
warnmsg,
'(a,a,a,a,a,a)') &
664 "CONDEQN in '", trim(this%packName),
"' should be ", &
665 "corrected from '", trim(keyword),
"' to 'THIEM'."
667 else if (keyword ==
'SKIN')
then
669 else if (keyword ==
'CUMULATIVE')
then
671 else if (keyword ==
'MEAN')
then
674 write (
errmsg,
'(a,1x,i0,1x,a)') &
675 'CONDEQN for well', n, &
676 "must be 'CUMULATIVE', 'THIEM', 'MEAN', or 'SKIN'."
681 ival = this%parser%GetInteger()
684 write (
errmsg,
'(a,1x,i0,1x,a)') &
685 'NGWFNODES for well', n,
'must be greater than zero.'
698 call this%parser%GetString(caux(jj, n))
702 write (cno,
'(i9.9)') n
703 bndname =
'MAWWELL'//cno
706 if (this%inamedbound /= 0)
then
707 call this%parser%GetStringCaps(bndnametemp)
708 if (bndnametemp /=
'')
then
709 bndname = bndnametemp
715 write (this%iout,
'(1x,a)') &
716 'END OF '//trim(adjustl(this%text))//
' PACKAGEDATA'
719 do n = 1, this%nmawwells
720 if (nboundchk(n) == 0)
then
721 write (
errmsg,
'(a,1x,i0,a)')
'No data specified for maw well', n,
'.'
723 else if (nboundchk(n) > 1)
then
724 write (
errmsg,
'(a,1x,i0,1x,a,1x,i0,1x,a)') &
725 'Data for maw well', n,
'specified', nboundchk(n),
'times.'
730 call store_error(
'Required packagedata block not found.')
735 call this%parser%StoreErrorUnit()
740 write (this%iout,
'(//4x,a,i7)')
'MAXBOUND = ', this%maxbound
743 call this%maw_allocate_well_conn_arrays()
746 do n = 1, this%nmawwells
748 this%radius(n) = rval
749 this%area(n) = dpi * rval**dtwo
750 this%bot(n) = bottom(n)
751 this%ieqn(n) = wellieqn(n)
752 this%ngwfnodes(n) = ngwfnodes(n)
753 this%cmawname(n) = nametxt(n)
759 bndelem => this%well_head(n)
761 this%packName,
'BND', this%tsManager, &
762 this%iprpak,
'WELL_HEAD')
765 this%strt(n) = this%well_head(n)
768 if (this%strt(n) < this%bot(n))
then
769 write (cstr, fmthdbot) this%strt(n), this%bot(n)
770 call this%maw_set_attribute_error(n,
'STRT', trim(cstr))
777 bndelem => this%mauxvar(jj, ii)
779 'AUX', this%tsManager, this%iprpak, &
787 do n = 1, this%nmawwells
788 do j = 1, this%ngwfnodes(n)
792 this%iaconn(n + 1) = idx + 1
796 deallocate (strttext)
798 if (this%naux > 0)
then
801 deallocate (nboundchk)
802 deallocate (wellieqn)
803 deallocate (ngwfnodes)
813 class(
mawtype),
intent(inout) :: this
815 character(len=LINELENGTH) :: cellid
816 character(len=30) :: nodestr
818 logical :: endOfBlock
828 integer(I4B) :: ireset_scrntop
829 integer(I4B) :: ireset_scrnbot
830 integer(I4B) :: ireset_wellbot
835 integer(I4B),
dimension(:),
pointer,
contiguous :: nboundchk
836 integer(I4B),
dimension(:),
pointer,
contiguous :: iachk
844 allocate (iachk(this%nmawwells + 1))
846 do n = 1, this%nmawwells
847 iachk(n + 1) = iachk(n) + this%ngwfnodes(n)
849 allocate (nboundchk(this%maxbound))
850 do n = 1, this%maxbound
855 call this%parser%GetBlock(
'CONNECTIONDATA', isfound, ierr, &
856 supportopenclose=.true.)
860 write (this%iout,
'(/1x,a)')
'PROCESSING '//trim(adjustl(this%text))// &
863 call this%parser%GetNextLine(endofblock)
867 ival = this%parser%GetInteger()
871 if (n < 1 .or. n > this%nmawwells)
then
872 write (
errmsg,
'(a,1x,i0,a)') &
873 'IMAW must be greater than 0 and less than or equal to ', &
880 ival = this%parser%GetInteger()
881 if (ival < 1 .or. ival > this%ngwfnodes(n))
then
882 write (
errmsg,
'(a,1x,i0,1x,a,1x,i0,a)') &
883 'JCONN for well ', n, &
884 'must be greater than 1 and less than or equal to ', &
885 this%ngwfnodes(n),
'.'
890 ipos = iachk(n) + ival - 1
891 nboundchk(ipos) = nboundchk(ipos) + 1
894 jpos = this%get_jpos(n, ival)
897 call this%parser%GetCellid(this%dis%ndim, cellid)
898 nn = this%dis%noder_from_cellid(cellid, this%inunit, this%iout)
899 topnn = this%dis%top(nn)
900 botnn = this%dis%bot(nn)
904 this%gwfnodes(jpos) = nn
907 rval = this%parser%GetDouble()
910 this%usrtopscrn(jpos) = rval
911 if (this%ieqn(n) /= 4)
then
914 if (rval > topnn)
then
915 ireset_scrntop = ireset_scrntop + 1
919 this%topscrn(jpos) = rval
922 rval = this%parser%GetDouble()
925 this%usrbotscrn(jpos) = rval
926 if (this%ieqn(n) /= 4)
then
929 if (rval < botnn)
then
930 ireset_scrnbot = ireset_scrnbot + 1
934 this%botscrn(jpos) = rval
938 if (rval < botw)
then
939 if (this%ieqn(n) /= 4)
then
940 ireset_wellbot = ireset_wellbot + 1
944 write (
errmsg,
'(a,1x,i0,1x,a,1x,i0,1x,a,g0,a,g0,a)') &
945 'Screen bottom for maw well', n,
'connection', j,
'(', &
946 this%botscrn(jpos),
') is less than the well bottom (', &
953 rval = this%parser%GetDouble()
954 if (this%ieqn(n) == 0)
then
955 this%satcond(jpos) = rval
956 else if (this%ieqn(n) == 2 .OR. this%ieqn(n) == 3 .OR. &
957 this%ieqn(n) == 4)
then
962 rval = this%parser%GetDouble()
963 if (this%ieqn(n) == 2 .OR. this%ieqn(n) == 3 .OR. &
964 this%ieqn(n) == 4)
then
965 this%sradius(jpos) = rval
966 if (this%sradius(jpos) <= this%radius(n))
then
967 write (
errmsg,
'(a,1x,i0,1x,a,1x,i0,1x,a,g0,a,g0,a)') &
968 'Screen radius for maw well', n,
'connection', j,
'(', &
969 this%sradius(jpos), &
970 ') is less than or equal to the well radius (', &
976 write (this%iout,
'(1x,a)') &
977 'END OF '//trim(adjustl(this%text))//
' CONNECTIONDATA'
980 do n = 1, this%nmawwells
981 do j = 1, this%ngwfnodes(n)
985 if (nboundchk(ipos) == 0)
then
986 write (
errmsg,
'(a,1x,i0,1x,a,1x,i0,a)') &
987 'No data specified for maw well', n,
'connection', j,
'.'
989 else if (nboundchk(ipos) > 1)
then
990 write (
errmsg,
'(a,1x,i0,1x,a,1x,i0,1x,a,1x,i0,1x,a)') &
991 'Data for maw well', n,
'connection', j, &
992 'specified', nboundchk(n),
'times.'
1000 do n = 1, this%nmawwells
1001 if (this%ieqn(n) /= 4)
then
1002 do j = 1, this%ngwfnodes(n)
1003 nn = this%get_gwfnode(n, j)
1004 do jj = 1, this%ngwfnodes(n)
1010 nn2 = this%get_gwfnode(n, jj)
1012 call this%dis%noder_to_string(nn, nodestr)
1013 write (
errmsg,
'(a,1x,i0,1x,a,1x,i0,3(1x,a))') &
1014 'Only one connection can be specified for maw well', &
1015 n,
'connection', j,
'to gwf cell', trim(adjustl(nodestr)), &
1016 'unless the mean condeqn is specified.'
1024 call store_error(
'Required connectiondata block not found.')
1029 deallocate (nboundchk)
1032 if (ireset_scrntop > 0)
then
1033 write (
warnmsg,
'(a,1x,a,1x,a,1x,i0,1x,a)') &
1034 'The screen tops in multi-aquifer well package', trim(this%packName), &
1035 'were reset to the top of the connected cell', ireset_scrntop,
'times.'
1038 if (ireset_scrnbot > 0)
then
1039 write (
warnmsg,
'(a,1x,a,1x,a,1x,i0,1x,a)') &
1040 'The screen bottoms in multi-aquifer well package', trim(this%packName), &
1041 'were reset to the bottom of the connected cell', ireset_scrnbot, &
1045 if (ireset_wellbot > 0)
then
1046 write (
warnmsg,
'(a,1x,a,1x,a,1x,i0,1x,a)') &
1047 'The well bottoms in multi-aquifer well package', trim(this%packName), &
1048 'were reset to the bottom of the connected cell', ireset_wellbot, &
1055 call this%parser%StoreErrorUnit()
1073 class(
mawtype),
intent(inout) :: this
1076 logical :: endOfBlock
1077 logical(LGP) :: success
1078 integer(I4B) :: ierr
1079 integer(I4B) :: ival
1082 integer(I4B) :: jpos
1083 integer(I4B) :: ipos
1084 integer(I4B) :: node
1086 real(DP) :: conn_len
1091 integer(I4B),
dimension(:),
pointer,
contiguous :: nboundchk
1092 integer(I4B),
dimension(:),
pointer,
contiguous :: iachk
1097 real(DP),
parameter :: coszero =
dem6
1099 real(DP),
parameter :: dninety = 9.0d1
1102 call this%parser%GetBlock(
'ANGLEDATA', isfound, ierr, &
1103 supportopenclose=.true., blockrequired=.false.)
1110 if (this%inonvert == 0)
then
1111 call store_error(
'An ANGLEDATA block was specified but the '// &
1112 'NON_VERTICAL_WELLS option was not specified in the '// &
1114 call this%parser%StoreErrorUnit()
1119 allocate (iachk(this%nmawwells + 1))
1121 do n = 1, this%nmawwells
1122 iachk(n + 1) = iachk(n) + this%ngwfnodes(n)
1124 allocate (nboundchk(this%maxbound))
1125 do n = 1, this%maxbound
1129 write (this%iout,
'(/1x,a)')
'PROCESSING '//trim(adjustl(this%text))// &
1132 call this%parser%GetNextLine(endofblock)
1133 if (endofblock)
exit
1136 ival = this%parser%GetInteger()
1138 if (n < 1 .or. n > this%nmawwells)
then
1139 write (
errmsg,
'(a,1x,i0,a)') &
1140 'IFNO must be greater than 0 and less than or equal to ', &
1147 ival = this%parser%GetInteger()
1148 if (ival < 1 .or. ival > this%ngwfnodes(n))
then
1149 write (
errmsg,
'(a,1x,i0,1x,a,1x,i0,a)') &
1150 'ICON for well ', n, &
1151 'must be greater than 0 and less than or equal to ', &
1152 this%ngwfnodes(n),
'.'
1157 jpos = this%get_jpos(n, j)
1160 ipos = iachk(n) + j - 1
1161 nboundchk(ipos) = nboundchk(ipos) + 1
1162 if (nboundchk(ipos) > 1)
then
1163 write (
errmsg,
'(a,1x,i0,1x,a,1x,i0,1x,a)') &
1164 'ANGLEDATA for maw well', n,
'connection', j, &
1165 'is specified more than once.'
1170 angle = this%parser%GetDouble()
1173 call this%parser%TryGetDouble(conn_len, success)
1174 if (.not. success)
then
1179 this%angle(jpos) = angle
1180 this%connlen(jpos) = conn_len
1183 if (angle <
dzero .or. angle > dninety)
then
1184 write (
errmsg,
'(a,1x,i0,1x,a,1x,i0,1x,a,g0,a)') &
1185 'ANGLE for maw well', n,
'connection', j,
'(', angle, &
1186 ') must be greater than or equal to 0.0 and less than or '// &
1187 'equal to 90.0 degrees.'
1198 if (this%ieqn(n) == 0)
then
1199 node = this%get_gwfnode(n, j)
1200 this%topscrn(jpos) = min(this%usrtopscrn(jpos), this%dis%top(node))
1201 this%botscrn(jpos) = max(this%usrbotscrn(jpos), this%dis%bot(node))
1205 dz = this%topscrn(jpos) - this%botscrn(jpos)
1206 if (dz <=
dzero)
then
1207 write (
errmsg,
'(a,1x,i0,1x,a,1x,i0,1x,a)') &
1208 'The screen top must be greater than the screen bottom for maw '// &
1209 'well', n,
'connection', j,
'listed in the ANGLEDATA block.'
1222 if (this%ieqn(n) /= 0)
then
1223 if (cos(omega) <= coszero .and. conn_len <=
dzero)
then
1224 write (
errmsg,
'(a,1x,i0,1x,a,1x,i0,1x,a)') &
1225 'A connection length must be specified for the (near) '// &
1226 'horizontal maw well', n,
'connection', j, &
1227 'listed in the ANGLEDATA block.'
1231 if (conn_len >
dzero)
then
1234 lw = (dz -
dtwo * this%radius(n) * sin(omega)) / cos(omega)
1236 if (lw <=
dzero)
then
1237 write (
errmsg,
'(a,1x,i0,1x,a,1x,i0,1x,a,g0,a)') &
1238 'The calculated in-cell screen length for maw well', n, &
1239 'connection', j,
'(', lw, &
1240 ') is not greater than zero. Specify a connection length in '// &
1241 'the ANGLEDATA block.'
1250 if (cos(omega) <= coszero .and. &
1251 this%ieqn(n) /= 4 .and. this%ieqn(n) /= 0)
then
1252 write (
warnmsg,
'(a,1x,i0,1x,a,1x,i0,1x,a)') &
1253 'The (near) horizontal maw well', n,
'connection', j, &
1254 'uses a radial conductance equation (THIEM, SKIN, or '// &
1255 'CUMULATIVE). The calculated conductance is an approximation '// &
1256 'for horizontal connections; the MEAN conductance equation is '// &
1257 'recommended for horizontal connections.'
1267 if (cos(omega) <= coszero .and. &
1268 (this%ieqn(n) == 4 .or. this%ieqn(n) == 0))
then
1269 topexp = this%botscrn(jpos) +
dtwo * this%radius(n)
1270 if (
is_close(this%topscrn(jpos), topexp))
then
1271 this%topscrn(jpos) = topexp
1273 write (
warnmsg,
'(a,1x,i0,1x,a,1x,i0,1x,a,g0,a)') &
1274 'The vertical screen extent (SCRN_TOP - SCRN_BOT) for the '// &
1275 '(near) horizontal maw well', n,
'connection', j, &
1276 'is not equal to the well diameter (2 * RADIUS = ', &
1277 dtwo * this%radius(n), &
1278 '). The vertical screen extent is used to determine the '// &
1279 'saturation of a connection and should equal the well '// &
1280 'diameter for a horizontal connection.'
1285 write (this%iout,
'(1x,a)') &
1286 'END OF '//trim(adjustl(this%text))//
' ANGLEDATA'
1290 deallocate (nboundchk)
1295 if (this%inonvert /= 0)
then
1297 'The NON_VERTICAL_WELLS option was specified but an ANGLEDATA '// &
1298 'block was not found. All multi-aquifer well connections will be '// &
1299 'treated as vertical.'
1306 call this%parser%StoreErrorUnit()
1323 class(
mawtype),
intent(inout) :: this
1324 integer(I4B),
intent(in) :: i
1325 integer(I4B),
intent(in) :: jpos
1335 if (this%angle(jpos) ==
dzero .and. this%connlen(jpos) <=
dzero)
then
1340 dz = this%topscrn(jpos) - this%botscrn(jpos)
1341 if (dz <=
dzero)
then
1347 if (this%connlen(jpos) >
dzero)
then
1348 lw = this%connlen(jpos)
1350 omega = this%angle(jpos) *
dpio180
1351 lw = (dz -
dtwo * this%radius(i) * sin(omega)) / cos(omega)
1362 class(
mawtype),
intent(inout) :: this
1364 character(len=LENBOUNDNAME) :: keyword
1365 integer(I4B) :: ierr
1366 logical :: isfound, endOfBlock
1374 call this%parser%GetBlock(
'DIMENSIONS', isfound, ierr, &
1375 supportopenclose=.true.)
1379 write (this%iout,
'(/1x,a)') &
1380 'PROCESSING '//trim(adjustl(this%text))//
' DIMENSIONS'
1382 call this%parser%GetNextLine(endofblock)
1383 if (endofblock)
exit
1384 call this%parser%GetStringCaps(keyword)
1385 select case (keyword)
1387 this%nmawwells = this%parser%GetInteger()
1388 write (this%iout,
'(4x,a,i0)')
'NMAWWELLS = ', this%nmawwells
1391 'Unknown '//trim(this%text)//
' dimension: ', trim(keyword),
'.'
1395 write (this%iout,
'(1x,a)') &
1396 'END OF '//trim(adjustl(this%text))//
' DIMENSIONS'
1398 call store_error(
'Required dimensions block not found.', terminate=.true.)
1402 if (this%nmawwells < 0)
then
1404 'NMAWWELLS was not specified or was specified incorrectly.'
1410 call this%parser%StoreErrorUnit()
1414 call this%maw_read_wells()
1417 call this%maw_read_well_connections()
1420 call this%maw_read_angledata()
1424 call this%define_listlabel()
1427 call this%maw_setup_budobj()
1430 call this%maw_setup_tableobj()
1440 class(
mawtype),
intent(inout) :: this
1442 character(len=LINELENGTH) :: title
1443 character(len=LINELENGTH) :: text
1444 integer(I4B) :: ntabcols
1448 integer(I4B) :: jpos
1449 integer(I4B) :: inode
1453 character(len=10),
dimension(0:4) :: ccond
1454 character(len=30) :: nodestr
1456 data ccond(0)/
'SPECIFIED '/
1457 data ccond(1)/
'THIEM '/
1458 data ccond(2)/
'SKIN '/
1459 data ccond(3)/
'CUMULATIVE'/
1460 data ccond(4)/
'MEAN '/
1462 character(len=*),
parameter :: fmtwelln = &
1463 "(1X,//43X,'MULTI-AQUIFER WELL DATA'&
1465 &/1X,7(A10,1X),A16)"
1466 character(len=*),
parameter :: fmtwelld = &
1467 &
"(1X,I10,1X,4(G10.3,1X),I10,1X,A10,1X,A16)"
1468 character(len=*),
parameter :: fmtline = &
1470 character(len=*),
parameter :: fmtwellcn = &
1471 "(1X,//37X,'MULTI-AQUIFER WELL CONNECTION DATA'&
1473 &/1X,2(A10,1X),A20,7(A10,1X))"
1474 character(len=*),
parameter :: fmtwellcd = &
1475 &
"(1X,2(I10,1X),A20,1X,2(G10.3,1X),2(A10,1X),3(G10.3,1X))"
1478 do n = 1, this%nmawwells
1479 this%xnewpak(n) = this%strt(n)
1480 this%xsto(n) = this%strt(n)
1484 do n = 1, this%nmawwells
1485 select case (this%status(n))
1487 this%iboundpak(n) = -1
1489 this%iboundpak(n) = 0
1491 this%iboundpak(n) = 1
1496 if (this%inamedbound /= 0)
then
1498 do n = 1, this%nmawwells
1499 do j = 1, this%ngwfnodes(n)
1501 this%boundname(idx) = this%cmawname(n)
1506 do n = 1, this%nmawwells
1507 this%cmawname(n) =
''
1512 call this%copy_boundname()
1522 call this%maw_check_attributes()
1525 do n = 1, this%nmawwells
1529 do j = 1, this%ngwfnodes(n)
1530 if (this%ieqn(n) /= 0)
then
1531 inode = this%get_gwfnode(n, j)
1532 call this%maw_calculate_satcond(n, j, inode)
1539 if (this%iprpak /= 0)
then
1541 if (this%inamedbound /= 0)
then
1542 ntabcols = ntabcols + 1
1544 title = trim(adjustl(this%text))//
' PACKAGE ('// &
1545 trim(adjustl(this%packName))//
') STATIC WELL DATA'
1546 call table_cr(this%inputtab, this%packName, title)
1547 call this%inputtab%table_df(this%nmawwells, ntabcols, this%iout)
1549 call this%inputtab%initialize_column(text, 10, alignment=tabcenter)
1551 call this%inputtab%initialize_column(text, 10, alignment=tabcenter)
1553 call this%inputtab%initialize_column(text, 10, alignment=tabcenter)
1554 text =
'WELL BOTTOM'
1555 call this%inputtab%initialize_column(text, 10, alignment=tabcenter)
1556 text =
'STARTING HEAD'
1557 call this%inputtab%initialize_column(text, 10, alignment=tabcenter)
1558 text =
'NUMBER OF GWF NODES'
1559 call this%inputtab%initialize_column(text, 10, alignment=tabcenter)
1560 text =
'CONDUCT. EQUATION'
1561 call this%inputtab%initialize_column(text, 10, alignment=tabcenter)
1562 if (this%inamedbound /= 0)
then
1564 call this%inputtab%initialize_column(text, 20, alignment=tableft)
1566 do n = 1, this%nmawwells
1567 call this%inputtab%add_term(n)
1568 call this%inputtab%add_term(this%radius(n))
1569 call this%inputtab%add_term(this%area(n))
1570 call this%inputtab%add_term(this%bot(n))
1571 call this%inputtab%add_term(this%strt(n))
1572 call this%inputtab%add_term(this%ngwfnodes(n))
1573 call this%inputtab%add_term(ccond(this%ieqn(n)))
1574 if (this%inamedbound /= 0)
then
1575 call this%inputtab%add_term(this%cmawname(n))
1581 if (this%iprpak /= 0)
then
1583 if (this%inonvert /= 0)
then
1584 ntabcols = ntabcols + 1
1586 title = trim(adjustl(this%text))//
' PACKAGE ('// &
1587 trim(adjustl(this%packName))//
') STATIC WELL CONNECTION DATA'
1588 call table_cr(this%inputtab, this%packName, title)
1589 call this%inputtab%table_df(this%maxbound, ntabcols, this%iout)
1591 call this%inputtab%initialize_column(text, 10, alignment=tabcenter)
1592 text =
'WELL CONNECTION'
1593 call this%inputtab%initialize_column(text, 10, alignment=tabcenter)
1595 call this%inputtab%initialize_column(text, 20, alignment=tableft)
1596 text =
'TOP OF SCREEN'
1597 call this%inputtab%initialize_column(text, 10, alignment=tabcenter)
1598 text =
'BOTTOM OF SCREEN'
1599 call this%inputtab%initialize_column(text, 10, alignment=tabcenter)
1600 text =
'SKIN RADIUS'
1601 call this%inputtab%initialize_column(text, 10, alignment=tabcenter)
1603 call this%inputtab%initialize_column(text, 10, alignment=tabcenter)
1605 call this%inputtab%initialize_column(text, 10, alignment=tabcenter)
1607 call this%inputtab%initialize_column(text, 10, alignment=tabcenter)
1608 text =
'SATURATED WELL CONDUCT.'
1609 call this%inputtab%initialize_column(text, 10, alignment=tabcenter)
1610 if (this%inonvert /= 0)
then
1611 text =
'ANGLE (DEG)'
1612 call this%inputtab%initialize_column(text, 10, alignment=tabcenter)
1616 do n = 1, this%nmawwells
1617 do j = 1, this%ngwfnodes(n)
1618 call this%inputtab%add_term(n)
1619 call this%inputtab%add_term(j)
1620 jpos = this%get_jpos(n, j)
1621 nn = this%get_gwfnode(n, j)
1622 call this%dis%noder_to_string(nn, nodestr)
1623 call this%inputtab%add_term(nodestr)
1624 call this%inputtab%add_term(this%topscrn(jpos))
1625 call this%inputtab%add_term(this%botscrn(jpos))
1626 if (this%ieqn(n) == 2 .or. &
1627 this%ieqn(n) == 3 .or. &
1628 this%ieqn(n) == 4)
then
1629 call this%inputtab%add_term(this%sradius(jpos))
1630 call this%inputtab%add_term(this%hk(jpos))
1632 call this%inputtab%add_term(
' ')
1633 call this%inputtab%add_term(
' ')
1635 if (this%ieqn(n) == 1 .or. &
1636 this%ieqn(n) == 2 .or. &
1637 this%ieqn(n) == 3)
then
1638 k11 = this%gwfk11(nn)
1639 if (this%gwfik22 == 0)
then
1640 k22 = this%gwfk11(nn)
1642 k22 = this%gwfk22(nn)
1644 call this%inputtab%add_term(k11)
1645 call this%inputtab%add_term(k22)
1647 call this%inputtab%add_term(
' ')
1648 call this%inputtab%add_term(
' ')
1650 call this%inputtab%add_term(this%satcond(jpos))
1651 if (this%inonvert /= 0)
then
1652 call this%inputtab%add_term(this%angle(jpos))
1659 this%gwfk11 => null()
1660 this%gwfk22 => null()
1661 this%gwfik22 => null()
1662 this%gwfsat => null()
1676 class(
mawtype),
intent(inout) :: this
1677 integer(I4B),
intent(in) :: imaw
1678 integer(I4B),
intent(inout) :: iheadlimit_warning
1680 character(len=LINELENGTH) :: errmsgr
1681 character(len=LINELENGTH) :: text
1682 character(len=LINELENGTH) :: cstr
1683 character(len=LINELENGTH) :: caux
1684 character(len=LINELENGTH) :: keyword
1688 real(DP),
pointer :: bndElem => null()
1689 integer(I4B) :: istat
1691 character(len=*),
parameter :: fmthdbot = &
1692 &
"('well head (',G0,') must be >= BOTTOM_ELEVATION (',G0, ').')"
1695 call this%parser%GetStringCaps(keyword)
1696 select case (keyword)
1698 call this%parser%GetStringCaps(text)
1699 this%status(imaw) = text(1:8)
1702 this%iboundpak(imaw) = -1
1704 this%iboundpak(imaw) = 0
1706 this%iboundpak(imaw) = 1
1709 'Unknown '//trim(this%text)//
" maw status keyword: '", &
1714 call this%parser%GetString(text)
1716 bndelem => this%rate(imaw)
1718 this%packName,
'BND', this%tsManager, &
1719 this%iprpak,
'RATE')
1721 call this%parser%GetString(text)
1723 bndelem => this%well_head(imaw)
1725 this%packName,
'BND', this%tsManager, &
1726 this%iprpak,
'WELL_HEAD')
1729 this%xnewpak(imaw) = this%well_head(imaw)
1732 if (this%well_head(imaw) < this%bot(imaw))
then
1733 write (cstr, fmthdbot) &
1734 this%well_head(imaw), this%bot(imaw)
1735 call this%maw_set_attribute_error(imaw,
'WELL HEAD', trim(cstr))
1737 case (
'FLOWING_WELL')
1738 this%fwelev(imaw) = this%parser%GetDouble()
1739 this%fwcond(imaw) = this%parser%GetDouble()
1740 this%fwrlen(imaw) = this%parser%GetDouble()
1744 if (this%iflowingwells == 0)
then
1745 this%iflowingwells = -1
1746 text =
'Flowing well data is specified in the '//trim(this%packName)// &
1747 ' package but FLOWING_WELL was not specified in the '// &
1751 case (
'RATE_SCALING')
1752 rval = this%parser%GetDouble()
1753 this%pumpelev(imaw) = rval
1754 rval = this%parser%GetDouble()
1755 this%reduction_length(imaw) = rval
1756 if (rval <
dzero)
then
1757 call this%maw_set_attribute_error(imaw, trim(keyword), &
1758 'must be greater than or equal to 0.')
1761 call this%parser%GetString(text)
1762 if (trim(text) ==
'OFF')
then
1763 this%shutofflevel(imaw) =
dep20
1765 read (text, *, iostat=istat, iomsg=errmsgr) &
1766 this%shutofflevel(imaw)
1767 if (istat /= 0)
then
1768 errmsg =
'Could not read HEAD_LIMIT value. '//trim(errmsgr)
1771 if (this%shutofflevel(imaw) <= this%bot(imaw))
then
1772 iheadlimit_warning = iheadlimit_warning + 1
1776 rval = this%parser%GetDouble()
1777 this%shutoffmin(imaw) = rval
1778 rval = this%parser%GetDouble()
1779 this%shutoffmax(imaw) = rval
1781 call this%parser%GetStringCaps(caux)
1782 do jj = 1, this%naux
1783 if (trim(adjustl(caux)) /= trim(adjustl(this%auxname(jj)))) cycle
1784 call this%parser%GetString(text)
1786 bndelem => this%mauxvar(jj, ii)
1788 this%packName,
'AUX', &
1789 this%tsManager, this%iprpak, &
1795 'Unknown '//trim(this%text)//
" maw data keyword: '", &
1807 class(
mawtype),
intent(inout) :: this
1808 integer(I4B),
intent(in) :: imaw
1809 character(len=*),
intent(in) :: keyword
1810 character(len=*),
intent(in) :: msg
1814 if (len(msg) == 0)
then
1815 write (
errmsg,
'(a,1x,a,1x,i0,1x,a)') &
1816 keyword,
' for MAW well', imaw,
'has already been set.'
1818 write (
errmsg,
'(a,1x,a,1x,i0,1x,a)') &
1819 keyword,
' for MAW well', imaw, msg
1829 class(
mawtype),
intent(inout) :: this
1831 character(len=LINELENGTH) :: cgwfnode
1835 integer(I4B) :: jpos
1839 do n = 1, this%nmawwells
1840 if (this%ngwfnodes(n) < 1)
then
1841 call this%maw_set_attribute_error(n,
'NGWFNODES',
'must be greater '// &
1844 if (this%radius(n) ==
dep20)
then
1845 call this%maw_set_attribute_error(n,
'RADIUS',
'has not been specified.')
1847 if (this%shutoffmin(n) >
dzero)
then
1848 if (this%shutoffmin(n) >= this%shutoffmax(n))
then
1849 call this%maw_set_attribute_error(n,
'SHUT_OFF',
'shutoffmax must '// &
1850 'be greater than shutoffmin.')
1853 do j = 1, this%ngwfnodes(n)
1856 jpos = this%get_jpos(n, j)
1859 write (cgwfnode,
'(a,i0,a)')
'gwfnode(', j,
')'
1862 if (this%botscrn(jpos) >= this%topscrn(jpos))
then
1863 call this%maw_set_attribute_error(n,
'SCREEN_TOP',
'screen bottom '// &
1864 'must be less than screen top. '// &
1869 if (this%ieqn(n) == 2 .OR. this%ieqn(n) == 3 .OR. &
1870 this%ieqn(n) == 4)
then
1871 if (this%hk(jpos) <=
dzero)
then
1872 call this%maw_set_attribute_error(n,
'HK_SKIN',
'skin hyraulic '// &
1873 'conductivity must be greater '// &
1874 'than zero. '//trim(cgwfnode))
1876 else if (this%ieqn(n) == 0)
then
1879 if (this%satcond(jpos) <
dzero)
then
1880 call this%maw_set_attribute_error(n,
'HK_SKIN', &
1881 'skin hyraulic conductivity '// &
1882 'must be greater than or '// &
1883 'equal to zero when using '// &
1884 'SPECIFIED condeqn. '// &
1900 class(
mawtype),
intent(inout) :: this
1901 integer(I4B),
intent(in) :: moffset
1907 integer(I4B) :: jglo
1908 integer(I4B) :: nglo
1912 do n = 1, this%nmawwells
1913 nglo = moffset + this%dis%nodes + this%ioffset + n
1914 call sparse%addconnection(nglo, nglo, 1)
1915 do j = 1, this%ngwfnodes(n)
1916 jj = this%get_gwfnode(n, j)
1918 call sparse%addconnection(nglo, jglo, 1)
1919 call sparse%addconnection(jglo, nglo, 1)
1931 class(
mawtype),
intent(inout) :: this
1932 integer(I4B),
intent(in) :: moffset
1938 integer(I4B) :: iglo
1939 integer(I4B) :: jglo
1940 integer(I4B) :: ipos
1944 call mem_allocate(this%idxlocnode, this%nmawwells,
'IDXLOCNODE', &
1946 call mem_allocate(this%idxdglo, this%maxbound,
'IDXDGLO', this%memoryPath)
1947 call mem_allocate(this%idxoffdglo, this%maxbound,
'IDXOFFDGLO', &
1949 call mem_allocate(this%idxsymdglo, this%maxbound,
'IDXSYMDGLO', &
1951 call mem_allocate(this%idxsymoffdglo, this%maxbound,
'IDXSYMOFFDGLO', &
1959 do n = 1, this%nmawwells
1960 iglo = moffset + this%dis%nodes + this%ioffset + n
1961 this%idxlocnode(n) = this%dis%nodes + this%ioffset + n
1962 do ii = 1, this%ngwfnodes(n)
1963 j = this%get_gwfnode(n, ii)
1965 this%idxdglo(ipos) = matrix_sln%get_position_diag(iglo)
1966 this%idxoffdglo(ipos) = matrix_sln%get_position(iglo, jglo)
1972 do n = 1, this%nmawwells
1973 do ii = 1, this%ngwfnodes(n)
1974 iglo = this%get_gwfnode(n, ii) + moffset
1975 jglo = moffset + this%dis%nodes + this%ioffset + n
1976 this%idxsymdglo(ipos) = matrix_sln%get_position_diag(iglo)
1977 this%idxsymoffdglo(ipos) = matrix_sln%get_position(iglo, jglo)
1992 class(
mawtype),
intent(inout) :: this
1993 character(len=*),
intent(inout) :: option
1994 logical,
intent(inout) :: found
1996 character(len=MAXCHARLEN) :: fname, keyword
1998 character(len=*),
parameter :: fmtflowingwells = &
1999 &
"(4x, 'FLOWING WELLS WILL BE SIMULATED.')"
2000 character(len=*),
parameter :: fmtshutdown = &
2001 &
"(4x, 'SHUTDOWN ', a, ' VALUE (',g15.7,') SPECIFIED.')"
2002 character(len=*),
parameter :: fmtnostoragewells = &
2003 &
"(4x, 'WELL STORAGE WILL NOT BE SIMULATED.')"
2004 character(len=*),
parameter :: fmtmawbin = &
2005 "(4x, 'MAW ', 1x, a, 1x, ' WILL BE SAVED TO FILE: ', a, /4x, &
2006 &'OPENED ON UNIT: ', I0)"
2010 select case (option)
2013 write (this%iout,
'(4x,a)') &
2014 trim(adjustl(this%text))//
' heads will be printed to listing file.'
2016 call this%parser%GetStringCaps(keyword)
2017 if (keyword ==
'FILEOUT')
then
2018 call this%parser%GetString(fname)
2019 call assign_iounit(this%iheadout, this%inunit,
"HEAD fileout")
2020 call openfile(this%iheadout, this%iout, fname,
'DATA(BINARY)', &
2022 write (this%iout, fmtmawbin)
'HEAD', trim(adjustl(fname)), &
2025 call store_error(
'Optional maw stage keyword must be '// &
2026 'followed by fileout.')
2029 call this%parser%GetStringCaps(keyword)
2030 if (keyword ==
'FILEOUT')
then
2031 call this%parser%GetString(fname)
2032 call assign_iounit(this%ibudgetout, this%inunit,
"BUDGET fileout")
2033 call openfile(this%ibudgetout, this%iout, fname,
'DATA(BINARY)', &
2035 write (this%iout, fmtmawbin)
'BUDGET', trim(adjustl(fname)), &
2038 call store_error(
'Optional maw budget keyword must be '// &
2039 'followed by fileout.')
2042 call this%parser%GetStringCaps(keyword)
2043 if (keyword ==
'FILEOUT')
then
2044 call this%parser%GetString(fname)
2045 call assign_iounit(this%ibudcsv, this%inunit,
"BUDGETCSV fileout")
2046 call openfile(this%ibudcsv, this%iout, fname,
'CSV', &
2047 filstat_opt=
'REPLACE')
2048 write (this%iout, fmtmawbin)
'BUDGET CSV', trim(adjustl(fname)), &
2051 call store_error(
'OPTIONAL BUDGETCSV KEYWORD MUST BE FOLLOWED BY &
2054 case (
'FLOWING_WELLS')
2055 this%iflowingwells = 1
2056 write (this%iout, fmtflowingwells)
2057 case (
'SHUTDOWN_THETA')
2058 this%theta = this%parser%GetDouble()
2059 write (this%iout, fmtshutdown)
'THETA', this%theta
2060 case (
'SHUTDOWN_KAPPA')
2061 this%kappa = this%parser%GetDouble()
2062 write (this%iout, fmtshutdown)
'KAPPA', this%kappa
2065 write (this%iout,
'(4x,A)')
'MOVER OPTION ENABLED'
2066 case (
'NO_WELL_STORAGE')
2068 write (this%iout, fmtnostoragewells)
2069 case (
'NON_VERTICAL_WELLS')
2071 write (this%iout,
'(4x,a)') &
2072 'NON-VERTICAL (SLANTED) MULTI-AQUIFER WELL CONNECTIONS WILL BE '// &
2073 'SIMULATED. SCREEN LENGTHS FOR CONNECTIONS LISTED IN THE ANGLEDATA '// &
2074 'BLOCK WILL BE USED TO CALCULATE THE SATURATED CONDUCTANCE.'
2075 case (
'FLOW_CORRECTION')
2076 this%correct_flow = .true.
2077 write (this%iout,
'(4x,a,/,4x,a)') &
2078 'MAW-GWF FLOW CORRECTIONS WILL BE APPLIED WHEN MAW HEADS ARE BELOW', &
2079 'OR GWF HEADS IN CONNECTED CELLS ARE BELOW THE CELL BOTTOM.'
2080 case (
'MAW_FLOW_REDUCE_CSV')
2081 call this%parser%GetStringCaps(keyword)
2082 if (keyword ==
'FILEOUT')
then
2083 call this%parser%GetString(fname)
2084 call this%maw_redflow_csv_init(fname)
2086 call store_error(
'OPTIONAL MAW_FLOW_REDUCE_CSV KEYWORD MUST BE &
2087 &FOLLOWED BY FILEOUT')
2094 case (
'DEV_PEACEMAN_EFFECTIVE_RADIUS')
2095 call this%parser%DevOpt()
2097 write (this%iout,
'(4x,a)') &
2098 'EFFECTIVE RADIUS FOR STRUCTURED GRIDS WILL BE CALCULATED &
2099 &USING PEACEMAN 1983'
2113 class(
mawtype),
intent(inout) :: this
2117 call this%obs%obs_ar()
2120 if (this%inewton > 0)
then
2121 this%satomega =
dem6
2125 call this%maw_allocate_arrays()
2128 call this%read_initial_attr()
2131 if (this%imover /= 0)
then
2132 allocate (this%pakmvrobj)
2133 call this%pakmvrobj%ar(this%nmawwells, this%nmawwells, this%memoryPath)
2145 class(
mawtype),
intent(inout) :: this
2147 character(len=LINELENGTH) :: title
2148 character(len=LINELENGTH) :: line
2149 character(len=LINELENGTH) :: text
2150 character(len=16) :: csteady
2152 logical :: endOfBlock
2153 integer(I4B) :: ierr
2154 integer(I4B) :: node
2156 integer(I4B) :: ntabcols
2157 integer(I4B) :: ntabrows
2158 integer(I4B) :: imaw
2159 integer(I4B) :: ibnd
2161 integer(I4B) :: jpos
2162 integer(I4B) :: iheadlimit_warning
2164 character(len=*),
parameter :: fmtblkerr = &
2165 &
"('Looking for BEGIN PERIOD iper. Found ', a, ' instead.')"
2166 character(len=*),
parameter :: fmtlsp = &
2167 &
"(1X,/1X,'REUSING ',A,'S FROM LAST STRESS PERIOD')"
2170 iheadlimit_warning = 0
2173 this%imawiss = this%gwfiss
2176 if (this%imawissopt == 1)
then
2181 this%nbound = this%maxbound
2185 if (this%inunit == 0)
return
2188 if (this%ionper <
kper)
then
2191 call this%parser%GetBlock(
'PERIOD', isfound, ierr, &
2192 supportopenclose=.true., &
2193 blockrequired=.false.)
2197 call this%read_check_ionper()
2203 this%ionper =
nper + 1
2206 call this%parser%GetCurrentLine(line)
2207 write (
errmsg, fmtblkerr) adjustl(trim(line))
2214 if (this%ionper ==
kper)
then
2217 if (this%iprpak /= 0)
then
2220 title = trim(adjustl(this%text))//
' PACKAGE ('// &
2221 trim(adjustl(this%packName))//
') DATA FOR PERIOD'
2222 write (title,
'(a,1x,i6)') trim(adjustl(title)),
kper
2223 call table_cr(this%inputtab, this%packName, title)
2224 call this%inputtab%table_df(1, 5, this%iout, finalize=.false.)
2226 call this%inputtab%initialize_column(text, 10, alignment=tabcenter)
2228 call this%inputtab%initialize_column(text, 20, alignment=tableft)
2230 write (text,
'(a,1x,i6)')
'VALUE', n
2231 call this%inputtab%initialize_column(text, 15, alignment=tabcenter)
2238 call this%parser%GetNextLine(endofblock)
2239 if (endofblock)
exit
2241 imaw = this%parser%GetInteger()
2242 if (imaw < 1 .or. imaw > this%nmawwells)
then
2243 write (
errmsg,
'(2(a,1x),i0,a)') &
2244 'IMAW must be greater than 0 and', &
2245 'less than or equal to ', this%nmawwells,
'.'
2251 call this%maw_set_stressperiod(imaw, iheadlimit_warning)
2254 if (this%iprpak /= 0)
then
2255 call this%parser%GetCurrentLine(line)
2256 call this%inputtab%line_to_columns(line)
2259 if (this%iprpak /= 0)
then
2260 call this%inputtab%finalize_table()
2265 write (this%iout, fmtlsp) trim(this%filtyp)
2269 if (iheadlimit_warning > 0)
then
2270 write (
warnmsg,
'(a,a,a,1x,a,1x,a)') &
2271 "HEAD_LIMIT in '", trim(this%packName),
"' was below the well bottom", &
2272 "for one or more multi-aquifer well(s). This may result in", &
2273 "convergence failures for some models."
2279 call this%parser%StoreErrorUnit()
2283 if (this%check_attr /= 0)
then
2284 call this%maw_check_attributes()
2287 if (this%iprpak == 1)
then
2288 if (this%imawiss /= 0)
then
2289 csteady =
'STEADY-STATE '
2291 csteady =
'TRANSIENT '
2295 title = trim(adjustl(this%text))//
' PACKAGE ('// &
2296 trim(adjustl(this%packName))//
') '//trim(adjustl(csteady))// &
2297 ' RATE DATA FOR PERIOD'
2298 write (title,
'(a,1x,i6)') trim(adjustl(title)),
kper
2300 call table_cr(this%inputtab, this%packName, title)
2301 call this%inputtab%table_df(this%nmawwells, ntabcols, this%iout)
2303 call this%inputtab%initialize_column(text, 10, alignment=tabcenter)
2305 call this%inputtab%initialize_column(text, 12, alignment=tabcenter)
2307 call this%inputtab%initialize_column(text, 12, alignment=tabcenter)
2308 text =
'SPECIFIED HEAD'
2309 call this%inputtab%initialize_column(text, 12, alignment=tabcenter)
2310 text =
'PUMP ELEVATION'
2311 call this%inputtab%initialize_column(text, 12, alignment=tabcenter)
2312 text =
'REDUCTION LENGTH'
2313 call this%inputtab%initialize_column(text, 12, alignment=tabcenter)
2314 do n = 1, this%nmawwells
2315 call this%inputtab%add_term(n)
2316 call this%inputtab%add_term(this%status(n))
2317 call this%inputtab%add_term(this%rate(n))
2318 if (this%iboundpak(n) < 0)
then
2319 call this%inputtab%add_term(this%well_head(n))
2321 call this%inputtab%add_term(
' ')
2323 call this%inputtab%add_term(this%pumpelev(n))
2324 if (this%reduction_length(n) /= dep20)
then
2325 call this%inputtab%add_term(this%reduction_length(n))
2327 call this%inputtab%add_term(
' ')
2332 if (this%iflowingwells > 0)
then
2335 title = trim(adjustl(this%text))//
' PACKAGE ('// &
2336 trim(adjustl(this%packName))//
') '//trim(adjustl(csteady))// &
2337 ' FLOWING WELL DATA FOR PERIOD'
2338 write (title,
'(a,1x,i6)') trim(adjustl(title)),
kper
2341 do n = 1, this%nmawwells
2342 if (this%fwcond(n) > dzero)
then
2343 ntabrows = ntabrows + 1
2346 if (ntabrows > 0)
then
2347 call table_cr(this%inputtab, this%packName, title)
2348 call this%inputtab%table_df(ntabrows, ntabcols, this%iout)
2350 call this%inputtab%initialize_column(text, 10, alignment=tabcenter)
2352 call this%inputtab%initialize_column(text, 12, alignment=tabcenter)
2354 call this%inputtab%initialize_column(text, 12, alignment=tabcenter)
2355 text =
'REDUCTION LENGTH'
2356 call this%inputtab%initialize_column(text, 12, alignment=tabcenter)
2357 do n = 1, this%nmawwells
2358 if (this%fwcond(n) > dzero)
then
2359 call this%inputtab%add_term(n)
2360 call this%inputtab%add_term(this%fwelev(n))
2361 call this%inputtab%add_term(this%fwcond(n))
2362 call this%inputtab%add_term(this%fwrlen(n))
2369 title = trim(adjustl(this%text))//
' PACKAGE ('// &
2370 trim(adjustl(this%packName))//
') '//trim(adjustl(csteady))// &
2371 ' WELL SHUTOFF DATA FOR PERIOD'
2372 write (title,
'(a,1x,i6)') trim(adjustl(title)),
kper
2375 do n = 1, this%nmawwells
2376 if (this%shutofflevel(n) /= dep20)
then
2377 ntabrows = ntabrows + 1
2380 if (ntabrows > 0)
then
2381 call table_cr(this%inputtab, this%packName, title)
2382 call this%inputtab%table_df(ntabrows, ntabcols, this%iout)
2384 call this%inputtab%initialize_column(text, 10, alignment=tabcenter)
2386 call this%inputtab%initialize_column(text, 12, alignment=tabcenter)
2388 call this%inputtab%initialize_column(text, 12, alignment=tabcenter)
2390 call this%inputtab%initialize_column(text, 12, alignment=tabcenter)
2391 do n = 1, this%nmawwells
2392 if (this%shutofflevel(n) /= dep20)
then
2393 call this%inputtab%add_term(n)
2394 call this%inputtab%add_term(this%shutofflevel(n))
2395 call this%inputtab%add_term(this%shutoffmin(n))
2396 call this%inputtab%add_term(this%shutoffmax(n))
2405 do n = 1, this%nmawwells
2406 do j = 1, this%ngwfnodes(n)
2407 jpos = this%get_jpos(n, j)
2408 node = this%get_gwfnode(n, j)
2409 this%nodelist(ibnd) = node
2410 this%bound(1, ibnd) = this%xnewpak(n)
2411 this%bound(2, ibnd) = this%satcond(jpos)
2412 this%bound(3, ibnd) = this%botscrn(jpos)
2413 if (this%iboundpak(n) > 0)
then
2414 this%bound(4, ibnd) = this%rate(n)
2416 this%bound(4, ibnd) = dzero
2433 integer(I4B) :: ibnd
2436 call this%TsManager%ad()
2441 if (this%naux > 0)
then
2443 do n = 1, this%nmawwells
2444 do j = 1, this%ngwfnodes(n)
2445 do jj = 1, this%naux
2446 if (this%noupdateauxvar(jj) /= 0) cycle
2447 this%auxvar(jj, ibnd) = this%mauxvar(jj, n)
2455 do n = 1, this%nmawwells
2456 this%xoldpak(n) = this%xnewpak(n)
2457 this%xoldsto(n) = this%xsto(n)
2458 if (this%iboundpak(n) < 0)
then
2459 this%xnewpak(n) = this%well_head(n)
2465 if (
kper == 1 .and.
kstp == 1)
then
2466 do n = 1, this%nmawwells
2467 if (this%fwcond(n) >
dzero)
then
2468 if (this%xoldsto(n) > this%fwelev(n))
then
2469 this%xoldsto(n) = this%fwelev(n)
2476 this%ishutoffcnt = 0
2479 if (this%imover == 1)
then
2480 call this%pakmvrobj%ad()
2486 call this%obs%obs_ad()
2499 call this%maw_cfupdate()
2504 subroutine maw_fc(this, rhs, ia, idxglo, matrix_sln)
2509 real(DP),
dimension(:),
intent(inout) :: rhs
2510 integer(I4B),
dimension(:),
intent(in) :: ia
2511 integer(I4B),
dimension(:),
intent(in) :: idxglo
2517 integer(I4B) :: iloc
2518 integer(I4B) :: isymloc
2519 integer(I4B) :: igwfnode
2520 integer(I4B) :: iposd
2521 integer(I4B) :: iposoffd
2522 integer(I4B) :: isymnode
2523 integer(I4B) :: ipossymd
2524 integer(I4B) :: ipossymoffd
2525 integer(I4B) :: jpos
2526 integer(I4B) :: icflow
2541 if (this%imover == 1)
then
2542 call this%pakmvrobj%fc()
2547 do n = 1, this%nmawwells
2548 iloc = this%idxlocnode(n)
2551 if (this%iboundpak(n) < 0)
then
2552 this%xnewpak(n) = this%well_head(n)
2554 hmaw = this%xnewpak(n)
2557 if (this%iboundpak(n) == 0)
then
2558 this%ratesim(n) =
dzero
2560 call this%maw_calculate_wellq(n, hmaw, rate)
2561 this%ratesim(n) = rate
2562 rhs(iloc) = rhs(iloc) - rate
2565 iposd = this%idxdglo(idx)
2570 if (this%iflowingwells > 0)
then
2571 if (this%fwcond(n) >
dzero)
then
2573 tp = bt + this%fwrlen(n)
2575 cfw = scale * this%fwcond(n)
2576 this%ifwdischarge(n) = 0
2577 if (cfw >
dzero)
then
2578 this%ifwdischarge(n) = 1
2581 this%fwcondsim(n) = cfw
2582 call matrix_sln%add_value_pos(iposd, -cfw)
2583 rhs(iloc) = rhs(iloc) - cfw * bt
2584 ratefw = cfw * (bt - hmaw)
2589 if (this%imawiss /= 1)
then
2590 if (this%ifwdischarge(n) /= 1)
then
2591 call matrix_sln%add_value_pos(iposd, -this%area(n) /
delt)
2592 rhs(iloc) = rhs(iloc) - (this%area(n) * this%xoldsto(n) /
delt)
2594 cterm = this%xoldsto(n) - this%fwelev(n)
2595 rhs(iloc) = rhs(iloc) - (this%area(n) * cterm /
delt)
2601 if (this%imover == 1)
then
2602 rhs(iloc) = rhs(iloc) - this%pakmvrobj%get_qfrommvr(n)
2606 call this%pakmvrobj%accumulate_qformvr(n, -rate)
2610 call this%pakmvrobj%accumulate_qformvr(n, -ratefw)
2616 do j = 1, this%ngwfnodes(n)
2617 if (this%iboundpak(n) /= 0)
then
2618 jpos = this%get_jpos(n, j)
2619 igwfnode = this%get_gwfnode(n, j)
2620 hgwf = this%xnew(igwfnode)
2623 call this%maw_calculate_conn_terms(n, j, icflow, cmaw, cterm, term, &
2625 this%simcond(jpos) = cmaw
2628 iposd = this%idxdglo(idx)
2629 iposoffd = this%idxoffdglo(idx)
2630 call matrix_sln%add_value_pos(iposd, -term)
2631 call matrix_sln%set_value_pos(iposoffd, term)
2634 rhs(iloc) = rhs(iloc) - cterm
2637 isymnode = this%get_gwfnode(n, j)
2638 isymloc = ia(isymnode)
2639 ipossymd = this%idxsymdglo(idx)
2640 ipossymoffd = this%idxsymoffdglo(idx)
2641 call matrix_sln%add_value_pos(ipossymd, -term)
2642 call matrix_sln%set_value_pos(ipossymoffd, term)
2645 rhs(isymnode) = rhs(isymnode) + cterm
2656 subroutine maw_fn(this, rhs, ia, idxglo, matrix_sln)
2659 real(DP),
dimension(:),
intent(inout) :: rhs
2660 integer(I4B),
dimension(:),
intent(in) :: ia
2661 integer(I4B),
dimension(:),
intent(in) :: idxglo
2667 integer(I4B) :: iloc
2668 integer(I4B) :: isymloc
2669 integer(I4B) :: igwfnode
2670 integer(I4B) :: iposd
2671 integer(I4B) :: iposoffd
2672 integer(I4B) :: isymnode
2673 integer(I4B) :: ipossymd
2674 integer(I4B) :: ipossymoffd
2675 integer(I4B) :: jpos
2676 integer(I4B) :: icflow
2697 do n = 1, this%nmawwells
2698 iloc = this%idxlocnode(n)
2699 hmaw = this%xnewpak(n)
2702 if (this%iboundpak(n) /= 0)
then
2703 iposd = this%idxdglo(idx)
2706 rate = this%ratesim(n)
2709 call this%maw_calculate_wellq(n, hmaw +
dem4, rate2)
2710 drterm = (rate2 - rate) /
dem4
2713 call matrix_sln%add_value_pos(iposd, drterm)
2714 rhs(iloc) = rhs(iloc) + drterm * hmaw
2717 if (this%iflowingwells > 0)
then
2718 if (this%fwcond(n) >
dzero)
then
2720 tp = bt + this%fwrlen(n)
2722 cfw = scale * this%fwcond(n)
2723 this%ifwdischarge(n) = 0
2724 if (cfw >
dzero)
then
2725 this%ifwdischarge(n) = 1
2727 this%fwcondsim(n) = cfw
2728 rate = cfw * (bt - hmaw)
2734 drterm = -(cfw + this%fwcond(n) * derv * (hmaw - bt))
2737 call matrix_sln%add_value_pos(iposd, &
2738 -this%fwcond(n) * derv * (hmaw - bt))
2739 rhs(iloc) = rhs(iloc) - rterm + drterm * hmaw
2746 do j = 1, this%ngwfnodes(n)
2747 if (this%iboundpak(n) /= 0)
then
2748 jpos = this%get_jpos(n, j)
2749 igwfnode = this%get_gwfnode(n, j)
2750 hgwf = this%xnew(igwfnode)
2753 iposd = this%idxdglo(idx)
2754 iposoffd = this%idxoffdglo(idx)
2757 isymnode = this%get_gwfnode(n, j)
2758 isymloc = ia(isymnode)
2759 ipossymd = this%idxsymdglo(idx)
2760 ipossymoffd = this%idxsymoffdglo(idx)
2763 call this%maw_calculate_conn_terms(n, j, icflow, cmaw, cterm, term, &
2767 if (hmaw > hgwf)
then
2768 if (icflow /= 0)
then
2769 rhsterm = term2 * hgwf + term * hmaw
2770 rhs(iloc) = rhs(iloc) + rhsterm
2771 rhs(isymnode) = rhs(isymnode) - rhsterm
2772 if (this%iboundpak(n) > 0)
then
2773 call matrix_sln%add_value_pos(iposd, term)
2774 call matrix_sln%add_value_pos(iposoffd, term2)
2776 call matrix_sln%add_value_pos(ipossymd, -term2)
2777 call matrix_sln%add_value_pos(ipossymoffd, -term)
2779 rhs(iloc) = rhs(iloc) + term * hmaw
2780 rhs(isymnode) = rhs(isymnode) - term * hmaw
2781 call matrix_sln%add_value_pos(iposd, term)
2782 if (this%ibound(igwfnode) > 0)
then
2783 call matrix_sln%add_value_pos(ipossymoffd, -term)
2789 if (icflow /= 0)
then
2790 rhsterm = term2 * hmaw + term * hgwf
2791 rhs(iloc) = rhs(iloc) + rhsterm
2792 rhs(isymnode) = rhs(isymnode) - rhsterm
2793 if (this%iboundpak(n) > 0)
then
2794 call matrix_sln%add_value_pos(iposd, term2)
2795 call matrix_sln%add_value_pos(iposoffd, term)
2797 call matrix_sln%add_value_pos(ipossymd, -term)
2798 call matrix_sln%add_value_pos(ipossymoffd, -term2)
2800 rhs(iloc) = rhs(iloc) + term * hgwf
2801 rhs(isymnode) = rhs(isymnode) - term * hgwf
2802 if (this%iboundpak(n) > 0)
then
2803 call matrix_sln%add_value_pos(iposoffd, term)
2805 call matrix_sln%add_value_pos(ipossymd, -term)
2819 subroutine maw_nur(this, neqpak, x, xtemp, dx, inewtonur, dxmax, locmax)
2821 class(
mawtype),
intent(inout) :: this
2822 integer(I4B),
intent(in) :: neqpak
2823 real(DP),
dimension(neqpak),
intent(inout) :: x
2824 real(DP),
dimension(neqpak),
intent(in) :: xtemp
2825 real(DP),
dimension(neqpak),
intent(inout) :: dx
2826 integer(I4B),
intent(inout) :: inewtonur
2827 real(DP),
intent(inout) :: dxmax
2828 integer(I4B),
intent(inout) :: locmax
2836 do n = 1, this%nmawwells
2837 if (this%iboundpak(n) < 1) cycle
2842 if (x(n) < botw)
then
2846 if (abs(dxx) > abs(dxmax))
then
2864 class(
mawtype),
intent(inout) :: this
2865 real(DP),
dimension(:),
intent(in) :: x
2866 real(DP),
dimension(:),
contiguous,
intent(inout) :: flowja
2867 integer(I4B),
optional,
intent(in) :: iadv
2873 integer(I4B) :: ibnd
2881 call this%maw_cfupdate()
2885 call this%BndType%bnd_cq(x, flowja, iadv=1)
2888 do n = 1, this%nmawwells
2889 this%qout(n) = dzero
2890 this%qsto(n) = dzero
2891 if (this%iflowingwells > 0)
then
2894 if (this%iboundpak(n) == 0)
then
2899 hmaw = this%xnewpak(n)
2903 rrate = this%ratesim(n)
2906 if (rrate < dzero)
then
2907 this%qout(n) = rrate
2911 if (this%iflowingwells > 0)
then
2912 if (this%fwcond(n) > dzero)
then
2913 cfw = this%fwcondsim(n)
2914 this%xsto(n) = this%fwelev(n)
2915 rrate = cfw * (this%fwelev(n) - hmaw)
2919 this%qout(n) = this%qout(n) + rrate
2924 if (this%imawiss /= 1)
then
2925 rrate = -this%area(n) * (this%xsto(n) - this%xoldsto(n)) /
delt
2926 this%qsto(n) = rrate
2932 do n = 1, this%nmawwells
2933 hmaw = this%xnewpak(n)
2934 this%qconst(n) = dzero
2935 do j = 1, this%ngwfnodes(n)
2936 rrate = -this%simvals(ibnd)
2937 this%qleak(ibnd) = rrate
2938 if (this%iboundpak(n) < 0)
then
2939 this%qconst(n) = this%qconst(n) - rrate
2942 if (-rrate < dzero)
then
2943 this%qout(n) = this%qout(n) - rrate
2952 if (this%iboundpak(n) < 0)
then
2955 this%qconst(n) = this%qconst(n) - this%ratesim(n)
2958 if (this%iflowingwells > 0)
then
2959 this%qconst(n) = this%qconst(n) - this%qfw(n)
2963 if (this%imawiss /= 1)
then
2964 this%qconst(n) = this%qconst(n) - this%qsto(n)
2970 call this%maw_fill_budobj()
2978 integer(I4B),
intent(in) :: icbcfl
2979 integer(I4B),
intent(in) :: ibudfl
2980 integer(I4B),
intent(in) :: icbcun
2981 integer(I4B),
dimension(:),
optional,
intent(in) :: imap
2984 call this%BndType%bnd_ot_model_flows(icbcfl, ibudfl, icbcun, this%imap)
2992 integer(I4B),
intent(in) :: icbcfl
2993 integer(I4B),
intent(in) :: ibudfl
2994 integer(I4B) :: ibinun
2998 if (this%ibudgetout /= 0)
then
2999 ibinun = this%ibudgetout
3001 if (icbcfl == 0) ibinun = 0
3002 if (ibinun > 0)
then
3003 call this%budobj%save_flows(this%dis, ibinun,
kstp,
kper,
delt, &
3008 if (ibudfl /= 0 .and. this%iprflow /= 0)
then
3009 call this%budobj%write_flowtable(this%dis,
kstp,
kper)
3020 integer(I4B),
intent(in) :: idvsave
3021 integer(I4B),
intent(in) :: idvprint
3022 integer(I4B) :: ibinun
3029 if (this%iheadout /= 0)
then
3030 ibinun = this%iheadout
3032 if (idvsave == 0) ibinun = 0
3035 if (ibinun > 0)
then
3036 do n = 1, this%nmawwells
3039 if (this%iboundpak(n) == 0)
then
3041 else if (d <= dzero)
then
3046 call ulasav(this%dbuff,
' HEAD', &
3048 this%nmawwells, 1, 1, ibinun)
3052 if (idvprint /= 0 .and. this%iprhed /= 0)
then
3055 call this%headtab%set_kstpkper(
kstp,
kper)
3058 do n = 1, this%nmawwells
3059 if (this%inamedbound == 1)
then
3060 call this%headtab%add_term(this%cmawname(n))
3062 call this%headtab%add_term(n)
3063 call this%headtab%add_term(this%xnewpak(n))
3075 integer(I4B),
intent(in) :: kstp
3076 integer(I4B),
intent(in) :: kper
3077 integer(I4B),
intent(in) :: iout
3078 integer(I4B),
intent(in) :: ibudfl
3080 call this%budobj%write_budtable(kstp, kper, iout, ibudfl,
totim,
delt)
3093 call this%budobj%budgetobject_da()
3094 deallocate (this%budobj)
3095 nullify (this%budobj)
3098 if (this%iprhed > 0)
then
3099 call this%headtab%table_da()
3100 deallocate (this%headtab)
3101 nullify (this%headtab)
3105 call mem_deallocate(this%cmawbudget,
'CMAWBUDGET', this%memoryPath)
3198 nullify (this%gwfiss)
3201 call this%BndType%bnd_da()
3208 class(
mawtype),
intent(inout) :: this
3211 this%listlabel = trim(this%filtyp)//
' NO.'
3212 if (this%dis%ndim == 3)
then
3213 write (this%listlabel,
'(a, a7)') trim(this%listlabel),
'LAYER'
3214 write (this%listlabel,
'(a, a7)') trim(this%listlabel),
'ROW'
3215 write (this%listlabel,
'(a, a7)') trim(this%listlabel),
'COL'
3216 elseif (this%dis%ndim == 2)
then
3217 write (this%listlabel,
'(a, a7)') trim(this%listlabel),
'LAYER'
3218 write (this%listlabel,
'(a, a7)') trim(this%listlabel),
'CELL2D'
3220 write (this%listlabel,
'(a, a7)') trim(this%listlabel),
'NODE'
3222 write (this%listlabel,
'(a, a16)') trim(this%listlabel),
'STRESS RATE'
3223 if (this%inamedbound == 1)
then
3224 write (this%listlabel,
'(a, a16)') trim(this%listlabel),
'BOUNDARY NAME'
3236 integer(I4B),
pointer :: neq
3237 integer(I4B),
dimension(:),
pointer,
contiguous :: ibound
3238 real(DP),
dimension(:),
pointer,
contiguous :: xnew
3239 real(DP),
dimension(:),
pointer,
contiguous :: xold
3240 real(DP),
dimension(:),
pointer,
contiguous :: flowja
3243 integer(I4B) :: istart, iend
3246 call this%BndType%set_pointers(neq, ibound, xnew, xold, flowja)
3251 istart = this%dis%nodes + this%ioffset + 1
3252 iend = istart + this%nmawwells - 1
3253 this%iboundpak => this%ibound(istart:iend)
3254 this%xnewpak => this%xnew(istart:iend)
3255 call mem_checkin(this%xnewpak,
'HEAD', this%memoryPath,
'X', &
3256 this%memoryPathModel)
3257 call mem_allocate(this%xoldpak, this%nmawwells,
'XOLDPAK', this%memoryPath)
3260 do n = 1, this%nmawwells
3261 this%xnewpak(n) =
dep20
3285 integer(I4B) :: indx
3289 call this%obs%StoreObsType(
'head', .false., indx)
3294 call this%obs%StoreObsType(
'from-mvr', .false., indx)
3299 call this%obs%StoreObsType(
'maw', .true., indx)
3304 call this%obs%StoreObsType(
'rate', .true., indx)
3309 call this%obs%StoreObsType(
'rate-to-mvr', .true., indx)
3314 call this%obs%StoreObsType(
'fw-rate', .true., indx)
3319 call this%obs%StoreObsType(
'fw-to-mvr', .true., indx)
3324 call this%obs%StoreObsType(
'storage', .true., indx)
3329 call this%obs%StoreObsType(
'constant', .true., indx)
3334 call this%obs%StoreObsType(
'conductance', .true., indx)
3339 call this%obs%StoreObsType(
'fw-conductance', .true., indx)
3355 integer(I4B) :: jpos
3363 if (this%obs%npakobs > 0)
then
3364 call this%obs%obs_bd_clear()
3365 do i = 1, this%obs%npakobs
3366 obsrv => this%obs%pakobs(i)%obsrv
3367 do j = 1, obsrv%indxbnds_count
3369 jj = obsrv%indxbnds(j)
3370 select case (obsrv%ObsTypeId)
3372 if (this%iboundpak(jj) /= 0)
then
3373 v = this%xnewpak(jj)
3376 if (this%iboundpak(jj) /= 0)
then
3377 if (this%imover == 1)
then
3378 v = this%pakmvrobj%get_qfrommvr(jj)
3383 if (this%iboundpak(n) /= 0)
then
3387 if (this%iboundpak(jj) /= 0)
then
3388 v = this%ratesim(jj)
3389 if (v <
dzero .and. this%qout(jj) <
dzero)
then
3390 qfact = v / this%qout(jj)
3391 if (this%imover == 1)
then
3392 v = v + this%pakmvrobj%get_qtomvr(jj) * qfact
3396 case (
'RATE-TO-MVR')
3397 if (this%iboundpak(jj) /= 0)
then
3398 if (this%imover == 1)
then
3399 v = this%ratesim(jj)
3401 if (v <
dzero .and. this%qout(jj) <
dzero)
then
3402 qfact = v / this%qout(jj)
3404 v = this%pakmvrobj%get_qtomvr(jj) * qfact
3411 if (this%iboundpak(jj) /= 0 .and. this%iflowingwells > 0)
then
3412 hmaw = this%xnewpak(jj)
3413 cmaw = this%fwcondsim(jj)
3414 v = cmaw * (this%fwelev(jj) - hmaw)
3415 if (v <
dzero .and. this%qout(jj) <
dzero)
then
3416 qfact = v / this%qout(jj)
3417 if (this%imover == 1)
then
3418 v = v + this%pakmvrobj%get_qtomvr(jj) * qfact
3423 if (this%iboundpak(jj) /= 0 .and. this%iflowingwells > 0)
then
3424 if (this%imover == 1)
then
3425 hmaw = this%xnewpak(jj)
3426 cmaw = this%fwcondsim(jj)
3427 v = cmaw * (this%fwelev(jj) - hmaw)
3429 if (v <
dzero .and. this%qout(jj) <
dzero)
then
3430 qfact = v / this%qout(jj)
3432 v = this%pakmvrobj%get_qtomvr(jj) * qfact
3439 if (this%iboundpak(jj) /= 0 .and. this%imawissopt /= 1)
then
3443 if (this%iboundpak(jj) /= 0)
then
3446 case (
'CONDUCTANCE')
3448 if (this%iboundpak(n) /= 0)
then
3449 nn = jj - this%iaconn(n) + 1
3450 jpos = this%get_jpos(n, nn)
3451 v = this%simcond(jpos)
3453 case (
'FW-CONDUCTANCE')
3454 if (this%iboundpak(jj) /= 0)
then
3455 v = this%fwcondsim(jj)
3458 errmsg =
'Unrecognized observation type: '//trim(obsrv%ObsTypeId)
3461 call this%obs%SaveOneSimval(obsrv, v)
3472 if (this%ioutredflowcsv > 0)
then
3473 call this%maw_redflow_csv_write()
3485 class(
mawtype),
intent(inout) :: this
3493 character(len=LENBOUNDNAME) :: bname
3497 10
format(
'Boundary "', a,
'" for observation "', a, &
3498 '" is invalid in package "', a,
'"')
3501 do i = 1, this%obs%npakobs
3502 obsrv => this%obs%pakobs(i)%obsrv
3505 nn1 = obsrv%NodeNumber
3507 bname = obsrv%FeatureName
3508 if (bname /=
'')
then
3513 if (obsrv%ObsTypeId ==
'MAW' .or. &
3514 obsrv%ObsTypeId ==
'CONDUCTANCE')
then
3515 do j = 1, this%nmawwells
3516 do jj = this%iaconn(j), this%iaconn(j + 1) - 1
3517 if (this%boundname(jj) == bname)
then
3519 call obsrv%AddObsIndex(jj)
3524 do j = 1, this%nmawwells
3525 if (this%cmawname(j) == bname)
then
3527 call obsrv%AddObsIndex(j)
3531 if (.not. jfound)
then
3533 trim(bname), trim(obsrv%Name), trim(this%packName)
3538 if (obsrv%indxbnds_count == 0)
then
3539 if (obsrv%ObsTypeId ==
'MAW' .or. &
3540 obsrv%ObsTypeId ==
'CONDUCTANCE')
then
3541 nn2 = obsrv%NodeNumber2
3542 j = this%iaconn(nn1) + nn2 - 1
3543 call obsrv%AddObsIndex(j)
3545 call obsrv%AddObsIndex(nn1)
3548 errmsg =
'Programming error in maw_rp_obs'
3555 if (obsrv%ObsTypeId ==
'HEAD')
then
3556 if (obsrv%indxbnds_count > 1)
then
3557 write (
errmsg,
'(a,3(1x,a))') &
3558 trim(adjustl(obsrv%ObsTypeId)), &
3559 'for observation', trim(adjustl(obsrv%Name)), &
3560 'must be assigned to a multi-aquifer well with a unique boundname.'
3566 if (obsrv%ObsTypeId ==
'MAW' .or. &
3567 obsrv%ObsTypeId ==
'CONDUCTANCE')
then
3568 do j = 1, obsrv%indxbnds_count
3569 nn1 = obsrv%indxbnds(j)
3571 nn2 = nn1 - this%iaconn(n) + 1
3572 jj = this%iaconn(n + 1) - this%iaconn(n)
3573 if (nn1 < 1 .or. nn1 > this%maxbound)
then
3574 write (
errmsg,
'(3(a,1x),i0,1x,a,i0,a)') &
3575 trim(adjustl(obsrv%ObsTypeId)), &
3576 'multi-aquifer well connection number must be greater than 0', &
3577 'and less than', jj,
'(specified value is ', nn2,
').'
3582 do j = 1, obsrv%indxbnds_count
3583 nn1 = obsrv%indxbnds(j)
3584 if (nn1 < 1 .or. nn1 > this%nmawwells)
then
3585 write (
errmsg,
'(3(a,1x),i0,1x,a,i0,a)') &
3586 trim(adjustl(obsrv%ObsTypeId)), &
3587 'multi-aquifer well must be greater than 0 ', &
3588 'and less than or equal to', this%nmawwells, &
3589 '(specified value is ', nn1,
').'
3614 integer(I4B),
intent(in) :: inunitobs
3615 integer(I4B),
intent(in) :: iout
3617 integer(I4B) :: nn1, nn2
3618 integer(I4B) :: icol, istart, istop
3619 character(len=LINELENGTH) :: string
3620 character(len=LENBOUNDNAME) :: bndname
3623 string = obsrv%IDstring
3631 obsrv%FeatureName = bndname
3633 if (obsrv%ObsTypeId ==
'MAW' .or. &
3634 obsrv%ObsTypeId ==
'CONDUCTANCE')
then
3636 if (len_trim(bndname) < 1 .and. nn2 < 0)
then
3637 write (
errmsg,
'(a,1x,a,a,1x,a,1x,a)') &
3638 'For observation type', trim(adjustl(obsrv%ObsTypeId)), &
3639 ', ID given as an integer and not as boundname,', &
3640 'but ID2 (icon) is missing. Either change ID to valid', &
3641 'boundname or supply valid entry for ID2.'
3645 obsrv%FeatureName = bndname
3649 obsrv%NodeNumber2 = nn2
3654 obsrv%NodeNumber = nn1
3664 class(
mawtype),
intent(inout) :: this
3665 character(len=*),
intent(in) :: fname
3667 character(len=*),
parameter :: fmtredflowcsv = &
3668 "(4x, 'MAW REDUCED FLOW INFORMATION WILL BE SAVED TO FILE: ', a, /4x, &
3669 &'OPENED ON UNIT: ', I0)"
3671 this%ioutredflowcsv =
getunit()
3672 call openfile(this%ioutredflowcsv, this%iout, fname,
'CSV', &
3673 filstat_opt=
'REPLACE')
3674 write (this%iout, fmtredflowcsv) trim(adjustl(fname)), &
3676 write (this%ioutredflowcsv,
'(a)') &
3677 'time,period,step,MAWnumber,rate-requested,rate-actual,maw-reduction'
3686 class(
mawtype),
intent(inout) :: this
3693 do n = 1, this%nmawwells
3696 if (this%status(n) .ne.
'ACTIVE')
then
3699 v = this%rate(n) - this%ratesim(n)
3700 if (abs(v) >
dem9)
then
3701 write (this%ioutredflowcsv,
'(*(G0,:,","))') &
3712 class(
mawtype),
intent(inout) :: this
3713 integer(I4B),
intent(in) :: i
3714 integer(I4B),
intent(in) :: j
3715 integer(I4B),
intent(in) :: node
3717 integer(I4B) :: iTcontrastErr
3718 integer(I4B) :: jpos
3722 real(DP) :: sqrtk11k22
3730 real(DP) :: Tcontrast
3755 jpos = this%get_jpos(i, j)
3758 k11 = this%gwfk11(node)
3759 if (this%gwfik22 == 0)
then
3760 k22 = this%gwfk11(node)
3762 k22 = this%gwfk22(node)
3764 sqrtk11k22 = sqrt(k11 * k22)
3767 gwftop = this%dis%top(node)
3768 gwfbot = this%dis%bot(node)
3769 tthka = gwftop - gwfbot
3770 gwfsat = this%gwfsat(node)
3774 topw = this%topscrn(jpos)
3775 botw = this%botscrn(jpos)
3779 if (gwftop == topw .and. gwfbot == botw)
then
3780 if (this%icelltype(node) == 0)
then
3781 tthkw = tthkw * gwfsat
3782 tthka = tthka * gwfsat
3787 t2pi =
dtwopi * tthka * sqrtk11k22
3790 if (this%dis%ndim == 3 .and. this%ieffradopt /= 0)
then
3793 dx = sqrt(this%dis%area(node))
3797 eradius = 0.28_dp * ((yx4 * dx)**
dtwo + &
3800 area = this%dis%area(node)
3806 if (this%ieqn(i) == 1 .or. this%ieqn(i) == 3)
then
3807 lc1 = log(eradius / this%radius(i)) / t2pi
3811 if (this%ieqn(i) == 2 .or. this%ieqn(i) == 3)
then
3813 if (tthkw * hks >
dzero)
then
3814 tcontrast = (sqrtk11k22 * tthka) / (hks * tthkw)
3815 skin = (tcontrast -
done) * log(this%sradius(jpos) / this%radius(i))
3822 if (tcontrast <= 1 .and. this%ieqn(i) == 2)
then
3824 write (
errmsg,
'(a,g0,a,1x,i0,1x,a,1x,i0,a,4(1x,a))') &
3825 'Invalid calculated transmissivity contrast (', tcontrast, &
3826 ') for maw well', i,
'connection', j,
'.',
'This happens when the', &
3827 'skin transmissivity equals or exceeds the aquifer transmissivity.', &
3828 'Consider decreasing HK_SKIN for the connection or using the', &
3829 'CUMULATIVE or MEAN conductance equations.'
3838 if (this%ieqn(i) == 4)
then
3840 ravg =
dhalf * (this%radius(i) + this%sradius(jpos))
3841 slen = this%sradius(jpos) - this%radius(i)
3843 c = hks * pavg * tthkw / slen
3848 if (this%ieqn(i) < 4)
then
3849 if (lc1 + lc2 /=
dzero)
then
3850 c =
done / (lc1 + lc2)
3858 if (c <
dzero .and. itcontrasterr == 0)
then
3859 write (
errmsg,
'(a,g0,a,1x,i0,1x,a,1x,i0,a,4(1x,a))') &
3860 'Invalid calculated negative conductance (', c, &
3861 ') for maw well', i,
'connection', j,
'.',
'this happens when the', &
3862 'skin transmissivity equals or exceeds the aquifer transmissivity.', &
3863 'consider decreasing hk_skin for the connection or using the', &
3864 'mean conductance equation.'
3871 if (this%inonvert /= 0)
then
3872 c = c * this%maw_calc_lcorr(i, jpos)
3876 this%satcond(jpos) = c
3883 class(
mawtype),
intent(inout) :: this
3884 integer(I4B),
intent(in) :: n
3885 integer(I4B),
intent(in) :: j
3886 integer(I4B),
intent(in) :: node
3887 real(DP),
intent(inout) :: sat
3889 integer(I4B) :: jpos
3900 if (this%icelltype(node) /= 0)
then
3903 hwell = this%xnewpak(n)
3906 jpos = this%get_jpos(n, j)
3909 topw = this%topscrn(jpos)
3910 botw = this%botscrn(jpos)
3913 if (this%inewton /= 1)
then
3914 h_temp = this%xnew(node)
3915 if (h_temp < botw)
then
3918 if (hwell < botw)
then
3921 h_temp =
dhalf * (h_temp + hwell)
3923 h_temp = this%xnew(node)
3924 if (hwell > h_temp)
then
3927 if (h_temp < botw)
then
3954 integer(I4B),
intent(in) :: n
3955 integer(I4B),
intent(in) :: j
3956 integer(I4B),
intent(inout) :: icflow
3957 real(DP),
intent(inout) :: cmaw
3958 real(DP),
intent(inout) :: cterm
3959 real(DP),
intent(inout) :: term
3960 real(DP),
intent(inout) :: flow
3961 real(DP),
intent(inout),
optional :: term2
3963 logical(LGP) :: correct_flow
3964 integer(I4B) :: inewton
3965 integer(I4B) :: jpos
3966 integer(I4B) :: igwfnode
3977 real(DP) :: dhbarterm
3978 real(DP) :: vscratio
3984 if (
present(term2))
then
3991 jpos = this%get_jpos(n, j)
3992 igwfnode = this%get_gwfnode(n, j)
3993 hgwf = this%xnew(igwfnode)
3994 hmaw = this%xnewpak(n)
3995 tmaw = this%topscrn(jpos)
3996 bmaw = this%botscrn(jpos)
3999 if (this%ivsc == 1)
then
4002 vscratio = this%viscratios(1, n)
4004 vscratio = this%viscratios(2, n)
4009 call this%maw_calculate_saturation(n, j, igwfnode, sat)
4010 cmaw = this%satcond(jpos) * vscratio * sat
4013 if (inewton == 1)
then
4017 if (hgwf > hups)
then
4028 if (this%correct_flow)
then
4031 en = max(bmaw, this%dis%bot(igwfnode))
4032 correct_flow = .false.
4034 correct_flow = .true.
4036 if (hgwf < en .and. this%icelltype(igwfnode) /= 0)
then
4037 correct_flow = .true.
4042 if (correct_flow)
then
4044 hdowns = min(hmaw, hgwf)
4046 if (hgwf > hmaw)
then
4047 cterm = cmaw * (hmaw - hbar)
4049 cterm = cmaw * (hbar - hgwf)
4054 if (inewton /= 0)
then
4057 if (hmaw > hgwf)
then
4059 term = drterm * this%satcond(jpos) * vscratio * (hbar - hmaw)
4061 term2 = cmaw * (dhbarterm -
done)
4066 term = -drterm * this%satcond(jpos) * vscratio * (hgwf - hbar)
4068 term2 = cmaw * (
done - dhbarterm)
4074 if (inewton /= 0)
then
4075 term = drterm * this%satcond(jpos) * vscratio * (hgwf - hmaw)
4081 if (inewton == 0)
then
4082 flow = term * (hgwf - hmaw) + cterm
4086 if (this%idense /= 0 .and. inewton == 0)
then
4087 call this%maw_calculate_density_exchange(jpos, hmaw, hgwf, cmaw, &
4088 bmaw, flow, term, cterm)
4097 integer(I4B),
intent(in) :: n
4098 real(DP),
intent(in) :: hmaw
4099 real(DP),
intent(inout) :: q
4116 if (rate <
dzero)
then
4121 if (this%shutofflevel(n) /=
dep20)
then
4122 call this%maw_calculate_qpot(n, q)
4124 if (q > -rate) q = -rate
4126 if (this%ishutoffcnt == 1)
then
4127 this%shutoffweight(n) =
done
4128 this%shutoffdq(n) =
dzero
4129 this%shutoffqold(n) = q
4132 dq = q - this%shutoffqold(n)
4133 weight = this%shutoffweight(n)
4136 if (this%shutoffdq(n) * dq <
dzero)
then
4137 weight = this%theta * this%shutoffweight(n)
4141 weight = this%shutoffweight(n) + this%kappa
4145 q = this%shutoffqold(n) + weight * dq
4147 this%shutoffqold(n) = q
4148 this%shutoffdq(n) = dq
4149 this%shutoffweight(n) = weight
4153 if (this%shutoffmin(n) >
dzero)
then
4154 if (hmaw < this%shutofflevel(n))
then
4158 if (this%ishutoff(n) /= 0)
then
4165 if (q < this%shutoffmin(n))
then
4166 if (this%ishutoffcnt > 2)
then
4167 this%ishutoff(n) = 1
4178 if (q > this%shutoffmax(n))
then
4179 if (this%ishutoffcnt <= 2)
then
4180 this%ishutoff(n) = 0
4183 if (this%ishutoff(n) /= 0)
then
4189 if (q /=
dzero) q = -q
4198 if (this%reduction_length(n) /=
dep20)
then
4199 bt = this%pumpelev(n)
4200 tp = bt + this%reduction_length(n)
4210 if (this%shutofflevel(n) /=
dep20)
then
4211 call this%maw_calculate_qpot(n, q)
4214 if (q > rate) q = rate
4216 if (this%ishutoffcnt == 1)
then
4217 this%shutoffweight(n) =
done
4218 this%shutoffdq(n) =
dzero
4219 this%shutoffqold(n) = q
4222 dq = q - this%shutoffqold(n)
4223 weight = this%shutoffweight(n)
4226 if (this%shutoffdq(n) * dq <
dzero)
then
4227 weight = this%theta * this%shutoffweight(n)
4231 weight = this%shutoffweight(n) + this%kappa
4235 q = this%shutoffqold(n) + weight * dq
4237 this%shutoffqold(n) = q
4238 this%shutoffdq(n) = dq
4239 this%shutoffweight(n) = weight
4247 if (this%reduction_length(n) /=
dep20)
then
4248 bt = this%pumpelev(n)
4249 tp = bt + this%reduction_length(n)
4262 class(
mawtype),
intent(inout) :: this
4263 integer(I4B),
intent(in) :: n
4264 real(DP),
intent(inout) :: qnet
4267 integer(I4B) :: jpos
4268 integer(I4B) :: igwfnode
4280 real(DP) :: vscratio
4286 h_temp = this%shutofflevel(n)
4289 if (this%ivsc == 1)
then
4292 vscratio = this%viscratios(1, n)
4294 vscratio = this%viscratios(2, n)
4299 if (this%iflowingwells > 0)
then
4300 if (this%fwcond(n) >
dzero)
then
4302 tp = bt + this%fwrlen(n)
4304 cfw = scale * this%fwcond(n) * this%viscratios(2, n)
4305 this%ifwdischarge(n) = 0
4306 if (cfw >
dzero)
then
4307 this%ifwdischarge(n) = 1
4310 qnet = qnet + cfw * (bt - h_temp)
4315 if (this%imawiss /= 1)
then
4316 if (this%ifwdischarge(n) /= 1)
then
4317 hdterm = this%xoldsto(n) - h_temp
4319 hdterm = this%xoldsto(n) - this%fwelev(n)
4321 qnet = qnet - (this%area(n) * hdterm /
delt)
4325 do j = 1, this%ngwfnodes(n)
4326 jpos = this%get_jpos(n, j)
4327 igwfnode = this%get_gwfnode(n, j)
4328 call this%maw_calculate_saturation(n, j, igwfnode, sat)
4329 cmaw = this%satcond(jpos) * vscratio * sat
4330 hgwf = this%xnew(igwfnode)
4331 bmaw = this%botscrn(jpos)
4336 if (hgwf < bmaw)
then
4339 qnet = qnet + cmaw * (hgwf - hv)
4351 integer(I4B) :: jpos
4352 integer(I4B) :: icflow
4353 integer(I4B) :: ibnd
4361 if (this%nbound .eq. 0)
return
4364 this%ishutoffcnt = this%ishutoffcnt + 1
4368 do n = 1, this%nmawwells
4369 hmaw = this%xnewpak(n)
4370 do j = 1, this%ngwfnodes(n)
4371 jpos = this%get_jpos(n, j)
4372 this%hcof(ibnd) =
dzero
4373 this%rhs(ibnd) =
dzero
4379 if (this%iboundpak(n) == 0)
then
4384 call this%maw_calculate_conn_terms(n, j, icflow, cmaw, cterm, &
4387 this%simcond(jpos) = cmaw
4388 this%bound(2, ibnd) = cmaw
4389 this%hcof(ibnd) = -term
4390 this%rhs(ibnd) = -term * hmaw + cterm
4408 integer(I4B) :: nbudterm
4409 integer(I4B) :: n, j, n2
4411 integer(I4B) :: maxlist, naux
4413 character(len=LENBUDTXT) :: text
4414 character(len=LENBUDTXT),
dimension(1) :: auxtxt
4420 if (this%iflowingwells > 0)
then
4421 nbudterm = nbudterm + 1
4423 if (this%imover == 1)
then
4424 nbudterm = nbudterm + 3
4425 if (this%iflowingwells > 0)
then
4426 nbudterm = nbudterm + 1
4429 if (this%naux > 0) nbudterm = nbudterm + 1
4433 call this%budobj%budgetobject_df(this%nmawwells, nbudterm, 0, 0, &
4434 ibudcsv=this%ibudcsv)
4442 maxlist = this%maxbound
4444 auxtxt(1) =
' FLOW-AREA'
4445 call this%budobj%budterm(idx)%initialize(text, &
4450 maxlist, .false., .true., &
4452 call this%budobj%budterm(idx)%reset(this%maxbound)
4454 do n = 1, this%nmawwells
4455 do j = 1, this%ngwfnodes(n)
4456 n2 = this%get_gwfnode(n, j)
4457 call this%budobj%budterm(idx)%update_term(n, n2, q)
4464 maxlist = this%nmawwells
4466 call this%budobj%budterm(idx)%initialize(text, &
4471 maxlist, .false., .false., &
4475 if (this%iflowingwells > 0)
then
4478 maxlist = this%nmawwells
4480 call this%budobj%budterm(idx)%initialize(text, &
4485 maxlist, .false., .false., &
4492 maxlist = this%nmawwells
4494 auxtxt(1) =
' VOLUME'
4495 call this%budobj%budterm(idx)%initialize(text, &
4500 maxlist, .false., .true., &
4506 maxlist = this%nmawwells
4508 call this%budobj%budterm(idx)%initialize(text, &
4513 maxlist, .false., .false., &
4517 if (this%imover == 1)
then
4522 maxlist = this%nmawwells
4524 call this%budobj%budterm(idx)%initialize(text, &
4529 maxlist, .false., .false., &
4533 text =
' RATE-TO-MVR'
4535 maxlist = this%nmawwells
4537 call this%budobj%budterm(idx)%initialize(text, &
4542 maxlist, .false., .false., &
4546 text =
' CONSTANT-TO-MVR'
4548 maxlist = this%nmawwells
4550 call this%budobj%budterm(idx)%initialize(text, &
4555 maxlist, .false., .false., &
4559 if (this%iflowingwells > 0)
then
4562 text =
' FW-RATE-TO-MVR'
4564 maxlist = this%nmawwells
4566 call this%budobj%budterm(idx)%initialize(text, &
4571 maxlist, .false., .false., &
4583 maxlist = this%maxbound
4584 call this%budobj%budterm(idx)%initialize(text, &
4589 maxlist, .false., .false., &
4594 if (this%iprflow /= 0)
then
4595 call this%budobj%flowtable_df(this%iout)
4609 integer(I4B) :: naux
4613 integer(I4B) :: jpos
4615 integer(I4B) :: ibnd
4631 call this%budobj%budterm(idx)%reset(this%maxbound)
4633 do n = 1, this%nmawwells
4634 do j = 1, this%ngwfnodes(n)
4635 jpos = this%get_jpos(n, j)
4636 n2 = this%get_gwfnode(n, j)
4637 tmaw = this%topscrn(jpos)
4638 bmaw = this%botscrn(jpos)
4639 call this%maw_calculate_saturation(n, j, n2, sat)
4640 this%qauxcbc(1) =
dtwo *
dpi * this%radius(n) * sat * (tmaw - bmaw)
4641 q = this%qleak(ibnd)
4642 call this%budobj%budterm(idx)%update_term(n, n2, q, this%qauxcbc)
4649 call this%budobj%budterm(idx)%reset(this%nmawwells)
4650 do n = 1, this%nmawwells
4654 if (this%imover == 1 .and. q <
dzero)
then
4656 if (this%qout(n) <
dzero)
then
4657 qfact = q / this%qout(n)
4659 q = q + qfact * this%pakmvrobj%get_qtomvr(n)
4661 call this%budobj%budterm(idx)%update_term(n, n, q)
4665 if (this%iflowingwells > 0)
then
4667 call this%budobj%budterm(idx)%reset(this%nmawwells)
4668 do n = 1, this%nmawwells
4670 if (this%imover == 1)
then
4674 if (this%qout(n) <
dzero)
then
4675 qfact = q / this%qout(n)
4677 q = q + qfact * this%pakmvrobj%get_qtomvr(n)
4679 call this%budobj%budterm(idx)%update_term(n, n, q)
4685 call this%budobj%budterm(idx)%reset(this%nmawwells)
4686 do n = 1, this%nmawwells
4687 b = this%xsto(n) - this%bot(n)
4691 v = this%area(n) * b
4692 if (this%imawissopt /= 1)
then
4698 call this%budobj%budterm(idx)%update_term(n, n, q, this%qauxcbc)
4703 call this%budobj%budterm(idx)%reset(this%nmawwells)
4704 do n = 1, this%nmawwells
4708 if (this%imover == 1 .and. q <
dzero)
then
4710 if (this%qout(n) <
dzero)
then
4711 qfact = q / this%qout(n)
4713 q = q + qfact * this%pakmvrobj%get_qtomvr(n)
4715 call this%budobj%budterm(idx)%update_term(n, n, q)
4719 if (this%imover == 1)
then
4723 call this%budobj%budterm(idx)%reset(this%nmawwells)
4724 do n = 1, this%nmawwells
4725 if (this%iboundpak(n) == 0)
then
4728 q = this%pakmvrobj%get_qfrommvr(n)
4730 call this%budobj%budterm(idx)%update_term(n, n, q)
4735 call this%budobj%budterm(idx)%reset(this%nmawwells)
4736 do n = 1, this%nmawwells
4737 q = this%pakmvrobj%get_qtomvr(n)
4740 q2 = this%ratesim(n)
4743 if (q2 <
dzero)
then
4744 qfact = q2 / this%qout(n)
4750 call this%budobj%budterm(idx)%update_term(n, n, q)
4755 call this%budobj%budterm(idx)%reset(this%nmawwells)
4756 do n = 1, this%nmawwells
4757 q = this%pakmvrobj%get_qtomvr(n)
4762 if (q2 <
dzero)
then
4763 qfact = q2 / this%qout(n)
4769 call this%budobj%budterm(idx)%update_term(n, n, q)
4773 if (this%iflowingwells > 0)
then
4775 call this%budobj%budterm(idx)%reset(this%nmawwells)
4776 do n = 1, this%nmawwells
4777 q = this%pakmvrobj%get_qtomvr(n)
4780 q2 = this%ratesim(n)
4784 if (this%qout(n) <
dzero)
then
4785 qfact = this%qfw(n) / this%qout(n)
4789 call this%budobj%budterm(idx)%update_term(n, n, q)
4799 call this%budobj%budterm(idx)%reset(this%nmawwells)
4800 do n = 1, this%nmawwells
4802 call this%budobj%budterm(idx)%update_term(n, n, q, this%auxvar(:, n))
4807 call this%budobj%accumulate_terms()
4821 integer(I4B) :: nterms
4822 character(len=LINELENGTH) :: title
4823 character(len=LINELENGTH) :: text
4826 if (this%iprhed > 0)
then
4830 if (this%inamedbound == 1) nterms = nterms + 1
4833 title = trim(adjustl(this%text))//
' PACKAGE ('// &
4834 trim(adjustl(this%packName))//
') HEADS FOR EACH CONTROL VOLUME'
4837 call table_cr(this%headtab, this%packName, title)
4838 call this%headtab%table_df(this%nmawwells, nterms, this%iout, &
4842 if (this%inamedbound == 1)
then
4844 call this%headtab%initialize_column(text, 20, alignment=tableft)
4849 call this%headtab%initialize_column(text, 10, alignment=tabcenter)
4853 call this%headtab%initialize_column(text, 12, alignment=tabcenter)
4861 integer(I4B) :: jpos
4864 integer(I4B),
intent(in) :: n
4865 integer(I4B),
intent(in) :: j
4869 jpos = this%iaconn(n) + j - 1
4876 integer(I4B) :: igwfnode
4879 integer(I4B),
intent(in) :: n
4880 integer(I4B),
intent(in) :: j
4882 integer(I4B) :: jpos
4885 jpos = this%get_jpos(n, j)
4886 igwfnode = this%gwfnodes(jpos)
4893 class(
mawtype),
intent(inout) :: this
4895 integer(I4B) :: i, j
4900 call mem_reallocate(this%denseterms, 3, this%MAXBOUND,
'DENSETERMS', &
4902 do i = 1, this%maxbound
4904 this%denseterms(j, i) =
dzero
4907 write (this%iout,
'(/1x,a)')
'DENSITY TERMS HAVE BEEN ACTIVATED FOR MAW &
4908 &PACKAGE: '//trim(adjustl(this%packName))
4919 class(
mawtype),
intent(inout) :: this
4926 call mem_reallocate(this%viscratios, 2, this%MAXBOUND,
'VISCRATIOS', &
4928 do i = 1, this%maxbound
4930 this%viscratios(j, i) =
done
4933 write (this%iout,
'(/1x,a)')
'VISCOSITY HAS BEEN ACTIVATED FOR MAW &
4934 &PACKAGE: '//trim(adjustl(this%packName))
4960 bmaw, flow, hcofterm, rhsterm)
4962 class(
mawtype),
intent(inout) :: this
4963 integer(I4B),
intent(in) :: iconn
4964 real(DP),
intent(in) :: hmaw
4965 real(DP),
intent(in) :: hgwf
4966 real(DP),
intent(in) :: cond
4967 real(DP),
intent(in) :: bmaw
4968 real(DP),
intent(inout) :: flow
4969 real(DP),
intent(inout) :: hcofterm
4970 real(DP),
intent(inout) :: rhsterm
4974 real(DP) :: rdensemaw
4975 real(DP) :: rdensegwf
4976 real(DP) :: rdenseavg
4981 rdensemaw = this%denseterms(1, iconn)
4982 rdensegwf = this%denseterms(2, iconn)
4983 if (rdensegwf ==
dzero)
return
4986 if (hmaw > bmaw .and. hgwf > bmaw)
then
4989 rdenseavg =
dhalf * (rdensemaw + rdensegwf)
4992 t = cond * (rdenseavg -
done) * (hgwf - hmaw)
4993 rhsterm = rhsterm + t
4997 havg =
dhalf * (hgwf + hmaw)
4998 elevavg = this%denseterms(3, iconn)
4999 t = cond * (havg - elevavg) * (rdensegwf - rdensemaw)
5000 rhsterm = rhsterm + t
5002 else if (hmaw > bmaw)
then
5005 t = (rdensemaw -
done) * rhsterm
5006 rhsterm = rhsterm + t
5008 else if (hgwf > bmaw)
then
5011 t = (rdensegwf -
done) * rhsterm
5012 rhsterm = rhsterm + t
This module contains block parser methods.
This module contains the base boundary package.
This module contains the BudgetModule.
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
real(dp), parameter dp9
real constant 9/10
real(dp), parameter deight
real constant 8
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 lentimeseriesname
maximum length of a time series name
real(dp), parameter dtwopi
real constant
real(dp), parameter dep20
real constant 1e20
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 lenauxname
maximum length of a aux variable
real(dp), parameter dpi
real constant
integer(i4b), parameter lenboundname
maximum length of a bound name
real(dp), parameter dpio180
real constant
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 dp7
real constant 7/10
real(dp), parameter dem9
real constant 1e-9
real(dp), parameter dem2
real constant 1e-2
real(dp), parameter dtwo
real constant 2
integer(i4b), parameter lenbudtxt
maximum length of a budget component names
real(dp), parameter dquarter
real constant 1/3
real(dp), parameter done
real constant 1
integer(i4b) function, public get_node(ilay, irow, icol, nlay, nrow, ncol)
Get node number, given layer, row, and column indices for a structured grid. If any argument is inval...
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.
subroutine maw_fill_budobj(this)
Copy flow terms into thisbudobj.
subroutine maw_rp(this)
Read and Prepare.
subroutine maw_set_stressperiod(this, imaw, iheadlimit_warning)
Set a stress period attribute for mawweslls(imaw) using keywords.
integer(i4b) function get_gwfnode(this, n, j)
Get the gwfnode for connection.
subroutine maw_cf(this)
Formulate the HCOF and RHS terms.
subroutine maw_ot_bdsummary(this, kstp, kper, iout, ibudfl)
Write MAW budget to listing file.
subroutine maw_activate_viscosity(this)
Activate viscosity terms.
subroutine maw_read_initial_attr(this)
Read the initial parameters for this package.
subroutine maw_bd_obs(this)
Calculate observations this time step and call ObsTypeSaveOneSimval for each MawType observation.
subroutine maw_read_angledata(this)
Read the optional ANGLEDATA block for non-vertical (slanted) MAW well connections.
subroutine maw_ar(this)
Allocate and Read.
subroutine maw_set_attribute_error(this, imaw, keyword, msg)
Issue a parameter error for mawweslls(imaw)
subroutine maw_ad(this)
Add package connection to matrix.
subroutine maw_calculate_conn_terms(this, n, j, icflow, cmaw, cterm, term, flow, term2)
Calculate matrix terms for a multi-aquifer well connection. Terms for fc and fn methods are calculate...
subroutine maw_calculate_density_exchange(this, iconn, hmaw, hgwf, cond, bmaw, flow, hcofterm, rhsterm)
Calculate the groundwater-maw density exchange terms.
subroutine maw_calculate_wellq(this, n, hmaw, q)
Calculate well pumping rate based on constraints.
subroutine maw_rp_obs(this)
Process each observation.
character(len=lenpackagename) text
subroutine maw_allocate_scalars(this)
Allocate scalar members.
subroutine maw_calculate_qpot(this, n, qnet)
Calculate groundwater inflow to a maw well.
subroutine maw_ot_model_flows(this, icbcfl, ibudfl, icbcun, imap)
Write flows to binary file and/or print flows to budget.
subroutine, public maw_create(packobj, id, ibcnum, inunit, iout, namemodel, pakname)
Create a New Multi-Aquifer Well (MAW) Package.
subroutine maw_set_pointers(this, neq, ibound, xnew, xold, flowja)
Set pointers to model arrays and variables so that a package has has access to these things.
subroutine maw_activate_density(this)
Activate density terms.
integer(i4b) function get_jpos(this, n, j)
Get position of value in connection data.
subroutine maw_fn(this, rhs, ia, idxglo, matrix_sln)
Fill newton terms.
subroutine maw_calculate_saturation(this, n, j, node, sat)
Calculate the saturation between the aquifer maw well_head.
subroutine maw_ot_package_flows(this, icbcfl, ibudfl)
Output MAW package flow terms.
subroutine maw_allocate_well_conn_arrays(this)
Allocate well arrays.
logical function maw_obs_supported(this)
Return true because MAW package supports observations.
subroutine maw_read_dimensions(this)
Read the dimensions for this package.
subroutine maw_read_options(this, option, found)
Set options specific to MawType.
subroutine maw_allocate_arrays(this)
Allocate arrays.
subroutine maw_cfupdate(this)
Update MAW satcond and package rhs and hcof.
subroutine maw_redflow_csv_write(this)
MAW reduced flows only when & where they occur.
subroutine maw_redflow_csv_init(this, fname)
Initialize the auto flow reduce csv output file.
real(dp) function maw_calc_lcorr(this, i, jpos)
Calculate the length correction factor for a multi-aquifer well connection.
subroutine maw_mc(this, moffset, matrix_sln)
Map package connection to matrix.
subroutine maw_read_wells(this)
Read the packagedata for this package.
subroutine maw_nur(this, neqpak, x, xtemp, dx, inewtonur, dxmax, locmax)
Calculate under-relaxation of groundwater flow model MAW Package heads for current outer iteration us...
subroutine maw_check_attributes(this)
Issue parameter errors for mawwells(imaw)
subroutine maw_ac(this, moffset, sparse)
Add package connection to matrix.
subroutine maw_ot_dv(this, idvsave, idvprint)
Save maw-calculated values to binary file.
subroutine maw_fc(this, rhs, ia, idxglo, matrix_sln)
Copy rhs and hcof into solution rhs and amat.
character(len=lenftype) ftype
subroutine maw_read_well_connections(this)
Read the dimensions for this package.
subroutine define_listlabel(this)
Define the list heading that is written to iout when PRINT_INPUT option is used.
subroutine maw_setup_budobj(this)
Set up the budget object that stores all the maw flows The terms listed here must correspond in numbe...
subroutine maw_cq(this, x, flowja, iadv)
Calculate flows.
subroutine maw_df_obs(this)
Store observation type supported by MAW package.
subroutine maw_calculate_satcond(this, i, j, node)
Calculate the appropriate saturated conductance to use based on aquifer and multi-aquifer well charac...
subroutine maw_da(this)
Deallocate memory.
subroutine maw_process_obsid(obsrv, dis, inunitobs, iout)
This procedure is pointed to by ObsDataTypeProcesssIdPtr. It processes the ID string of an observatio...
subroutine maw_setup_tableobj(this)
Set up the table object that is used to write the maw head data.
character(len=lenmempath) function create_mem_path(component, subcomponent, context)
returns the path to the memory object
This module contains the derived types ObserveType and ObsDataType.
This module contains the derived type ObsType.
This module contains simulation methods.
subroutine, public store_warning(msg, substring)
Store warning message.
subroutine, public store_error(msg, terminate)
Store an error message.
integer(i4b) function, public count_errors()
Return number of errors.
subroutine, public store_error_unit(iunit, terminate)
Store the file unit number.
This module contains simulation variables.
character(len=maxcharlen) errmsg
error message string
character(len=maxcharlen) warnmsg
warning message string
real(dp) function squadraticsaturation(top, bot, x, eps)
@ brief sQuadraticSaturation
real(dp) function squadraticsaturationderivative(top, bot, x, eps)
@ brief Derivative of the quadratic saturation function
real(dp) function sqsaturationderivative(top, bot, x, c1, c2)
@ brief sQSaturationDerivative
real(dp) function squadratic0spderivative(x, xi, tomega)
@ brief sQuadratic0spDerivative
real(dp) function sqsaturation(top, bot, x, c1, c2)
@ brief sQSaturation
real(dp) function squadratic0sp(x, xi, tomega)
@ brief sQuadratic0sp
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
integer(i4b), pointer, public nper
number of stress period
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).
Derived type for the Budget object.