47 subroutine qconds(nnbrmx, nnbr0, inbr0, il01, vc0, vn0, dl0, dl0n, ck0, &
48 nnbr1, inbr1, il10, vc1, vn1, dl1, dl1n, ck1, ar01, ar10, &
49 vcthresh, allhc0, allhc1, chat01, chati0, chat1j)
51 integer(I4B) :: nnbrmx
53 integer(I4B),
dimension(nnbrmx) :: inbr0
55 real(DP),
dimension(nnbrmx, 3) :: vc0
56 real(DP),
dimension(nnbrmx, 3) :: vn0
57 real(DP),
dimension(nnbrmx) :: dl0
58 real(DP),
dimension(nnbrmx) :: dl0n
59 real(DP),
dimension(3, 3) :: ck0
61 integer(I4B),
dimension(nnbrmx) :: inbr1
63 real(DP),
dimension(nnbrmx) :: vc1
64 real(DP),
dimension(nnbrmx) :: vn1
65 real(DP),
dimension(nnbrmx) :: dl1
66 real(DP),
dimension(nnbrmx) :: dl1n
67 real(DP),
dimension(3, 3) :: ck1
74 real(DP),
dimension(nnbrmx) :: chati0
75 real(DP),
dimension(nnbrmx) :: chat1j
83 real(DP),
dimension(nnbrmx) :: bhat0
84 real(DP),
dimension(nnbrmx) :: bhat1
95 if (ar01 .eq. 0d0)
then
104 call abhats(nnbrmx, nnbr0, inbr0, il01, vc0, vn0, dl0, dl0n, ck0, &
105 vcthresh, allhc0, ar01, ahat0, bhat0)
107 call abhats(nnbrmx, nnbr1, inbr1, il10, vc1, vn1, dl1, dl1n, ck1, &
108 vcthresh, allhc1, ar10, ahat1, bhat1)
110 denom = (ahat0 + ahat1)
111 if (abs(denom) >
dprec)
then
112 wght1 = ahat0 / (ahat0 + ahat1)
117 chat01 = wght1 * ahat1
119 chati0(i) = wght0 * bhat0(i)
120 chat1j(i) = wght1 * bhat1(i)
127 subroutine abhats(nnbrmx, nnbr, inbr, il01, vc, vn, dl0, dln, ck, &
128 vcthresh, allhc, ar01, ahat, bhat)
130 integer(I4B) :: nnbrmx
132 integer(I4B),
dimension(nnbrmx) :: inbr
134 real(DP),
dimension(nnbrmx, 3) :: vc
135 real(DP),
dimension(nnbrmx, 3) :: vn
136 real(DP),
dimension(nnbrmx) :: dl0
137 real(DP),
dimension(nnbrmx) :: dln
138 real(DP),
dimension(3, 3) :: ck
143 real(DP),
dimension(nnbrmx) :: bhat
146 real(DP),
dimension(nnbrmx, 3) :: vccde
147 real(DP),
dimension(3, 3) :: rmat
148 real(DP),
dimension(3) :: sigma
149 real(DP),
dimension(nnbrmx) :: bd
150 real(DP),
dimension(nnbrmx) :: be
151 real(DP),
dimension(nnbrmx) :: betad
152 real(DP),
dimension(nnbrmx) :: betae
173 call getrot(nnbrmx, nnbr, inbr, vc, il01, rmat, iml0)
179 if (iml0 .eq. 0)
then
183 sigma(1) = dot_product(vn(il01, :), matmul(ck, rmat(:, 1)))
184 ahat = sigma(1) / dl0(il01)
191 call tranvc(nnbrmx, nnbr, rmat, vc, vccde)
194 call abwts(nnbrmx, nnbr, inbr, il01, 2, vccde, &
195 vcthresh, dl0, dln, acd, add, aed, bd)
210 if ((il == il01) .or. (inbr(il) == 0))
then
212 else if (dabs(vccde(il, 3)) > 1d-10)
then
218 call abwts(nnbrmx, nnbr, inbr, il01, 3, vccde, &
219 vcthresh, dl0, dln, ace, aee, ade, be)
229 determ = add * aee - ade * aed
231 alphad = (acd * aee - ace * aed) * oodet
232 alphae = (ace * add - acd * ade) * oodet
237 if ((il == il01) .or. (inbr(il) == 0)) cycle
238 betad(il) = (bd(il) * aee - be(il) * aed) * oodet
239 betae(il) = (be(il) * add - bd(il) * ade) * oodet
243 sigma = matmul(vn(il01, :), matmul(ck, rmat))
246 ahat = (sigma(1) - sigma(2) * alphad - sigma(3) * alphae) / dl0(il01)
250 if ((il == il01) .or. (inbr(il) == 0)) cycle
251 dl0il = dl0(il) + dln(il)
252 bhat(il) = (sigma(2) * betad(il) + sigma(3) * betae(il)) / dl0il
283 subroutine getrot(nnbrmx, nnbr, inbr, vc, il01, rmat, iml0)
285 integer(I4B) :: nnbrmx
287 integer(I4B),
dimension(nnbrmx) :: inbr
288 real(DP),
dimension(nnbrmx, 3) :: vc
290 real(DP),
dimension(3, 3) :: rmat
293 real(DP),
dimension(3) :: vcc
294 real(DP),
dimension(3) :: vcd
295 real(DP),
dimension(3) :: vce
296 real(DP),
dimension(3) :: vcmax
312 if ((il .eq. il01) .or. (inbr(il) .eq. 0))
then
315 cmp = dot_product(vc(il, :), vcc)
317 if (acmp .lt. acmpmn)
then
328 vcmax(:) = vc(iml0, :)
333 vcd = vcmax - cmpmn * vcc
334 vcd = vcd / dsqrt(1d0 - cmpmn * cmpmn)
338 vce(1) = vcc(2) * vcd(3) - vcc(3) * vcd(2)
339 vce(2) = vcc(3) * vcd(1) - vcc(1) * vcd(3)
340 vce(3) = vcc(1) * vcd(2) - vcc(2) * vcd(1)
360 subroutine tranvc(nnbrmx, nnbrs, rmat, vc, vccde)
362 integer(I4B) :: nnbrmx
363 integer(I4B) :: nnbrs
364 real(DP),
dimension(3, 3) :: rmat
365 real(DP),
dimension(nnbrmx, 3) :: vc
366 real(DP),
dimension(nnbrmx, 3) :: vccde
374 vccde(il, :) = matmul(transpose(rmat), vc(il, :))
389 subroutine abwts(nnbrmx, nnbr, inbr, il01, nde1, vccde, &
390 vcthresh, dl0, dln, acd, add, aed, bd)
392 integer(I4B) :: nnbrmx
394 integer(I4B),
dimension(nnbrmx) :: inbr
397 real(DP),
dimension(nnbrmx, 3) :: vccde
399 real(DP),
dimension(nnbrmx) :: dl0
400 real(DP),
dimension(nnbrmx) :: dln
404 real(DP),
dimension(nnbrmx) :: bd
416 real(DP),
dimension(nnbrmx) :: omwt
427 if ((il .eq. il01) .or. (inbr(il) .eq. 0)) cycle
428 vcmx = max(dabs(vccde(il, nde1)), vcmx)
429 dlm = 5d-1 * (dl0(il) + dln(il))
435 cosang = vccde(il, 1)
436 dl4wt = dsqrt(dlm * dlm + dl0(il01) * dl0(il01) &
437 - 2d0 * dlm * dl0(il01) * cosang)
438 omwt(il) = dabs(vccde(il, nde1)) * dl4wt
439 dsum = dsum + omwt(il)
446 dsum = dsum + 1d-10 * dsum
449 if ((il .eq. il01) .or. (inbr(il) .eq. 0)) cycle
450 fact = dsum - omwt(il)
451 omwt(il) = fact * dabs(vccde(il, nde1))
459 if ((il .eq. il01) .or. (inbr(il) .eq. 0)) cycle
460 bd(il) = omwt(il) * sign(1d0, vccde(il, nde1))
461 dsum = dsum + omwt(il) * dabs(vccde(il, nde1))
467 if ((il .eq. il01) .or. (inbr(il) .eq. 0)) cycle
468 bd(il) = bd(il) * oodsum
477 if ((il .eq. il01) .or. (inbr(il) .eq. 0)) cycle
478 acd = acd + bd(il) * vccde(il, 1)
479 aed = aed + bd(il) * vccde(il, nde2)
483 if (vcmx .lt. vcthresh)
then
484 fatten = vcmx / vcthresh
This module contains simulation constants.
real(dp), parameter dprec
real constant machine precision
real(dp), parameter done
real constant 1
This module defines variable data types.
subroutine qconds(nnbrmx, nnbr0, inbr0, il01, vc0, vn0, dl0, dl0n, ck0, nnbr1, inbr1, il10, vc1, vn1, dl1, dl1n, ck1, ar01, ar10, vcthresh, allhc0, allhc1, chat01, chati0, chat1j)
Compute the "conductances" in the normal-flux expression for an interface (modflow-usg version)....
subroutine abwts(nnbrmx, nnbr, inbr, il01, nde1, vccde, vcthresh, dl0, dln, acd, add, aed, bd)
Compute "a" and "b" weights for the local connections with respect to the perpendicular direction of ...
subroutine getrot(nnbrmx, nnbr, inbr, vc, il01, rmat, iml0)
Compute the matrix that rotates the model-coordinate axes to the "(c, d, e)-coordinate" axes associat...
subroutine tranvc(nnbrmx, nnbrs, rmat, vc, vccde)
Transform local connection unit-vectors from model coordinates to "(c, d, e)" coordinates associated ...
subroutine abhats(nnbrmx, nnbr, inbr, il01, vc, vn, dl0, dln, ck, vcthresh, allhc, ar01, ahat, bhat)
Compute "ahat" and "bhat" coefficients for one side of an interface.