7 module subroutine csub_cg_fc(this, node, tled, area, hcell, hcellold, hcof, &
10 class(GwfCsubType) :: this
11 integer(I4B),
intent(in) :: node
12 real(DP),
intent(in) :: tled
13 real(DP),
intent(in) :: area
14 real(DP),
intent(in) :: hcell
15 real(DP),
intent(in) :: hcellold
16 real(DP),
intent(inout) :: hcof
17 real(DP),
intent(inout) :: rhs
33 top = this%dis%top(node)
34 bot = this%dis%bot(node)
35 tthk = this%cg_thickini(node)
38 if (tthk > dzero)
then
41 call this%csub_calc_sat(node, hcell, hcellold, snnew, snold)
44 hbar = squadratic0sp(hcell, bot, this%satomega)
47 call this%csub_cg_calc_sske(node, sske, hcell)
48 rho1 = sske * area * tthk * tled
51 this%cg_ske(node) = sske * tthk * snold
52 this%cg_sk(node) = sske * tthk * snnew
56 rhs = rho1 * snold * this%cg_es0(node) - &
57 rho1 * snnew * (this%cg_gs(node) + bot)
60 rhs = rhs - rho1 * snnew * (hcell - hbar)
62 end subroutine csub_cg_fc
65 module subroutine csub_cg_fn(this, node, tled, area, hcell, hcof, rhs)
67 class(GwfCsubType) :: this
68 integer(I4B),
intent(in) :: node
69 real(DP),
intent(in) :: tled
70 real(DP),
intent(in) :: area
71 real(DP),
intent(in) :: hcell
72 real(DP),
intent(inout) :: hcof
73 real(DP),
intent(inout) :: rhs
91 top = this%dis%top(node)
92 bot = this%dis%bot(node)
93 tthk = this%cg_thickini(node)
96 if (tthk > dzero)
then
99 call this%csub_calc_sat(node, hcell, top, snnew, snold)
102 satderv = this%csub_calc_sat_derivative(node, hcell)
105 hbar = squadratic0sp(hcell, bot, this%satomega)
108 hbarderv = squadratic0spderivative(hcell, bot, this%satomega)
111 call this%csub_cg_calc_sske(node, sske, hcell)
112 rho1 = sske * area * tthk * tled
115 hcof = rho1 * snnew * (done - hbarderv) + &
116 rho1 * (this%cg_gs(node) - hbar + bot) * satderv
119 if (this%ieslag /= 0)
then
120 hcof = hcof - rho1 * this%cg_es0(node) * satderv
126 end subroutine csub_cg_fn
129 module subroutine csub_cg_calc_sske(this, n, sske, hcell)
131 class(GwfCsubType),
intent(inout) :: this
132 integer(I4B),
intent(in) :: n
133 real(DP),
intent(inout) :: sske
134 real(DP),
intent(in) :: hcell
150 if (this%lhead_based .EQV. .true.)
then
156 top = this%dis%top(n)
157 bot = this%dis%bot(n)
160 hbar = squadratic0sp(hcell, bot, this%satomega)
163 znode = this%csub_calc_znode(top, bot, hbar)
168 theta = this%cg_thetaini(n)
173 call this%csub_calc_sfacts(n, bot, znode, theta, es, es0, &
176 sske = f * this%cg_ske_cr(n)
177 end subroutine csub_cg_calc_sske
180 module subroutine csub_cg_calc_comp(this, node, hcell, hcellold, comp)
182 class(GwfCsubType) :: this
183 integer(I4B),
intent(in) :: node
184 real(DP),
intent(in) :: hcell
185 real(DP),
intent(in) :: hcellold
186 real(DP),
intent(inout) :: comp
198 call this%csub_cg_fc(node, tled, area, hcell, hcellold, hcof, rhs)
201 comp = hcof * hcell - rhs
202 end subroutine csub_cg_calc_comp
205 module subroutine csub_cg_update(this, node)
207 class(GwfCsubType),
intent(inout) :: this
208 integer(I4B),
intent(in) :: node
210 character(len=20) :: cellid
216 comp = this%cg_tcomp(node) + this%cg_comp(node)
217 call this%dis%noder_to_string(node, cellid)
218 if (abs(comp) > dzero)
then
219 thick = this%cg_thickini(node)
220 theta = this%cg_thetaini(node)
221 call compact_layer(comp, thick, theta)
222 if (thick <= dzero)
then
223 write (errmsg,
'(a,1x,a,1x,a,g0,a)') &
224 'Adjusted thickness for cell', trim(adjustl(cellid)), &
225 'is less than or equal to 0 (', thick,
').'
226 call store_error(errmsg)
228 if (theta <= dzero)
then
229 write (errmsg,
'(a,1x,a,1x,a,g0,a)') &
230 'Adjusted theta for cell', trim(adjustl(cellid)), &
231 'is less than or equal to 0 (', theta,
').'
232 call store_error(errmsg)
234 this%cg_thick(node) = thick
235 this%cg_theta(node) = theta
237 end subroutine csub_cg_update
240 module subroutine csub_cg_wcomp_fc(this, node, tled, area, hcell, hcellold, &
243 class(GwfCsubType),
intent(inout) :: this
244 integer(I4B),
intent(in) :: node
245 real(DP),
intent(in) :: tled
246 real(DP),
intent(in) :: area
247 real(DP),
intent(in) :: hcell
248 real(DP),
intent(in) :: hcellold
249 real(DP),
intent(inout) :: hcof
250 real(DP),
intent(inout) :: rhs
266 top = this%dis%top(node)
267 bot = this%dis%bot(node)
268 tthk = this%cg_thick(node)
269 tthk0 = this%cg_thick0(node)
272 call this%csub_calc_sat(node, hcell, hcellold, snnew, snold)
275 wc0 = this%brg * area * tthk0 * this%cg_theta0(node) * tled
276 wc = this%brg * area * tthk * this%cg_theta(node) * tled
282 rhs = -wc0 * snold * hcellold
283 end subroutine csub_cg_wcomp_fc
286 module subroutine csub_cg_wcomp_fn(this, node, tled, area, hcell, hcellold, &
289 class(GwfCsubType),
intent(inout) :: this
290 integer(I4B),
intent(in) :: node
291 real(DP),
intent(in) :: tled
292 real(DP),
intent(in) :: area
293 real(DP),
intent(in) :: hcell
294 real(DP),
intent(in) :: hcellold
295 real(DP),
intent(inout) :: hcof
296 real(DP),
intent(inout) :: rhs
312 top = this%dis%top(node)
313 bot = this%dis%bot(node)
314 tthk = this%cg_thick(node)
317 satderv = this%csub_calc_sat_derivative(node, hcell)
320 f = this%brg * area * tled
323 wc = f * tthk * this%cg_theta(node)
326 hcof = -wc * hcell * satderv
329 if (this%ieslag /= 0)
then
330 tthk0 = this%cg_thick0(node)
331 wc0 = f * tthk0 * this%cg_theta0(node)
332 hcof = hcof + wc * hcellold * satderv
337 end subroutine csub_cg_wcomp_fn
339end submodule gwfcsubmodulecoarse
This module contains the CSUB package methods.