35 character(len=LENFTYPE) ::
ftype =
'IST'
36 character(len=LENPACKAGENAME) ::
text =
' IMMOBILE DOMAIN'
38 character(len=LENBUDTXT),
dimension(NBDITEMS) ::
budtxt
39 data budtxt/
' STORAGE-AQUEOUS',
' STORAGE-SORBED', &
40 ' DECAY-AQUEOUS',
' DECAY-SORBED', &
60 integer(I4B),
pointer :: icimout => null()
61 integer(I4B),
pointer :: ibudgetout => null()
62 integer(I4B),
pointer :: ibudcsv => null()
63 integer(I4B),
pointer :: ioutsorbate => null()
64 integer(I4B),
pointer :: idcy => null()
65 integer(I4B),
pointer :: isrb => null()
66 integer(I4B),
pointer :: kiter => null()
67 real(dp),
pointer,
contiguous :: cim(:) => null()
68 real(dp),
pointer,
contiguous :: cimnew(:) => null()
69 real(dp),
pointer,
contiguous :: cimold(:) => null()
70 real(dp),
pointer,
contiguous :: cimsrb(:) => null()
71 real(dp),
pointer,
contiguous :: zetaim(:) => null()
72 real(dp),
pointer,
contiguous :: porosity(:) => null()
73 real(dp),
pointer,
contiguous :: volfrac(:) => null()
74 real(dp),
pointer,
contiguous :: bulk_density(:) => null()
75 real(dp),
pointer,
contiguous :: distcoef(:) => null()
76 real(dp),
pointer,
contiguous :: sp2(:) => null()
77 real(dp),
pointer,
contiguous :: decay(:) => null()
78 real(dp),
pointer,
contiguous :: decaylast(:) => null()
79 real(dp),
pointer,
contiguous :: decayslast(:) => null()
80 real(dp),
pointer,
contiguous :: decay_sorbed(:) => null()
81 real(dp),
pointer,
contiguous :: strg(:) => null()
115 subroutine ist_create(packobj, id, ibcnum, inunit, iout, namemodel, pakname, &
118 class(
bndtype),
pointer :: packobj
119 integer(I4B),
intent(in) :: id
120 integer(I4B),
intent(in) :: ibcnum
121 integer(I4B),
intent(in) :: inunit
122 integer(I4B),
intent(in) :: iout
123 character(len=*),
intent(in) :: namemodel
124 character(len=*),
intent(in) :: pakname
135 call packobj%set_names(ibcnum, namemodel, pakname,
ftype)
139 call packobj%allocate_scalars()
142 call packobj%pack_initialize()
145 packobj%inunit = inunit
148 packobj%ibcnum = ibcnum
172 call this%ist_allocate_arrays()
176 call this%ocd%init_dbl(
'CIM', this%cimnew, this%dis,
'PRINT LAST ', &
177 'COLUMNS 10 WIDTH 11 DIGITS 4 GENERAL ', &
181 call this%read_data()
184 do n = 1, this%dis%nodes
185 this%cimnew(n) = this%cim(n)
189 call this%mst%addto_volfracim(this%volfrac)
192 call budget_cr(this%budget, this%memoryPath)
193 call this%budget%budget_df(
nbditems,
'MASS',
'M', bdzone=this%packName)
194 call this%budget%set_ibudcsv(this%ibudcsv)
198 if (this%idcy /= this%mst%idcy)
then
199 call store_error(
'DECAY must be activated consistently between the &
200 &MST and IST Packages. Activate or deactivate DECAY for both &
203 if (this%isrb /= this%mst%isrb)
then
204 call store_error(
'Sorption is active for the IST Package but it is not &
205 &compatible with the sorption option selected for the MST Package. &
206 &If sorption is active for the IST Package, then the same type of &
207 &sorption (LINEAR, FREUNDLICH, or LANGMUIR) must &
208 &be specified in the options block of the MST Package.')
211 call this%parser%StoreErrorUnit()
242 call this%BndType%bnd_ad()
250 do n = 1, this%dis%nodes
251 this%cimold(n) = this%cimnew(n)
254 do n = 1, this%dis%nodes
255 this%cimnew(n) = this%cimold(n)
262 subroutine ist_fc(this, rhs, ia, idxglo, matrix_sln)
267 real(DP),
dimension(:),
intent(inout) :: rhs
268 integer(I4B),
dimension(:),
intent(in) :: ia
269 integer(I4B),
dimension(:),
intent(in) :: idxglo
272 integer(I4B) :: n, idiag
274 real(DP) :: hhcof, rrhs
275 real(DP) :: swt, swtpdt
281 real(DP) :: volfracim
283 real(DP) :: lambda1im
284 real(DP) :: lambda2im
289 real(DP) :: cimsrbold
290 real(DP) :: cimsrbnew
291 real(DP),
dimension(9) :: ddterm
295 this%kiter = this%kiter + 1
299 do n = 1, this%dis%nodes
302 if (this%ibound(n) <= 0) cycle
305 vcell = this%dis%area(n) * (this%dis%top(n) - this%dis%bot(n))
306 swtpdt = this%fmi%gwfsat(n)
307 swt = this%fmi%gwfsatold(n,
delt)
308 thetaim = this%get_thetaim(n)
312 zetaim = this%zetaim(n)
326 if (this%idcy == 1) lambda1im = this%decay(n)
327 if (this%idcy == 2)
then
329 this%kiter, this%cimold(n), &
330 this%cimnew(n),
delt)
331 this%decaylast(n) = gamma1im
335 if (this%isrb > 0)
then
338 volfracim = this%volfrac(n)
339 rhobim = this%bulk_density(n)
342 select case (this%isrb)
345 kdnew = this%distcoef(n)
346 kdold = this%distcoef(n)
347 cimsrbnew = this%cimnew(n) * kdnew
348 cimsrbold = this%cimold(n) * kdold
372 if (this%idcy == 1)
then
373 lambda2im = this%decay_sorbed(n)
374 else if (this%idcy == 2)
then
376 this%decayslast(n), &
377 this%kiter, cimsrbold, &
379 this%decayslast(n) = gamma2im
385 volfracim, rhobim, kdnew, kdold, lambda1im, lambda2im, &
386 gamma1im, gamma2im, zetaim, ddterm, f)
387 cimold = this%cimold(n)
391 call matrix_sln%add_value_pos(idxglo(idiag), hhcof)
392 rhs(n) = rhs(n) + rrhs
406 real(DP),
dimension(:),
intent(in) :: x
407 real(DP),
dimension(:),
contiguous,
intent(inout) :: flowja
408 integer(I4B),
optional,
intent(in) :: iadv
410 integer(I4B) :: idiag
413 real(DP) :: swt, swtpdt
414 real(DP) :: hhcof, rrhs
420 real(DP) :: volfracim
422 real(DP) :: lambda1im
423 real(DP) :: lambda2im
429 real(DP) :: cimsrbold
430 real(DP) :: cimsrbnew
431 real(DP),
dimension(9) :: ddterm
435 this%budterm(:, :) =
dzero
438 do n = 1, this%dis%nodes
443 if (this%ibound(n) > 0)
then
446 vcell = this%dis%area(n) * (this%dis%top(n) - this%dis%bot(n))
447 swtpdt = this%fmi%gwfsat(n)
448 swt = this%fmi%gwfsatold(n,
delt)
449 thetaim = this%get_thetaim(n)
452 zetaim = this%zetaim(n)
466 if (this%idcy == 1) lambda1im = this%decay(n)
467 if (this%idcy == 2)
then
469 this%cimold(n), this%cimnew(n),
delt)
473 if (this%isrb > 0)
then
476 volfracim = this%volfrac(n)
477 rhobim = this%bulk_density(n)
480 select case (this%isrb)
483 kdnew = this%distcoef(n)
484 kdold = this%distcoef(n)
485 cimsrbnew = this%cimnew(n) * kdnew
486 cimsrbold = this%cimold(n) * kdold
510 if (this%idcy == 1)
then
511 lambda2im = this%decay_sorbed(n)
512 else if (this%idcy == 2)
then
514 this%decayslast(n), &
522 volfracim, rhobim, kdnew, kdold, lambda1im, lambda2im, &
523 gamma1im, gamma2im, zetaim, ddterm, f)
524 cimold = this%cimold(n)
528 rate = hhcof * x(n) - rrhs
540 idiag = this%dis%con%ia(n)
541 flowja(idiag) = flowja(idiag) + rate
544 this%cimnew(n) = cimnew
549 if (this%isrb /= 0)
then
550 call this%ist_calc_csrb(this%cimnew)
560 real(DP),
intent(in),
dimension(:) :: cim
569 if (this%ibound(n) > 0)
then
570 distcoef = this%distcoef(n)
571 if (this%isrb == 1)
then
572 csrb = cim(n) * distcoef
573 else if (this%isrb == 2)
then
575 else if (this%isrb == 3)
then
579 this%cimsrb(n) = csrb
596 type(
budgettype),
intent(inout) :: model_budget
600 integer(I4B) :: isuppress_output
603 call model_budget%addentry(ratin, ratout,
delt, this%text, &
604 isuppress_output, this%packName)
618 integer(I4B),
intent(in) :: icbcfl
619 integer(I4B),
intent(in) :: ibudfl
620 integer(I4B),
intent(in) :: icbcun
621 integer(I4B),
dimension(:),
optional,
intent(in) :: imap
624 integer(I4B) :: ibinun
625 integer(I4B) :: nbound
628 real(DP),
dimension(0) :: auxrow
631 if (this%ipakcb < 0)
then
633 elseif (this%ipakcb == 0)
then
638 if (icbcfl == 0) ibinun = 0
643 if (ibinun /= 0)
then
644 nbound = this%dis%nodes
646 call this%dis%record_srcdst_list_header(this%text, this%name_model, &
647 this%name_model, this%name_model, &
648 this%packName, naux, this%auxname, &
649 ibinun, nbound, this%iout)
653 do n = 1, this%dis%nodes
657 if (this%ibound(n) > 0)
then
664 if (ibinun /= 0)
then
665 call this%dis%record_mf6_list_entry(ibinun, n, n, rate, &
679 integer(I4B),
intent(in) :: idvsave
680 integer(I4B),
intent(in) :: idvprint
682 call this%output_immobile_concentration(idvsave, idvprint)
683 call this%output_immobile_sorbate_concentration(idvsave, idvprint)
694 integer(I4B),
intent(in) :: idvsave
695 integer(I4B),
intent(in) :: idvprint
697 integer(I4B) :: ipflg
698 integer(I4B) :: ibinun
704 if (idvsave == 0) ibinun = 0
705 if (ibinun /= 0)
then
707 iprint_opt=0, isav_opt=ibinun)
711 if (idvprint /= 0)
then
713 iprint_opt=idvprint, isav_opt=0)
724 integer(I4B),
intent(in) :: idvsave
725 integer(I4B),
intent(in) :: idvprint
727 character(len=1) :: cdatafmp =
' ', editdesc =
' '
728 integer(I4B) :: ibinun
729 integer(I4B) :: iprint, nvaluesp, nwidthp
735 if (this%ioutsorbate /= 0)
then
740 if (idvsave == 0) ibinun = 0
743 if (ibinun /= 0)
then
746 if (this%ioutsorbate /= 0)
then
747 ibinun = this%ioutsorbate
748 call this%dis%record_array(this%cimsrb, this%iout, iprint, ibinun, &
749 ' SORBATE', cdatafmp, nvaluesp, &
750 nwidthp, editdesc, dinact)
768 integer(I4B),
intent(in) :: kstp
769 integer(I4B),
intent(in) :: kper
770 integer(I4B),
intent(in) :: iout
771 integer(I4B),
intent(in) :: ibudfl
773 integer(I4B) :: isuppress_output = 0
776 call this%budget%reset()
777 call this%budget%addentry(this%budterm,
delt,
budtxt, isuppress_output)
780 call this%budget%finalize_step(
delt)
781 if (ibudfl /= 0)
then
782 call this%budget%budget_ot(kstp, kper, iout)
786 call this%budget%writecsv(
totim)
801 if (this%inunit > 0)
then
831 call this%budget%budget_da()
832 deallocate (this%budget)
833 call this%ocd%ocd_da()
834 deallocate (this%ocd)
837 call this%BndType%bnd_da()
854 call this%BndType%allocate_scalars()
857 call mem_allocate(this%icimout,
'ICIMOUT', this%memoryPath)
858 call mem_allocate(this%ibudgetout,
'IBUDGETOUT', this%memoryPath)
859 call mem_allocate(this%ibudcsv,
'IBUDCSV', this%memoryPath)
860 call mem_allocate(this%ioutsorbate,
'IOUTSORBATE', this%memoryPath)
894 call this%BndType%allocate_arrays()
897 call mem_allocate(this%strg, this%dis%nodes,
'STRG', this%memoryPath)
898 call mem_allocate(this%cim, this%dis%nodes,
'CIM', this%memoryPath)
899 call mem_allocate(this%cimnew, this%dis%nodes,
'CIMNEW', this%memoryPath)
900 call mem_allocate(this%cimold, this%dis%nodes,
'CIMOLD', this%memoryPath)
901 call mem_allocate(this%porosity, this%dis%nodes,
'POROSITY', this%memoryPath)
902 call mem_allocate(this%zetaim, this%dis%nodes,
'ZETAIM', this%memoryPath)
903 call mem_allocate(this%volfrac, this%dis%nodes,
'VOLFRAC', this%memoryPath)
904 if (this%isrb == 0)
then
905 call mem_allocate(this%bulk_density, 1,
'BULK_DENSITY', this%memoryPath)
906 call mem_allocate(this%distcoef, 1,
'DISTCOEF', this%memoryPath)
908 call mem_allocate(this%cimsrb, 1,
'SORBATE', this%memoryPath)
910 call mem_allocate(this%bulk_density, this%dis%nodes,
'BULK_DENSITY', &
912 call mem_allocate(this%distcoef, this%dis%nodes,
'DISTCOEF', &
914 call mem_allocate(this%cimsrb, this%dis%nodes,
'SORBATE', &
916 if (this%isrb == 1)
then
919 call mem_allocate(this%sp2, this%dis%nodes,
'SP2', this%memoryPath)
922 if (this%idcy == 0)
then
923 call mem_allocate(this%decay, 1,
'DECAY', this%memoryPath)
924 call mem_allocate(this%decaylast, 1,
'DECAYLAST', this%memoryPath)
926 call mem_allocate(this%decay, this%dis%nodes,
'DECAY', this%memoryPath)
927 call mem_allocate(this%decaylast, this%dis%nodes,
'DECAYLAST', &
930 if (this%isrb == 0 .and. this%idcy == 0)
then
931 call mem_allocate(this%decayslast, 1,
'DECAYSLAST', this%memoryPath)
933 call mem_allocate(this%decayslast, this%dis%nodes,
'DECAYSLAST', &
936 call mem_allocate(this%decay_sorbed, 1,
'DECAY_SORBED', this%memoryPath)
939 do n = 1, this%dis%nodes
942 this%cimnew(n) =
dzero
943 this%cimold(n) =
dzero
944 this%porosity(n) =
dzero
945 this%zetaim(n) =
dzero
946 this%volfrac(n) =
dzero
948 do n = 1,
size(this%bulk_density)
949 this%bulk_density(n) =
dzero
950 this%distcoef(n) =
dzero
951 this%cimsrb(n) =
dzero
953 do n = 1,
size(this%sp2)
956 do n = 1,
size(this%decay)
957 this%decay(n) =
dzero
958 this%decaylast(n) =
dzero
960 do n = 1,
size(this%decayslast)
961 this%decayslast(n) =
dzero
965 this%ocd%dis => this%dis
982 character(len=LINELENGTH) :: errmsg, keyword
983 character(len=LINELENGTH) :: sorption
984 character(len=LINELENGTH) :: fname
985 character(len=:),
allocatable :: keyword2
987 logical :: isfound, endOfBlock
990 character(len=*),
parameter :: fmtisvflow = &
991 "(4x,'CELL-BY-CELL FLOW INFORMATION WILL BE SAVED TO BINARY FILE &
992 &WHENEVER ICBCFL IS NOT ZERO.')"
993 character(len=*),
parameter :: fmtlinear = &
994 &
"(4x,'LINEAR SORPTION IS SELECTED. ')"
995 character(len=*),
parameter :: fmtfreundlich = &
996 &
"(4x,'FREUNDLICH SORPTION IS ACTIVE. ')"
997 character(len=*),
parameter :: fmtlangmuir = &
998 &
"(4x,'LANGMUIR SORPTION IS ACTIVE. ')"
999 character(len=*),
parameter :: fmtidcy1 = &
1000 &
"(4x,'FIRST-ORDER DECAY IS ACTIVE. ')"
1001 character(len=*),
parameter :: fmtidcy2 = &
1002 &
"(4x,'ZERO-ORDER DECAY IS ACTIVE. ')"
1003 character(len=*),
parameter :: fmtistbin = &
1004 "(4x, 'IST ', 1x, a, 1x, ' WILL BE SAVED TO FILE: ', a, &
1005 &/4x, 'OPENED ON UNIT: ', I0)"
1008 call this%parser%GetBlock(
'OPTIONS', isfound, ierr, blockrequired=.false., &
1009 supportopenclose=.true.)
1013 write (this%iout,
'(1x,a)')
'PROCESSING IMMOBILE STORAGE AND TRANSFER &
1016 call this%parser%GetNextLine(endofblock)
1017 if (endofblock)
exit
1018 call this%parser%GetStringCaps(keyword)
1019 select case (keyword)
1022 write (this%iout, fmtisvflow)
1024 call this%parser%GetRemainingLine(keyword2)
1025 call this%ocd%set_option(keyword2, this%inunit, this%iout)
1027 call this%parser%GetStringCaps(keyword)
1028 if (keyword ==
'FILEOUT')
then
1029 call this%parser%GetString(fname)
1030 call assign_iounit(this%ibudgetout, this%inunit,
"BUDGET fileout")
1031 call openfile(this%ibudgetout, this%iout, fname,
'DATA(BINARY)', &
1033 write (this%iout, fmtistbin)
'BUDGET', trim(adjustl(fname)), &
1038 &be followed by FILEOUT')
1041 call this%parser%GetStringCaps(keyword)
1042 if (keyword ==
'FILEOUT')
then
1043 call this%parser%GetString(fname)
1044 call assign_iounit(this%ibudcsv, this%inunit,
"BUDGETCSV fileout")
1045 call openfile(this%ibudcsv, this%iout, fname,
'CSV', &
1046 filstat_opt=
'REPLACE')
1047 write (this%iout, fmtistbin)
'BUDGET CSV', trim(adjustl(fname)), &
1050 call store_error(
'Optional BUDGETCSV keyword must be followed by &
1054 call store_error(
'SORBTION is not a valid option. Use &
1055 &SORPTION instead.')
1056 call this%parser%StoreErrorUnit()
1058 call this%parser%GetStringCaps(sorption)
1059 select case (sorption)
1062 write (this%iout, fmtlinear)
1065 write (this%iout, fmtfreundlich)
1068 write (this%iout, fmtlangmuir)
1070 call store_error(
'Unknown sorption type was specified ' &
1071 & //
'('//trim(adjustl(sorption))//
').'// &
1072 &
' Sorption must be specified as LINEAR, &
1073 &FREUNDLICH, or LANGMUIR.')
1074 call this%parser%StoreErrorUnit()
1076 case (
'FIRST_ORDER_DECAY')
1078 write (this%iout, fmtidcy1)
1079 case (
'ZERO_ORDER_DECAY')
1081 write (this%iout, fmtidcy2)
1083 call this%parser%GetStringCaps(keyword)
1084 if (keyword ==
'FILEOUT')
then
1085 call this%parser%GetString(fname)
1087 call openfile(this%ioutsorbate, this%iout, fname,
'DATA(BINARY)', &
1089 write (this%iout, fmtistbin) &
1090 'SORBATE', fname, this%ioutsorbate
1092 errmsg =
'Optional SORBATE keyword must be '// &
1093 'followed by FILEOUT.'
1097 write (errmsg,
'(a,a)')
'Unknown IST option: ', &
1100 call this%parser%StoreErrorUnit()
1103 write (this%iout,
'(1x,a)')
'END OF IMMOBILE STORAGE AND TRANSFER &
1133 character(len=LINELENGTH) :: errmsg, keyword
1134 character(len=:),
allocatable :: line
1135 integer(I4B) :: istart, istop, lloc, ierr
1136 logical :: isfound, endOfBlock
1137 logical,
dimension(9) :: lname
1138 character(len=24),
dimension(9) :: aname
1141 data aname(1)/
' BULK DENSITY'/
1142 data aname(2)/
'DISTRIBUTION COEFFICIENT'/
1143 data aname(3)/
' DECAY RATE'/
1144 data aname(4)/
' DECAY SORBED RATE'/
1145 data aname(5)/
' INITIAL IMMOBILE CONC'/
1146 data aname(6)/
' FIRST ORDER TRANS RATE'/
1147 data aname(7)/
'IMMOBILE DOMAIN POROSITY'/
1148 data aname(8)/
'IMMOBILE VOLUME FRACTION'/
1149 data aname(9)/
' SECOND SORPTION PARAM'/
1156 call this%parser%GetBlock(
'GRIDDATA', isfound, ierr)
1158 write (this%iout,
'(1x,a)')
'PROCESSING GRIDDATA'
1160 call this%parser%GetNextLine(endofblock)
1161 if (endofblock)
exit
1162 call this%parser%GetStringCaps(keyword)
1163 call this%parser%GetRemainingLine(line)
1165 select case (keyword)
1166 case (
'BULK_DENSITY')
1167 if (this%isrb == 0) &
1169 'BULK_DENSITY', trim(this%memoryPath))
1170 call this%dis%read_grid_array(line, lloc, istart, istop, this%iout, &
1171 this%parser%iuactive, &
1172 this%bulk_density, aname(1))
1175 if (this%isrb == 0) &
1177 trim(this%memoryPath))
1178 call this%dis%read_grid_array(line, lloc, istart, istop, this%iout, &
1179 this%parser%iuactive, this%distcoef, &
1183 if (this%idcy == 0) &
1185 trim(this%memoryPath))
1186 call this%dis%read_grid_array(line, lloc, istart, istop, this%iout, &
1187 this%parser%iuactive, this%decay, &
1190 case (
'DECAY_SORBED')
1192 'DECAY_SORBED', trim(this%memoryPath))
1193 call this%dis%read_grid_array(line, lloc, istart, istop, this%iout, &
1194 this%parser%iuactive, &
1195 this%decay_sorbed, aname(4))
1198 call this%dis%read_grid_array(line, lloc, istart, istop, this%iout, &
1199 this%parser%iuactive, this%cim, &
1203 call this%dis%read_grid_array(line, lloc, istart, istop, this%iout, &
1204 this%parser%iuactive, this%zetaim, &
1208 call this%dis%read_grid_array(line, lloc, istart, istop, this%iout, &
1209 this%parser%iuactive, this%porosity, &
1213 call this%dis%read_grid_array(line, lloc, istart, istop, this%iout, &
1214 this%parser%iuactive, this%volfrac, &
1218 if (this%isrb < 2) &
1220 trim(this%memoryPath))
1221 call this%dis%read_grid_array(line, lloc, istart, istop, this%iout, &
1222 this%parser%iuactive, this%sp2, &
1226 write (errmsg,
'(a)') &
1227 'THETAIM is no longer supported. See Chapter 9 in &
1228 &mf6suptechinfo.pdf for revised parameterization of mobile and &
1229 &immobile domain simulations.'
1231 call this%parser%StoreErrorUnit()
1233 write (errmsg,
'(a,a)')
'Unknown GRIDDATA tag: ', trim(keyword)
1235 call this%parser%StoreErrorUnit()
1238 write (this%iout,
'(1x,a)')
'END PROCESSING GRIDDATA'
1240 write (errmsg,
'(a)')
'Required GRIDDATA block not found.'
1242 call this%parser%StoreErrorUnit()
1246 if (this%isrb > 0)
then
1247 if (.not. lname(1))
then
1248 write (errmsg,
'(a)')
'Sorption is active but BULK_DENSITY &
1249 ¬ specified. BULK_DENSITY must be specified in griddata block.'
1252 if (.not. lname(2))
then
1253 write (errmsg,
'(a)')
'Sorption is active but distribution &
1254 &coefficient not specified. DISTCOEF must be specified in &
1258 if (this%isrb > 1 .and. .not. lname(9))
then
1259 write (errmsg,
'(a)')
'Nonlinear sorption is active but SP2 &
1260 ¬ specified. SP2 must be specified in GRIDDATA block when &
1261 &FREUNDLICH or LANGMUIR sorption is active.'
1266 write (this%iout,
'(1x,a)')
'Warning. Sorption is not active but &
1267 &BULK_DENSITY was specified. BULK_DENSITY will have no affect on &
1268 &simulation results.'
1271 write (this%iout,
'(1x,a)')
'Warning. Sorption is not active but &
1272 &distribution coefficient was specified. DISTCOEF will have &
1273 &no affect on simulation results.'
1276 write (this%iout,
'(1x,a)')
'Warning. Sorption is not active but &
1277 &SP2 was specified. SP2 will have no affect on simulation results.'
1282 if (this%idcy > 0)
then
1283 if (.not. lname(3))
then
1284 write (errmsg,
'(a)')
'First- or zero-order decay is &
1285 &active but the first rate coefficient was not specified. &
1286 &Decay must be specified in GRIDDATA block.'
1289 if (.not. lname(4))
then
1293 if (this%isrb > 0)
then
1294 write (errmsg,
'(a)')
'DECAY_SORBED not provided in GRIDDATA &
1295 &block but decay and sorption are active. Specify DECAY_SORBED &
1296 &in GRIDDATA block.'
1302 write (this%iout,
'(1x,a)')
'Warning. First- or zero-order decay &
1303 &is not active but DECAY was specified. DECAY will &
1304 &have no affect on simulation results.'
1307 write (this%iout,
'(1x,a)')
'Warning. First- or zero-order decay &
1308 &is not active but DECAY_SORBED was specified. &
1309 &DECAY_SORBED will have no affect on simulation &
1316 if (.not. lname(5))
then
1317 write (this%iout,
'(1x,a)')
'Warning. Dual domain is active but &
1318 &initial immobile domain concentration was not specified. &
1319 &Setting CIM to zero.'
1321 if (.not. lname(6))
then
1322 write (errmsg,
'(a)')
'Dual domain is active but dual &
1323 &domain mass transfer rate (ZETAIM) was not specified. ZETAIM &
1324 &must be specified in GRIDDATA block.'
1327 if (.not. lname(7))
then
1328 write (errmsg,
'(a)')
'Dual domain is active but &
1329 &immobile domain POROSITY was not specified. POROSITY &
1330 &must be specified in GRIDDATA block.'
1333 if (.not. lname(8))
then
1334 write (errmsg,
'(a)')
'Dual domain is active but &
1335 &immobile domain VOLFRAC was not specified. VOLFRAC &
1336 &must be specified in GRIDDATA block. This is a new &
1337 &requirement for MODFLOW versions later than version &
1344 call this%parser%StoreErrorUnit()
1357 integer(I4B),
intent(in) :: node
1361 thetaim = this%volfrac(node) * this%porosity(node)
1373 volfracim, rhobim, kdnew, kdold, &
1374 lambda1im, lambda2im, &
1375 gamma1im, gamma2im, zetaim, ddterm, f)
1377 real(DP),
intent(in) :: thetaim
1378 real(DP),
intent(in) :: vcell
1379 real(DP),
intent(in) :: delt
1380 real(DP),
intent(in) :: swtpdt
1381 real(DP),
intent(in) :: volfracim
1382 real(DP),
intent(in) :: rhobim
1383 real(DP),
intent(in) :: kdnew
1384 real(DP),
intent(in) :: kdold
1385 real(DP),
intent(in) :: lambda1im
1386 real(DP),
intent(in) :: lambda2im
1387 real(DP),
intent(in) :: gamma1im
1388 real(DP),
intent(in) :: gamma2im
1389 real(DP),
intent(in) :: zetaim
1390 real(DP),
dimension(:),
intent(inout) :: ddterm
1391 real(DP),
intent(inout) :: f
1402 ddterm(1) = thetaim * vcell * tled
1403 ddterm(2) = thetaim * vcell * tled
1404 ddterm(3) = volfracim * rhobim * vcell * kdnew * tled
1405 ddterm(4) = volfracim * rhobim * vcell * kdold * tled
1406 ddterm(5) = thetaim * lambda1im * vcell
1407 ddterm(6) = lambda2im * volfracim * rhobim * kdnew * vcell
1408 ddterm(7) = thetaim * gamma1im * vcell
1409 ddterm(8) = gamma2im * volfracim * rhobim * vcell
1410 ddterm(9) = vcell * swtpdt * zetaim
1413 f = ddterm(1) + ddterm(3) + ddterm(5) + ddterm(6) + ddterm(9)
1424 real(DP),
dimension(:),
intent(in) :: ddterm
1425 real(DP),
intent(in) :: f
1426 real(DP),
intent(in) :: cimold
1427 real(DP),
intent(inout) :: hcof
1428 real(DP),
intent(inout) :: rhs
1431 hcof = ddterm(9)**2 / f - ddterm(9)
1435 rhs = (ddterm(2) + ddterm(4)) * cimold - ddterm(7) - ddterm(8)
1436 rhs = rhs * ddterm(9) / f
1447 real(dp),
dimension(:),
intent(in) :: ddterm
1448 real(dp),
intent(in) :: f
1449 real(dp),
intent(in) :: cimold
1450 real(dp),
intent(in) :: cnew
1456 cimnew = (ddterm(2) + ddterm(4)) * cimold + ddterm(9) * cnew - ddterm(7) &
1470 real(DP),
dimension(:, :),
intent(inout) :: budterm
1471 real(DP),
dimension(:),
intent(in) :: ddterm
1472 real(DP),
intent(in) :: cimnew
1473 real(DP),
intent(in) :: cimold
1474 real(DP),
intent(in) :: cnew
1475 integer(I4B),
intent(in) :: idcy
1482 rate = -ddterm(1) * cimnew + ddterm(2) * cimold
1483 if (rate >
dzero)
then
1484 budterm(1, i) = budterm(1, i) + rate
1486 budterm(2, i) = budterm(2, i) - rate
1491 rate = -ddterm(3) * cimnew + ddterm(4) * cimold
1492 if (rate >
dzero)
then
1493 budterm(1, i) = budterm(1, i) + rate
1495 budterm(2, i) = budterm(2, i) - rate
1502 rate = -ddterm(5) * cimnew
1503 else if (idcy == 2)
then
1508 if (rate >
dzero)
then
1509 budterm(1, i) = budterm(1, i) + rate
1511 budterm(2, i) = budterm(2, i) - rate
1517 rate = -ddterm(6) * cimnew
1518 else if (idcy == 2)
then
1523 if (rate >
dzero)
then
1524 budterm(1, i) = budterm(1, i) + rate
1526 budterm(2, i) = budterm(2, i) - rate
1531 rate = ddterm(9) * cnew - ddterm(9) * cimnew
1532 if (rate >
dzero)
then
1533 budterm(1, i) = budterm(1, i) + rate
1535 budterm(2, i) = budterm(2, i) - rate
This module contains the base boundary package.
This module contains the BudgetModule.
subroutine, public budget_cr(this, name_model)
@ brief Create a new budget object
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
@ mnormal
normal output mode
integer(i4b), parameter lenpackagename
maximum length of the package name
real(dp), parameter dhnoflo
real no flow constant
real(dp), parameter dhalf
real constant 1/2
integer(i4b), parameter lenftype
maximum length of a package type (DIS, WEL, OC, etc.)
real(dp), parameter dzero
real constant zero
integer(i4b), parameter lenbudtxt
maximum length of a budget component names
real(dp), parameter done
real constant 1
– @ brief Immobile Storage and Transfer (IST) Module
subroutine ist_da(this)
@ brief Deallocate package memory
subroutine ist_calc_csrb(this, cim)
@ brief Calculate immobile sorbed concentration
subroutine ist_rp(this)
@ brief Read and prepare method for package
real(dp) function get_ddconc(ddterm, f, cimold, cnew)
@ brief Calculate the immobile domain concentration
subroutine, public ist_create(packobj, id, ibcnum, inunit, iout, namemodel, pakname, fmi, mst)
@ brief Create a new package object
real(dp) function get_thetaim(this, node)
@ brief Return thetaim
subroutine get_hcofrhs(ddterm, f, cimold, hcof, rhs)
@ brief Calculate the hcof and rhs terms for immobile domain
subroutine get_ddterm(thetaim, vcell, delt, swtpdt, volfracim, rhobim, kdnew, kdold, lambda1im, lambda2im, gamma1im, gamma2im, zetaim, ddterm, f)
@ brief Calculate immobile domain equation terms
integer(i4b), parameter nbditems
subroutine output_immobile_sorbate_concentration(this, idvsave, idvprint)
@ brief Output immobile domain sorbate concentration.
subroutine ist_ot_model_flows(this, icbcfl, ibudfl, icbcun, imap)
@ brief Output model flow terms.
subroutine ist_read_dimensions(this)
@ brief Read dimensions for package
subroutine allocate_scalars(this)
@ brief Allocate package scalars
character(len=lenftype) ftype
subroutine ist_ar(this)
@ brief Allocate and read method for package
subroutine ist_ot_bdsummary(this, kstp, kper, iout, ibudfl)
@ brief Output IST package budget summary.
subroutine ist_ot_dv(this, idvsave, idvprint)
@ brief Output dependent variables.
subroutine ist_allocate_arrays(this)
@ brief Allocate package arrays
subroutine read_data(this)
@ brief Read data for package
subroutine ist_cq(this, x, flowja, iadv)
@ brief Calculate package flows.
subroutine ist_ad(this)
@ brief Advance the ist package
subroutine accumulate_budterm(budterm, ddterm, cimnew, cimold, cnew, idcy)
@ brief Calculate the immobile domain budget terms
subroutine ist_bd(this, model_budget)
@ brief Add package flows to model budget.
subroutine ist_fc(this, rhs, ia, idxglo, matrix_sln)
@ brief Fill coefficient method for package
character(len=lenbudtxt), dimension(nbditems) budtxt
subroutine read_options(this)
@ brief Read options for package
character(len=lenpackagename) text
subroutine output_immobile_concentration(this, idvsave, idvprint)
@ brief Output immobile domain aqueous concentration.
– @ brief Mobile Storage and Transfer (MST) Module
real(dp) function get_zero_order_decay(decay_rate_usr, decay_rate_last, kiter, cold, cnew, delt)
@ brief Calculate zero-order decay rate and constrain if necessary
real(dp) function get_freundlich_derivative(conc, kf, a)
@ brief Calculate sorption derivative using Freundlich
real(dp) function get_langmuir_kd(conc, kl, sbar)
@ brief Get effective Langmuir distribution coefficient
real(dp) function get_freundlich_conc(conc, kf, a)
@ brief Calculate sorption concentration using Freundlich
real(dp) function get_freundlich_kd(conc, kf, a)
@ brief Get effective Freundlich distribution coefficient
real(dp) function get_langmuir_derivative(conc, kl, sbar)
@ brief Calculate sorption derivative using Langmuir
real(dp) function get_langmuir_conc(conc, kl, sbar)
@ brief Calculate sorption concentration using Langmuir
This module defines variable data types.
Output control data module.
subroutine, public ocd_cr(ocdobj)
@ brief Create a new output control data type.
This module contains simulation methods.
subroutine, public store_error(msg, terminate)
Store an error message.
integer(i4b) function, public count_errors()
Return number of errors.
This module contains simulation variables.
integer(i4b) ifailedstepretry
current retry for this time step
logical(lgp), pointer, public endofperiod
flag indicating end of stress period
real(dp), pointer, public totim
time relative to start of simulation
integer(i4b), pointer, public kstp
current time step number
real(dp), pointer, public delt
length of the current time step
Derived type for the Budget object.
@ brief Immobile storage and transfer
@ brief Mobile storage and transfer
Output control data type.