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
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%get_cell_volume(n)
319 swtpdt = this%fmi%gwfsat(n)
320 thetaim = this%get_thetaim(n)
324 zetaim = this%zetaim(n)
338 if (this%idcy == 1) lambda1im = this%decay(n)
339 if (this%idcy == 2)
then
341 this%kiter, this%cimold(n), &
342 this%cimnew(n),
delt)
343 this%decaylast(n) = gamma1im
347 if (this%isrb > 0)
then
350 volfracim = this%volfrac(n)
351 rhobim = this%bulk_density(n)
354 cimsrbnew = this%isotherm%value(this%cimnew, n)
355 cimsrbold = this%isotherm%value(this%cimold, n)
356 select case (this%isrb)
358 kdnew = this%distcoef(n)
359 kdold = this%distcoef(n)
373 if (this%idcy == 1)
then
374 lambda2im = this%decay_sorbed(n)
375 else if (this%idcy == 2)
then
377 this%decayslast(n), &
378 this%kiter, cimsrbold, &
380 this%decayslast(n) = gamma2im
386 volfracim, rhobim, kdnew, kdold, lambda1im, lambda2im, &
387 gamma1im, gamma2im, zetaim, ddterm, f)
388 cimold = this%cimold(n)
392 call matrix_sln%add_value_pos(idxglo(idiag), hhcof)
393 rhs(n) = rhs(n) + rrhs
407 real(DP),
dimension(:),
intent(in) :: x
408 real(DP),
dimension(:),
contiguous,
intent(inout) :: flowja
409 integer(I4B),
optional,
intent(in) :: iadv
411 integer(I4B) :: idiag
415 real(DP) :: hhcof, rrhs
421 real(DP) :: volfracim
423 real(DP) :: lambda1im
424 real(DP) :: lambda2im
430 real(DP) :: cimsrbold
431 real(DP) :: cimsrbnew
432 real(DP),
dimension(9) :: ddterm
436 this%budterm(:, :) =
dzero
439 do n = 1, this%dis%nodes
444 if (this%ibound(n) > 0)
then
447 vcell = this%dis%get_cell_volume(n)
448 swtpdt = this%fmi%gwfsat(n)
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 cimsrbnew = this%isotherm%value(this%cimnew, n)
481 cimsrbold = this%isotherm%value(this%cimold, n)
482 select case (this%isrb)
484 kdnew = this%distcoef(n)
485 kdold = this%distcoef(n)
499 if (this%idcy == 1)
then
500 lambda2im = this%decay_sorbed(n)
501 else if (this%idcy == 2)
then
503 this%decayslast(n), &
511 volfracim, rhobim, kdnew, kdold, lambda1im, lambda2im, &
512 gamma1im, gamma2im, zetaim, ddterm, f)
513 cimold = this%cimold(n)
517 rate = hhcof * x(n) - rrhs
529 idiag = this%dis%con%ia(n)
530 flowja(idiag) = flowja(idiag) + rate
533 this%cimnew(n) = cimnew
538 if (this%isrb /= 0)
then
539 call this%ist_calc_csrb(this%cimnew)
549 real(DP),
intent(in),
dimension(:) :: cim
557 if (this%ibound(n) > 0 .and. this%isrb /=
sorption_off)
then
558 csrb = this%isotherm%value(cim, n)
560 this%cimsrb(n) = csrb
577 type(
budgettype),
intent(inout) :: model_budget
581 integer(I4B) :: isuppress_output
584 call model_budget%addentry(ratin, ratout,
delt, this%text, &
585 isuppress_output, this%packName)
599 integer(I4B),
intent(in) :: icbcfl
600 integer(I4B),
intent(in) :: ibudfl
601 integer(I4B),
intent(in) :: icbcun
602 integer(I4B),
dimension(:),
optional,
intent(in) :: imap
605 integer(I4B) :: ibinun
606 integer(I4B) :: nbound
609 real(DP),
dimension(0) :: auxrow
612 if (this%ipakcb < 0)
then
614 elseif (this%ipakcb == 0)
then
619 if (icbcfl == 0) ibinun = 0
624 if (ibinun /= 0)
then
625 nbound = this%dis%nodes
627 call this%dis%record_srcdst_list_header(this%text, this%name_model, &
628 this%name_model, this%name_model, &
629 this%packName, naux, this%auxname, &
630 ibinun, nbound, this%iout)
634 do n = 1, this%dis%nodes
638 if (this%ibound(n) > 0)
then
645 if (ibinun /= 0)
then
646 call this%dis%record_mf6_list_entry(ibinun, n, n, rate, &
660 integer(I4B),
intent(in) :: idvsave
661 integer(I4B),
intent(in) :: idvprint
663 call this%output_immobile_concentration(idvsave, idvprint)
664 call this%output_immobile_sorbate_concentration(idvsave, idvprint)
675 integer(I4B),
intent(in) :: idvsave
676 integer(I4B),
intent(in) :: idvprint
678 integer(I4B) :: ipflg
679 integer(I4B) :: ibinun
685 if (idvsave == 0) ibinun = 0
686 if (ibinun /= 0)
then
688 iprint_opt=0, isav_opt=ibinun)
692 if (idvprint /= 0)
then
694 iprint_opt=idvprint, isav_opt=0)
705 integer(I4B),
intent(in) :: idvsave
706 integer(I4B),
intent(in) :: idvprint
708 character(len=1) :: cdatafmp =
' ', editdesc =
' '
709 integer(I4B) :: ibinun
710 integer(I4B) :: iprint, nvaluesp, nwidthp
716 if (this%ioutsorbate /= 0)
then
721 if (idvsave == 0) ibinun = 0
724 if (ibinun /= 0)
then
727 if (this%ioutsorbate /= 0)
then
728 ibinun = this%ioutsorbate
729 call this%dis%record_array(this%cimsrb, this%iout, iprint, ibinun, &
730 ' SORBATE', cdatafmp, nvaluesp, &
731 nwidthp, editdesc, dinact)
749 integer(I4B),
intent(in) :: kstp
750 integer(I4B),
intent(in) :: kper
751 integer(I4B),
intent(in) :: iout
752 integer(I4B),
intent(in) :: ibudfl
754 integer(I4B) :: isuppress_output = 0
757 call this%budget%reset()
758 call this%budget%addentry(this%budterm,
delt,
budtxt, isuppress_output)
761 call this%budget%finalize_step(
delt)
762 if (ibudfl /= 0)
then
763 call this%budget%budget_ot(kstp, kper, iout)
767 call this%budget%writecsv(
totim)
782 if (this%inunit > 0)
then
812 call this%budget%budget_da()
813 deallocate (this%budget)
814 call this%ocd%ocd_da()
815 deallocate (this%ocd)
816 if (
associated(this%isotherm))
then
817 deallocate (this%isotherm)
818 nullify (this%isotherm)
822 call this%BndType%bnd_da()
839 call this%BndType%allocate_scalars()
842 call mem_allocate(this%icimout,
'ICIMOUT', this%memoryPath)
843 call mem_allocate(this%ibudgetout,
'IBUDGETOUT', this%memoryPath)
844 call mem_allocate(this%ibudcsv,
'IBUDCSV', this%memoryPath)
845 call mem_allocate(this%ioutsorbate,
'IOUTSORBATE', this%memoryPath)
880 call this%BndType%allocate_arrays()
883 call mem_allocate(this%strg, this%dis%nodes,
'STRG', this%memoryPath)
884 call mem_allocate(this%cim, this%dis%nodes,
'CIM', this%memoryPath)
885 call mem_allocate(this%cimnew, this%dis%nodes,
'CIMNEW', this%memoryPath)
886 call mem_allocate(this%cimold, this%dis%nodes,
'CIMOLD', this%memoryPath)
887 call mem_allocate(this%porosity, this%dis%nodes,
'POROSITY', this%memoryPath)
888 call mem_allocate(this%zetaim, this%dis%nodes,
'ZETAIM', this%memoryPath)
889 call mem_allocate(this%volfrac, this%dis%nodes,
'VOLFRAC', this%memoryPath)
890 if (this%isrb == 0)
then
891 call mem_allocate(this%bulk_density, 1,
'BULK_DENSITY', this%memoryPath)
892 call mem_allocate(this%distcoef, 1,
'DISTCOEF', this%memoryPath)
894 call mem_allocate(this%cimsrb, 1,
'SORBATE', this%memoryPath)
896 call mem_allocate(this%bulk_density, this%dis%nodes,
'BULK_DENSITY', &
898 call mem_allocate(this%distcoef, this%dis%nodes,
'DISTCOEF', &
900 call mem_allocate(this%cimsrb, this%dis%nodes,
'SORBATE', &
902 if (this%isrb == 1)
then
905 call mem_allocate(this%sp2, this%dis%nodes,
'SP2', this%memoryPath)
908 if (this%idcy == 0)
then
909 call mem_allocate(this%decay, 1,
'DECAY', this%memoryPath)
910 call mem_allocate(this%decaylast, 1,
'DECAYLAST', this%memoryPath)
912 call mem_allocate(this%decay, this%dis%nodes,
'DECAY', this%memoryPath)
913 call mem_allocate(this%decaylast, this%dis%nodes,
'DECAYLAST', &
916 if (this%isrb == 0 .and. this%idcy == 0)
then
917 call mem_allocate(this%decayslast, 1,
'DECAYSLAST', this%memoryPath)
919 call mem_allocate(this%decayslast, this%dis%nodes,
'DECAYSLAST', &
922 call mem_allocate(this%decay_sorbed, 1,
'DECAY_SORBED', this%memoryPath)
925 do n = 1, this%dis%nodes
928 this%cimnew(n) = dzero
929 this%cimold(n) = dzero
930 this%porosity(n) = dzero
931 this%zetaim(n) = dzero
932 this%volfrac(n) = dzero
934 do n = 1,
size(this%bulk_density)
935 this%bulk_density(n) = dzero
936 this%distcoef(n) = dzero
937 this%cimsrb(n) = dzero
939 do n = 1,
size(this%sp2)
942 do n = 1,
size(this%decay)
943 this%decay(n) = dzero
944 this%decaylast(n) = dzero
946 do n = 1,
size(this%decayslast)
947 this%decayslast(n) = dzero
951 this%ocd%dis => this%dis
969 character(len=LINELENGTH) :: prnfmt
970 integer(I4B),
pointer :: columns, width, digits
972 character(len=LENVARNAME),
dimension(3) :: sorption_method = &
973 &[character(len=LENVARNAME) ::
'LINEAR',
'FREUNDLICH',
'LANGMUIR']
974 character(len=
linelength) :: sorbate_fname, cim6_fname, budget_fname, &
981 call mem_set_value(this%ipakcb,
'SAVE_FLOWS', this%input_mempath, &
983 call mem_set_value(budget_fname,
'BUDGETFILE', this%input_mempath, &
985 call mem_set_value(budgetcsv_fname,
'BUDGETCSVFILE', this%input_mempath, &
987 call mem_set_value(this%isrb,
'SORPTION', this%input_mempath, &
988 sorption_method, found%sorption)
989 call mem_set_value(this%idcy,
'ORDER1_DECAY', this%input_mempath, &
991 call mem_set_value(this%idcy,
'ORDER0_DECAY', this%input_mempath, &
993 call mem_set_value(cim6_fname,
'CIMFILE', this%input_mempath, &
995 call mem_set_value(sorbate_fname,
'SORBATEFILE', this%input_mempath, &
1007 if (found%save_flows) this%ipakcb = -1
1008 if (found%budgetfile)
then
1009 call assign_iounit(this%ibudgetout, this%inunit,
"BUDGET fileout")
1010 call openfile(this%ibudgetout, this%iout, budget_fname,
'DATA(BINARY)', &
1013 if (found%budgetcsvfile)
then
1014 call assign_iounit(this%ibudcsv, this%inunit,
"BUDGETCSV fileout")
1015 call openfile(this%ibudcsv, this%iout, budgetcsv_fname,
'CSV', &
1016 filstat_opt=
'REPLACE')
1018 if (found%sorption)
then
1019 if (this%isrb == 0)
then
1020 call store_error(
'Unknown sorption type was specified. &
1021 &Sorption must be specified as LINEAR, &
1022 &FREUNDLICH, or LANGMUIR.')
1026 if (found%order1_decay) this%idcy = 1
1027 if (found%order0_decay) this%idcy = 2
1028 if (found%cimfile)
then
1029 call this%ocd%set_ocfile(cim6_fname, this%iout)
1031 if ((found%columns .or. found%width .or. found%digits) .and. &
1032 .not. (found%columns .and. found%width .and. found%digits))
then
1033 call store_error(
'PRINT_FORMAT must include COLUMNS, WIDTH and DIGITS. &
1034 &Syntax is: COLUMNS <columns> WIDTH <width> &
1035 &DIGITS <digits> [<format>].')
1038 if (found%columns .and. found%width .and. &
1039 found%digits .and. found%format)
then
1040 write (this%lstfmt,
'(a,i0,a,i0,a,i0,a)')
'COLUMNS ', columns, &
1041 ' WIDTH ', width,
' DIGITS ', digits,
' '//trim(prnfmt)
1043 if (found%sorbatefile)
then
1045 call openfile(this%ioutsorbate, this%iout, sorbate_fname, &
1050 if (this%iout > 0)
then
1051 call this%log_options(found, cim6_fname, budget_fname, &
1052 budgetcsv_fname, sorbate_fname)
1055 deallocate (columns)
1063 budgetcsv_fname, sorbate_fname)
1067 character(len=*),
intent(in) :: cim6_fname
1068 character(len=*),
intent(in) :: budget_fname
1069 character(len=*),
intent(in) :: budgetcsv_fname
1070 character(len=*),
intent(in) :: sorbate_fname
1072 character(len=*),
parameter :: fmtisvflow = &
1073 "(4x,'CELL-BY-CELL FLOW INFORMATION WILL BE SAVED TO BINARY FILE &
1074 &WHENEVER ICBCFL IS NOT ZERO.')"
1075 character(len=*),
parameter :: fmtlinear = &
1076 &
"(4x,'LINEAR SORPTION IS SELECTED. ')"
1077 character(len=*),
parameter :: fmtfreundlich = &
1078 &
"(4x,'FREUNDLICH SORPTION IS ACTIVE. ')"
1079 character(len=*),
parameter :: fmtlangmuir = &
1080 &
"(4x,'LANGMUIR SORPTION IS ACTIVE. ')"
1081 character(len=*),
parameter :: fmtidcy1 = &
1082 &
"(4x,'FIRST-ORDER DECAY IS ACTIVE. ')"
1083 character(len=*),
parameter :: fmtidcy2 = &
1084 &
"(4x,'ZERO-ORDER DECAY IS ACTIVE. ')"
1085 character(len=*),
parameter :: fmtistbin = &
1086 "(4x, 'IST ', 1x, a, 1x, ' WILL BE SAVED TO FILE: ', a, &
1087 &/4x, 'OPENED ON UNIT: ', I0)"
1089 write (this%iout,
'(1x,a)')
'PROCESSING IMMOBILE STORAGE AND TRANSFER &
1091 if (found%save_flows)
then
1092 write (this%iout, fmtisvflow)
1094 if (found%budgetfile)
then
1095 write (this%iout, fmtistbin)
'BUDGET', trim(adjustl(budget_fname)), &
1098 if (found%budgetcsvfile)
then
1099 write (this%iout, fmtistbin)
'BUDGET CSV', trim(adjustl(budgetcsv_fname)), &
1102 if (found%sorption)
then
1103 select case (this%isrb)
1105 write (this%iout, fmtlinear)
1107 write (this%iout, fmtfreundlich)
1109 write (this%iout, fmtlangmuir)
1112 if (found%order1_decay)
then
1113 write (this%iout, fmtidcy1)
1115 if (found%order0_decay)
then
1116 write (this%iout, fmtidcy2)
1118 if (found%sorbatefile)
then
1119 write (this%iout, fmtistbin) &
1120 'SORBATE', sorbate_fname, this%ioutsorbate
1122 write (this%iout,
'(1x,a)')
'END OF IMMOBILE STORAGE AND TRANSFER &
1137 call this%source_options()
1158 integer(I4B) :: asize
1159 integer(I4B),
dimension(:),
pointer,
contiguous :: map
1163 if (this%dis%nodes < this%dis%nodesuser) map => this%dis%nodeuser
1166 if (this%isrb == 0)
then
1167 call get_isize(
'BULK_DENSITY', this%input_mempath, asize)
1170 'BULK_DENSITY', this%memoryPath)
1171 call get_isize(
'DISTCOEF', this%input_mempath, asize)
1176 if (this%idcy == 0)
then
1177 call get_isize(
'DECAY', this%input_mempath, asize)
1179 call mem_reallocate(this%decay, this%dis%nodes,
'DECAY', this%memoryPath)
1181 call get_isize(
'DECAY_SORBED', this%input_mempath, asize)
1184 'DECAY_SORBED', this%memoryPath)
1186 if (this%isrb < 2)
then
1187 call get_isize(
'SP2', this%input_mempath, asize)
1189 call mem_reallocate(this%sp2, this%dis%nodes,
'SP2', this%memoryPath)
1193 call mem_set_value(this%porosity,
'POROSITY', this%input_mempath, map, &
1195 call mem_set_value(this%volfrac,
'VOLFRAC', this%input_mempath, map, &
1197 call mem_set_value(this%zetaim,
'ZETAIM', this%input_mempath, map, &
1199 call mem_set_value(this%cim,
'CIM', this%input_mempath, map, &
1201 call mem_set_value(this%decay,
'DECAY', this%input_mempath, map, &
1203 call mem_set_value(this%decay_sorbed,
'DECAY_SORBED', this%input_mempath, &
1204 map, found%decay_sorbed)
1205 call mem_set_value(this%bulk_density,
'BULK_DENSITY', this%input_mempath, &
1206 map, found%bulk_density)
1207 call mem_set_value(this%distcoef,
'DISTCOEF', this%input_mempath, map, &
1209 call mem_set_value(this%sp2,
'SP2', this%input_mempath, map, &
1213 if (this%iout > 0)
then
1214 call this%log_data(found)
1218 if (this%isrb > 0)
then
1219 if (.not. found%bulk_density)
then
1220 write (
errmsg,
'(a)')
'Sorption is active but BULK_DENSITY &
1221 ¬ specified. BULK_DENSITY must be specified in GRIDDATA block.'
1224 if (.not. found%distcoef)
then
1225 write (
errmsg,
'(a)')
'Sorption is active but distribution &
1226 &coefficient not specified. DISTCOEF must be specified in &
1230 if (this%isrb > 1)
then
1231 if (.not. found%sp2)
then
1232 write (
errmsg,
'(a)')
'Freundlich or langmuir sorption is active &
1233 &but SP2 not specified. SP2 must be specified in &
1239 if (found%bulk_density)
then
1240 write (
warnmsg,
'(a)')
'Sorption is not active but &
1241 &BULK_DENSITY was specified. BULK_DENSITY will have no affect on &
1242 &simulation results.'
1244 write (this%iout,
'(1x,a)')
'WARNING. '//
warnmsg
1246 if (found%distcoef)
then
1247 write (
warnmsg,
'(a)')
'Sorption is not active but &
1248 &distribution coefficient was specified. DISTCOEF will have &
1249 &no affect on simulation results.'
1251 write (this%iout,
'(1x,a)')
'WARNING. '//
warnmsg
1254 write (
warnmsg,
'(a)')
'Sorption is not active but &
1255 &SP2 was specified. SP2 will have &
1256 &no affect on simulation results.'
1258 write (this%iout,
'(1x,a)')
'WARNING. '//
warnmsg
1263 if (this%idcy > 0)
then
1264 if (.not. found%decay)
then
1265 write (
errmsg,
'(a)')
'First or zero order decay is &
1266 &active but the first rate coefficient is not specified. DECAY &
1267 &must be specified in GRIDDATA block.'
1270 if (.not. found%decay_sorbed)
then
1274 write (
errmsg,
'(a)')
'DECAY_SORBED not provided in GRIDDATA &
1275 &block but decay and sorption are active. Specify DECAY_SORBED &
1276 &in GRIDDATA block.'
1280 if (found%decay)
then
1281 write (
warnmsg,
'(a)')
'First- or zero-order decay &
1282 &is not active but decay was specified. DECAY will &
1283 &have no affect on simulation results.'
1285 write (this%iout,
'(1x,a)')
'WARNING. '//
warnmsg
1287 if (found%decay_sorbed)
then
1288 write (
warnmsg,
'(a)')
'First- or zero-order decay &
1289 &is not active but DECAY_SORBED was specified. &
1290 &DECAY_SORBED will have no affect on simulation results.'
1292 write (this%iout,
'(1x,a)')
'WARNING. '//
warnmsg
1298 if (.not. found%cim)
then
1299 write (this%iout,
'(1x,a)')
'Warning. Dual domain is active but &
1300 &initial immobile domain concentration was not specified. &
1301 &Setting CIM to zero.'
1303 if (.not. found%zetaim)
then
1304 write (
errmsg,
'(a)')
'Dual domain is active but dual &
1305 &domain mass transfer rate (ZETAIM) was not specified. ZETAIM &
1306 &must be specified in GRIDDATA block.'
1309 if (.not. found%porosity)
then
1310 write (
errmsg,
'(a)')
'Dual domain is active but &
1311 &immobile domain POROSITY was not specified. POROSITY &
1312 &must be specified in GRIDDATA block.'
1315 if (.not. found%volfrac)
then
1316 write (
errmsg,
'(a)')
'Dual domain is active but &
1317 &immobile domain VOLFRAC was not specified. VOLFRAC &
1318 &must be specified in GRIDDATA block. This is a new &
1319 &requirement for MODFLOW versions later than version &
1337 write (this%iout,
'(1x,a)')
'PROCESSING GRIDDATA'
1338 if (found%porosity)
then
1339 write (this%iout,
'(4x,a)')
'MOBILE DOMAIN POROSITY set from input file'
1341 if (found%volfrac)
then
1342 write (this%iout,
'(4x,a)')
'VOLFRAC set from input file'
1344 if (found%zetaim)
then
1345 write (this%iout,
'(4x,a)')
'ZETAIM set from input file'
1348 write (this%iout,
'(4x,a)')
'CIM set from input file'
1350 if (found%decay)
then
1351 write (this%iout,
'(4x,a)')
'DECAY RATE set from input file'
1353 if (found%decay_sorbed)
then
1354 write (this%iout,
'(4x,a)')
'DECAY SORBED RATE set from input file'
1356 if (found%bulk_density)
then
1357 write (this%iout,
'(4x,a)')
'BULK DENSITY set from input file'
1359 if (found%distcoef)
then
1360 write (this%iout,
'(4x,a)')
'DISTRIBUTION COEFFICIENT set from input file'
1363 write (this%iout,
'(4x,a)')
'SECOND SORPTION PARAM set from input file'
1365 write (this%iout,
'(1x,a)')
'END PROCESSING GRIDDATA'
1389 integer(I4B),
intent(in) :: node
1393 thetaim = this%volfrac(node) * this%porosity(node)
1405 volfracim, rhobim, kdnew, kdold, &
1406 lambda1im, lambda2im, &
1407 gamma1im, gamma2im, zetaim, ddterm, f)
1409 real(DP),
intent(in) :: thetaim
1410 real(DP),
intent(in) :: vcell
1411 real(DP),
intent(in) :: delt
1412 real(DP),
intent(in) :: swtpdt
1413 real(DP),
intent(in) :: volfracim
1414 real(DP),
intent(in) :: rhobim
1415 real(DP),
intent(in) :: kdnew
1416 real(DP),
intent(in) :: kdold
1417 real(DP),
intent(in) :: lambda1im
1418 real(DP),
intent(in) :: lambda2im
1419 real(DP),
intent(in) :: gamma1im
1420 real(DP),
intent(in) :: gamma2im
1421 real(DP),
intent(in) :: zetaim
1422 real(DP),
dimension(:),
intent(inout) :: ddterm
1423 real(DP),
intent(inout) :: f
1434 ddterm(1) = thetaim * vcell * tled
1435 ddterm(2) = thetaim * vcell * tled
1436 ddterm(3) = volfracim * rhobim * vcell * kdnew * tled
1437 ddterm(4) = volfracim * rhobim * vcell * kdold * tled
1438 ddterm(5) = thetaim * lambda1im * vcell
1439 ddterm(6) = lambda2im * volfracim * rhobim * kdnew * vcell
1440 ddterm(7) = thetaim * gamma1im * vcell
1441 ddterm(8) = gamma2im * volfracim * rhobim * vcell
1442 ddterm(9) = vcell * swtpdt * zetaim
1445 f = ddterm(1) + ddterm(3) + ddterm(5) + ddterm(6) + ddterm(9)
1456 real(DP),
dimension(:),
intent(in) :: ddterm
1457 real(DP),
intent(in) :: f
1458 real(DP),
intent(in) :: cimold
1459 real(DP),
intent(inout) :: hcof
1460 real(DP),
intent(inout) :: rhs
1463 hcof = ddterm(9)**2 / f - ddterm(9)
1467 rhs = (ddterm(2) + ddterm(4)) * cimold - ddterm(7) - ddterm(8)
1468 rhs = rhs * ddterm(9) / f
1479 real(dp),
dimension(:),
intent(in) :: ddterm
1480 real(dp),
intent(in) :: f
1481 real(dp),
intent(in) :: cimold
1482 real(dp),
intent(in) :: cnew
1488 cimnew = (ddterm(2) + ddterm(4)) * cimold + ddterm(9) * cnew - ddterm(7) &
1502 real(DP),
dimension(:, :),
intent(inout) :: budterm
1503 real(DP),
dimension(:),
intent(in) :: ddterm
1504 real(DP),
intent(in) :: cimnew
1505 real(DP),
intent(in) :: cimold
1506 real(DP),
intent(in) :: cnew
1507 integer(I4B),
intent(in) :: idcy
1514 rate = -ddterm(1) * cimnew + ddterm(2) * cimold
1515 if (rate > dzero)
then
1516 budterm(1, i) = budterm(1, i) + rate
1518 budterm(2, i) = budterm(2, i) - rate
1523 rate = -ddterm(3) * cimnew + ddterm(4) * cimold
1524 if (rate > dzero)
then
1525 budterm(1, i) = budterm(1, i) + rate
1527 budterm(2, i) = budterm(2, i) - rate
1534 rate = -ddterm(5) * cimnew
1535 else if (idcy == 2)
then
1540 if (rate > dzero)
then
1541 budterm(1, i) = budterm(1, i) + rate
1543 budterm(2, i) = budterm(2, i) - rate
1549 rate = -ddterm(6) * cimnew
1550 else if (idcy == 2)
then
1555 if (rate > dzero)
then
1556 budterm(1, i) = budterm(1, i) + rate
1558 budterm(2, i) = budterm(2, i) - rate
1563 rate = ddterm(9) * cnew - ddterm(9) * cimnew
1564 if (rate > dzero)
then
1565 budterm(1, i) = budterm(1, i) + rate
1567 budterm(2, i) = budterm(2, i) - rate
1576 real(dp),
intent(in) :: conc
1577 real(dp),
intent(in) :: kf
1578 real(dp),
intent(in) :: a
1579 real(dp),
parameter :: k = 10.0_dp
1584 eps = (k / (a * kf))**(1.0_dp / (a - 1.0_dp))
1585 if (conc > dzero)
then
1586 kd = kf * (conc + eps)**(a - done) - kf * eps**(a - done)
1596 real(dp),
intent(in) :: conc
1597 real(dp),
intent(in) :: kl
1598 real(dp),
intent(in) :: sbar
1602 if (conc > dzero)
then
1603 kd = (kl * sbar) / (done + kl * conc)
This module contains the base boundary package.
subroutine bnd_ar(this)
Allocate and read method for boundary package.
subroutine bnd_rp(this)
Allocate and read method for package.
subroutine bnd_ot_dv(this, idvsave, idvprint)
Output advanced package dependent-variable terms.
subroutine bnd_ot_model_flows(this, icbcfl, ibudfl, icbcun, imap)
Output package flow terms.
subroutine bnd_da(this)
Deallocate package memory.
subroutine bnd_bd(this, model_budget)
Add package flows to model budget.
subroutine bnd_fc(this, rhs, ia, idxglo, matrix_sln)
Copy hcof and rhs terms into solution.
subroutine bnd_ot_bdsummary(this, kstp, kper, iout, ibudfl)
Output advanced package budget summary.
subroutine bnd_ad(this)
Advance the boundary package.
subroutine bnd_cq(this, x, flowja, iadv)
Calculate advanced package flows.
This module contains the BudgetModule.
subroutine, public budget_cr(this, name_model)
Create a new budget object.
subroutine, public rate_accumulator(flow, rin, rout)
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
subroutine ist_da(this)
Deallocate package memory.
subroutine log_data(this, found)
Log user data to list file.
subroutine ist_calc_csrb(this, cim)
Calculate immobile sorbed concentration.
subroutine ist_rp(this)
Read and prepare method for package.
real(dp) function get_ddconc(ddterm, f, cimold, cnew)
Calculate the immobile domain concentration.
real(dp) function get_thetaim(this, node)
Return thetaim.
subroutine source_data(this)
Source data for package.
subroutine get_hcofrhs(ddterm, f, cimold, hcof, rhs)
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)
Calculate immobile domain equation terms.
integer(i4b), parameter nbditems
subroutine output_immobile_sorbate_concentration(this, idvsave, idvprint)
Output immobile domain sorbate concentration.
real(dp) function get_freundlich_kd(conc, kf, a)
Get effective Freundlich distribution coefficient.
subroutine source_options(this)
Source options for package.
real(dp) function get_langmuir_kd(conc, kl, sbar)
Get effective Langmuir distribution coefficient.
subroutine ist_ot_model_flows(this, icbcfl, ibudfl, icbcun, imap)
Output model flow terms.
subroutine ist_read_dimensions(this)
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)
Allocate package scalars.
character(len=lenftype) ftype
subroutine ist_ar(this)
Allocate and read method for package.
subroutine ist_ot_bdsummary(this, kstp, kper, iout, ibudfl)
Output IST package budget summary.
subroutine ist_ot_dv(this, idvsave, idvprint)
Output dependent variables.
subroutine ist_allocate_arrays(this)
Allocate package arrays.
subroutine ist_cq(this, x, flowja, iadv)
Calculate package flows.
subroutine ist_ad(this)
Advance the ist package.
subroutine accumulate_budterm(budterm, ddterm, cimnew, cimold, cnew, idcy)
Calculate the immobile domain budget terms.
subroutine ist_bd(this, model_budget)
Add package flows to model budget.
subroutine ist_fc(this, rhs, ia, idxglo, matrix_sln)
Fill coefficient method for package.
character(len=lenbudtxt), dimension(nbditems) budtxt
subroutine read_options(this)
Read options for package.
subroutine, public ist_create(packobj, id, ibcnum, inunit, iout, namemodel, pakname, mempath, fmi, mst)
Create a new package object.
character(len=lenpackagename) text
subroutine output_immobile_concentration(this, idvsave, idvprint)
Output immobile domain aqueous concentration.
real(dp) function get_zero_order_decay(decay_rate_usr, decay_rate_last, kiter, cold, cnew, delt)
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)
Get the number of elements for this variable.
Output control data module.
subroutine, public ocd_cr(ocdobj)
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.
Immobile storage and transfer.
Mobile storage and transfer.
Output control data type.