31 character(len=LENBUDTXT),
dimension(NBDITEMS) ::
budtxt
32 data budtxt/
' STORAGE-AQUEOUS',
' DECAY-AQUEOUS', &
33 ' STORAGE-SORBED',
' DECAY-SORBED'/
52 real(dp),
dimension(:),
pointer,
contiguous :: porosity => null()
53 real(dp),
dimension(:),
pointer,
contiguous :: thetam => null()
54 real(dp),
dimension(:),
pointer,
contiguous :: volfracim => null()
55 real(dp),
dimension(:),
pointer,
contiguous :: ratesto => null()
58 integer(I4B),
pointer :: idcy => null()
59 real(dp),
dimension(:),
pointer,
contiguous :: decay => null()
60 real(dp),
dimension(:),
pointer,
contiguous :: decay_sorbed => null()
61 real(dp),
dimension(:),
pointer,
contiguous :: ratedcy => null()
62 real(dp),
dimension(:),
pointer,
contiguous :: decaylast => null()
63 real(dp),
dimension(:),
pointer,
contiguous :: decayslast => null()
66 integer(I4B),
pointer :: isrb => null()
67 integer(I4B),
pointer :: ioutsorbate => null()
68 real(dp),
dimension(:),
pointer,
contiguous :: bulk_density => null()
69 real(dp),
dimension(:),
pointer,
contiguous :: distcoef => null()
70 real(dp),
dimension(:),
pointer,
contiguous :: sp2 => null()
71 real(dp),
dimension(:),
pointer,
contiguous :: ratesrb => null()
72 real(dp),
dimension(:),
pointer,
contiguous :: ratedcys => null()
73 real(dp),
dimension(:),
pointer,
contiguous :: csrb => null()
76 integer(I4B),
dimension(:),
pointer,
contiguous :: ibound => null()
114 subroutine mst_cr(mstobj, name_model, input_mempath, inunit, iout, fmi)
117 character(len=*),
intent(in) :: name_model
118 character(len=*),
intent(in) :: input_mempath
119 integer(I4B),
intent(in) :: inunit
120 integer(I4B),
intent(in) ::
iout
127 call mstobj%set_names(1, name_model,
'MST',
'MST', input_mempath)
130 call mstobj%allocate_scalars()
133 mstobj%inunit = inunit
147 integer(I4B),
dimension(:),
pointer,
contiguous :: ibound
150 character(len=*),
parameter :: fmtmst = &
151 "(1x,/1x,'MST -- MOBILE STORAGE AND TRANSFER PACKAGE, VERSION 1, &
152 &7/29/2020 INPUT READ FROM MEMPATH: ', A, //)"
155 write (this%iout, fmtmst) this%input_mempath
158 call this%source_options()
162 this%ibound => ibound
165 call this%allocate_arrays(dis%nodes)
168 call this%source_data()
178 subroutine mst_fc(this, nodes, cold, nja, matrix_sln, idxglo, cnew, &
183 integer,
intent(in) :: nodes
184 real(DP),
intent(in),
dimension(nodes) :: cold
185 integer(I4B),
intent(in) :: nja
187 integer(I4B),
intent(in),
dimension(nja) :: idxglo
188 real(DP),
intent(inout),
dimension(nodes) :: rhs
189 real(DP),
intent(in),
dimension(nodes) :: cnew
190 integer(I4B),
intent(in) :: kiter
193 call this%mst_fc_sto(nodes, cold, nja, matrix_sln, idxglo, rhs)
197 call this%mst_fc_dcy(nodes, cold, cnew, nja, matrix_sln, idxglo, &
203 call this%mst_fc_srb(nodes, cold, nja, matrix_sln, idxglo, rhs, cnew)
208 call this%mst_fc_dcy_srb(nodes, cold, nja, matrix_sln, idxglo, rhs, &
217 subroutine mst_fc_sto(this, nodes, cold, nja, matrix_sln, idxglo, rhs)
222 integer,
intent(in) :: nodes
223 real(DP),
intent(in),
dimension(nodes) :: cold
224 integer(I4B),
intent(in) :: nja
226 integer(I4B),
intent(in),
dimension(nja) :: idxglo
227 real(DP),
intent(inout),
dimension(nodes) :: rhs
229 integer(I4B) :: n, idiag
231 real(DP) :: hhcof, rrhs
232 real(DP) :: vnew, vold
238 do n = 1, this%dis%nodes
241 if (this%ibound(n) <= 0) cycle
244 vnew = this%dis%get_cell_volume(n) * this%fmi%gwfsat(n) * this%thetam(n)
246 if (this%fmi%igwfstrgss /= 0) vold = vold + this%fmi%gwfstrgss(n) *
delt
247 if (this%fmi%igwfstrgsy /= 0) vold = vold + this%fmi%gwfstrgsy(n) *
delt
251 rrhs = -vold * tled * cold(n)
252 idiag = this%dis%con%ia(n)
253 call matrix_sln%add_value_pos(idxglo(idiag), hhcof)
254 rhs(n) = rhs(n) + rrhs
262 subroutine mst_fc_dcy(this, nodes, cold, cnew, nja, matrix_sln, &
268 integer,
intent(in) :: nodes
269 real(DP),
intent(in),
dimension(nodes) :: cold
270 real(DP),
intent(in),
dimension(nodes) :: cnew
271 integer(I4B),
intent(in) :: nja
273 integer(I4B),
intent(in),
dimension(nja) :: idxglo
274 real(DP),
intent(inout),
dimension(nodes) :: rhs
275 integer(I4B),
intent(in) :: kiter
277 integer(I4B) :: n, idiag
278 real(DP) :: hhcof, rrhs
281 real(DP) :: decay_rate
284 do n = 1, this%dis%nodes
287 if (this%ibound(n) <= 0) cycle
290 vcell = this%dis%get_cell_volume(n)
291 swtpdt = this%fmi%gwfsat(n)
294 idiag = this%dis%con%ia(n)
295 select case (this%idcy)
300 if (cnew(n) >
dzero)
then
301 hhcof = -this%decay(n) * vcell * swtpdt * this%thetam(n)
302 call matrix_sln%add_value_pos(idxglo(idiag), hhcof)
309 kiter, cold(n), cnew(n),
delt)
310 this%decaylast(n) = decay_rate
311 rrhs = decay_rate * vcell * swtpdt * this%thetam(n)
312 rhs(n) = rhs(n) + rrhs
322 subroutine mst_fc_srb(this, nodes, cold, nja, matrix_sln, idxglo, rhs, &
328 integer,
intent(in) :: nodes
329 real(DP),
intent(in),
dimension(nodes) :: cold
330 integer(I4B),
intent(in) :: nja
332 integer(I4B),
intent(in),
dimension(nja) :: idxglo
333 real(DP),
intent(inout),
dimension(nodes) :: rhs
334 real(DP),
intent(in),
dimension(nodes) :: cnew
336 integer(I4B) :: n, idiag
338 real(DP) :: hhcof, rrhs
342 real(DP) :: sat_new, sat_old
348 do n = 1, this%dis%nodes
351 if (this%ibound(n) <= 0) cycle
354 vcell = this%dis%get_cell_volume(n)
355 volfracm = this%get_volfracm(n)
356 rhobm = this%bulk_density(n)
357 sat_new = this%fmi%gwfsat(n)
358 sat_old = this%fmi%gwfsatold(n,
delt, this%thetam(n))
361 hhcof = -volfracm * rhobm * sat_new * this%isotherm%derivative(cnew, n) &
363 idiag = this%dis%con%ia(n)
364 call matrix_sln%add_value_pos(idxglo(idiag), hhcof)
367 rrhs = -volfracm * rhobm * sat_new * this%isotherm%derivative(cnew, n) &
368 * cnew(n) * vcell * tled
369 rhs(n) = rhs(n) + rrhs
371 rrhs = volfracm * rhobm * sat_new * this%isotherm%value(cnew, n) * &
373 rhs(n) = rhs(n) + rrhs
376 rrhs = -volfracm * rhobm * sat_old * this%isotherm%value(cold, n) * &
378 rhs(n) = rhs(n) + rrhs
393 integer,
intent(in) :: nodes
394 real(DP),
intent(in),
dimension(nodes) :: cold
395 integer(I4B),
intent(in) :: nja
397 integer(I4B),
intent(in),
dimension(nja) :: idxglo
398 real(DP),
intent(inout),
dimension(nodes) :: rhs
399 real(DP),
intent(in),
dimension(nodes) :: cnew
400 integer(I4B),
intent(in) :: kiter
402 integer(I4B) :: n, idiag
403 real(DP) :: hhcof, rrhs
411 real(DP) :: decay_rate
416 do n = 1, this%dis%nodes
419 if (this%ibound(n) <= 0) cycle
424 vcell = this%dis%get_cell_volume(n)
425 swnew = this%fmi%gwfsat(n)
426 distcoef = this%distcoef(n)
427 idiag = this%dis%con%ia(n)
428 volfracm = this%get_volfracm(n)
429 rhobm = this%bulk_density(n)
430 term = this%decay_sorbed(n) * volfracm * rhobm * swnew * vcell
433 select case (this%idcy)
435 select case (this%isrb)
440 if (cnew(n) >
dzero)
then
441 hhcof = -term * distcoef
446 csrb = this%isotherm%value(cnew, n)
451 csrb = this%isotherm%value(cnew, n)
458 if (distcoef >
dzero)
then
459 csrbold = this%isotherm%value(cold, n)
460 csrbnew = this%isotherm%value(cnew, n)
463 this%decayslast(n), &
464 kiter, csrbold, csrbnew,
delt)
465 this%decayslast(n) = decay_rate
466 rrhs = decay_rate * volfracm * rhobm * swnew * vcell
471 call matrix_sln%add_value_pos(idxglo(idiag), hhcof)
472 rhs(n) = rhs(n) + rrhs
481 subroutine mst_cq(this, nodes, cnew, cold, flowja)
484 integer(I4B),
intent(in) :: nodes
485 real(DP),
intent(in),
dimension(nodes) :: cnew
486 real(DP),
intent(in),
dimension(nodes) :: cold
487 real(DP),
dimension(:),
contiguous,
intent(inout) :: flowja
490 call this%mst_cq_sto(nodes, cnew, cold, flowja)
494 call this%mst_cq_dcy(nodes, cnew, cold, flowja)
499 call this%mst_cq_srb(nodes, cnew, cold, flowja)
504 call this%mst_cq_dcy_srb(nodes, cnew, cold, flowja)
509 call this%mst_calc_csrb(cnew)
522 integer(I4B),
intent(in) :: nodes
523 real(DP),
intent(in),
dimension(nodes) :: cnew
524 real(DP),
intent(in),
dimension(nodes) :: cold
525 real(DP),
dimension(:),
contiguous,
intent(inout) :: flowja
528 integer(I4B) :: idiag
531 real(DP) :: vnew, vold
532 real(DP) :: hhcof, rrhs
539 this%ratesto(n) =
dzero
542 if (this%ibound(n) <= 0) cycle
545 vnew = this%dis%get_cell_volume(n) * this%fmi%gwfsat(n) * this%thetam(n)
547 if (this%fmi%igwfstrgss /= 0) vold = vold + this%fmi%gwfstrgss(n) *
delt
548 if (this%fmi%igwfstrgsy /= 0) vold = vold + this%fmi%gwfstrgsy(n) *
delt
552 rrhs = -vold * tled * cold(n)
553 rate = hhcof * cnew(n) - rrhs
554 this%ratesto(n) = rate
555 idiag = this%dis%con%ia(n)
556 flowja(idiag) = flowja(idiag) + rate
569 integer(I4B),
intent(in) :: nodes
570 real(DP),
intent(in),
dimension(nodes) :: cnew
571 real(DP),
intent(in),
dimension(nodes) :: cold
572 real(DP),
dimension(:),
contiguous,
intent(inout) :: flowja
575 integer(I4B) :: idiag
578 real(DP) :: hhcof, rrhs
580 real(DP) :: decay_rate
588 this%ratedcy(n) =
dzero
589 if (this%ibound(n) <= 0) cycle
592 vcell = this%dis%get_cell_volume(n)
593 swtpdt = this%fmi%gwfsat(n)
600 if (cnew(n) >
dzero)
then
601 hhcof = -this%decay(n) * vcell * swtpdt * this%thetam(n)
605 0, cold(n), cnew(n),
delt)
606 rrhs = decay_rate * vcell * swtpdt * this%thetam(n)
608 rate = hhcof * cnew(n) - rrhs
609 this%ratedcy(n) = rate
610 idiag = this%dis%con%ia(n)
611 flowja(idiag) = flowja(idiag) + rate
625 integer(I4B),
intent(in) :: nodes
626 real(DP),
intent(in),
dimension(nodes) :: cnew
627 real(DP),
intent(in),
dimension(nodes) :: cold
628 real(DP),
dimension(:),
contiguous,
intent(inout) :: flowja
631 integer(I4B) :: idiag
637 real(DP) :: sat_new, sat_old
638 real(DP) :: contribution
647 this%ratesrb(n) =
dzero
651 if (this%ibound(n) <= 0) cycle
654 vcell = this%dis%get_cell_volume(n)
656 rhobm = this%bulk_density(n)
657 volfracm = this%get_volfracm(n)
658 sat_new = this%fmi%gwfsat(n)
659 sat_old = this%fmi%gwfsatold(n,
delt, this%thetam(n))
662 contribution = -volfracm * rhobm * sat_new &
663 * this%isotherm%derivative(cnew, n) * cnew(n) * vcell * tled
664 rate = rate + contribution
668 contribution = -volfracm * rhobm * sat_new * &
669 this%isotherm%derivative(cnew, n) * cnew(n) * vcell * tled
670 rate = rate - contribution
672 contribution = volfracm * rhobm * sat_new * this%isotherm%value(cnew, n) &
674 rate = rate - contribution
677 contribution = -volfracm * rhobm * sat_old * this%isotherm%value(cold, n) &
679 rate = rate - contribution
681 this%ratesrb(n) = rate
682 idiag = this%dis%con%ia(n)
683 flowja(idiag) = flowja(idiag) + rate
697 integer(I4B),
intent(in) :: nodes
698 real(DP),
intent(in),
dimension(nodes) :: cnew
699 real(DP),
intent(in),
dimension(nodes) :: cold
700 real(DP),
dimension(:),
contiguous,
intent(inout) :: flowja
703 integer(I4B) :: idiag
705 real(DP) :: hhcof, rrhs
715 real(DP) :: decay_rate
722 this%ratedcys(n) =
dzero
725 if (this%ibound(n) <= 0) cycle
730 vcell = this%dis%get_cell_volume(n)
731 swnew = this%fmi%gwfsat(n)
732 distcoef = this%distcoef(n)
733 volfracm = this%get_volfracm(n)
734 rhobm = this%bulk_density(n)
735 term = this%decay_sorbed(n) * volfracm * rhobm * swnew * vcell
738 select case (this%idcy)
742 select case (this%isrb)
747 if (cnew(n) >
dzero)
then
748 hhcof = -term * distcoef
753 csrb = this%isotherm%value(cnew, n)
758 csrb = this%isotherm%value(cnew, n)
765 if (distcoef >
dzero)
then
766 csrbold = this%isotherm%value(cold, n)
767 csrbnew = this%isotherm%value(cnew, n)
770 this%decayslast(n), &
771 0, csrbold, csrbnew,
delt)
772 rrhs = decay_rate * volfracm * rhobm * swnew * vcell
777 rate = hhcof * cnew(n) - rrhs
778 this%ratedcys(n) = rate
779 idiag = this%dis%con%ia(n)
780 flowja(idiag) = flowja(idiag) + rate
790 real(DP),
intent(in),
dimension(:) :: cnew
798 if (this%ibound(n) > 0 .and. this%isrb /=
sorption_off)
then
799 csrb = this%isotherm%value(cnew, n)
808 subroutine mst_bd(this, isuppress_output, model_budget)
814 integer(I4B),
intent(in) :: isuppress_output
815 type(
budgettype),
intent(inout) :: model_budget
822 call model_budget%addentry(rin, rout,
delt,
budtxt(1), &
823 isuppress_output, rowlabel=this%packName)
828 call model_budget%addentry(rin, rout,
delt,
budtxt(2), &
829 isuppress_output, rowlabel=this%packName)
835 call model_budget%addentry(rin, rout,
delt,
budtxt(3), &
836 isuppress_output, rowlabel=this%packName)
842 call model_budget%addentry(rin, rout,
delt,
budtxt(4), &
843 isuppress_output, rowlabel=this%packName)
854 integer(I4B),
intent(in) :: icbcfl
855 integer(I4B),
intent(in) :: icbcun
857 integer(I4B) :: ibinun
858 integer(I4B) :: iprint, nvaluesp, nwidthp
859 character(len=1) :: cdatafmp =
' ', editdesc =
' '
863 if (this%ipakcb < 0)
then
865 elseif (this%ipakcb == 0)
then
870 if (icbcfl == 0) ibinun = 0
873 if (ibinun /= 0)
then
878 call this%dis%record_array(this%ratesto, this%iout, iprint, -ibinun, &
879 budtxt(1), cdatafmp, nvaluesp, &
880 nwidthp, editdesc, dinact)
884 call this%dis%record_array(this%ratedcy, this%iout, iprint, -ibinun, &
885 budtxt(2), cdatafmp, nvaluesp, &
886 nwidthp, editdesc, dinact)
890 call this%dis%record_array(this%ratesrb, this%iout, iprint, -ibinun, &
891 budtxt(3), cdatafmp, nvaluesp, &
892 nwidthp, editdesc, dinact)
896 call this%dis%record_array(this%ratedcys, this%iout, iprint, -ibinun, &
897 budtxt(4), cdatafmp, nvaluesp, &
898 nwidthp, editdesc, dinact)
907 integer(I4B),
intent(in) :: idvsave
909 character(len=1) :: cdatafmp =
' ', editdesc =
' '
910 integer(I4B) :: ibinun
911 integer(I4B) :: iprint
912 integer(I4B) :: nvaluesp
913 integer(I4B) :: nwidthp
917 if (this%ioutsorbate /= 0)
then
922 if (idvsave == 0) ibinun = 0
925 if (ibinun /= 0)
then
928 if (this%ioutsorbate /= 0)
then
929 ibinun = this%ioutsorbate
930 call this%dis%record_array(this%csrb, this%iout, iprint, ibinun, &
931 ' SORBATE', cdatafmp, nvaluesp, &
932 nwidthp, editdesc, dinact)
949 if (this%inunit > 0)
then
968 this%ibound => null()
975 if (
associated(this%isotherm))
then
976 deallocate (this%isotherm)
977 nullify (this%isotherm)
981 call this%NumericalPackageType%da()
995 call this%NumericalPackageType%allocate_scalars()
999 call mem_allocate(this%ioutsorbate,
'IOUTSORBATE', this%memoryPath)
1004 this%ioutsorbate = 0
1018 integer(I4B),
intent(in) :: nodes
1024 call mem_allocate(this%porosity, nodes,
'POROSITY', this%memoryPath)
1025 call mem_allocate(this%thetam, nodes,
'THETAM', this%memoryPath)
1026 call mem_allocate(this%volfracim, nodes,
'VOLFRACIM', this%memoryPath)
1027 call mem_allocate(this%ratesto, nodes,
'RATESTO', this%memoryPath)
1031 call mem_allocate(this%ratedcy, 1,
'RATEDCY', this%memoryPath)
1032 call mem_allocate(this%decay, 1,
'DECAY', this%memoryPath)
1033 call mem_allocate(this%decaylast, 1,
'DECAYLAST', this%memoryPath)
1035 call mem_allocate(this%ratedcy, this%dis%nodes,
'RATEDCY', this%memoryPath)
1036 call mem_allocate(this%decay, nodes,
'DECAY', this%memoryPath)
1037 call mem_allocate(this%decaylast, nodes,
'DECAYLAST', this%memoryPath)
1040 call mem_allocate(this%ratedcys, this%dis%nodes,
'RATEDCYS', &
1042 call mem_allocate(this%decayslast, this%dis%nodes,
'DECAYSLAST', &
1045 call mem_allocate(this%ratedcys, 1,
'RATEDCYS', this%memoryPath)
1046 call mem_allocate(this%decayslast, 1,
'DECAYSLAST', this%memoryPath)
1048 call mem_allocate(this%decay_sorbed, 1,
'DECAY_SORBED', &
1053 call mem_allocate(this%bulk_density, 1,
'BULK_DENSITY', this%memoryPath)
1055 call mem_allocate(this%distcoef, 1,
'DISTCOEF', this%memoryPath)
1056 call mem_allocate(this%ratesrb, 1,
'RATESRB', this%memoryPath)
1057 call mem_allocate(this%csrb, 1,
'CSRB', this%memoryPath)
1059 call mem_allocate(this%bulk_density, nodes,
'BULK_DENSITY', this%memoryPath)
1060 call mem_allocate(this%distcoef, nodes,
'DISTCOEF', this%memoryPath)
1061 call mem_allocate(this%ratesrb, nodes,
'RATESRB', this%memoryPath)
1062 call mem_allocate(this%csrb, nodes,
'CSRB', this%memoryPath)
1066 call mem_allocate(this%sp2, nodes,
'SP2', this%memoryPath)
1072 this%porosity(n) =
dzero
1073 this%thetam(n) =
dzero
1074 this%volfracim(n) =
dzero
1075 this%ratesto(n) =
dzero
1077 do n = 1,
size(this%decay)
1078 this%decay(n) =
dzero
1079 this%ratedcy(n) =
dzero
1080 this%decaylast(n) =
dzero
1082 do n = 1,
size(this%bulk_density)
1083 this%bulk_density(n) =
dzero
1084 this%distcoef(n) =
dzero
1085 this%ratesrb(n) =
dzero
1086 this%csrb(n) =
dzero
1088 do n = 1,
size(this%sp2)
1091 do n = 1,
size(this%ratedcys)
1092 this%ratedcys(n) =
dzero
1093 this%decayslast(n) =
dzero
1112 character(len=LENVARNAME),
dimension(3) :: sorption_method = &
1113 &[character(len=LENVARNAME) ::
'LINEAR',
'FREUNDLICH',
'LANGMUIR']
1117 call mem_set_value(this%ipakcb,
'SAVE_FLOWS', this%input_mempath, &
1119 call mem_set_value(this%idcy,
'ORDER1_DECAY', this%input_mempath, &
1121 call mem_set_value(this%idcy,
'ORDER0_DECAY', this%input_mempath, &
1123 call mem_set_value(this%isrb,
'SORPTION', this%input_mempath, &
1124 sorption_method, found%sorption)
1125 call mem_set_value(fname,
'SORBATEFILE', this%input_mempath, &
1129 if (found%save_flows) this%ipakcb = -1
1132 if (found%sorption)
then
1133 if (this%isrb ==
izero)
then
1134 call store_error(
'Unknown sorption type was specified. &
1135 &Sorption must be specified as LINEAR, &
1136 &FREUNDLICH, or LANGMUIR.')
1140 if (found%sorbatefile)
then
1142 call openfile(this%ioutsorbate, this%iout, fname,
'DATA(BINARY)', &
1147 if (this%iout > 0)
then
1148 call this%log_options(found, fname)
1158 character(len=*),
intent(in) :: sorbate_fname
1160 character(len=*),
parameter :: fmtisvflow = &
1161 "(4x,'CELL-BY-CELL FLOW INFORMATION WILL BE SAVED TO BINARY FILE &
1162 &WHENEVER ICBCFL IS NOT ZERO.')"
1163 character(len=*),
parameter :: fmtlinear = &
1164 &
"(4x,'LINEAR SORPTION IS ACTIVE. ')"
1165 character(len=*),
parameter :: fmtfreundlich = &
1166 &
"(4x,'FREUNDLICH SORPTION IS ACTIVE. ')"
1167 character(len=*),
parameter :: fmtlangmuir = &
1168 &
"(4x,'LANGMUIR SORPTION IS ACTIVE. ')"
1169 character(len=*),
parameter :: fmtidcy1 = &
1170 &
"(4x,'FIRST-ORDER DECAY IS ACTIVE. ')"
1171 character(len=*),
parameter :: fmtidcy2 = &
1172 &
"(4x,'ZERO-ORDER DECAY IS ACTIVE. ')"
1173 character(len=*),
parameter :: fmtfileout = &
1174 "(4x,'MST ',1x,a,1x,' WILL BE SAVED TO FILE: ',a,/4x,&
1175 &'OPENED ON UNIT: ',I7)"
1177 write (this%iout,
'(1x,a)')
'PROCESSING MOBILE STORAGE AND TRANSFER OPTIONS'
1178 if (found%save_flows)
then
1179 write (this%iout, fmtisvflow)
1181 if (found%order1_decay)
then
1182 write (this%iout, fmtidcy1)
1184 if (found%order0_decay)
then
1185 write (this%iout, fmtidcy2)
1187 if (found%sorption)
then
1188 select case (this%isrb)
1190 write (this%iout, fmtlinear)
1192 write (this%iout, fmtfreundlich)
1194 write (this%iout, fmtlangmuir)
1197 if (found%sorbatefile)
then
1198 write (this%iout, fmtfileout) &
1199 'SORBATE', sorbate_fname, this%ioutsorbate
1201 write (this%iout,
'(1x,a)')
'END OF MOBILE STORAGE AND TRANSFER OPTIONS'
1216 character(len=LINELENGTH) :: errmsg
1218 integer(I4B) :: n, asize
1219 integer(I4B),
dimension(:),
pointer,
contiguous :: map
1223 if (this%dis%nodes < this%dis%nodesuser) map => this%dis%nodeuser
1227 call get_isize(
'BULK_DENSITY', this%input_mempath, asize)
1230 'BULK_DENSITY', this%memoryPath)
1231 call get_isize(
'DISTCOEF', this%input_mempath, asize)
1237 call get_isize(
'DECAY', this%input_mempath, asize)
1239 call mem_reallocate(this%decay, this%dis%nodes,
'DECAY', this%memoryPath)
1241 call get_isize(
'DECAY_SORBED', this%input_mempath, asize)
1244 'DECAY_SORBED', this%memoryPath)
1247 call get_isize(
'SP2', this%input_mempath, asize)
1249 call mem_reallocate(this%sp2, this%dis%nodes,
'SP2', this%memoryPath)
1253 call mem_set_value(this%porosity,
'POROSITY', this%input_mempath, map, &
1255 call mem_set_value(this%decay,
'DECAY', this%input_mempath, map, &
1257 call mem_set_value(this%decay_sorbed,
'DECAY_SORBED', this%input_mempath, &
1258 map, found%decay_sorbed)
1259 call mem_set_value(this%bulk_density,
'BULK_DENSITY', this%input_mempath, &
1260 map, found%bulk_density)
1261 call mem_set_value(this%distcoef,
'DISTCOEF', this%input_mempath, map, &
1263 call mem_set_value(this%sp2,
'SP2', this%input_mempath, map, &
1267 if (this%iout > 0)
then
1268 call this%log_data(found)
1272 if (.not. found%porosity)
then
1273 write (errmsg,
'(a)')
'POROSITY not specified in GRIDDATA block.'
1280 if (.not. found%bulk_density)
then
1281 write (errmsg,
'(a)')
'Sorption is active but BULK_DENSITY &
1282 ¬ specified. BULK_DENSITY must be specified in GRIDDATA block.'
1285 if (.not. found%distcoef)
then
1286 write (errmsg,
'(a)')
'Sorption is active but distribution &
1287 &coefficient not specified. DISTCOEF must be specified in &
1292 if (.not. found%sp2)
then
1293 write (errmsg,
'(a)')
'Freundlich or langmuir sorption is active &
1294 &but SP2 not specified. SP2 must be specified in &
1300 if (found%bulk_density)
then
1301 write (
warnmsg,
'(a)')
'Sorption is not active but &
1302 &BULK_DENSITY was specified. BULK_DENSITY will have no affect on &
1303 &simulation results.'
1305 write (this%iout,
'(1x,a)')
'WARNING. '//
warnmsg
1307 if (found%distcoef)
then
1308 write (
warnmsg,
'(a)')
'Sorption is not active but &
1309 &distribution coefficient was specified. DISTCOEF will have &
1310 &no affect on simulation results.'
1312 write (this%iout,
'(1x,a)')
'WARNING. '//
warnmsg
1315 write (
warnmsg,
'(a)')
'Sorption is not active but &
1316 &SP2 was specified. SP2 will have &
1317 &no affect on simulation results.'
1319 write (this%iout,
'(1x,a)')
'WARNING. '//
warnmsg
1325 if (.not. found%decay)
then
1326 write (errmsg,
'(a)')
'First or zero order decay is &
1327 &active but the first rate coefficient is not specified. DECAY &
1328 &must be specified in GRIDDATA block.'
1331 if (.not. found%decay_sorbed)
then
1337 write (errmsg,
'(a)')
'DECAY_SORBED not provided in GRIDDATA &
1338 &block but decay and sorption are active. Specify DECAY_SORBED &
1339 &in GRIDDATA block.'
1344 if (found%decay)
then
1345 write (
warnmsg,
'(a)')
'First- or zero-order decay &
1346 &is not active but decay was specified. DECAY will &
1347 &have no affect on simulation results.'
1349 write (this%iout,
'(1x,a)')
'WARNING. '//
warnmsg
1351 if (found%decay_sorbed)
then
1352 write (
warnmsg,
'(a)')
'First- or zero-order decay &
1353 &is not active but DECAY_SORBED was specified. &
1354 &DECAY_SORBED will have no affect on simulation results.'
1356 write (this%iout,
'(1x,a)')
'WARNING. '//
warnmsg
1366 do n = 1,
size(this%porosity)
1367 this%thetam(n) = this%porosity(n)
1378 write (this%iout,
'(1x,a)')
'PROCESSING GRIDDATA'
1379 if (found%porosity)
then
1380 write (this%iout,
'(4x,a)')
'MOBILE DOMAIN POROSITY set from input file'
1382 if (found%decay)
then
1383 write (this%iout,
'(4x,a)')
'DECAY RATE set from input file'
1385 if (found%decay_sorbed)
then
1386 write (this%iout,
'(4x,a)')
'DECAY SORBED RATE set from input file'
1388 if (found%bulk_density)
then
1389 write (this%iout,
'(4x,a)')
'BULK DENSITY set from input file'
1391 if (found%distcoef)
then
1392 write (this%iout,
'(4x,a)')
'DISTRIBUTION COEFFICIENT set from input file'
1395 write (this%iout,
'(4x,a)')
'SECOND SORPTION PARAM set from input file'
1397 write (this%iout,
'(1x,a)')
'END PROCESSING GRIDDATA'
1408 real(DP),
dimension(:),
intent(in) :: volfracim
1413 do n = 1, this%dis%nodes
1414 this%volfracim(n) = this%volfracim(n) + volfracim(n)
1419 do n = 1, this%dis%nodes
1420 this%thetam(n) = this%get_volfracm(n) * this%porosity(n)
1431 integer(I4B),
intent(in) :: node
1433 real(dp) :: volfracm
1435 volfracm = done - this%volfracim(node)
1447 cold, cnew, delt)
result(decay_rate)
1449 real(dp),
intent(in) :: decay_rate_usr
1450 real(dp),
intent(in) :: decay_rate_last
1451 integer(I4B),
intent(in) :: kiter
1452 real(dp),
intent(in) :: cold
1453 real(dp),
intent(in) :: cnew
1454 real(dp),
intent(in) :: delt
1456 real(dp) :: decay_rate
1459 if (decay_rate_usr < dzero)
then
1462 decay_rate = decay_rate_usr
1468 if (kiter == 1)
then
1469 decay_rate = min(decay_rate_usr, cold / delt)
1471 decay_rate = decay_rate_last
1472 if (cnew < dzero)
then
1473 decay_rate = decay_rate_last + cnew / delt
1474 else if (cnew > cold)
then
1475 decay_rate = decay_rate_last + cnew / delt
1477 decay_rate = min(decay_rate_usr, decay_rate)
1479 decay_rate = max(decay_rate, dzero)
This module contains the BudgetModule.
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
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 izero
integer constant zero
real(dp), parameter dzero
real constant zero
integer(i4b), parameter maxcharlen
maximum length of char string
real(dp), parameter dtwo
real constant 2
integer(i4b), parameter lenbudtxt
maximum length of a budget component names
real(dp), parameter done
real constant 1
subroutine mst_cq_srb(this, nodes, cnew, cold, flowja)
Calculate sorption terms for package.
subroutine mst_calc_csrb(this, cnew)
Calculate sorbed concentration.
subroutine addto_volfracim(this, volfracim)
Add volfrac values to volfracim.
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.
character(len=lenbudtxt), dimension(nbditems) budtxt
subroutine mst_cq(this, nodes, cnew, cold, flowja)
Calculate flows for package.
@ decay_zero_order
Zeroth-order decay.
@ decay_first_order
First-order decay.
@ decay_off
Decay (or production) of mass inactive (default).
subroutine mst_bd(this, isuppress_output, model_budget)
Calculate budget terms for package.
subroutine allocate_arrays(this, nodes)
Allocate arrays for package.
subroutine mst_cq_dcy_srb(this, nodes, cnew, cold, flowja)
Calculate decay-sorption terms for package.
subroutine, public mst_cr(mstobj, name_model, input_mempath, inunit, iout, fmi)
Create a new package object.
real(dp) function get_volfracm(this, node)
Return mobile domain volume fraction.
subroutine mst_ot_dv(this, idvsave)
Save sorbate concentration array to binary file.
subroutine mst_ot_flow(this, icbcfl, icbcun)
Output flow terms for package.
subroutine mst_ar(this, dis, ibound)
Allocate and read method for package.
subroutine mst_fc_srb(this, nodes, cold, nja, matrix_sln, idxglo, rhs, cnew)
Fill sorption coefficient method for package.
subroutine mst_cq_dcy(this, nodes, cnew, cold, flowja)
Calculate decay terms for package.
subroutine allocate_scalars(this)
Allocate scalar variables for package.
subroutine log_options(this, found, sorbate_fname)
Log user options to list file.
subroutine source_options(this)
Source options for package.
subroutine mst_fc_dcy_srb(this, nodes, cold, nja, matrix_sln, idxglo, rhs, cnew, kiter)
Fill sorption-decay coefficient method for package.
subroutine source_data(this)
Source data for package.
subroutine log_data(this, found)
Log user data to list file.
subroutine mst_da(this)
Deallocate.
subroutine mst_fc_dcy(this, nodes, cold, cnew, nja, matrix_sln, idxglo, rhs, kiter)
Fill decay coefficient method for package.
integer(i4b), parameter nbditems
subroutine mst_fc(this, nodes, cold, nja, matrix_sln, idxglo, cnew, rhs, kiter)
Fill coefficient method for package.
subroutine mst_fc_sto(this, nodes, cold, nja, matrix_sln, idxglo, rhs)
Fill storage coefficient method for package.
subroutine mst_cq_sto(this, nodes, cnew, cold, flowja)
Calculate storage terms for package.
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.
This module contains the base numerical package 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
character(len=maxcharlen) warnmsg
warning message string
integer(i4b) iout
file unit number for simulation output
real(dp), pointer, public delt
length of the current time step
Derived type for the Budget object.
Mobile storage and transfer.