49 character(len=LENLISTLABEL),
pointer :: listlabel => null()
50 character(len=LENPACKAGENAME) :: text =
''
51 character(len=LENAUXNAME),
dimension(:),
pointer, &
52 contiguous :: auxname => null()
54 contiguous :: auxname_cst => null()
55 character(len=LENBOUNDNAME),
dimension(:),
pointer, &
56 contiguous :: boundname => null()
58 contiguous :: boundname_cst => null()
61 integer(I4B),
pointer :: isadvpak => null()
62 integer(I4B),
pointer :: ibcnum => null()
63 integer(I4B),
pointer :: maxbound => null()
64 integer(I4B),
pointer :: nbound => null()
65 integer(I4B),
pointer :: ncolbnd => null()
66 integer(I4B),
pointer :: iscloc => null()
67 integer(I4B),
pointer :: naux => null()
68 integer(I4B),
pointer :: inamedbound => null()
69 integer(I4B),
pointer :: iauxmultcol => null()
70 integer(I4B),
pointer :: npakeq => null()
71 integer(I4B),
pointer :: ioffset => null()
73 integer(I4B),
dimension(:),
pointer,
contiguous :: nodelist => null()
74 integer(I4B),
dimension(:),
pointer,
contiguous :: noupdateauxvar => null()
75 real(dp),
dimension(:, :),
pointer,
contiguous :: bound => null()
76 real(dp),
dimension(:),
pointer,
contiguous :: hcof => null()
77 real(dp),
dimension(:),
pointer,
contiguous :: rhs => null()
78 real(dp),
dimension(:, :),
pointer,
contiguous :: auxvar => null()
79 real(dp),
dimension(:),
pointer,
contiguous :: simvals => null()
80 real(dp),
dimension(:),
pointer,
contiguous :: simtomvr => null()
83 integer(I4B),
pointer :: imover => null()
87 integer(I4B),
pointer :: ivsc => null()
88 real(dp),
dimension(:),
pointer,
contiguous :: condinput => null()
93 integer(I4B) :: indxconvertflux = 0
94 logical(LGP) :: allowtimearrayseries = .false.
97 integer(I4B),
pointer :: inobspkg => null()
101 integer(I4B),
pointer :: neq
102 integer(I4B),
dimension(:),
pointer,
contiguous :: ibound => null()
103 real(dp),
dimension(:),
pointer,
contiguous :: xnew => null()
104 real(dp),
dimension(:),
pointer,
contiguous :: xold => null()
105 real(dp),
dimension(:),
pointer,
contiguous :: flowja => null()
106 integer(I4B),
dimension(:),
pointer,
contiguous :: icelltype => null()
107 character(len=LENMEMPATH) :: ictmempath =
''
181 class(
bndtype),
intent(inout) :: this
182 integer(I4B),
intent(inout) :: neq
190 call tasmanager_cr(this%TasManager, dis, this%name_model, this%iout)
193 call obs_cr(this%obs, this%inobspkg)
196 write (this%iout, 1) this%filtyp, trim(adjustl(this%text)), this%inunit
197 1
format(1x, /1x, a,
' -- ', a,
' PACKAGE, VERSION 8, 2/22/2014', &
198 ' INPUT READ FROM UNIT ', i0)
201 call this%parser%Initialize(this%inunit, this%iout)
204 call this%read_options()
208 call this%tsmanager%tsmanager_df()
209 call this%tasmanager%tasmanager_df()
212 call this%read_dimensions()
215 if (this%npakeq > 0)
then
216 this%ioffset = neq - this%dis%nodes
220 neq = neq + this%npakeq
223 if (this%bnd_obs_supported())
then
224 call this%obs%obs_df(this%iout, this%packName, this%filtyp, this%dis)
225 call this%bnd_df_obs()
240 class(
bndtype),
intent(inout) :: this
241 integer(I4B),
intent(in) :: moffset
251 subroutine bnd_mc(this, moffset, matrix_sln)
253 class(
bndtype),
intent(inout) :: this
254 integer(I4B),
intent(in) :: moffset
268 class(
bndtype),
intent(inout) :: this
271 call this%obs%obs_ar()
274 call this%allocate_arrays()
277 call this%read_initial_attr()
280 if (this%imover == 1)
then
281 allocate (this%pakmvrobj)
282 call this%pakmvrobj%ar(this%maxbound, 0, this%memoryPath)
296 class(
bndtype),
intent(inout) :: this
299 integer(I4B) :: nlist
300 logical(LGP) :: isfound
301 character(len=LINELENGTH) :: line
303 character(len=*),
parameter :: fmtblkerr = &
304 &
"('Looking for BEGIN PERIOD iper. Found ', a, ' instead.')"
305 character(len=*),
parameter :: fmtlsp = &
306 &
"(1X,/1X,'REUSING ',A,'S FROM LAST STRESS PERIOD')"
307 character(len=*),
parameter :: fmtnbd = &
308 "(1X,/1X,'THE NUMBER OF ACTIVE ',A,'S (',I6, &
309 &') IS GREATER THAN MAXIMUM(',I6,')')"
313 if (this%inunit == 0)
return
316 if (this%ionper <
kper)
then
319 call this%parser%GetBlock(
'PERIOD', isfound, ierr, &
320 supportopenclose=.true., &
321 blockrequired=.false.)
325 call this%read_check_ionper()
331 this%ionper =
nper + 1
334 call this%parser%GetCurrentLine(line)
335 write (
errmsg, fmtblkerr) adjustl(trim(line))
337 call this%parser%StoreErrorUnit()
343 if (this%ionper ==
kper)
then
347 call this%TsManager%Reset(this%packName)
348 call this%TasManager%Reset(this%packName)
351 call this%dis%read_list(this%parser%line_reader, &
352 this%parser%iuactive, this%iout, &
353 this%iprpak, nlist, this%inamedbound, &
354 this%iauxmultcol, this%nodelist, &
355 this%bound, this%auxvar, this%auxname, &
356 this%boundname, this%listlabel, &
357 this%packName, this%tsManager, this%iscloc)
361 if (this%ivsc == 1)
then
362 call this%bnd_store_user_cond(nlist, this%bound, this%condinput)
369 call this%bnd_rp_ts()
372 call this%parser%terminateblock()
375 call this%copy_boundname()
378 write (this%iout, fmtlsp) trim(this%filtyp)
393 real(DP) :: begintime, endtime
397 endtime = begintime +
delt
400 call this%TsManager%ad()
401 call this%TasManager%ad()
406 call this%obs%obs_ad()
416 class(
bndtype),
intent(inout) :: this
427 if (this%imover == 1)
then
428 call this%pakmvrobj%reset()
454 subroutine bnd_fc(this, rhs, ia, idxglo, matrix_sln)
457 real(DP),
dimension(:),
intent(inout) :: rhs
458 integer(I4B),
dimension(:),
intent(in) :: ia
459 integer(I4B),
dimension(:),
intent(in) :: idxglo
467 do i = 1, this%nbound
469 rhs(n) = rhs(n) + this%rhs(i)
471 call matrix_sln%add_value_pos(idxglo(ipos), this%hcof(i))
482 subroutine bnd_fn(this, rhs, ia, idxglo, matrix_sln)
485 real(DP),
dimension(:),
intent(inout) :: rhs
486 integer(I4B),
dimension(:),
intent(in) :: ia
487 integer(I4B),
dimension(:),
intent(in) :: idxglo
502 subroutine bnd_nur(this, neqpak, x, xtemp, dx, inewtonur, dxmax, locmax)
504 class(
bndtype),
intent(inout) :: this
505 integer(I4B),
intent(in) :: neqpak
506 real(DP),
dimension(neqpak),
intent(inout) :: x
507 real(DP),
dimension(neqpak),
intent(in) :: xtemp
508 real(DP),
dimension(neqpak),
intent(inout) :: dx
509 integer(I4B),
intent(inout) :: inewtonur
510 real(DP),
intent(inout) :: dxmax
511 integer(I4B),
intent(inout) :: locmax
527 subroutine bnd_cc(this, innertot, kiter, iend, icnvgmod, cpak, ipak, dpak)
529 class(
bndtype),
intent(inout) :: this
530 integer(I4B),
intent(in) :: innertot
531 integer(I4B),
intent(in) :: kiter
532 integer(I4B),
intent(in) :: iend
533 integer(I4B),
intent(in) :: icnvgmod
534 character(len=LENPAKLOC),
intent(inout) :: cpak
535 integer(I4B),
intent(inout) :: ipak
536 real(DP),
intent(inout) :: dpak
548 class(
bndtype),
intent(inout) :: this
549 real(DP),
dimension(:),
intent(in) :: x
550 real(DP),
dimension(:),
contiguous,
intent(inout) :: flowja
551 integer(I4B),
optional,
intent(in) :: iadv
553 integer(I4B) :: imover
557 if (
present(iadv))
then
572 call this%bnd_cq_simrate(x, flowja, imover)
573 if (imover == 1)
then
574 call this%bnd_cq_simtomvr(flowja)
587 real(DP),
dimension(:),
intent(in) :: hnew
588 real(DP),
dimension(:),
intent(inout) :: flowja
589 integer(I4B),
intent(in) :: imover
593 integer(I4B) :: idiag
597 if (this%nbound > 0)
then
600 do i = 1, this%nbound
601 node = this%nodelist(i)
606 idiag = this%dis%con%ia(node)
607 if (this%ibound(node) > 0)
then
610 rrate = this%hcof(i) * hnew(node) - this%rhs(i)
612 flowja(idiag) = flowja(idiag) + rrate
616 this%simvals(i) = rrate
631 real(DP),
dimension(:),
intent(inout) :: flowja
640 if (this%nbound > 0)
then
643 do i = 1, this%nbound
644 node = this%nodelist(i)
649 if (this%ibound(node) > 0)
then
655 rrate = this%pakmvrobj%get_qtomvr(i)
664 if (fact >
done)
then
674 if (rrate >
dzero)
then
682 this%simtomvr(i) = rrate
700 type(
budgettype),
intent(inout) :: model_budget
702 character(len=LENPACKAGENAME) :: text
705 integer(I4B) :: isuppress_output
712 call model_budget%addentry(ratin, ratout,
delt, this%text, &
713 isuppress_output, this%packName)
714 if (this%imover == 1 .and. this%isadvpak == 0)
then
715 text = trim(adjustl(this%text))//
'-TO-MVR'
718 call model_budget%addentry(ratin, ratout,
delt, text, &
719 isuppress_output, this%packName)
732 integer(I4B),
intent(in) :: icbcfl
733 integer(I4B),
intent(in) :: ibudfl
747 integer(I4B),
intent(in) :: idvsave
748 integer(I4B),
intent(in) :: idvprint
762 integer(I4B),
intent(in) :: kstp
763 integer(I4B),
intent(in) :: kper
764 integer(I4B),
intent(in) :: iout
765 integer(I4B),
intent(in) :: ibudfl
779 integer(I4B),
intent(in) :: icbcfl
780 integer(I4B),
intent(in) :: ibudfl
781 integer(I4B),
intent(in) :: icbcun
782 integer(I4B),
dimension(:),
optional,
intent(in) :: imap
784 character(len=LINELENGTH) :: title
785 character(len=LENPACKAGENAME) :: text
786 integer(I4B) :: imover
789 title = trim(adjustl(this%text))//
' PACKAGE ('//trim(this%packName)// &
791 if (
present(imap))
then
793 this%outputtab, this%nbound, this%nodelist, &
794 this%simvals, this%ibound, title, this%text, &
795 this%ipakcb, this%dis, this%naux, &
796 this%name_model, this%name_model, &
797 this%name_model, this%packName, &
798 this%auxname, this%auxvar, this%iout, &
799 this%inamedbound, this%boundname, imap)
802 this%outputtab, this%nbound, this%nodelist, &
803 this%simvals, this%ibound, title, this%text, &
804 this%ipakcb, this%dis, this%naux, &
805 this%name_model, this%name_model, &
806 this%name_model, this%packName, &
807 this%auxname, this%auxvar, this%iout, &
808 this%inamedbound, this%boundname)
816 if (this%isadvpak /= 0) imover = 0
817 if (imover == 1)
then
818 text = trim(adjustl(this%text))//
'-TO-MVR'
820 title = trim(adjustl(this%text))//
' PACKAGE ('// &
821 trim(this%packName)//
') FLOW RATES TO-MVR'
823 this%outputtab, this%nbound, this%nodelist, &
824 this%simtomvr, this%ibound, title, text, &
825 this%ipakcb, this%dis, this%naux, &
826 this%name_model, this%name_model, &
827 this%name_model, this%packName, &
828 this%auxname, this%auxvar, this%iout, &
829 this%inamedbound, this%boundname)
847 call mem_deallocate(this%noupdateauxvar,
'NOUPDATEAUXVAR', this%memoryPath)
856 call mem_deallocate(this%boundname_cst,
'BOUNDNAME_CST', this%memoryPath)
858 call mem_deallocate(this%auxname_cst,
'AUXNAME_CST', this%memoryPath)
859 nullify (this%icelltype)
862 if (this%imover /= 0)
then
863 call this%pakmvrobj%da()
864 deallocate (this%pakmvrobj)
865 nullify (this%pakmvrobj)
869 if (
associated(this%inputtab))
then
870 call this%inputtab%table_da()
871 deallocate (this%inputtab)
872 nullify (this%inputtab)
876 if (
associated(this%outputtab))
then
877 call this%outputtab%table_da()
878 deallocate (this%outputtab)
879 nullify (this%outputtab)
883 if (
associated(this%errortab))
then
884 call this%errortab%table_da()
885 deallocate (this%errortab)
886 nullify (this%errortab)
909 call this%obs%obs_da()
910 call this%TsManager%da()
911 call this%TasManager%da()
914 deallocate (this%obs)
915 deallocate (this%TsManager)
916 deallocate (this%TasManager)
917 nullify (this%TsManager)
918 nullify (this%TasManager)
921 call this%NumericalPackageType%da()
937 integer(I4B),
pointer :: imodelnewton => null()
940 call this%NumericalPackageType%allocate_scalars()
947 call mem_allocate(this%isadvpak,
'ISADVPAK', this%memoryPath)
948 call mem_allocate(this%ibcnum,
'IBCNUM', this%memoryPath)
949 call mem_allocate(this%maxbound,
'MAXBOUND', this%memoryPath)
950 call mem_allocate(this%nbound,
'NBOUND', this%memoryPath)
951 call mem_allocate(this%ncolbnd,
'NCOLBND', this%memoryPath)
952 call mem_allocate(this%iscloc,
'ISCLOC', this%memoryPath)
954 call mem_allocate(this%inamedbound,
'INAMEDBOUND', this%memoryPath)
955 call mem_allocate(this%iauxmultcol,
'IAUXMULTCOL', this%memoryPath)
956 call mem_allocate(this%inobspkg,
'INOBSPKG', this%memoryPath)
959 call mem_allocate(this%imover,
'IMOVER', this%memoryPath)
965 call mem_allocate(this%npakeq,
'NPAKEQ', this%memoryPath)
966 call mem_allocate(this%ioffset,
'IOFFSET', this%memoryPath)
969 allocate (this%TsManager)
970 allocate (this%TasManager)
995 this%inewton = imodelnewton
996 imodelnewton => null()
1010 integer(I4B),
dimension(:),
pointer,
contiguous,
optional :: nodelist
1011 real(DP),
dimension(:, :),
pointer,
contiguous,
optional :: auxvar
1017 if (
present(nodelist))
then
1018 this%nodelist => nodelist
1020 call mem_allocate(this%nodelist, this%maxbound,
'NODELIST', &
1022 do j = 1, this%maxbound
1023 this%nodelist(j) = 0
1029 call mem_allocate(this%noupdateauxvar, this%naux,
'NOUPDATEAUXVAR', &
1031 this%noupdateauxvar(:) = 0
1034 call mem_allocate(this%bound, this%ncolbnd, this%maxbound,
'BOUND', &
1039 call mem_allocate(this%condinput, 0,
'CONDINPUT', this%memoryPath)
1042 call mem_allocate(this%hcof, this%maxbound,
'HCOF', this%memoryPath)
1043 call mem_allocate(this%rhs, this%maxbound,
'RHS', this%memoryPath)
1046 call mem_allocate(this%simvals, this%maxbound,
'SIMVALS', this%memoryPath)
1047 if (this%imover == 1)
then
1048 call mem_allocate(this%simtomvr, this%maxbound,
'SIMTOMVR', &
1050 do i = 1, this%maxbound
1051 this%simtomvr(i) =
dzero
1054 call mem_allocate(this%simtomvr, 0,
'SIMTOMVR', this%memoryPath)
1058 if (
present(auxvar))
then
1059 this%auxvar => auxvar
1061 call mem_allocate(this%auxvar, this%naux, this%maxbound,
'AUXVAR', &
1063 do i = 1, this%maxbound
1065 this%auxvar(j, i) =
dzero
1071 if (this%inamedbound /= 0)
then
1073 'BOUNDNAME', this%memoryPath)
1075 'BOUNDNAME_CST', this%memoryPath)
1078 'BOUNDNAME', this%memoryPath)
1080 'BOUNDNAME_CST', this%memoryPath)
1086 if (this%ictMemPath /=
'')
then
1087 call mem_setptr(this%icelltype,
'ICELLTYPE', this%ictMemPath)
1091 do j = 1, this%maxbound
1092 do i = 1, this%ncolbnd
1093 this%bound(i, j) =
dzero
1096 do i = 1, this%maxbound
1097 this%hcof(i) =
dzero
1102 call this%pak_setup_outputtab()
1124 integer(I4B),
pointer :: neq
1125 integer(I4B),
dimension(:),
pointer,
contiguous :: ibound
1126 real(DP),
dimension(:),
pointer,
contiguous :: xnew
1127 real(DP),
dimension(:),
pointer,
contiguous :: xold
1128 real(DP),
dimension(:),
pointer,
contiguous :: flowja
1132 this%ibound => ibound
1135 this%flowja => flowja
1147 class(
bndtype),
intent(inout) :: this
1149 character(len=:),
allocatable :: line
1150 character(len=LINELENGTH) :: fname
1151 character(len=LINELENGTH) :: keyword
1152 character(len=LENAUXNAME) :: sfacauxname
1153 character(len=LENAUXNAME),
dimension(:),
allocatable :: caux
1154 integer(I4B) :: lloc
1155 integer(I4B) :: istart
1156 integer(I4B) :: istop
1158 integer(I4B) :: ierr
1159 integer(I4B) :: inobs
1160 logical(LGP) :: isfound
1161 logical(LGP) :: endOfBlock
1162 logical(LGP) :: foundchildclassoption
1164 character(len=*),
parameter :: fmtflow = &
1165 &
"(4x, 'FLOWS WILL BE SAVED TO FILE: ', a, /4x, 'OPENED ON UNIT: ', I7)"
1166 character(len=*),
parameter :: fmtflow2 = &
1167 &
"(4x, 'FLOWS WILL BE SAVED TO BUDGET FILE SPECIFIED IN OUTPUT CONTROL')"
1168 character(len=*),
parameter :: fmttas = &
1169 &
"(4x, 'TIME-ARRAY SERIES DATA WILL BE READ FROM FILE: ', a)"
1170 character(len=*),
parameter :: fmtts = &
1171 &
"(4x, 'TIME-SERIES DATA WILL BE READ FROM FILE: ', a)"
1172 character(len=*),
parameter :: fmtnme = &
1178 call this%parser%GetBlock(
'OPTIONS', isfound, ierr, &
1179 supportopenclose=.true., blockrequired=.false.)
1183 write (this%iout,
'(/1x,a)')
'PROCESSING '//trim(adjustl(this%text)) &
1186 call this%parser%GetNextLine(endofblock)
1187 if (endofblock)
then
1190 call this%parser%GetStringCaps(keyword)
1191 select case (keyword)
1192 case (
'AUX',
'AUXILIARY')
1193 call this%parser%GetRemainingLine(line)
1195 call urdaux(this%naux, this%parser%iuactive, this%iout, lloc, &
1196 istart, istop, caux, line, this%text)
1198 'AUXNAME', this%memoryPath)
1200 'AUXNAME_CST', this%memoryPath)
1202 this%auxname(n) = caux(n)
1203 this%auxname_cst(n) = caux(n)
1208 write (this%iout, fmtflow2)
1209 case (
'PRINT_INPUT')
1211 write (this%iout,
'(4x,a)') &
1212 'LISTS OF '//trim(adjustl(this%text))//
' CELLS WILL BE PRINTED.'
1213 case (
'PRINT_FLOWS')
1215 write (this%iout,
'(4x,a)') trim(adjustl(this%text))// &
1216 ' FLOWS WILL BE PRINTED TO LISTING FILE.'
1218 this%inamedbound = 1
1219 write (this%iout,
'(4x,a)') trim(adjustl(this%text))// &
1220 ' BOUNDARIES HAVE NAMES IN LAST COLUMN.'
1222 call this%parser%GetStringCaps(keyword)
1223 if (trim(adjustl(keyword)) /=
'FILEIN')
then
1224 errmsg =
'TS6 keyword must be followed by "FILEIN" '// &
1228 call this%parser%GetString(fname)
1229 write (this%iout, fmtts) trim(fname)
1230 call this%TsManager%add_tsfile(fname, this%inunit)
1232 if (this%AllowTimeArraySeries)
then
1233 if (.not. this%dis%supports_layers())
then
1234 errmsg =
'TAS6 FILE cannot be used '// &
1235 'with selected discretization type.'
1239 errmsg =
'The '//trim(this%filtyp)// &
1240 ' package does not support TIMEARRAYSERIESFILE'
1242 call this%parser%StoreErrorUnit()
1244 call this%parser%GetStringCaps(keyword)
1245 if (trim(adjustl(keyword)) /=
'FILEIN')
then
1246 errmsg =
'TAS6 keyword must be followed by "FILEIN" '// &
1249 call this%parser%StoreErrorUnit()
1251 call this%parser%GetString(fname)
1252 write (this%iout, fmttas) trim(fname)
1253 call this%TasManager%add_tasfile(fname)
1254 case (
'AUXMULTNAME')
1255 call this%parser%GetStringCaps(sfacauxname)
1256 this%iauxmultcol = -1
1257 write (this%iout,
'(4x,a,a)') &
1258 'AUXILIARY MULTIPLIER NAME: ', sfacauxname
1260 call this%parser%GetStringCaps(keyword)
1261 if (trim(adjustl(keyword)) /=
'FILEIN')
then
1262 errmsg =
'OBS6 keyword must be followed by "FILEIN" '// &
1265 call this%parser%StoreErrorUnit()
1267 if (this%obs%active)
then
1268 errmsg =
'Multiple OBS6 keywords detected in OPTIONS block. '// &
1269 'Only one OBS6 entry allowed for a package.'
1272 this%obs%active = .true.
1273 call this%parser%GetString(this%obs%inputFilename)
1275 call openfile(inobs, this%iout, this%obs%inputFilename,
'OBS')
1276 this%obs%inUnitObs = inobs
1282 case (
'DEV_NO_NEWTON')
1283 call this%parser%DevOpt()
1285 write (this%iout,
'(4x,a)') &
1286 'NEWTON-RAPHSON method disabled for unconfined cells'
1290 call this%bnd_options(keyword, foundchildclassoption)
1293 if (.not. foundchildclassoption)
then
1294 write (
errmsg,
'(a,3(1x,a))') &
1295 'UNKNOWN', trim(adjustl(this%text)),
'OPTION:', trim(keyword)
1300 write (this%iout,
'(1x,a)') &
1301 'END OF '//trim(adjustl(this%text))//
' OPTIONS'
1303 write (this%iout,
'(1x,a)')
'NO '//trim(adjustl(this%text))// &
1304 ' OPTION BLOCK DETECTED.'
1308 if (this%iauxmultcol < 0)
then
1311 if (this%naux == 0)
then
1312 write (
errmsg,
'(a,2(1x,a))') &
1313 'AUXMULTNAME was specified as', trim(adjustl(sfacauxname)), &
1314 'but no AUX variables specified.'
1319 this%iauxmultcol = 0
1321 if (sfacauxname == this%auxname(n))
then
1322 this%iauxmultcol = n
1328 if (this%iauxmultcol == 0)
then
1329 write (
errmsg,
'(a,2(1x,a))') &
1330 'AUXMULTNAME was specified as', trim(adjustl(sfacauxname)), &
1331 'but no AUX variable found with this name.'
1338 call this%parser%StoreErrorUnit()
1350 class(
bndtype),
intent(inout) :: this
1352 character(len=LINELENGTH) :: keyword
1353 logical(LGP) :: isfound
1354 logical(LGP) :: endOfBlock
1355 integer(I4B) :: ierr
1358 call this%parser%GetBlock(
'DIMENSIONS', isfound, ierr, &
1359 supportopenclose=.true.)
1363 write (this%iout,
'(/1x,a)')
'PROCESSING '//trim(adjustl(this%text))// &
1366 call this%parser%GetNextLine(endofblock)
1367 if (endofblock)
exit
1368 call this%parser%GetStringCaps(keyword)
1369 select case (keyword)
1371 this%maxbound = this%parser%GetInteger()
1372 write (this%iout,
'(4x,a,i7)')
'MAXBOUND = ', this%maxbound
1374 write (
errmsg,
'(a,3(1x,a))') &
1375 'Unknown', trim(this%text),
'dimension:', trim(keyword)
1380 write (this%iout,
'(1x,a)') &
1381 'END OF '//trim(adjustl(this%text))//
' DIMENSIONS'
1383 call store_error(
'Required DIMENSIONS block not found.')
1384 call this%parser%StoreErrorUnit()
1388 if (this%maxbound <= 0)
then
1389 write (
errmsg,
'(a)')
'MAXBOUND must be an integer greater than zero.'
1395 call this%parser%StoreErrorUnit()
1400 call this%define_listlabel()
1415 class(
bndtype),
intent(inout) :: this
1416 integer(I4B),
intent(in) :: nlist
1417 real(DP),
dimension(:, :),
pointer,
contiguous,
intent(in) :: rlist
1418 real(DP),
dimension(:),
pointer,
contiguous,
intent(inout) :: condinput
1424 condinput(l) = rlist(2, l)
1436 class(
bndtype),
intent(inout) :: this
1447 class(
bndtype),
intent(inout) :: this
1448 character(len=*),
intent(inout) :: option
1449 logical(LGP),
intent(inout) :: found
1462 class(
bndtype),
intent(inout) :: this
1468 if (this%inamedbound /= 0)
then
1469 do i = 1,
size(this%boundname)
1470 this%boundname_cst(i) = this%boundname(i)
1482 class(
bndtype),
intent(inout) :: this
1484 character(len=LINELENGTH) :: title
1485 character(len=LINELENGTH) :: text
1486 integer(I4B) :: ntabcol
1489 if (this%iprflow /= 0)
then
1493 if (this%inamedbound > 0)
then
1494 ntabcol = ntabcol + 1
1498 title = trim(adjustl(this%text))//
' PACKAGE ('//trim(this%packName)// &
1500 call table_cr(this%outputtab, this%packName, title)
1501 call this%outputtab%table_df(this%maxbound, ntabcol, this%iout, &
1504 call this%outputtab%initialize_column(text, 10, alignment=
tabcenter)
1506 call this%outputtab%initialize_column(text, 20, alignment=
tableft)
1508 call this%outputtab%initialize_column(text, 15, alignment=
tabcenter)
1509 if (this%inamedbound > 0)
then
1511 call this%outputtab%initialize_column(text,
lenboundname, &
1524 class(
bndtype),
intent(inout) :: this
1539 logical(LGP) :: supported
1569 class(
bndtype),
intent(inout) :: this
1574 character(len=LENBOUNDNAME) :: bname
1575 logical(LGP) :: jfound
1577 if (.not. this%bnd_obs_supported())
return
1579 do i = 1, this%obs%npakobs
1580 obsrv => this%obs%pakobs(i)%obsrv
1584 call obsrv%ResetObsIndex()
1585 obsrv%BndFound = .false.
1587 bname = obsrv%FeatureName
1588 if (bname /=
'')
then
1594 do j = 1, this%nbound
1595 if (this%boundname(j) == bname)
then
1597 obsrv%BndFound = .true.
1598 obsrv%CurrentTimeStepEndValue =
dzero
1599 call obsrv%AddObsIndex(j)
1606 jloop:
do j = 1, this%nbound
1607 if (this%nodelist(j) == obsrv%NodeNumber)
then
1609 obsrv%BndFound = .true.
1610 obsrv%CurrentTimeStepEndValue =
dzero
1611 call obsrv%AddObsIndex(j)
1639 call this%obs%obs_bd_clear()
1642 do i = 1, this%obs%npakobs
1643 obsrv => this%obs%pakobs(i)%obsrv
1644 if (obsrv%BndFound)
then
1645 do n = 1, obsrv%indxbnds_count
1646 if (obsrv%ObsTypeId ==
'TO-MVR')
then
1647 if (this%imover == 1)
then
1648 v = this%pakmvrobj%get_qtomvr(obsrv%indxbnds(n))
1656 v = this%simvals(obsrv%indxbnds(n))
1658 call this%obs%SaveOneSimval(obsrv, v)
1661 call this%obs%SaveOneSimval(obsrv,
dnodata)
1676 call this%obs%obs_ot()
1689 class(
bndtype),
intent(inout) :: this
1699 class(
bndtype),
intent(inout) :: this
1709 class(*),
pointer,
intent(inout) :: obj
1710 class(
bndtype),
pointer :: res
1716 if (.not.
associated(obj))
return
1731 type(
listtype),
intent(inout) :: list
1732 class(
bndtype),
pointer,
intent(inout) :: bnd
1734 class(*),
pointer :: obj
1748 type(
listtype),
intent(inout) :: list
1749 integer(I4B),
intent(in) :: idx
1750 class(
bndtype),
pointer :: res
1752 class(*),
pointer :: obj
1755 obj => list%GetItem(idx)
1765 outputtab, nbound, nodelist, flow, ibound, &
1766 title, text, ipakcb, dis, naux, textmodel, &
1767 textpackage, dstmodel, dstpackage, &
1768 auxname, auxvar, iout, inamedbound, &
1773 integer(I4B),
intent(in) :: icbcfl
1774 integer(I4B),
intent(in) :: ibudfl
1775 integer(I4B),
intent(in) :: icbcun
1776 integer(I4B),
intent(in) :: iprflow
1777 type(
tabletype),
pointer,
intent(inout) :: outputtab
1778 integer(I4B),
intent(in) :: nbound
1779 integer(I4B),
dimension(:),
contiguous,
intent(in) :: nodelist
1780 real(dp),
dimension(:),
contiguous,
intent(in) :: flow
1781 integer(I4B),
dimension(:),
contiguous,
intent(in) :: ibound
1782 character(len=*),
intent(in) :: title
1783 character(len=*),
intent(in) :: text
1784 integer(I4B),
intent(in) :: ipakcb
1786 integer(I4B),
intent(in) :: naux
1787 character(len=*),
intent(in) :: textmodel
1788 character(len=*),
intent(in) :: textpackage
1789 character(len=*),
intent(in) :: dstmodel
1790 character(len=*),
intent(in) :: dstpackage
1791 character(len=*),
dimension(:),
intent(in) :: auxname
1792 real(dp),
dimension(:, :),
intent(in) :: auxvar
1793 integer(I4B),
intent(in) :: iout
1794 integer(I4B),
intent(in) :: inamedbound
1795 character(len=LENBOUNDNAME),
dimension(:),
contiguous :: boundname
1796 integer(I4B),
dimension(:),
optional,
intent(in) :: imap
1798 character(len=20) :: nodestr
1799 integer(I4B) :: nodeu
1800 integer(I4B) :: maxrows
1802 integer(I4B) :: node
1804 integer(I4B) :: ibinun
1805 integer(I4B) :: nboundcount
1807 real(dp),
dimension(naux) :: auxrow
1809 character(len=LENBOUNDNAME) :: bname
1812 if (iprflow /= 0)
then
1813 call outputtab%set_kstpkper(
kstp,
kper)
1818 if (ibudfl /= 0 .and. iprflow /= 0)
then
1822 maxrows = maxrows + 1
1825 if (maxrows > 0)
then
1826 call outputtab%set_maxbound(maxrows)
1828 call outputtab%set_title(title)
1832 if (ipakcb < 0)
then
1834 else if (ipakcb == 0)
then
1839 if (icbcfl == 0)
then
1844 if (ibinun /= 0)
then
1852 if (node > 0) nboundcount = nboundcount + 1
1854 call dis%record_srcdst_list_header(text, textmodel, textpackage, &
1855 dstmodel, dstpackage, naux, &
1856 auxname, ibinun, nboundcount, iout)
1860 if (nbound > 0)
then
1866 if (inamedbound > 0)
then
1867 bname = boundname(i)
1882 if (ibudfl /= 0)
then
1883 if (iprflow /= 0)
then
1886 nodeu = dis%get_nodeuser(node)
1887 call dis%nodeu_to_string(nodeu, nodestr)
1888 call outputtab%print_list_entry(i, trim(adjustl(nodestr)), &
1894 if (ibinun /= 0)
then
1896 if (
present(imap)) n2 = imap(i)
1898 auxrow(:) = auxvar(:, i)
1900 call dis%record_mf6_list_entry(ibinun, node, n2, rrate, naux, &
1901 auxrow, olconv2=.false.)
1906 if (ibudfl /= 0)
then
1907 if (iprflow /= 0)
then
1908 write (iout,
'(1x)')
1924 class(
bndtype),
intent(inout) :: this
1933 call mem_reallocate(this%condinput, this%maxbound,
'CONDINPUT', &
1935 do i = 1, this%maxbound
1936 this%condinput(i) =
dzero
1941 write (this%iout,
'(/1x,a,a)')
'VISCOSITY ACTIVE IN ', &
1942 trim(this%filtyp)//
' PACKAGE CALCULATIONS: '//trim(adjustl(this%packName))
This module contains block parser methods.
This module contains the base boundary package.
subroutine bnd_read_dimensions(this)
@ brief Read dimensions for package
logical(lgp) function bnd_obs_supported(this)
Determine if observations are supported.
subroutine bnd_ar(this)
@ brief Allocate and read method for boundary package
subroutine bnd_rp(this)
@ brief Allocate and read method for package
subroutine allocate_scalars(this)
@ brief Allocate package scalars
subroutine bnd_ot_dv(this, idvsave, idvprint)
@ brief Output advanced package dependent-variable terms.
subroutine bnd_store_user_cond(this, nlist, rlist, condinput)
@ brief Store user-specified conductances when vsc is active
subroutine bnd_ot_obs(this)
Output observations for the package.
subroutine bnd_nur(this, neqpak, x, xtemp, dx, inewtonur, dxmax, locmax)
@ brief Apply Newton-Raphson under-relaxation for package.
subroutine bnd_ot_package_flows(this, icbcfl, ibudfl)
@ brief Output advanced package flow terms.
subroutine bnd_read_options(this)
@ brief Read additional options for package
subroutine bnd_ot_model_flows(this, icbcfl, ibudfl, icbcun, imap)
@ brief Output package flow terms.
subroutine bnd_cc(this, innertot, kiter, iend, icnvgmod, cpak, ipak, dpak)
@ brief Convergence check for package.
subroutine bnd_rp_ts(this)
Assign time series links for the package.
subroutine bnd_bd_obs(this)
Save observations for the package.
subroutine bnd_options(this, option, found)
@ brief Read additional options for package
subroutine bnd_da(this)
@ brief Deallocate package memory
subroutine bnd_bd(this, model_budget)
@ brief Add package flows to model budget.
subroutine, public addbndtolist(list, bnd)
Add boundary to package list.
subroutine bnd_cq_simrate(this, hnew, flowja, imover)
@ brief Calculate simrate.
subroutine bnd_mc(this, moffset, matrix_sln)
@ brief Map boundary package connection to matrix
class(bndtype) function, pointer, public getbndfromlist(list, idx)
Get boundary from package list.
subroutine bnd_fc(this, rhs, ia, idxglo, matrix_sln)
@ brief Copy hcof and rhs terms into solution.
subroutine allocate_arrays(this, nodelist, auxvar)
@ brief Allocate package arrays
subroutine bnd_ck(this)
@ brief Check boundary package period data
subroutine pak_setup_outputtab(this)
@ brief Setup output table for package
subroutine bnd_ac(this, moffset, sparse)
@ brief Add boundary package connection to matrix
subroutine bnd_ot_bdsummary(this, kstp, kper, iout, ibudfl)
@ brief Output advanced package budget summary.
subroutine copy_boundname(this)
@ brief Copy boundnames into boundnames_cst
subroutine bnd_df_obs(this)
Define the observation types available in the package.
subroutine bnd_reset(this)
@ brief Reset bnd package before formulating
subroutine bnd_activate_viscosity(this)
Activate viscosity terms.
subroutine bnd_cq_simtomvr(this, flowja)
@ brief Calculate flow to the mover.
subroutine bnd_read_initial_attr(this)
@ brief Read initial parameters for package
subroutine, public save_print_model_flows(icbcfl, ibudfl, icbcun, iprflow, outputtab, nbound, nodelist, flow, ibound, title, text, ipakcb, dis, naux, textmodel, textpackage, dstmodel, dstpackage, auxname, auxvar, iout, inamedbound, boundname, imap)
Save and/or print flows for a package.
subroutine set_pointers(this, neq, ibound, xnew, xold, flowja)
@ brief Set pointers to model variables
subroutine bnd_rp_log(this)
Log period input for a boundary package.
subroutine bnd_rp_obs(this)
Read and prepare observations for a package.
subroutine bnd_cf(this)
@ brief Formulate the package hcof and rhs terms.
subroutine bnd_fn(this, rhs, ia, idxglo, matrix_sln)
@ brief Add Newton-Raphson terms for package into solution.
subroutine bnd_ad(this)
@ brief Advance the boundary package
class(bndtype) function, pointer, private castasbndclass(obj)
Cast as a boundary type.
subroutine bnd_cq(this, x, flowja, iadv)
@ brief Calculate advanced package flows.
subroutine define_listlabel(this)
@ brief Define the list label for the package
subroutine pack_initialize(this)
@ brief Allocate and initialize select package members
subroutine bnd_df(this, neq, dis)
@ brief Define boundary package options and dimensions
This module contains the BudgetModule.
subroutine, public rate_accumulator(flow, rin, rout)
@ brief Rate accumulator subroutine
This module contains simulation constants.
integer(i4b), parameter linelength
maximum length of a standard line
@ tabcenter
centered table column
@ tableft
left justified table column
integer(i4b), parameter lenmodelname
maximum length of the model name
integer(i4b), parameter lenpackagename
maximum length of the package name
real(dp), parameter dnodata
real no data constant
integer(i4b), parameter lenlistlabel
maximum length of a llist label
integer(i4b), parameter lenpakloc
maximum length of a package location
integer(i4b), parameter lenftype
maximum length of a package type (DIS, WEL, OC, etc.)
integer(i4b), parameter lenauxname
maximum length of a aux variable
integer(i4b), parameter lenboundname
maximum length of a bound name
real(dp), parameter dzero
real constant zero
integer(i4b), parameter maxcharlen
maximum length of char string
integer(i4b), parameter lenmempath
maximum length of the memory path
real(dp), parameter done
real constant 1
This module defines variable data types.
character(len=lenmempath) function create_mem_path(component, subcomponent, context)
returns the path to the memory object
This module contains the base numerical package type.
This module contains the derived types ObserveType and ObsDataType.
This module contains the derived type ObsType.
subroutine, public obs_cr(obs, inobs)
@ brief Create a new ObsType object
This module contains simulation methods.
subroutine, public store_error(msg, terminate)
Store an error message.
integer(i4b) function, public count_errors()
Return number of errors.
subroutine, public store_error_unit(iunit, terminate)
Store the file unit number.
This module contains simulation variables.
character(len=maxcharlen) errmsg
error message string
subroutine, public table_cr(this, name, title)
real(dp), pointer, public totimc
simulation time at start of time step
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 tasmanager_cr(this, dis, modelname, iout)
Create the time-array series manager.
subroutine, public tsmanager_cr(this, iout, removeTsLinksOnCompletion, extendTsToEndOfSimulation)
Create the tsmanager.
Derived type for the Budget object.
This class is used to store a single deferred-length character string. It was designed to work in an ...
A generic heterogeneous doubly-linked list.