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', &
59 character(len=LINELENGTH) :: lstfmt
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()
118 subroutine ist_create(packobj, id, ibcnum, inunit, iout, namemodel, pakname, &
121 class(
bndtype),
pointer :: packobj
122 integer(I4B),
intent(in) :: id
123 integer(I4B),
intent(in) :: ibcnum
124 integer(I4B),
intent(in) :: inunit
125 integer(I4B),
intent(in) :: iout
126 character(len=*),
intent(in) :: namemodel
127 character(len=*),
intent(in) :: pakname
128 character(len=*),
intent(in) :: mempath
139 call packobj%set_names(ibcnum, namemodel, pakname,
ftype, mempath)
143 call packobj%allocate_scalars()
146 call packobj%pack_initialize()
149 packobj%inunit = inunit
152 packobj%ibcnum = ibcnum
176 call this%ist_allocate_arrays()
180 call this%ocd%init_dbl(
'CIM', this%cimnew, this%dis,
'PRINT LAST ', &
181 'COLUMNS 10 WIDTH 11 DIGITS 4 GENERAL ', &
185 if (this%lstfmt /=
'')
then
186 call this%ocd%set_prnfmt(trim(this%lstfmt)//
" ", 0)
190 call this%source_data()
193 do n = 1, this%dis%nodes
194 this%cimnew(n) = this%cim(n)
198 call this%mst%addto_volfracim(this%volfrac)
201 call budget_cr(this%budget, this%memoryPath)
202 call this%budget%budget_df(
nbditems,
'MASS',
'M', bdzone=this%packName)
203 call this%budget%set_ibudcsv(this%ibudcsv)
207 if (this%idcy /= this%mst%idcy)
then
208 call store_error(
'DECAY must be activated consistently between the &
209 &MST and IST Packages. Activate or deactivate DECAY for both &
212 if (this%isrb /= this%mst%isrb)
then
213 call store_error(
'SORPTION must be activated consistently between the &
214 &MST and IST Packages. Activate or deactivate SORPTION for both &
215 &Packages. If activated, the same type of sorption (LINEAR, &
216 &FREUNDLICH, or LANGMUIR) must be specified in the options block of &
217 &both the MST and IST Packages.')
251 call this%BndType%bnd_ad()
259 do n = 1, this%dis%nodes
260 this%cimold(n) = this%cimnew(n)
263 do n = 1, this%dis%nodes
264 this%cimnew(n) = this%cimold(n)
271 subroutine ist_fc(this, rhs, ia, idxglo, matrix_sln)
276 real(DP),
dimension(:),
intent(inout) :: rhs
277 integer(I4B),
dimension(:),
intent(in) :: ia
278 integer(I4B),
dimension(:),
intent(in) :: idxglo
281 integer(I4B) :: n, idiag
283 real(DP) :: hhcof, rrhs
284 real(DP) :: swt, swtpdt
290 real(DP) :: volfracim
292 real(DP) :: lambda1im
293 real(DP) :: lambda2im
298 real(DP) :: cimsrbold
299 real(DP) :: cimsrbnew
300 real(DP),
dimension(9) :: ddterm
304 this%kiter = this%kiter + 1
308 do n = 1, this%dis%nodes
311 if (this%ibound(n) <= 0) cycle
314 vcell = this%dis%area(n) * (this%dis%top(n) - this%dis%bot(n))
315 swtpdt = this%fmi%gwfsat(n)
316 swt = this%fmi%gwfsatold(n,
delt)
317 thetaim = this%get_thetaim(n)
321 zetaim = this%zetaim(n)
335 if (this%idcy == 1) lambda1im = this%decay(n)
336 if (this%idcy == 2)
then
338 this%kiter, this%cimold(n), &
339 this%cimnew(n),
delt)
340 this%decaylast(n) = gamma1im
344 if (this%isrb > 0)
then
347 volfracim = this%volfrac(n)
348 rhobim = this%bulk_density(n)
351 select case (this%isrb)
354 kdnew = this%distcoef(n)
355 kdold = this%distcoef(n)
356 cimsrbnew = this%cimnew(n) * kdnew
357 cimsrbold = this%cimold(n) * kdold
381 if (this%idcy == 1)
then
382 lambda2im = this%decay_sorbed(n)
383 else if (this%idcy == 2)
then
385 this%decayslast(n), &
386 this%kiter, cimsrbold, &
388 this%decayslast(n) = gamma2im
394 volfracim, rhobim, kdnew, kdold, lambda1im, lambda2im, &
395 gamma1im, gamma2im, zetaim, ddterm, f)
396 cimold = this%cimold(n)
400 call matrix_sln%add_value_pos(idxglo(idiag), hhcof)
401 rhs(n) = rhs(n) + rrhs
415 real(DP),
dimension(:),
intent(in) :: x
416 real(DP),
dimension(:),
contiguous,
intent(inout) :: flowja
417 integer(I4B),
optional,
intent(in) :: iadv
419 integer(I4B) :: idiag
422 real(DP) :: swt, swtpdt
423 real(DP) :: hhcof, rrhs
429 real(DP) :: volfracim
431 real(DP) :: lambda1im
432 real(DP) :: lambda2im
438 real(DP) :: cimsrbold
439 real(DP) :: cimsrbnew
440 real(DP),
dimension(9) :: ddterm
444 this%budterm(:, :) =
dzero
447 do n = 1, this%dis%nodes
452 if (this%ibound(n) > 0)
then
455 vcell = this%dis%area(n) * (this%dis%top(n) - this%dis%bot(n))
456 swtpdt = this%fmi%gwfsat(n)
457 swt = this%fmi%gwfsatold(n,
delt)
458 thetaim = this%get_thetaim(n)
461 zetaim = this%zetaim(n)
475 if (this%idcy == 1) lambda1im = this%decay(n)
476 if (this%idcy == 2)
then
478 this%cimold(n), this%cimnew(n),
delt)
482 if (this%isrb > 0)
then
485 volfracim = this%volfrac(n)
486 rhobim = this%bulk_density(n)
489 select case (this%isrb)
492 kdnew = this%distcoef(n)
493 kdold = this%distcoef(n)
494 cimsrbnew = this%cimnew(n) * kdnew
495 cimsrbold = this%cimold(n) * kdold
519 if (this%idcy == 1)
then
520 lambda2im = this%decay_sorbed(n)
521 else if (this%idcy == 2)
then
523 this%decayslast(n), &
531 volfracim, rhobim, kdnew, kdold, lambda1im, lambda2im, &
532 gamma1im, gamma2im, zetaim, ddterm, f)
533 cimold = this%cimold(n)
537 rate = hhcof * x(n) - rrhs
549 idiag = this%dis%con%ia(n)
550 flowja(idiag) = flowja(idiag) + rate
553 this%cimnew(n) = cimnew
558 if (this%isrb /= 0)
then
559 call this%ist_calc_csrb(this%cimnew)
569 real(DP),
intent(in),
dimension(:) :: cim
578 if (this%ibound(n) > 0)
then
579 distcoef = this%distcoef(n)
580 if (this%isrb == 1)
then
581 csrb = cim(n) * distcoef
582 else if (this%isrb == 2)
then
584 else if (this%isrb == 3)
then
588 this%cimsrb(n) = csrb
605 type(
budgettype),
intent(inout) :: model_budget
609 integer(I4B) :: isuppress_output
612 call model_budget%addentry(ratin, ratout,
delt, this%text, &
613 isuppress_output, this%packName)
627 integer(I4B),
intent(in) :: icbcfl
628 integer(I4B),
intent(in) :: ibudfl
629 integer(I4B),
intent(in) :: icbcun
630 integer(I4B),
dimension(:),
optional,
intent(in) :: imap
633 integer(I4B) :: ibinun
634 integer(I4B) :: nbound
637 real(DP),
dimension(0) :: auxrow
640 if (this%ipakcb < 0)
then
642 elseif (this%ipakcb == 0)
then
647 if (icbcfl == 0) ibinun = 0
652 if (ibinun /= 0)
then
653 nbound = this%dis%nodes
655 call this%dis%record_srcdst_list_header(this%text, this%name_model, &
656 this%name_model, this%name_model, &
657 this%packName, naux, this%auxname, &
658 ibinun, nbound, this%iout)
662 do n = 1, this%dis%nodes
666 if (this%ibound(n) > 0)
then
673 if (ibinun /= 0)
then
674 call this%dis%record_mf6_list_entry(ibinun, n, n, rate, &
688 integer(I4B),
intent(in) :: idvsave
689 integer(I4B),
intent(in) :: idvprint
691 call this%output_immobile_concentration(idvsave, idvprint)
692 call this%output_immobile_sorbate_concentration(idvsave, idvprint)
703 integer(I4B),
intent(in) :: idvsave
704 integer(I4B),
intent(in) :: idvprint
706 integer(I4B) :: ipflg
707 integer(I4B) :: ibinun
713 if (idvsave == 0) ibinun = 0
714 if (ibinun /= 0)
then
716 iprint_opt=0, isav_opt=ibinun)
720 if (idvprint /= 0)
then
722 iprint_opt=idvprint, isav_opt=0)
733 integer(I4B),
intent(in) :: idvsave
734 integer(I4B),
intent(in) :: idvprint
736 character(len=1) :: cdatafmp =
' ', editdesc =
' '
737 integer(I4B) :: ibinun
738 integer(I4B) :: iprint, nvaluesp, nwidthp
744 if (this%ioutsorbate /= 0)
then
749 if (idvsave == 0) ibinun = 0
752 if (ibinun /= 0)
then
755 if (this%ioutsorbate /= 0)
then
756 ibinun = this%ioutsorbate
757 call this%dis%record_array(this%cimsrb, this%iout, iprint, ibinun, &
758 ' SORBATE', cdatafmp, nvaluesp, &
759 nwidthp, editdesc, dinact)
777 integer(I4B),
intent(in) :: kstp
778 integer(I4B),
intent(in) :: kper
779 integer(I4B),
intent(in) :: iout
780 integer(I4B),
intent(in) :: ibudfl
782 integer(I4B) :: isuppress_output = 0
785 call this%budget%reset()
786 call this%budget%addentry(this%budterm,
delt,
budtxt, isuppress_output)
789 call this%budget%finalize_step(
delt)
790 if (ibudfl /= 0)
then
791 call this%budget%budget_ot(kstp, kper, iout)
795 call this%budget%writecsv(
totim)
810 if (this%inunit > 0)
then
840 call this%budget%budget_da()
841 deallocate (this%budget)
842 call this%ocd%ocd_da()
843 deallocate (this%ocd)
846 call this%BndType%bnd_da()
863 call this%BndType%allocate_scalars()
866 call mem_allocate(this%icimout,
'ICIMOUT', this%memoryPath)
867 call mem_allocate(this%ibudgetout,
'IBUDGETOUT', this%memoryPath)
868 call mem_allocate(this%ibudcsv,
'IBUDCSV', this%memoryPath)
869 call mem_allocate(this%ioutsorbate,
'IOUTSORBATE', this%memoryPath)
904 call this%BndType%allocate_arrays()
907 call mem_allocate(this%strg, this%dis%nodes,
'STRG', this%memoryPath)
908 call mem_allocate(this%cim, this%dis%nodes,
'CIM', this%memoryPath)
909 call mem_allocate(this%cimnew, this%dis%nodes,
'CIMNEW', this%memoryPath)
910 call mem_allocate(this%cimold, this%dis%nodes,
'CIMOLD', this%memoryPath)
911 call mem_allocate(this%porosity, this%dis%nodes,
'POROSITY', this%memoryPath)
912 call mem_allocate(this%zetaim, this%dis%nodes,
'ZETAIM', this%memoryPath)
913 call mem_allocate(this%volfrac, this%dis%nodes,
'VOLFRAC', this%memoryPath)
914 if (this%isrb == 0)
then
915 call mem_allocate(this%bulk_density, 1,
'BULK_DENSITY', this%memoryPath)
916 call mem_allocate(this%distcoef, 1,
'DISTCOEF', this%memoryPath)
918 call mem_allocate(this%cimsrb, 1,
'SORBATE', this%memoryPath)
920 call mem_allocate(this%bulk_density, this%dis%nodes,
'BULK_DENSITY', &
922 call mem_allocate(this%distcoef, this%dis%nodes,
'DISTCOEF', &
924 call mem_allocate(this%cimsrb, this%dis%nodes,
'SORBATE', &
926 if (this%isrb == 1)
then
929 call mem_allocate(this%sp2, this%dis%nodes,
'SP2', this%memoryPath)
932 if (this%idcy == 0)
then
933 call mem_allocate(this%decay, 1,
'DECAY', this%memoryPath)
934 call mem_allocate(this%decaylast, 1,
'DECAYLAST', this%memoryPath)
936 call mem_allocate(this%decay, this%dis%nodes,
'DECAY', this%memoryPath)
937 call mem_allocate(this%decaylast, this%dis%nodes,
'DECAYLAST', &
940 if (this%isrb == 0 .and. this%idcy == 0)
then
941 call mem_allocate(this%decayslast, 1,
'DECAYSLAST', this%memoryPath)
943 call mem_allocate(this%decayslast, this%dis%nodes,
'DECAYSLAST', &
946 call mem_allocate(this%decay_sorbed, 1,
'DECAY_SORBED', this%memoryPath)
949 do n = 1, this%dis%nodes
952 this%cimnew(n) =
dzero
953 this%cimold(n) =
dzero
954 this%porosity(n) =
dzero
955 this%zetaim(n) =
dzero
956 this%volfrac(n) =
dzero
958 do n = 1,
size(this%bulk_density)
959 this%bulk_density(n) =
dzero
960 this%distcoef(n) =
dzero
961 this%cimsrb(n) =
dzero
963 do n = 1,
size(this%sp2)
966 do n = 1,
size(this%decay)
967 this%decay(n) =
dzero
968 this%decaylast(n) =
dzero
970 do n = 1,
size(this%decayslast)
971 this%decayslast(n) =
dzero
975 this%ocd%dis => this%dis
993 character(len=LINELENGTH) :: prnfmt
994 integer(I4B),
pointer :: columns, width, digits
996 character(len=LENVARNAME),
dimension(3) :: sorption_method = &
997 &[character(len=LENVARNAME) ::
'LINEAR',
'FREUNDLICH',
'LANGMUIR']
998 character(len=
linelength) :: sorbate_fname, cim6_fname, budget_fname, &
1005 call mem_set_value(this%ipakcb,
'SAVE_FLOWS', this%input_mempath, &
1007 call mem_set_value(budget_fname,
'BUDGETFILE', this%input_mempath, &
1009 call mem_set_value(budgetcsv_fname,
'BUDGETCSVFILE', this%input_mempath, &
1010 found%budgetcsvfile)
1011 call mem_set_value(this%isrb,
'SORPTION', this%input_mempath, &
1012 sorption_method, found%sorption)
1013 call mem_set_value(this%idcy,
'ORDER1_DECAY', this%input_mempath, &
1015 call mem_set_value(this%idcy,
'ORDER0_DECAY', this%input_mempath, &
1017 call mem_set_value(cim6_fname,
'CIMFILE', this%input_mempath, &
1019 call mem_set_value(sorbate_fname,
'SORBATEFILE', this%input_mempath, &
1021 call mem_set_value(columns,
'COLUMNS', this%input_mempath, &
1031 if (found%save_flows) this%ipakcb = -1
1032 if (found%budgetfile)
then
1033 call assign_iounit(this%ibudgetout, this%inunit,
"BUDGET fileout")
1034 call openfile(this%ibudgetout, this%iout, budget_fname,
'DATA(BINARY)', &
1037 if (found%budgetcsvfile)
then
1038 call assign_iounit(this%ibudcsv, this%inunit,
"BUDGETCSV fileout")
1039 call openfile(this%ibudcsv, this%iout, budgetcsv_fname,
'CSV', &
1040 filstat_opt=
'REPLACE')
1042 if (found%sorption)
then
1043 if (this%isrb == 0)
then
1044 call store_error(
'Unknown sorption type was specified. &
1045 &Sorption must be specified as LINEAR, &
1046 &FREUNDLICH, or LANGMUIR.')
1050 if (found%order1_decay) this%idcy = 1
1051 if (found%order0_decay) this%idcy = 2
1052 if (found%cimfile)
then
1053 call this%ocd%set_ocfile(cim6_fname, this%iout)
1055 if (found%columns .and. found%width .and. &
1056 found%digits .and. found%format)
then
1057 write (this%lstfmt,
'(a,i0,a,i0,a,i0,a)')
'COLUMNS ', columns, &
1058 ' WIDTH ', width,
' DIGITS ', digits,
' '//trim(prnfmt)
1060 if (found%sorbatefile)
then
1062 call openfile(this%ioutsorbate, this%iout, sorbate_fname, &
1067 if (this%iout > 0)
then
1068 call this%log_options(found, cim6_fname, budget_fname, &
1069 budgetcsv_fname, sorbate_fname)
1072 deallocate (columns)
1080 budgetcsv_fname, sorbate_fname)
1084 character(len=*),
intent(in) :: cim6_fname
1085 character(len=*),
intent(in) :: budget_fname
1086 character(len=*),
intent(in) :: budgetcsv_fname
1087 character(len=*),
intent(in) :: sorbate_fname
1089 character(len=*),
parameter :: fmtisvflow = &
1090 "(4x,'CELL-BY-CELL FLOW INFORMATION WILL BE SAVED TO BINARY FILE &
1091 &WHENEVER ICBCFL IS NOT ZERO.')"
1092 character(len=*),
parameter :: fmtlinear = &
1093 &
"(4x,'LINEAR SORPTION IS SELECTED. ')"
1094 character(len=*),
parameter :: fmtfreundlich = &
1095 &
"(4x,'FREUNDLICH SORPTION IS ACTIVE. ')"
1096 character(len=*),
parameter :: fmtlangmuir = &
1097 &
"(4x,'LANGMUIR SORPTION IS ACTIVE. ')"
1098 character(len=*),
parameter :: fmtidcy1 = &
1099 &
"(4x,'FIRST-ORDER DECAY IS ACTIVE. ')"
1100 character(len=*),
parameter :: fmtidcy2 = &
1101 &
"(4x,'ZERO-ORDER DECAY IS ACTIVE. ')"
1102 character(len=*),
parameter :: fmtistbin = &
1103 "(4x, 'IST ', 1x, a, 1x, ' WILL BE SAVED TO FILE: ', a, &
1104 &/4x, 'OPENED ON UNIT: ', I0)"
1106 write (this%iout,
'(1x,a)')
'PROCESSING IMMOBILE STORAGE AND TRANSFER &
1108 if (found%save_flows)
then
1109 write (this%iout, fmtisvflow)
1111 if (found%budgetfile)
then
1112 write (this%iout, fmtistbin)
'BUDGET', trim(adjustl(budget_fname)), &
1115 if (found%budgetcsvfile)
then
1116 write (this%iout, fmtistbin)
'BUDGET CSV', trim(adjustl(budgetcsv_fname)), &
1119 if (found%sorption)
then
1120 select case (this%isrb)
1122 write (this%iout, fmtlinear)
1124 write (this%iout, fmtfreundlich)
1126 write (this%iout, fmtlangmuir)
1129 if (found%order1_decay)
then
1130 write (this%iout, fmtidcy1)
1132 if (found%order0_decay)
then
1133 write (this%iout, fmtidcy2)
1135 if (found%sorbatefile)
then
1136 write (this%iout, fmtistbin) &
1137 'SORBATE', sorbate_fname, this%ioutsorbate
1139 write (this%iout,
'(1x,a)')
'END OF IMMOBILE STORAGE AND TRANSFER &
1154 call this%source_options()
1175 integer(I4B) :: asize
1176 integer(I4B),
dimension(:),
pointer,
contiguous :: map
1180 if (this%dis%nodes < this%dis%nodesuser) map => this%dis%nodeuser
1183 if (this%isrb == 0)
then
1184 call get_isize(
'BULK_DENSITY', this%input_mempath, asize)
1187 'BULK_DENSITY', this%memoryPath)
1188 call get_isize(
'DISTCOEF', this%input_mempath, asize)
1193 if (this%idcy == 0)
then
1194 call get_isize(
'DECAY', this%input_mempath, asize)
1196 call mem_reallocate(this%decay, this%dis%nodes,
'DECAY', this%memoryPath)
1198 call get_isize(
'DECAY_SORBED', this%input_mempath, asize)
1201 'DECAY_SORBED', this%memoryPath)
1203 if (this%isrb < 2)
then
1204 call get_isize(
'SP2', this%input_mempath, asize)
1206 call mem_reallocate(this%sp2, this%dis%nodes,
'SP2', this%memoryPath)
1210 call mem_set_value(this%porosity,
'POROSITY', this%input_mempath, map, &
1212 call mem_set_value(this%volfrac,
'VOLFRAC', this%input_mempath, map, &
1214 call mem_set_value(this%zetaim,
'ZETAIM', this%input_mempath, map, &
1216 call mem_set_value(this%cim,
'CIM', this%input_mempath, map, &
1218 call mem_set_value(this%decay,
'DECAY', this%input_mempath, map, &
1220 call mem_set_value(this%decay_sorbed,
'DECAY_SORBED', this%input_mempath, &
1221 map, found%decay_sorbed)
1222 call mem_set_value(this%bulk_density,
'BULK_DENSITY', this%input_mempath, &
1223 map, found%bulk_density)
1224 call mem_set_value(this%distcoef,
'DISTCOEF', this%input_mempath, map, &
1226 call mem_set_value(this%sp2,
'SP2', this%input_mempath, map, &
1230 if (this%iout > 0)
then
1231 call this%log_data(found)
1235 if (this%isrb > 0)
then
1236 if (.not. found%bulk_density)
then
1237 write (
errmsg,
'(a)')
'Sorption is active but BULK_DENSITY &
1238 ¬ specified. BULK_DENSITY must be specified in GRIDDATA block.'
1241 if (.not. found%distcoef)
then
1242 write (
errmsg,
'(a)')
'Sorption is active but distribution &
1243 &coefficient not specified. DISTCOEF must be specified in &
1247 if (this%isrb > 1)
then
1248 if (.not. found%sp2)
then
1249 write (
errmsg,
'(a)')
'Freundlich or langmuir sorption is active &
1250 &but SP2 not specified. SP2 must be specified in &
1256 if (found%bulk_density)
then
1257 write (
warnmsg,
'(a)')
'Sorption is not active but &
1258 &BULK_DENSITY was specified. BULK_DENSITY will have no affect on &
1259 &simulation results.'
1261 write (this%iout,
'(1x,a)')
'WARNING. '//
warnmsg
1263 if (found%distcoef)
then
1264 write (
warnmsg,
'(a)')
'Sorption is not active but &
1265 &distribution coefficient was specified. DISTCOEF will have &
1266 &no affect on simulation results.'
1268 write (this%iout,
'(1x,a)')
'WARNING. '//
warnmsg
1271 write (
warnmsg,
'(a)')
'Sorption is not active but &
1272 &SP2 was specified. SP2 will have &
1273 &no affect on simulation results.'
1275 write (this%iout,
'(1x,a)')
'WARNING. '//
warnmsg
1280 if (this%idcy > 0)
then
1281 if (.not. found%decay)
then
1282 write (
errmsg,
'(a)')
'First or zero order decay is &
1283 &active but the first rate coefficient is not specified. DECAY &
1284 &must be specified in GRIDDATA block.'
1287 if (.not. found%decay_sorbed)
then
1291 write (
errmsg,
'(a)')
'DECAY_SORBED not provided in GRIDDATA &
1292 &block but decay and sorption are active. Specify DECAY_SORBED &
1293 &in GRIDDATA block.'
1297 if (found%decay)
then
1298 write (
warnmsg,
'(a)')
'First- or zero-order decay &
1299 &is not active but decay was specified. DECAY will &
1300 &have no affect on simulation results.'
1302 write (this%iout,
'(1x,a)')
'WARNING. '//
warnmsg
1304 if (found%decay_sorbed)
then
1305 write (
warnmsg,
'(a)')
'First- or zero-order decay &
1306 &is not active but DECAY_SORBED was specified. &
1307 &DECAY_SORBED will have no affect on simulation results.'
1309 write (this%iout,
'(1x,a)')
'WARNING. '//
warnmsg
1315 if (.not. found%cim)
then
1316 write (this%iout,
'(1x,a)')
'Warning. Dual domain is active but &
1317 &initial immobile domain concentration was not specified. &
1318 &Setting CIM to zero.'
1320 if (.not. found%zetaim)
then
1321 write (
errmsg,
'(a)')
'Dual domain is active but dual &
1322 &domain mass transfer rate (ZETAIM) was not specified. ZETAIM &
1323 &must be specified in GRIDDATA block.'
1326 if (.not. found%porosity)
then
1327 write (
errmsg,
'(a)')
'Dual domain is active but &
1328 &immobile domain POROSITY was not specified. POROSITY &
1329 &must be specified in GRIDDATA block.'
1332 if (.not. found%volfrac)
then
1333 write (
errmsg,
'(a)')
'Dual domain is active but &
1334 &immobile domain VOLFRAC was not specified. VOLFRAC &
1335 &must be specified in GRIDDATA block. This is a new &
1336 &requirement for MODFLOW versions later than version &
1354 write (this%iout,
'(1x,a)')
'PROCESSING GRIDDATA'
1355 if (found%porosity)
then
1356 write (this%iout,
'(4x,a)')
'MOBILE DOMAIN POROSITY set from input file'
1358 if (found%volfrac)
then
1359 write (this%iout,
'(4x,a)')
'VOLFRAC set from input file'
1361 if (found%zetaim)
then
1362 write (this%iout,
'(4x,a)')
'ZETAIM set from input file'
1365 write (this%iout,
'(4x,a)')
'CIM set from input file'
1367 if (found%decay)
then
1368 write (this%iout,
'(4x,a)')
'DECAY RATE set from input file'
1370 if (found%decay_sorbed)
then
1371 write (this%iout,
'(4x,a)')
'DECAY SORBED RATE set from input file'
1373 if (found%bulk_density)
then
1374 write (this%iout,
'(4x,a)')
'BULK DENSITY set from input file'
1376 if (found%distcoef)
then
1377 write (this%iout,
'(4x,a)')
'DISTRIBUTION COEFFICIENT set from input file'
1380 write (this%iout,
'(4x,a)')
'SECOND SORPTION PARAM set from input file'
1382 write (this%iout,
'(1x,a)')
'END PROCESSING GRIDDATA'
1406 integer(I4B),
intent(in) :: node
1410 thetaim = this%volfrac(node) * this%porosity(node)
1422 volfracim, rhobim, kdnew, kdold, &
1423 lambda1im, lambda2im, &
1424 gamma1im, gamma2im, zetaim, ddterm, f)
1426 real(DP),
intent(in) :: thetaim
1427 real(DP),
intent(in) :: vcell
1428 real(DP),
intent(in) :: delt
1429 real(DP),
intent(in) :: swtpdt
1430 real(DP),
intent(in) :: volfracim
1431 real(DP),
intent(in) :: rhobim
1432 real(DP),
intent(in) :: kdnew
1433 real(DP),
intent(in) :: kdold
1434 real(DP),
intent(in) :: lambda1im
1435 real(DP),
intent(in) :: lambda2im
1436 real(DP),
intent(in) :: gamma1im
1437 real(DP),
intent(in) :: gamma2im
1438 real(DP),
intent(in) :: zetaim
1439 real(DP),
dimension(:),
intent(inout) :: ddterm
1440 real(DP),
intent(inout) :: f
1451 ddterm(1) = thetaim * vcell * tled
1452 ddterm(2) = thetaim * vcell * tled
1453 ddterm(3) = volfracim * rhobim * vcell * kdnew * tled
1454 ddterm(4) = volfracim * rhobim * vcell * kdold * tled
1455 ddterm(5) = thetaim * lambda1im * vcell
1456 ddterm(6) = lambda2im * volfracim * rhobim * kdnew * vcell
1457 ddterm(7) = thetaim * gamma1im * vcell
1458 ddterm(8) = gamma2im * volfracim * rhobim * vcell
1459 ddterm(9) = vcell * swtpdt * zetaim
1462 f = ddterm(1) + ddterm(3) + ddterm(5) + ddterm(6) + ddterm(9)
1473 real(DP),
dimension(:),
intent(in) :: ddterm
1474 real(DP),
intent(in) :: f
1475 real(DP),
intent(in) :: cimold
1476 real(DP),
intent(inout) :: hcof
1477 real(DP),
intent(inout) :: rhs
1480 hcof = ddterm(9)**2 / f - ddterm(9)
1484 rhs = (ddterm(2) + ddterm(4)) * cimold - ddterm(7) - ddterm(8)
1485 rhs = rhs * ddterm(9) / f
1496 real(dp),
dimension(:),
intent(in) :: ddterm
1497 real(dp),
intent(in) :: f
1498 real(dp),
intent(in) :: cimold
1499 real(dp),
intent(in) :: cnew
1505 cimnew = (ddterm(2) + ddterm(4)) * cimold + ddterm(9) * cnew - ddterm(7) &
1519 real(DP),
dimension(:, :),
intent(inout) :: budterm
1520 real(DP),
dimension(:),
intent(in) :: ddterm
1521 real(DP),
intent(in) :: cimnew
1522 real(DP),
intent(in) :: cimold
1523 real(DP),
intent(in) :: cnew
1524 integer(I4B),
intent(in) :: idcy
1531 rate = -ddterm(1) * cimnew + ddterm(2) * cimold
1532 if (rate >
dzero)
then
1533 budterm(1, i) = budterm(1, i) + rate
1535 budterm(2, i) = budterm(2, i) - rate
1540 rate = -ddterm(3) * cimnew + ddterm(4) * cimold
1541 if (rate >
dzero)
then
1542 budterm(1, i) = budterm(1, i) + rate
1544 budterm(2, i) = budterm(2, i) - rate
1551 rate = -ddterm(5) * cimnew
1552 else if (idcy == 2)
then
1557 if (rate >
dzero)
then
1558 budterm(1, i) = budterm(1, i) + rate
1560 budterm(2, i) = budterm(2, i) - rate
1566 rate = -ddterm(6) * cimnew
1567 else if (idcy == 2)
then
1572 if (rate >
dzero)
then
1573 budterm(1, i) = budterm(1, i) + rate
1575 budterm(2, i) = budterm(2, i) - rate
1580 rate = ddterm(9) * cnew - ddterm(9) * cimnew
1581 if (rate >
dzero)
then
1582 budterm(1, i) = budterm(1, i) + rate
1584 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
integer(i4b), parameter lenbigline
maximum length of a big line
real(dp), parameter dhnoflo
real no flow constant
integer(i4b), parameter lenvarname
maximum length of a variable name
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 log_data(this, found)
Log user data to list file.
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
real(dp) function get_thetaim(this, node)
@ brief Return thetaim
subroutine source_data(this)
@ brief Source data for package
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 source_options(this)
@ brief Source options for package
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 log_options(this, found, cim6_fname, budget_fname, budgetcsv_fname, sorbate_fname)
Log user options to list file.
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 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
subroutine, public ist_create(packobj, id, ibcnum, inunit, iout, namemodel, pakname, mempath, fmi, mst)
@ brief Create a new package object
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.
subroutine, public get_isize(name, mem_path, isize)
@ brief Get the number of elements for this variable
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_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_filename(filename, terminate)
Store the erroring file name.
This module contains simulation variables.
character(len=maxcharlen) errmsg
error message string
integer(i4b) ifailedstepretry
current retry for this time step
character(len=maxcharlen) warnmsg
warning message string
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.