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()
119 subroutine ist_create(packobj, id, ibcnum, inunit, iout, namemodel, pakname, &
122 class(
bndtype),
pointer :: packobj
123 integer(I4B),
intent(in) :: id
124 integer(I4B),
intent(in) :: ibcnum
125 integer(I4B),
intent(in) :: inunit
126 integer(I4B),
intent(in) :: iout
127 character(len=*),
intent(in) :: namemodel
128 character(len=*),
intent(in) :: pakname
129 character(len=*),
intent(in) :: mempath
140 call packobj%set_names(ibcnum, namemodel, pakname,
ftype, mempath)
144 call packobj%allocate_scalars()
147 call packobj%pack_initialize()
150 packobj%inunit = inunit
153 packobj%ibcnum = ibcnum
177 call this%ist_allocate_arrays()
181 call this%ocd%init_dbl(
'CIM', this%cimnew, this%dis,
'PRINT LAST ', &
182 'COLUMNS 10 WIDTH 11 DIGITS 4 GENERAL ', &
186 if (this%lstfmt /=
'')
then
187 call this%ocd%set_prnfmt(trim(this%lstfmt)//
" ", 0)
191 call this%source_data()
194 do n = 1, this%dis%nodes
195 this%cimnew(n) = this%cim(n)
199 call this%mst%addto_volfracim(this%volfrac)
202 call budget_cr(this%budget, this%memoryPath)
203 call this%budget%budget_df(
nbditems,
'MASS',
'M', bdzone=this%packName)
204 call this%budget%set_ibudcsv(this%ibudcsv)
211 if (this%idcy /= this%mst%idcy)
then
212 call store_error(
'DECAY must be activated consistently between the &
213 &MST and IST Packages. Activate or deactivate DECAY for both &
216 if (this%isrb /= this%mst%isrb)
then
217 call store_error(
'SORPTION must be activated consistently between the &
218 &MST and IST Packages. Activate or deactivate SORPTION for both &
219 &Packages. If activated, the same type of sorption (LINEAR, &
220 &FREUNDLICH, or LANGMUIR) must be specified in the options block of &
221 &both the MST and IST Packages.')
255 call this%BndType%bnd_ad()
263 do n = 1, this%dis%nodes
264 this%cimold(n) = this%cimnew(n)
267 do n = 1, this%dis%nodes
268 this%cimnew(n) = this%cimold(n)
275 subroutine ist_fc(this, rhs, ia, idxglo, matrix_sln)
280 real(DP),
dimension(:),
intent(inout) :: rhs
281 integer(I4B),
dimension(:),
intent(in) :: ia
282 integer(I4B),
dimension(:),
intent(in) :: idxglo
285 integer(I4B) :: n, idiag
287 real(DP) :: hhcof, rrhs
288 real(DP) :: swt, swtpdt
294 real(DP) :: volfracim
296 real(DP) :: lambda1im
297 real(DP) :: lambda2im
302 real(DP) :: cimsrbold
303 real(DP) :: cimsrbnew
304 real(DP),
dimension(9) :: ddterm
308 this%kiter = this%kiter + 1
312 do n = 1, this%dis%nodes
315 if (this%ibound(n) <= 0) cycle
318 vcell = this%dis%area(n) * (this%dis%top(n) - this%dis%bot(n))
319 swtpdt = this%fmi%gwfsat(n)
320 swt = this%fmi%gwfsatold(n,
delt)
321 thetaim = this%get_thetaim(n)
325 zetaim = this%zetaim(n)
339 if (this%idcy == 1) lambda1im = this%decay(n)
340 if (this%idcy == 2)
then
342 this%kiter, this%cimold(n), &
343 this%cimnew(n),
delt)
344 this%decaylast(n) = gamma1im
348 if (this%isrb > 0)
then
351 volfracim = this%volfrac(n)
352 rhobim = this%bulk_density(n)
355 cimsrbnew = this%isotherm%value(this%cimnew, n)
356 cimsrbold = this%isotherm%value(this%cimold, n)
357 select case (this%isrb)
359 kdnew = this%distcoef(n)
360 kdold = this%distcoef(n)
374 if (this%idcy == 1)
then
375 lambda2im = this%decay_sorbed(n)
376 else if (this%idcy == 2)
then
378 this%decayslast(n), &
379 this%kiter, cimsrbold, &
381 this%decayslast(n) = gamma2im
387 volfracim, rhobim, kdnew, kdold, lambda1im, lambda2im, &
388 gamma1im, gamma2im, zetaim, ddterm, f)
389 cimold = this%cimold(n)
393 call matrix_sln%add_value_pos(idxglo(idiag), hhcof)
394 rhs(n) = rhs(n) + rrhs
408 real(DP),
dimension(:),
intent(in) :: x
409 real(DP),
dimension(:),
contiguous,
intent(inout) :: flowja
410 integer(I4B),
optional,
intent(in) :: iadv
412 integer(I4B) :: idiag
415 real(DP) :: swt, swtpdt
416 real(DP) :: hhcof, rrhs
422 real(DP) :: volfracim
424 real(DP) :: lambda1im
425 real(DP) :: lambda2im
431 real(DP) :: cimsrbold
432 real(DP) :: cimsrbnew
433 real(DP),
dimension(9) :: ddterm
437 this%budterm(:, :) =
dzero
440 do n = 1, this%dis%nodes
445 if (this%ibound(n) > 0)
then
448 vcell = this%dis%area(n) * (this%dis%top(n) - this%dis%bot(n))
449 swtpdt = this%fmi%gwfsat(n)
450 swt = this%fmi%gwfsatold(n,
delt)
451 thetaim = this%get_thetaim(n)
454 zetaim = this%zetaim(n)
468 if (this%idcy == 1) lambda1im = this%decay(n)
469 if (this%idcy == 2)
then
471 this%cimold(n), this%cimnew(n),
delt)
475 if (this%isrb > 0)
then
478 volfracim = this%volfrac(n)
479 rhobim = this%bulk_density(n)
482 cimsrbnew = this%isotherm%value(this%cimnew, n)
483 cimsrbold = this%isotherm%value(this%cimold, n)
484 select case (this%isrb)
486 kdnew = this%distcoef(n)
487 kdold = this%distcoef(n)
501 if (this%idcy == 1)
then
502 lambda2im = this%decay_sorbed(n)
503 else if (this%idcy == 2)
then
505 this%decayslast(n), &
513 volfracim, rhobim, kdnew, kdold, lambda1im, lambda2im, &
514 gamma1im, gamma2im, zetaim, ddterm, f)
515 cimold = this%cimold(n)
519 rate = hhcof * x(n) - rrhs
531 idiag = this%dis%con%ia(n)
532 flowja(idiag) = flowja(idiag) + rate
535 this%cimnew(n) = cimnew
540 if (this%isrb /= 0)
then
541 call this%ist_calc_csrb(this%cimnew)
551 real(DP),
intent(in),
dimension(:) :: cim
559 if (this%ibound(n) > 0 .and. this%isrb /=
sorption_off)
then
560 csrb = this%isotherm%value(cim, n)
562 this%cimsrb(n) = csrb
579 type(
budgettype),
intent(inout) :: model_budget
583 integer(I4B) :: isuppress_output
586 call model_budget%addentry(ratin, ratout,
delt, this%text, &
587 isuppress_output, this%packName)
601 integer(I4B),
intent(in) :: icbcfl
602 integer(I4B),
intent(in) :: ibudfl
603 integer(I4B),
intent(in) :: icbcun
604 integer(I4B),
dimension(:),
optional,
intent(in) :: imap
607 integer(I4B) :: ibinun
608 integer(I4B) :: nbound
611 real(DP),
dimension(0) :: auxrow
614 if (this%ipakcb < 0)
then
616 elseif (this%ipakcb == 0)
then
621 if (icbcfl == 0) ibinun = 0
626 if (ibinun /= 0)
then
627 nbound = this%dis%nodes
629 call this%dis%record_srcdst_list_header(this%text, this%name_model, &
630 this%name_model, this%name_model, &
631 this%packName, naux, this%auxname, &
632 ibinun, nbound, this%iout)
636 do n = 1, this%dis%nodes
640 if (this%ibound(n) > 0)
then
647 if (ibinun /= 0)
then
648 call this%dis%record_mf6_list_entry(ibinun, n, n, rate, &
662 integer(I4B),
intent(in) :: idvsave
663 integer(I4B),
intent(in) :: idvprint
665 call this%output_immobile_concentration(idvsave, idvprint)
666 call this%output_immobile_sorbate_concentration(idvsave, idvprint)
677 integer(I4B),
intent(in) :: idvsave
678 integer(I4B),
intent(in) :: idvprint
680 integer(I4B) :: ipflg
681 integer(I4B) :: ibinun
687 if (idvsave == 0) ibinun = 0
688 if (ibinun /= 0)
then
690 iprint_opt=0, isav_opt=ibinun)
694 if (idvprint /= 0)
then
696 iprint_opt=idvprint, isav_opt=0)
707 integer(I4B),
intent(in) :: idvsave
708 integer(I4B),
intent(in) :: idvprint
710 character(len=1) :: cdatafmp =
' ', editdesc =
' '
711 integer(I4B) :: ibinun
712 integer(I4B) :: iprint, nvaluesp, nwidthp
718 if (this%ioutsorbate /= 0)
then
723 if (idvsave == 0) ibinun = 0
726 if (ibinun /= 0)
then
729 if (this%ioutsorbate /= 0)
then
730 ibinun = this%ioutsorbate
731 call this%dis%record_array(this%cimsrb, this%iout, iprint, ibinun, &
732 ' SORBATE', cdatafmp, nvaluesp, &
733 nwidthp, editdesc, dinact)
751 integer(I4B),
intent(in) :: kstp
752 integer(I4B),
intent(in) :: kper
753 integer(I4B),
intent(in) :: iout
754 integer(I4B),
intent(in) :: ibudfl
756 integer(I4B) :: isuppress_output = 0
759 call this%budget%reset()
760 call this%budget%addentry(this%budterm,
delt,
budtxt, isuppress_output)
763 call this%budget%finalize_step(
delt)
764 if (ibudfl /= 0)
then
765 call this%budget%budget_ot(kstp, kper, iout)
769 call this%budget%writecsv(
totim)
784 if (this%inunit > 0)
then
814 call this%budget%budget_da()
815 deallocate (this%budget)
816 call this%ocd%ocd_da()
817 deallocate (this%ocd)
818 if (
associated(this%isotherm))
then
819 deallocate (this%isotherm)
820 nullify (this%isotherm)
824 call this%BndType%bnd_da()
841 call this%BndType%allocate_scalars()
844 call mem_allocate(this%icimout,
'ICIMOUT', this%memoryPath)
845 call mem_allocate(this%ibudgetout,
'IBUDGETOUT', this%memoryPath)
846 call mem_allocate(this%ibudcsv,
'IBUDCSV', this%memoryPath)
847 call mem_allocate(this%ioutsorbate,
'IOUTSORBATE', this%memoryPath)
882 call this%BndType%allocate_arrays()
885 call mem_allocate(this%strg, this%dis%nodes,
'STRG', this%memoryPath)
886 call mem_allocate(this%cim, this%dis%nodes,
'CIM', this%memoryPath)
887 call mem_allocate(this%cimnew, this%dis%nodes,
'CIMNEW', this%memoryPath)
888 call mem_allocate(this%cimold, this%dis%nodes,
'CIMOLD', this%memoryPath)
889 call mem_allocate(this%porosity, this%dis%nodes,
'POROSITY', this%memoryPath)
890 call mem_allocate(this%zetaim, this%dis%nodes,
'ZETAIM', this%memoryPath)
891 call mem_allocate(this%volfrac, this%dis%nodes,
'VOLFRAC', this%memoryPath)
892 if (this%isrb == 0)
then
893 call mem_allocate(this%bulk_density, 1,
'BULK_DENSITY', this%memoryPath)
894 call mem_allocate(this%distcoef, 1,
'DISTCOEF', this%memoryPath)
896 call mem_allocate(this%cimsrb, 1,
'SORBATE', this%memoryPath)
898 call mem_allocate(this%bulk_density, this%dis%nodes,
'BULK_DENSITY', &
900 call mem_allocate(this%distcoef, this%dis%nodes,
'DISTCOEF', &
902 call mem_allocate(this%cimsrb, this%dis%nodes,
'SORBATE', &
904 if (this%isrb == 1)
then
907 call mem_allocate(this%sp2, this%dis%nodes,
'SP2', this%memoryPath)
910 if (this%idcy == 0)
then
911 call mem_allocate(this%decay, 1,
'DECAY', this%memoryPath)
912 call mem_allocate(this%decaylast, 1,
'DECAYLAST', this%memoryPath)
914 call mem_allocate(this%decay, this%dis%nodes,
'DECAY', this%memoryPath)
915 call mem_allocate(this%decaylast, this%dis%nodes,
'DECAYLAST', &
918 if (this%isrb == 0 .and. this%idcy == 0)
then
919 call mem_allocate(this%decayslast, 1,
'DECAYSLAST', this%memoryPath)
921 call mem_allocate(this%decayslast, this%dis%nodes,
'DECAYSLAST', &
924 call mem_allocate(this%decay_sorbed, 1,
'DECAY_SORBED', this%memoryPath)
927 do n = 1, this%dis%nodes
930 this%cimnew(n) =
dzero
931 this%cimold(n) =
dzero
932 this%porosity(n) =
dzero
933 this%zetaim(n) =
dzero
934 this%volfrac(n) =
dzero
936 do n = 1,
size(this%bulk_density)
937 this%bulk_density(n) =
dzero
938 this%distcoef(n) =
dzero
939 this%cimsrb(n) =
dzero
941 do n = 1,
size(this%sp2)
944 do n = 1,
size(this%decay)
945 this%decay(n) =
dzero
946 this%decaylast(n) =
dzero
948 do n = 1,
size(this%decayslast)
949 this%decayslast(n) =
dzero
953 this%ocd%dis => this%dis
971 character(len=LINELENGTH) :: prnfmt
972 integer(I4B),
pointer :: columns, width, digits
974 character(len=LENVARNAME),
dimension(3) :: sorption_method = &
975 &[character(len=LENVARNAME) ::
'LINEAR',
'FREUNDLICH',
'LANGMUIR']
976 character(len=
linelength) :: sorbate_fname, cim6_fname, budget_fname, &
983 call mem_set_value(this%ipakcb,
'SAVE_FLOWS', this%input_mempath, &
985 call mem_set_value(budget_fname,
'BUDGETFILE', this%input_mempath, &
987 call mem_set_value(budgetcsv_fname,
'BUDGETCSVFILE', this%input_mempath, &
989 call mem_set_value(this%isrb,
'SORPTION', this%input_mempath, &
990 sorption_method, found%sorption)
991 call mem_set_value(this%idcy,
'ORDER1_DECAY', this%input_mempath, &
993 call mem_set_value(this%idcy,
'ORDER0_DECAY', this%input_mempath, &
995 call mem_set_value(cim6_fname,
'CIMFILE', this%input_mempath, &
997 call mem_set_value(sorbate_fname,
'SORBATEFILE', this%input_mempath, &
1009 if (found%save_flows) this%ipakcb = -1
1010 if (found%budgetfile)
then
1011 call assign_iounit(this%ibudgetout, this%inunit,
"BUDGET fileout")
1012 call openfile(this%ibudgetout, this%iout, budget_fname,
'DATA(BINARY)', &
1015 if (found%budgetcsvfile)
then
1016 call assign_iounit(this%ibudcsv, this%inunit,
"BUDGETCSV fileout")
1017 call openfile(this%ibudcsv, this%iout, budgetcsv_fname,
'CSV', &
1018 filstat_opt=
'REPLACE')
1020 if (found%sorption)
then
1021 if (this%isrb == 0)
then
1022 call store_error(
'Unknown sorption type was specified. &
1023 &Sorption must be specified as LINEAR, &
1024 &FREUNDLICH, or LANGMUIR.')
1028 if (found%order1_decay) this%idcy = 1
1029 if (found%order0_decay) this%idcy = 2
1030 if (found%cimfile)
then
1031 call this%ocd%set_ocfile(cim6_fname, this%iout)
1033 if (found%columns .and. found%width .and. &
1034 found%digits .and. found%format)
then
1035 write (this%lstfmt,
'(a,i0,a,i0,a,i0,a)')
'COLUMNS ', columns, &
1036 ' WIDTH ', width,
' DIGITS ', digits,
' '//trim(prnfmt)
1038 if (found%sorbatefile)
then
1040 call openfile(this%ioutsorbate, this%iout, sorbate_fname, &
1045 if (this%iout > 0)
then
1046 call this%log_options(found, cim6_fname, budget_fname, &
1047 budgetcsv_fname, sorbate_fname)
1050 deallocate (columns)
1058 budgetcsv_fname, sorbate_fname)
1062 character(len=*),
intent(in) :: cim6_fname
1063 character(len=*),
intent(in) :: budget_fname
1064 character(len=*),
intent(in) :: budgetcsv_fname
1065 character(len=*),
intent(in) :: sorbate_fname
1067 character(len=*),
parameter :: fmtisvflow = &
1068 "(4x,'CELL-BY-CELL FLOW INFORMATION WILL BE SAVED TO BINARY FILE &
1069 &WHENEVER ICBCFL IS NOT ZERO.')"
1070 character(len=*),
parameter :: fmtlinear = &
1071 &
"(4x,'LINEAR SORPTION IS SELECTED. ')"
1072 character(len=*),
parameter :: fmtfreundlich = &
1073 &
"(4x,'FREUNDLICH SORPTION IS ACTIVE. ')"
1074 character(len=*),
parameter :: fmtlangmuir = &
1075 &
"(4x,'LANGMUIR SORPTION IS ACTIVE. ')"
1076 character(len=*),
parameter :: fmtidcy1 = &
1077 &
"(4x,'FIRST-ORDER DECAY IS ACTIVE. ')"
1078 character(len=*),
parameter :: fmtidcy2 = &
1079 &
"(4x,'ZERO-ORDER DECAY IS ACTIVE. ')"
1080 character(len=*),
parameter :: fmtistbin = &
1081 "(4x, 'IST ', 1x, a, 1x, ' WILL BE SAVED TO FILE: ', a, &
1082 &/4x, 'OPENED ON UNIT: ', I0)"
1084 write (this%iout,
'(1x,a)')
'PROCESSING IMMOBILE STORAGE AND TRANSFER &
1086 if (found%save_flows)
then
1087 write (this%iout, fmtisvflow)
1089 if (found%budgetfile)
then
1090 write (this%iout, fmtistbin)
'BUDGET', trim(adjustl(budget_fname)), &
1093 if (found%budgetcsvfile)
then
1094 write (this%iout, fmtistbin)
'BUDGET CSV', trim(adjustl(budgetcsv_fname)), &
1097 if (found%sorption)
then
1098 select case (this%isrb)
1100 write (this%iout, fmtlinear)
1102 write (this%iout, fmtfreundlich)
1104 write (this%iout, fmtlangmuir)
1107 if (found%order1_decay)
then
1108 write (this%iout, fmtidcy1)
1110 if (found%order0_decay)
then
1111 write (this%iout, fmtidcy2)
1113 if (found%sorbatefile)
then
1114 write (this%iout, fmtistbin) &
1115 'SORBATE', sorbate_fname, this%ioutsorbate
1117 write (this%iout,
'(1x,a)')
'END OF IMMOBILE STORAGE AND TRANSFER &
1132 call this%source_options()
1153 integer(I4B) :: asize
1154 integer(I4B),
dimension(:),
pointer,
contiguous :: map
1158 if (this%dis%nodes < this%dis%nodesuser) map => this%dis%nodeuser
1161 if (this%isrb == 0)
then
1162 call get_isize(
'BULK_DENSITY', this%input_mempath, asize)
1165 'BULK_DENSITY', this%memoryPath)
1166 call get_isize(
'DISTCOEF', this%input_mempath, asize)
1171 if (this%idcy == 0)
then
1172 call get_isize(
'DECAY', this%input_mempath, asize)
1174 call mem_reallocate(this%decay, this%dis%nodes,
'DECAY', this%memoryPath)
1176 call get_isize(
'DECAY_SORBED', this%input_mempath, asize)
1179 'DECAY_SORBED', this%memoryPath)
1181 if (this%isrb < 2)
then
1182 call get_isize(
'SP2', this%input_mempath, asize)
1184 call mem_reallocate(this%sp2, this%dis%nodes,
'SP2', this%memoryPath)
1188 call mem_set_value(this%porosity,
'POROSITY', this%input_mempath, map, &
1190 call mem_set_value(this%volfrac,
'VOLFRAC', this%input_mempath, map, &
1192 call mem_set_value(this%zetaim,
'ZETAIM', this%input_mempath, map, &
1194 call mem_set_value(this%cim,
'CIM', this%input_mempath, map, &
1196 call mem_set_value(this%decay,
'DECAY', this%input_mempath, map, &
1198 call mem_set_value(this%decay_sorbed,
'DECAY_SORBED', this%input_mempath, &
1199 map, found%decay_sorbed)
1200 call mem_set_value(this%bulk_density,
'BULK_DENSITY', this%input_mempath, &
1201 map, found%bulk_density)
1202 call mem_set_value(this%distcoef,
'DISTCOEF', this%input_mempath, map, &
1204 call mem_set_value(this%sp2,
'SP2', this%input_mempath, map, &
1208 if (this%iout > 0)
then
1209 call this%log_data(found)
1213 if (this%isrb > 0)
then
1214 if (.not. found%bulk_density)
then
1215 write (
errmsg,
'(a)')
'Sorption is active but BULK_DENSITY &
1216 ¬ specified. BULK_DENSITY must be specified in GRIDDATA block.'
1219 if (.not. found%distcoef)
then
1220 write (
errmsg,
'(a)')
'Sorption is active but distribution &
1221 &coefficient not specified. DISTCOEF must be specified in &
1225 if (this%isrb > 1)
then
1226 if (.not. found%sp2)
then
1227 write (
errmsg,
'(a)')
'Freundlich or langmuir sorption is active &
1228 &but SP2 not specified. SP2 must be specified in &
1234 if (found%bulk_density)
then
1235 write (
warnmsg,
'(a)')
'Sorption is not active but &
1236 &BULK_DENSITY was specified. BULK_DENSITY will have no affect on &
1237 &simulation results.'
1239 write (this%iout,
'(1x,a)')
'WARNING. '//
warnmsg
1241 if (found%distcoef)
then
1242 write (
warnmsg,
'(a)')
'Sorption is not active but &
1243 &distribution coefficient was specified. DISTCOEF will have &
1244 &no affect on simulation results.'
1246 write (this%iout,
'(1x,a)')
'WARNING. '//
warnmsg
1249 write (
warnmsg,
'(a)')
'Sorption is not active but &
1250 &SP2 was specified. SP2 will have &
1251 &no affect on simulation results.'
1253 write (this%iout,
'(1x,a)')
'WARNING. '//
warnmsg
1258 if (this%idcy > 0)
then
1259 if (.not. found%decay)
then
1260 write (
errmsg,
'(a)')
'First or zero order decay is &
1261 &active but the first rate coefficient is not specified. DECAY &
1262 &must be specified in GRIDDATA block.'
1265 if (.not. found%decay_sorbed)
then
1269 write (
errmsg,
'(a)')
'DECAY_SORBED not provided in GRIDDATA &
1270 &block but decay and sorption are active. Specify DECAY_SORBED &
1271 &in GRIDDATA block.'
1275 if (found%decay)
then
1276 write (
warnmsg,
'(a)')
'First- or zero-order decay &
1277 &is not active but decay was specified. DECAY will &
1278 &have no affect on simulation results.'
1280 write (this%iout,
'(1x,a)')
'WARNING. '//
warnmsg
1282 if (found%decay_sorbed)
then
1283 write (
warnmsg,
'(a)')
'First- or zero-order decay &
1284 &is not active but DECAY_SORBED was specified. &
1285 &DECAY_SORBED will have no affect on simulation results.'
1287 write (this%iout,
'(1x,a)')
'WARNING. '//
warnmsg
1293 if (.not. found%cim)
then
1294 write (this%iout,
'(1x,a)')
'Warning. Dual domain is active but &
1295 &initial immobile domain concentration was not specified. &
1296 &Setting CIM to zero.'
1298 if (.not. found%zetaim)
then
1299 write (
errmsg,
'(a)')
'Dual domain is active but dual &
1300 &domain mass transfer rate (ZETAIM) was not specified. ZETAIM &
1301 &must be specified in GRIDDATA block.'
1304 if (.not. found%porosity)
then
1305 write (
errmsg,
'(a)')
'Dual domain is active but &
1306 &immobile domain POROSITY was not specified. POROSITY &
1307 &must be specified in GRIDDATA block.'
1310 if (.not. found%volfrac)
then
1311 write (
errmsg,
'(a)')
'Dual domain is active but &
1312 &immobile domain VOLFRAC was not specified. VOLFRAC &
1313 &must be specified in GRIDDATA block. This is a new &
1314 &requirement for MODFLOW versions later than version &
1332 write (this%iout,
'(1x,a)')
'PROCESSING GRIDDATA'
1333 if (found%porosity)
then
1334 write (this%iout,
'(4x,a)')
'MOBILE DOMAIN POROSITY set from input file'
1336 if (found%volfrac)
then
1337 write (this%iout,
'(4x,a)')
'VOLFRAC set from input file'
1339 if (found%zetaim)
then
1340 write (this%iout,
'(4x,a)')
'ZETAIM set from input file'
1343 write (this%iout,
'(4x,a)')
'CIM set from input file'
1345 if (found%decay)
then
1346 write (this%iout,
'(4x,a)')
'DECAY RATE set from input file'
1348 if (found%decay_sorbed)
then
1349 write (this%iout,
'(4x,a)')
'DECAY SORBED RATE set from input file'
1351 if (found%bulk_density)
then
1352 write (this%iout,
'(4x,a)')
'BULK DENSITY set from input file'
1354 if (found%distcoef)
then
1355 write (this%iout,
'(4x,a)')
'DISTRIBUTION COEFFICIENT set from input file'
1358 write (this%iout,
'(4x,a)')
'SECOND SORPTION PARAM set from input file'
1360 write (this%iout,
'(1x,a)')
'END PROCESSING GRIDDATA'
1384 integer(I4B),
intent(in) :: node
1388 thetaim = this%volfrac(node) * this%porosity(node)
1400 volfracim, rhobim, kdnew, kdold, &
1401 lambda1im, lambda2im, &
1402 gamma1im, gamma2im, zetaim, ddterm, f)
1404 real(DP),
intent(in) :: thetaim
1405 real(DP),
intent(in) :: vcell
1406 real(DP),
intent(in) :: delt
1407 real(DP),
intent(in) :: swtpdt
1408 real(DP),
intent(in) :: volfracim
1409 real(DP),
intent(in) :: rhobim
1410 real(DP),
intent(in) :: kdnew
1411 real(DP),
intent(in) :: kdold
1412 real(DP),
intent(in) :: lambda1im
1413 real(DP),
intent(in) :: lambda2im
1414 real(DP),
intent(in) :: gamma1im
1415 real(DP),
intent(in) :: gamma2im
1416 real(DP),
intent(in) :: zetaim
1417 real(DP),
dimension(:),
intent(inout) :: ddterm
1418 real(DP),
intent(inout) :: f
1429 ddterm(1) = thetaim * vcell * tled
1430 ddterm(2) = thetaim * vcell * tled
1431 ddterm(3) = volfracim * rhobim * vcell * kdnew * tled
1432 ddterm(4) = volfracim * rhobim * vcell * kdold * tled
1433 ddterm(5) = thetaim * lambda1im * vcell
1434 ddterm(6) = lambda2im * volfracim * rhobim * kdnew * vcell
1435 ddterm(7) = thetaim * gamma1im * vcell
1436 ddterm(8) = gamma2im * volfracim * rhobim * vcell
1437 ddterm(9) = vcell * swtpdt * zetaim
1440 f = ddterm(1) + ddterm(3) + ddterm(5) + ddterm(6) + ddterm(9)
1451 real(DP),
dimension(:),
intent(in) :: ddterm
1452 real(DP),
intent(in) :: f
1453 real(DP),
intent(in) :: cimold
1454 real(DP),
intent(inout) :: hcof
1455 real(DP),
intent(inout) :: rhs
1458 hcof = ddterm(9)**2 / f - ddterm(9)
1462 rhs = (ddterm(2) + ddterm(4)) * cimold - ddterm(7) - ddterm(8)
1463 rhs = rhs * ddterm(9) / f
1474 real(dp),
dimension(:),
intent(in) :: ddterm
1475 real(dp),
intent(in) :: f
1476 real(dp),
intent(in) :: cimold
1477 real(dp),
intent(in) :: cnew
1483 cimnew = (ddterm(2) + ddterm(4)) * cimold + ddterm(9) * cnew - ddterm(7) &
1497 real(DP),
dimension(:, :),
intent(inout) :: budterm
1498 real(DP),
dimension(:),
intent(in) :: ddterm
1499 real(DP),
intent(in) :: cimnew
1500 real(DP),
intent(in) :: cimold
1501 real(DP),
intent(in) :: cnew
1502 integer(I4B),
intent(in) :: idcy
1509 rate = -ddterm(1) * cimnew + ddterm(2) * cimold
1510 if (rate >
dzero)
then
1511 budterm(1, i) = budterm(1, i) + rate
1513 budterm(2, i) = budterm(2, i) - rate
1518 rate = -ddterm(3) * cimnew + ddterm(4) * cimold
1519 if (rate >
dzero)
then
1520 budterm(1, i) = budterm(1, i) + rate
1522 budterm(2, i) = budterm(2, i) - rate
1529 rate = -ddterm(5) * cimnew
1530 else if (idcy == 2)
then
1535 if (rate >
dzero)
then
1536 budterm(1, i) = budterm(1, i) + rate
1538 budterm(2, i) = budterm(2, i) - rate
1544 rate = -ddterm(6) * cimnew
1545 else if (idcy == 2)
then
1550 if (rate >
dzero)
then
1551 budterm(1, i) = budterm(1, i) + rate
1553 budterm(2, i) = budterm(2, i) - rate
1558 rate = ddterm(9) * cnew - ddterm(9) * cimnew
1559 if (rate >
dzero)
then
1560 budterm(1, i) = budterm(1, i) + rate
1562 budterm(2, i) = budterm(2, i) - rate
1571 real(dp),
intent(in) :: conc
1572 real(dp),
intent(in) :: kf
1573 real(dp),
intent(in) :: a
1577 if (conc >
dzero)
then
1578 kd = kf * conc**(a -
done)
1588 real(dp),
intent(in) :: conc
1589 real(dp),
intent(in) :: kl
1590 real(dp),
intent(in) :: sbar
1594 if (conc >
dzero)
then
1595 kd = (kl * sbar) / (
done + kl * conc)
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.
real(dp) function get_freundlich_kd(conc, kf, a)
@ brief Get effective Freundlich distribution coefficient
subroutine source_options(this)
@ brief Source options for package
real(dp) function get_langmuir_kd(conc, kl, sbar)
@ brief Get effective Langmuir distribution coefficient
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
class(isothermtype) function, pointer, public create_isotherm(isotherm_type, distcoef, sp2)
Create an isotherm object based on type and parameters.
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.