5 character(len=LENBUDTXT),
dimension(4) :: budtxt = & !< text labels for budget terms
14 module subroutine csub_cc(this, innertot, kiter, iend, icnvgmod, nodes, &
15 hnew, hold, cpak, ipak, dpak)
19 class(GwfCsubType) :: this
20 integer(I4B),
intent(in) :: innertot
21 integer(I4B),
intent(in) :: kiter
22 integer(I4B),
intent(in) :: iend
23 integer(I4B),
intent(in) :: icnvgmod
24 integer(I4B),
intent(in) :: nodes
25 real(DP),
dimension(nodes),
intent(in) :: hnew
26 real(DP),
dimension(nodes),
intent(in) :: hold
27 character(len=LENPAKLOC),
intent(inout) :: cpak
28 integer(I4B),
intent(inout) :: ipak
29 real(DP),
intent(inout) :: dpak
31 character(len=LENPAKLOC) :: cloc
32 integer(I4B) :: icheck
33 integer(I4B) :: ipakfail
36 integer(I4B) :: idelay
37 integer(I4B) :: locdhmax
38 integer(I4B) :: locrmax
39 integer(I4B) :: ifirst
59 icheck = this%iconvchk
69 if (this%gwfiss /= 0)
then
72 if (icnvgmod == 0)
then
79 if (
delt > dzero)
then
84 final_check:
do ib = 1, this%ninterbeds
85 idelay = this%idelay(ib)
86 node = this%nodelist(ib)
89 if (idelay == 0) cycle
92 if (this%ibound(node) < 1) cycle
95 dh = this%dbdhmax(idelay)
100 area = this%dis%get_area(node)
102 hcellold = hold(node)
105 call this%csub_calc_sat(node, hcell, hcellold, snnew, snold)
108 call this%csub_delay_calc_dstor(ib, hcell, stoe, stoi)
109 v1 = (stoe + stoi) * area * this%rnb(ib) * tled
112 call this%csub_delay_calc_wcomp(ib, dwc)
113 v1 = v1 + dwc * area * this%rnb(ib)
116 call this%csub_delay_fc(ib, hcof, rhs)
117 v2 = (-hcof * hcell - rhs) * area * this%rnb(ib)
124 df = df *
delt / area
127 if (ifirst == 1)
then
134 if (abs(dh) > abs(dhmax))
then
138 if (abs(df) > abs(rmax))
then
147 if (abs(dhmax) > abs(dpak))
then
150 write (cloc,
"(a,'-',a)") trim(this%packName),
'head'
155 if (abs(rmax) > abs(dpak))
then
158 write (cloc,
"(a,'-',a)") trim(this%packName),
'storage'
163 if (this%ipakcsv /= 0)
then
166 call this%pakcsvtab%add_term(innertot)
167 call this%pakcsvtab%add_term(
totim)
168 call this%pakcsvtab%add_term(
kper)
169 call this%pakcsvtab%add_term(
kstp)
170 call this%pakcsvtab%add_term(kiter)
171 if (this%ndelaybeds > 0)
then
172 call this%pakcsvtab%add_term(dhmax)
173 call this%pakcsvtab%add_term(locdhmax)
174 call this%pakcsvtab%add_term(rmax)
175 call this%pakcsvtab%add_term(locrmax)
177 call this%pakcsvtab%add_term(
'--')
178 call this%pakcsvtab%add_term(
'--')
179 call this%pakcsvtab%add_term(
'--')
180 call this%pakcsvtab%add_term(
'--')
185 call this%pakcsvtab%finalize_table()
189 end subroutine csub_cc
192 module subroutine csub_cq(this, nodes, hnew, hold, isuppress_output, flowja)
197 class(GwfCsubType) :: this
198 integer(I4B),
intent(in) :: nodes
199 real(DP),
intent(in),
dimension(nodes) :: hnew
200 real(DP),
intent(in),
dimension(nodes) :: hold
201 integer(I4B),
intent(in) :: isuppress_output
202 real(DP),
dimension(:),
contiguous,
intent(inout) :: flowja
205 integer(I4B) :: idelay
206 integer(I4B) :: ielastic
207 integer(I4B) :: iconvert
211 integer(I4B) :: idiag
238 integer(I4B) :: iprobslocal
248 do node = 1, this%dis%nodes
249 idiag = this%dis%con%ia(node)
250 area = this%dis%get_area(node)
254 if (this%gwfiss == 0)
then
260 if (this%ibound(node) > 0 .and. this%cg_thickini(node) >
dzero)
then
263 call this%csub_cg_fc(node, tled, area, hnew(node), hold(node), &
265 rrate = hcof * hnew(node) - rhs
268 call this%csub_cg_calc_comp(node, hnew(node), hold(node), comp)
271 call this%csub_cg_wcomp_fc(node, tled, area, hnew(node), hold(node), &
273 rratewc = hcof * hnew(node) - rhs
279 this%cg_stor(node) = rrate
280 this%cell_wcstor(node) = rratewc
281 this%cell_thick(node) = this%cg_thick(node)
284 this%cg_comp(node) = comp
288 if (isuppress_output == 0)
then
292 if (this%iupdatematprop /= 0)
then
293 call this%csub_cg_update(node)
297 this%cg_tcomp(node) = this%cg_tcomp(node) + comp
301 flowja(idiag) = flowja(idiag) + rrate
302 flowja(idiag) = flowja(idiag) + rratewc
308 if (this%ndelaybeds > 0)
then
309 this%idb_nconv_count(1) = 0
316 do ib = 1, this%ninterbeds
318 idelay = this%idelay(ib)
319 ielastic = this%ielastic(ib)
323 if (idelay == 0)
then
327 b = this%thick(ib) * this%rnb(ib)
331 node = this%nodelist(ib)
332 idiag = this%dis%con%ia(node)
333 area = this%dis%get_area(node)
336 this%cell_thick(node) = this%cell_thick(node) + b
339 if (this%gwfiss == 0)
then
347 if (this%ibound(node) < 1) cycle
350 if (idelay == 0)
then
351 iconvert = this%iconvert(ib)
355 call this%csub_nodelay_calc_comp(ib, hnew(node), hold(node), comp, &
359 es = this%cg_es(node)
361 es0 = this%cg_es0(node)
364 if (ielastic > 0 .or. iconvert == 0)
then
367 stoi = -pcs * rho2 + (rho2 * es)
368 stoe = pcs * rho1 - (rho1 * es0)
374 this%storagee(ib) = stoe * tledm
375 this%storagei(ib) = stoi * tledm
381 if (isuppress_output == 0)
then
384 if (this%iupdatematprop /= 0)
then
385 call this%csub_nodelay_update(ib)
389 this%tcomp(ib) = this%tcomp(ib) + comp
390 this%tcompe(ib) = this%tcompe(ib) + compe
391 this%tcompi(ib) = this%tcompi(ib) + compi
400 call this%csub_calc_sat(node, h, h0, snnew, snold)
403 call this%csub_delay_calc_dstor(ib, h, stoe, stoi)
404 this%storagee(ib) = stoe * area * this%rnb(ib) * tledm
405 this%storagei(ib) = stoi * area * this%rnb(ib) * tledm
408 q = this%csub_calc_delay_flow(ib, 1, h) * area * this%rnb(ib)
409 this%dbflowtop(idelay) = q
410 nn = this%ndelaycells
411 q = this%csub_calc_delay_flow(ib, nn, h) * area * this%rnb(ib)
412 this%dbflowbot(idelay) = q
415 if (isuppress_output == 0)
then
418 call this%csub_delay_calc_comp(ib, h, h0, comp, compi, compe)
422 if (this%iupdatematprop /= 0)
then
423 call this%csub_delay_update(ib)
427 this%tcomp(ib) = this%tcomp(ib) + comp
428 this%tcompi(ib) = this%tcompi(ib) + compi
429 this%tcompe(ib) = this%tcompe(ib) + compe
432 do n = 1, this%ndelaycells
433 this%dbtcomp(n, idelay) = this%dbtcomp(n, idelay) + &
434 this%dbcomp(n, idelay)
439 call this%csub_delay_head_check(ib)
446 if (idelay == 0)
then
447 call this%csub_nodelay_wcomp_fc(ib, node, tledm, area, &
448 hnew(node), hold(node), hcof, rhs)
449 rratewc = hcof * hnew(node) - rhs
453 call this%csub_delay_calc_wcomp(ib, q)
454 rratewc = q * area * this%rnb(ib)
456 this%cell_wcstor(node) = this%cell_wcstor(node) + rratewc
459 flowja(idiag) = flowja(idiag) + rratewc
461 this%storagee(ib) =
dzero
462 this%storagei(ib) =
dzero
463 if (idelay /= 0)
then
464 this%dbflowtop(idelay) =
dzero
465 this%dbflowbot(idelay) =
dzero
470 flowja(idiag) = flowja(idiag) + this%storagee(ib)
471 flowja(idiag) = flowja(idiag) + this%storagei(ib)
475 if (this%iupdatematprop /= 0)
then
476 if (count_errors() > 0)
then
477 call store_error_filename(this%input_fname)
480 end subroutine csub_cq
483 module subroutine csub_bd(this, isuppress_output, model_budget)
489 class(GwfCsubType) :: this
490 integer(I4B),
intent(in) :: isuppress_output
491 type(BudgetType),
intent(inout) :: model_budget
498 call model_budget%addentry(rin, rout,
delt, budtxt(1), &
499 isuppress_output,
' CSUB')
500 if (this%ninterbeds > 0)
then
504 call model_budget%addentry(rin, rout,
delt, budtxt(2), &
505 isuppress_output,
' CSUB')
509 call model_budget%addentry(rin, rout,
delt, budtxt(3), &
510 isuppress_output,
' CSUB')
513 call model_budget%addentry(rin, rout,
delt, budtxt(4), &
514 isuppress_output,
' CSUB')
516 end subroutine csub_bd
519 module subroutine csub_save_model_flows(this, icbcfl, icbcun)
521 class(GwfCsubType) :: this
522 integer(I4B),
intent(in) :: icbcfl
523 integer(I4B),
intent(in) :: icbcun
525 character(len=1) :: cdatafmp =
' '
526 character(len=1) :: editdesc =
' '
527 integer(I4B) :: ibinun
528 integer(I4B) :: iprint
529 integer(I4B) :: nvaluesp
530 integer(I4B) :: nwidthp
539 if (this%ipakcb < 0)
then
541 elseif (this%ipakcb == 0)
then
546 if (icbcfl == 0) ibinun = 0
549 if (ibinun /= 0)
then
554 call this%dis%record_array(this%cg_stor, this%iout, iprint, -ibinun, &
555 budtxt(1), cdatafmp, nvaluesp, &
556 nwidthp, editdesc, dinact)
557 if (this%ninterbeds > 0)
then
561 call this%dis%record_srcdst_list_header(budtxt(2), &
571 do ib = 1, this%ninterbeds
572 q = this%storagee(ib)
573 node = this%nodelist(ib)
574 call this%dis%record_mf6_list_entry(ibinun, node, node, q, naux, &
579 call this%dis%record_srcdst_list_header(budtxt(3), &
589 do ib = 1, this%ninterbeds
590 q = this%storagei(ib)
591 node = this%nodelist(ib)
592 call this%dis%record_mf6_list_entry(ibinun, node, node, q, naux, &
598 call this%dis%record_array(this%cell_wcstor, this%iout, iprint, -ibinun, &
599 budtxt(4), cdatafmp, nvaluesp, &
600 nwidthp, editdesc, dinact)
602 end subroutine csub_save_model_flows
604end submodule gwfcsubmodulebudget
This module contains the BudgetModule.
subroutine, public rate_accumulator(flow, rin, rout)
Rate accumulator subroutine.
This module contains simulation constants.
integer(i4b), parameter lenboundname
maximum length of a bound name
real(dp), parameter dzero
real constant zero
real(dp), parameter done
real constant 1
This module contains the CSUB package methods.
real(dp), pointer, public totim
time relative to start of simulation
integer(i4b), pointer, public kstp
current time step number
integer(i4b), pointer, public kper
current stress period number
real(dp), pointer, public delt
length of the current time step
Derived type for the Budget object.