7 module subroutine csub_nodelay_update(this, i)
9 class(GwfCsubType),
intent(inout) :: this
10 integer(I4B),
intent(in) :: i
17 comp = this%tcomp(i) + this%comp(i)
18 if (abs(comp) > dzero)
then
19 thick = this%thickini(i)
20 theta = this%thetaini(i)
21 call compact_layer(comp, thick, theta)
22 if (thick <= dzero)
then
23 write (errmsg,
'(a,1x,i0,1x,a,g0,a)') &
24 'Adjusted thickness for no-delay interbed', i, &
25 'is less than or equal to 0 (', thick,
').'
26 call store_error(errmsg)
28 if (theta <= dzero)
then
29 write (errmsg,
'(a,1x,i0,1x,a,g0,a)') &
30 'Adjusted theta for no-delay interbed', i, &
31 'is less than or equal to 0 (', theta,
').'
32 call store_error(errmsg)
37 end subroutine csub_nodelay_update
40 module subroutine csub_nodelay_fc(this, ib, hcell, hcellold, rho1, rho2, &
45 class(GwfCsubType) :: this
46 integer(I4B),
intent(in) :: ib
47 real(DP),
intent(in) :: hcell
48 real(DP),
intent(in) :: hcellold
49 real(DP),
intent(inout) :: rho1
50 real(DP),
intent(inout) :: rho2
51 real(DP),
intent(inout) :: rhs
52 real(DP),
intent(in),
optional :: argtled
74 if (
present(argtled))
then
79 node = this%nodelist(ib)
80 area = this%dis%get_area(node)
81 bot = this%dis%bot(node)
82 top = this%dis%top(node)
83 thick = this%thickini(ib)
86 hbar = squadratic0sp(hcell, bot, this%satomega)
92 call this%csub_calc_sat(node, hcell, hcellold, snnew, snold)
93 if (this%lhead_based .EQV. .true.)
then
97 znode = this%csub_calc_znode(top, bot, hbar)
99 es0 = this%cg_es0(node)
100 theta = this%thetaini(ib)
105 call this%csub_calc_sfacts(node, bot, znode, theta, es, es0, &
108 sto_fac = tled * snnew * thick * f
109 sto_fac0 = tled * snold * thick * f
112 rho1 = this%rci(ib) * sto_fac0
113 rho2 = this%rci(ib) * sto_fac
114 if (this%cg_es(node) > this%pcs(ib))
then
115 this%iconvert(ib) = 1
116 rho2 = this%ci(ib) * sto_fac
120 rcorr = rho2 * (hcell - hbar)
123 if (this%ielastic(ib) /= 0)
then
124 rhs = rho1 * this%cg_es0(node) - &
125 rho2 * (this%cg_gs(node) + bot) - &
128 rhs = -rho2 * (this%cg_gs(node) + bot) + &
129 (this%pcs(ib) * (rho2 - rho1)) + &
130 (rho1 * this%cg_es0(node)) - &
137 end subroutine csub_nodelay_fc
140 module subroutine csub_nodelay_calc_comp(this, ib, hcell, hcellold, comp, &
143 class(GwfCsubType) :: this
144 integer(I4B),
intent(in) :: ib
145 real(DP),
intent(in) :: hcell
146 real(DP),
intent(in) :: hcellold
147 real(DP),
intent(inout) :: comp
148 real(DP),
intent(inout) :: rho1
149 real(DP),
intent(inout) :: rho2
159 node = this%nodelist(ib)
161 es = this%cg_es(node)
162 es0 = this%cg_es0(node)
166 call this%csub_nodelay_fc(ib, hcell, hcellold, rho1, rho2, rhs, argtled=tled)
169 if (this%ielastic(ib) /= 0)
then
170 comp = rho2 * es - rho1 * es0
172 comp = -pcs * (rho2 - rho1) - (rho1 * es0) + (rho2 * es)
174 end subroutine csub_nodelay_calc_comp
177 module subroutine csub_interbed_fc(this, ib, node, area, hcell, hcellold, &
180 class(GwfCsubType) :: this
181 integer(I4B),
intent(in) :: ib
182 integer(I4B),
intent(in) :: node
183 real(DP),
intent(in) :: area
184 real(DP),
intent(in) :: hcell
185 real(DP),
intent(in) :: hcellold
186 real(DP),
intent(inout) :: hcof
187 real(DP),
intent(inout) :: rhs
206 if (this%ibound(node) > 0)
then
207 if (this%idelay(ib) == 0)
then
210 if (this%iupdatematprop /= 0)
then
211 if (this%ieslag == 0)
then
214 call this%csub_nodelay_calc_comp(ib, hcell, hcellold, comp, &
219 call this%csub_nodelay_update(ib)
224 call this%csub_nodelay_fc(ib, hcell, hcellold, rho1, hcof, rhs)
229 call this%csub_calc_sat(node, hcell, hcellold, snnew, snold)
232 if (this%iupdatematprop /= 0)
then
233 if (this%ieslag == 0)
then
236 call this%csub_delay_calc_comp(ib, hcell, hcellold, &
241 call this%csub_delay_update(ib)
246 call this%csub_delay_sln(ib, hcell)
247 call this%csub_delay_fc(ib, hcof, rhs)
248 f = area * this%rnb(ib)
253 end subroutine csub_interbed_fc
256 module subroutine csub_interbed_fn(this, ib, node, hcell, hcellold, hcof, rhs)
260 class(GwfCsubType) :: this
261 integer(I4B),
intent(in) :: ib
262 integer(I4B),
intent(in) :: node
263 real(DP),
intent(in) :: hcell
264 real(DP),
intent(in) :: hcellold
265 real(DP),
intent(inout) :: hcof
266 real(DP),
intent(inout) :: rhs
268 integer(I4B) :: idelay
290 idelay = this%idelay(ib)
291 top = this%dis%top(node)
292 bot = this%dis%bot(node)
295 if (this%ibound(node) > 0)
then
297 tthk = this%thickini(ib)
300 call this%csub_calc_sat(node, hcell, hcellold, snnew, snold)
303 if (idelay == 0)
then
309 satderv = this%csub_calc_sat_derivative(node, hcell)
312 hbar = squadratic0sp(hcell, bot, this%satomega)
315 hbarderv = squadratic0spderivative(hcell, bot, this%satomega)
318 call this%csub_nodelay_fc(ib, hcell, hcellold, rho1, rho2, rhsn)
321 hcofn = rho2 * (done - hbarderv) * snnew + &
322 rho2 * (this%cg_gs(node) - hbar + bot) * satderv
323 if (this%ielastic(ib) == 0)
then
324 hcofn = hcofn - rho2 * this%pcs(ib) * satderv
328 if (this%ieslag /= 0)
then
329 if (this%ielastic(ib) /= 0)
then
330 hcofn = hcofn - rho1 * this%cg_es0(node) * satderv
332 hcofn = hcofn - rho1 * (this%pcs(ib) - this%cg_es0(node)) * satderv
337 end subroutine csub_interbed_fn
340 module subroutine csub_nodelay_wcomp_fc(this, ib, node, tled, area, hcell, &
343 class(GwfCsubType),
intent(inout) :: this
344 integer(I4B),
intent(in) :: ib
345 integer(I4B),
intent(in) :: node
346 real(DP),
intent(in) :: tled
347 real(DP),
intent(in) :: area
348 real(DP),
intent(in) :: hcell
349 real(DP),
intent(in) :: hcellold
350 real(DP),
intent(inout) :: hcof
351 real(DP),
intent(inout) :: rhs
366 top = this%dis%top(node)
367 bot = this%dis%bot(node)
370 call this%csub_calc_sat(node, hcell, hcellold, snnew, snold)
373 f = this%brg * area * tled
374 wc0 = f * this%theta0(ib) * this%thick0(ib)
375 wc = f * this%theta(ib) * this%thick(ib)
377 rhs = -wc0 * snold * hcellold
378 end subroutine csub_nodelay_wcomp_fc
381 module subroutine csub_nodelay_wcomp_fn(this, ib, node, tled, area, hcell, &
384 class(GwfCsubType),
intent(inout) :: this
385 integer(I4B),
intent(in) :: ib
386 integer(I4B),
intent(in) :: node
387 real(DP),
intent(in) :: tled
388 real(DP),
intent(in) :: area
389 real(DP),
intent(in) :: hcell
390 real(DP),
intent(in) :: hcellold
391 real(DP),
intent(inout) :: hcof
392 real(DP),
intent(inout) :: rhs
406 top = this%dis%top(node)
407 bot = this%dis%bot(node)
410 f = this%brg * area * tled
413 satderv = this%csub_calc_sat_derivative(node, hcell)
416 wc = f * this%theta(ib) * this%thick(ib)
419 hcof = -wc * hcell * satderv
422 if (this%ieslag /= 0)
then
423 wc0 = f * this%theta0(ib) * this%thick0(ib)
424 hcof = hcof + wc0 * hcellold * satderv
429 end subroutine csub_nodelay_wcomp_fn
431end submodule gwfcsubmodulenodelay
This module contains the CSUB package methods.
real(dp), pointer, public delt
length of the current time step