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_option(trim(this%lstfmt)//
" ", 0, this%iout)
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_option(
'FILEOUT '//trim(cim6_fname)//
" ", 0, &
1056 if (found%columns .and. found%width .and. &
1057 found%digits .and. found%format)
then
1058 write (this%lstfmt,
'(a,i0,a,i0,a,i0,a)')
'PRINT_FORMAT COLUMNS ', &
1059 columns,
' WIDTH ', width,
' DIGITS ', digits,
' '//trim(prnfmt)
1061 if (found%sorbatefile)
then
1063 call openfile(this%ioutsorbate, this%iout, sorbate_fname, &
1068 if (this%iout > 0)
then
1069 call this%log_options(found, cim6_fname, budget_fname, &
1070 budgetcsv_fname, sorbate_fname)
1073 deallocate (columns)
1081 budgetcsv_fname, sorbate_fname)
1085 character(len=*),
intent(in) :: cim6_fname
1086 character(len=*),
intent(in) :: budget_fname
1087 character(len=*),
intent(in) :: budgetcsv_fname
1088 character(len=*),
intent(in) :: sorbate_fname
1090 character(len=*),
parameter :: fmtisvflow = &
1091 "(4x,'CELL-BY-CELL FLOW INFORMATION WILL BE SAVED TO BINARY FILE &
1092 &WHENEVER ICBCFL IS NOT ZERO.')"
1093 character(len=*),
parameter :: fmtlinear = &
1094 &
"(4x,'LINEAR SORPTION IS SELECTED. ')"
1095 character(len=*),
parameter :: fmtfreundlich = &
1096 &
"(4x,'FREUNDLICH SORPTION IS ACTIVE. ')"
1097 character(len=*),
parameter :: fmtlangmuir = &
1098 &
"(4x,'LANGMUIR SORPTION IS ACTIVE. ')"
1099 character(len=*),
parameter :: fmtidcy1 = &
1100 &
"(4x,'FIRST-ORDER DECAY IS ACTIVE. ')"
1101 character(len=*),
parameter :: fmtidcy2 = &
1102 &
"(4x,'ZERO-ORDER DECAY IS ACTIVE. ')"
1103 character(len=*),
parameter :: fmtistbin = &
1104 "(4x, 'IST ', 1x, a, 1x, ' WILL BE SAVED TO FILE: ', a, &
1105 &/4x, 'OPENED ON UNIT: ', I0)"
1107 write (this%iout,
'(1x,a)')
'PROCESSING IMMOBILE STORAGE AND TRANSFER &
1109 if (found%save_flows)
then
1110 write (this%iout, fmtisvflow)
1112 if (found%budgetfile)
then
1113 write (this%iout, fmtistbin)
'BUDGET', trim(adjustl(budget_fname)), &
1116 if (found%budgetcsvfile)
then
1117 write (this%iout, fmtistbin)
'BUDGET CSV', trim(adjustl(budgetcsv_fname)), &
1120 if (found%sorption)
then
1121 select case (this%isrb)
1123 write (this%iout, fmtlinear)
1125 write (this%iout, fmtfreundlich)
1127 write (this%iout, fmtlangmuir)
1130 if (found%order1_decay)
then
1131 write (this%iout, fmtidcy1)
1133 if (found%order0_decay)
then
1134 write (this%iout, fmtidcy2)
1136 if (found%sorbatefile)
then
1137 write (this%iout, fmtistbin) &
1138 'SORBATE', sorbate_fname, this%ioutsorbate
1140 write (this%iout,
'(1x,a)')
'END OF IMMOBILE STORAGE AND TRANSFER &
1155 call this%source_options()
1176 integer(I4B) :: asize
1177 integer(I4B),
dimension(:),
pointer,
contiguous :: map
1181 if (this%dis%nodes < this%dis%nodesuser) map => this%dis%nodeuser
1184 if (this%isrb == 0)
then
1185 call get_isize(
'BULK_DENSITY', this%input_mempath, asize)
1188 'BULK_DENSITY', this%memoryPath)
1189 call get_isize(
'DISTCOEF', this%input_mempath, asize)
1194 if (this%idcy == 0)
then
1195 call get_isize(
'DECAY', this%input_mempath, asize)
1197 call mem_reallocate(this%decay, this%dis%nodes,
'DECAY', this%memoryPath)
1199 call get_isize(
'DECAY_SORBED', this%input_mempath, asize)
1202 'DECAY_SORBED', this%memoryPath)
1204 if (this%isrb < 2)
then
1205 call get_isize(
'SP2', this%input_mempath, asize)
1207 call mem_reallocate(this%sp2, this%dis%nodes,
'SP2', this%memoryPath)
1211 call mem_set_value(this%porosity,
'POROSITY', this%input_mempath, map, &
1213 call mem_set_value(this%volfrac,
'VOLFRAC', this%input_mempath, map, &
1215 call mem_set_value(this%zetaim,
'ZETAIM', this%input_mempath, map, &
1217 call mem_set_value(this%cim,
'CIM', this%input_mempath, map, &
1219 call mem_set_value(this%decay,
'DECAY', this%input_mempath, map, &
1221 call mem_set_value(this%decay_sorbed,
'DECAY_SORBED', this%input_mempath, &
1222 map, found%decay_sorbed)
1223 call mem_set_value(this%bulk_density,
'BULK_DENSITY', this%input_mempath, &
1224 map, found%bulk_density)
1225 call mem_set_value(this%distcoef,
'DISTCOEF', this%input_mempath, map, &
1227 call mem_set_value(this%sp2,
'SP2', this%input_mempath, map, &
1231 if (this%iout > 0)
then
1232 call this%log_data(found)
1236 if (this%isrb > 0)
then
1237 if (.not. found%bulk_density)
then
1238 write (
errmsg,
'(a)')
'Sorption is active but BULK_DENSITY &
1239 ¬ specified. BULK_DENSITY must be specified in GRIDDATA block.'
1242 if (.not. found%distcoef)
then
1243 write (
errmsg,
'(a)')
'Sorption is active but distribution &
1244 &coefficient not specified. DISTCOEF must be specified in &
1248 if (this%isrb > 1)
then
1249 if (.not. found%sp2)
then
1250 write (
errmsg,
'(a)')
'Freundlich or langmuir sorption is active &
1251 &but SP2 not specified. SP2 must be specified in &
1257 if (found%bulk_density)
then
1258 write (
warnmsg,
'(a)')
'Sorption is not active but &
1259 &BULK_DENSITY was specified. BULK_DENSITY will have no affect on &
1260 &simulation results.'
1262 write (this%iout,
'(1x,a)')
'WARNING. '//
warnmsg
1264 if (found%distcoef)
then
1265 write (
warnmsg,
'(a)')
'Sorption is not active but &
1266 &distribution coefficient was specified. DISTCOEF will have &
1267 &no affect on simulation results.'
1269 write (this%iout,
'(1x,a)')
'WARNING. '//
warnmsg
1272 write (
warnmsg,
'(a)')
'Sorption is not active but &
1273 &SP2 was specified. SP2 will have &
1274 &no affect on simulation results.'
1276 write (this%iout,
'(1x,a)')
'WARNING. '//
warnmsg
1281 if (this%idcy > 0)
then
1282 if (.not. found%decay)
then
1283 write (
errmsg,
'(a)')
'First or zero order decay is &
1284 &active but the first rate coefficient is not specified. DECAY &
1285 &must be specified in GRIDDATA block.'
1288 if (.not. found%decay_sorbed)
then
1292 write (
errmsg,
'(a)')
'DECAY_SORBED not provided in GRIDDATA &
1293 &block but decay and sorption are active. Specify DECAY_SORBED &
1294 &in GRIDDATA block.'
1298 if (found%decay)
then
1299 write (
warnmsg,
'(a)')
'First- or zero-order decay &
1300 &is not active but decay was specified. DECAY will &
1301 &have no affect on simulation results.'
1303 write (this%iout,
'(1x,a)')
'WARNING. '//
warnmsg
1305 if (found%decay_sorbed)
then
1306 write (
warnmsg,
'(a)')
'First- or zero-order decay &
1307 &is not active but DECAY_SORBED was specified. &
1308 &DECAY_SORBED will have no affect on simulation results.'
1310 write (this%iout,
'(1x,a)')
'WARNING. '//
warnmsg
1316 if (.not. found%cim)
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. found%zetaim)
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. found%porosity)
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. found%volfrac)
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 &
1355 write (this%iout,
'(1x,a)')
'PROCESSING GRIDDATA'
1356 if (found%porosity)
then
1357 write (this%iout,
'(4x,a)')
'MOBILE DOMAIN POROSITY set from input file'
1359 if (found%volfrac)
then
1360 write (this%iout,
'(4x,a)')
'VOLFRAC set from input file'
1362 if (found%zetaim)
then
1363 write (this%iout,
'(4x,a)')
'ZETAIM set from input file'
1366 write (this%iout,
'(4x,a)')
'CIM set from input file'
1368 if (found%decay)
then
1369 write (this%iout,
'(4x,a)')
'DECAY RATE set from input file'
1371 if (found%decay_sorbed)
then
1372 write (this%iout,
'(4x,a)')
'DECAY SORBED RATE set from input file'
1374 if (found%bulk_density)
then
1375 write (this%iout,
'(4x,a)')
'BULK DENSITY set from input file'
1377 if (found%distcoef)
then
1378 write (this%iout,
'(4x,a)')
'DISTRIBUTION COEFFICIENT set from input file'
1381 write (this%iout,
'(4x,a)')
'SECOND SORPTION PARAM set from input file'
1383 write (this%iout,
'(1x,a)')
'END PROCESSING GRIDDATA'
1407 integer(I4B),
intent(in) :: node
1411 thetaim = this%volfrac(node) * this%porosity(node)
1423 volfracim, rhobim, kdnew, kdold, &
1424 lambda1im, lambda2im, &
1425 gamma1im, gamma2im, zetaim, ddterm, f)
1427 real(DP),
intent(in) :: thetaim
1428 real(DP),
intent(in) :: vcell
1429 real(DP),
intent(in) :: delt
1430 real(DP),
intent(in) :: swtpdt
1431 real(DP),
intent(in) :: volfracim
1432 real(DP),
intent(in) :: rhobim
1433 real(DP),
intent(in) :: kdnew
1434 real(DP),
intent(in) :: kdold
1435 real(DP),
intent(in) :: lambda1im
1436 real(DP),
intent(in) :: lambda2im
1437 real(DP),
intent(in) :: gamma1im
1438 real(DP),
intent(in) :: gamma2im
1439 real(DP),
intent(in) :: zetaim
1440 real(DP),
dimension(:),
intent(inout) :: ddterm
1441 real(DP),
intent(inout) :: f
1452 ddterm(1) = thetaim * vcell * tled
1453 ddterm(2) = thetaim * vcell * tled
1454 ddterm(3) = volfracim * rhobim * vcell * kdnew * tled
1455 ddterm(4) = volfracim * rhobim * vcell * kdold * tled
1456 ddterm(5) = thetaim * lambda1im * vcell
1457 ddterm(6) = lambda2im * volfracim * rhobim * kdnew * vcell
1458 ddterm(7) = thetaim * gamma1im * vcell
1459 ddterm(8) = gamma2im * volfracim * rhobim * vcell
1460 ddterm(9) = vcell * swtpdt * zetaim
1463 f = ddterm(1) + ddterm(3) + ddterm(5) + ddterm(6) + ddterm(9)
1474 real(DP),
dimension(:),
intent(in) :: ddterm
1475 real(DP),
intent(in) :: f
1476 real(DP),
intent(in) :: cimold
1477 real(DP),
intent(inout) :: hcof
1478 real(DP),
intent(inout) :: rhs
1481 hcof = ddterm(9)**2 / f - ddterm(9)
1485 rhs = (ddterm(2) + ddterm(4)) * cimold - ddterm(7) - ddterm(8)
1486 rhs = rhs * ddterm(9) / f
1497 real(dp),
dimension(:),
intent(in) :: ddterm
1498 real(dp),
intent(in) :: f
1499 real(dp),
intent(in) :: cimold
1500 real(dp),
intent(in) :: cnew
1506 cimnew = (ddterm(2) + ddterm(4)) * cimold + ddterm(9) * cnew - ddterm(7) &
1520 real(DP),
dimension(:, :),
intent(inout) :: budterm
1521 real(DP),
dimension(:),
intent(in) :: ddterm
1522 real(DP),
intent(in) :: cimnew
1523 real(DP),
intent(in) :: cimold
1524 real(DP),
intent(in) :: cnew
1525 integer(I4B),
intent(in) :: idcy
1532 rate = -ddterm(1) * cimnew + ddterm(2) * cimold
1533 if (rate >
dzero)
then
1534 budterm(1, i) = budterm(1, i) + rate
1536 budterm(2, i) = budterm(2, i) - rate
1541 rate = -ddterm(3) * cimnew + ddterm(4) * cimold
1542 if (rate >
dzero)
then
1543 budterm(1, i) = budterm(1, i) + rate
1545 budterm(2, i) = budterm(2, i) - rate
1552 rate = -ddterm(5) * cimnew
1553 else if (idcy == 2)
then
1558 if (rate >
dzero)
then
1559 budterm(1, i) = budterm(1, i) + rate
1561 budterm(2, i) = budterm(2, i) - rate
1567 rate = -ddterm(6) * cimnew
1568 else if (idcy == 2)
then
1573 if (rate >
dzero)
then
1574 budterm(1, i) = budterm(1, i) + rate
1576 budterm(2, i) = budterm(2, i) - rate
1581 rate = ddterm(9) * cnew - ddterm(9) * cimnew
1582 if (rate >
dzero)
then
1583 budterm(1, i) = budterm(1, i) + rate
1585 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.