43 function hcond(ibdn, ibdm, ictn, ictm, iupstream, ihc, icellavg, &
44 condsat, hn, hm, satn, satm, hkn, hkm, topn, topm, &
45 botn, botm, cln, clm, fawidth) &
50 integer(I4B),
intent(in) :: ibdn
51 integer(I4B),
intent(in) :: ibdm
52 integer(I4B),
intent(in) :: ictn
53 integer(I4B),
intent(in) :: ictm
54 integer(I4B),
intent(in) :: iupstream
55 integer(I4B),
intent(in) :: ihc
56 integer(I4B),
intent(in) :: icellavg
57 real(dp),
intent(in) :: condsat
58 real(dp),
intent(in) :: hn
59 real(dp),
intent(in) :: hm
60 real(dp),
intent(in) :: satn
61 real(dp),
intent(in) :: satm
62 real(dp),
intent(in) :: hkn
63 real(dp),
intent(in) :: hkm
64 real(dp),
intent(in) :: topn
65 real(dp),
intent(in) :: topm
66 real(dp),
intent(in) :: botn
67 real(dp),
intent(in) :: botm
68 real(dp),
intent(in) :: cln
69 real(dp),
intent(in) :: clm
70 real(dp),
intent(in) :: fawidth
73 if (ibdn == 0 .or. ibdm == 0)
then
76 elseif (ictn == 0 .and. ictm == 0)
then
78 else if (iupstream == 1)
then
82 satn, satm, hkn, hkm, &
83 topn, topm, botn, botm, &
95 real(dp),
intent(in) :: condsat
96 real(dp),
intent(in) :: hn
97 real(dp),
intent(in) :: hm
98 real(dp),
intent(in) :: satn
99 real(dp),
intent(in) :: satm
108 condnm = sat_up * condsat
114 topn, topm, botn, botm, cln, clm, fawidth) &
119 integer(I4B),
intent(in) :: ihc
120 integer(I4B),
intent(in) :: icellavg
121 real(dp),
intent(in) :: satn
122 real(dp),
intent(in) :: satm
123 real(dp),
intent(in) :: hkn
124 real(dp),
intent(in) :: hkm
125 real(dp),
intent(in) :: topn
126 real(dp),
intent(in) :: topm
127 real(dp),
intent(in) :: botn
128 real(dp),
intent(in) :: botm
129 real(dp),
intent(in) :: cln
130 real(dp),
intent(in) :: clm
131 real(dp),
intent(in) :: fawidth
140 thksatn = satn * (topn - botn)
141 thksatm = satm * (topm - botm)
143 condnm =
condmean(hkn, hkm, thksatn, thksatm, cln, clm, &
149 function vcond(ibdn, ibdm, ictn, ictm, inewton, ivarcv, idewatcv, &
150 condsat, hn, hm, vkn, vkm, satn, satm, topn, topm, botn, &
151 botm, flowarea)
result(condnm)
155 integer(I4B),
intent(in) :: ibdn
156 integer(I4B),
intent(in) :: ibdm
157 integer(I4B),
intent(in) :: ictn
158 integer(I4B),
intent(in) :: ictm
159 integer(I4B),
intent(in) :: inewton
160 integer(I4B),
intent(in) :: ivarcv
161 integer(I4B),
intent(in) :: idewatcv
162 real(dp),
intent(in) :: condsat
163 real(dp),
intent(in) :: hn
164 real(dp),
intent(in) :: hm
165 real(dp),
intent(in) :: vkn
166 real(dp),
intent(in) :: vkm
167 real(dp),
intent(in) :: satn
168 real(dp),
intent(in) :: satm
169 real(dp),
intent(in) :: topn
170 real(dp),
intent(in) :: topm
171 real(dp),
intent(in) :: botn
172 real(dp),
intent(in) :: botm
173 real(dp),
intent(in) :: flowarea
182 if (ibdn == 0 .or. ibdm == 0)
then
186 elseif (ivarcv == 0)
then
190 elseif (ictn == 0 .and. ictm == 0)
then
194 elseif (hn >= topn .and. hm >= topm)
then
206 if (idewatcv == 0)
then
207 if (botn > botm)
then
213 bovk1 = satntmp * (topn - botn) *
dhalf / vkn
214 bovk2 = satmtmp * (topm - botm) *
dhalf / vkm
215 denom = (bovk1 + bovk2)
216 if (denom /=
dzero)
then
217 condnm = flowarea / denom
226 function condmean(k1, k2, thick1, thick2, cl1, cl2, width, iavgmeth)
230 real(dp),
intent(in) :: k1
231 real(dp),
intent(in) :: k2
232 real(dp),
intent(in) :: thick1
233 real(dp),
intent(in) :: thick2
234 real(dp),
intent(in) :: cl1
235 real(dp),
intent(in) :: cl2
236 real(dp),
intent(in) :: width
237 integer(I4B),
intent(in) :: iavgmeth
250 select case (iavgmeth)
253 if (t1 * t2 >
dzero)
then
254 condmean = width * t1 * t2 / (t1 * cl2 + t2 * cl1)
260 if (t1 * t2 >
dzero)
then
265 condmean = tmean * width / (cl1 + cl2)
268 if (k1 * k2 >
dzero)
then
273 condmean = kmean *
dhalf * (thick1 + thick2) * width / (cl1 + cl2)
276 denom = (k1 * cl2 + k2 * cl1)
277 if (denom >
dzero)
then
278 kmean = k1 * k2 / denom
294 real(dp),
intent(in) :: d1
295 real(dp),
intent(in) :: d2
301 logmean = (d2 - d1) / log(drat)
309 function thksatnm(ibdn, ibdm, ictn, ictm, iupstream, ihc, &
310 hn, hm, satn, satm, topn, topm, botn, botm)
result(res)
314 integer(I4B),
intent(in) :: ibdn
315 integer(I4B),
intent(in) :: ibdm
316 integer(I4B),
intent(in) :: ictn
317 integer(I4B),
intent(in) :: ictm
318 integer(I4B),
intent(in) :: iupstream
319 integer(I4B),
intent(in) :: ihc
320 real(dp),
intent(in) :: hn
321 real(dp),
intent(in) :: hm
322 real(dp),
intent(in) :: satn
323 real(dp),
intent(in) :: satm
324 real(dp),
intent(in) :: topn
325 real(dp),
intent(in) :: topm
326 real(dp),
intent(in) :: botn
327 real(dp),
intent(in) :: botm
335 if (ibdn == 0 .or. ibdm == 0)
then
339 elseif (ictn == 0 .and. ictm == 0)
then
341 sill_top = min(topn, topm)
342 sill_bot = max(botn, botm)
344 thksatn = max(sill_top - sill_bot,
dzero)
347 thksatn = topn - botn
348 thksatm = topm - botm
350 res =
dhalf * (thksatn + thksatm)
353 elseif (iupstream == 1)
then
355 res = satn * (topn - botn)
357 res = satm * (topm - botm)
366 thksatn = satn * (topn - botn)
367 thksatm = satm * (topm - botm)
369 res =
dhalf * (thksatn + thksatm)
389 sill_top = min(top, topc)
390 sill_bot = max(bot, botc)
391 tp = bot + sat * (top - bot)
392 res = max(min(tp, sill_top) - sill_bot,
dzero)
This module contains simulation constants.
@ c3d_staggered
horizontal connection for a vertically staggered grid
real(dp), parameter dlnlow
real constant low ratio used to calculate log mean of K
real(dp), parameter dhalf
real constant 1/2
real(dp), parameter dzero
real constant zero
real(dp), parameter dlnhigh
real constant high ratio used to calculate log mean of K
real(dp), parameter done
real constant 1
This module contains stateless conductance functions.
real(dp) function, public thksatnm(ibdn, ibdm, ictn, ictm, iupstream, ihc, hn, hm, satn, satm, topn, topm, botn, botm)
Calculate wetted cell thickness at interface between two cells.
real(dp) function convertible_upstream(hn, hm, satn, satm, condsat)
Convertible cell(s) with upstream weighted horizontal conductance.
real(dp) function logmean(d1, d2)
Calculate the the logarithmic mean of two double precision numbers.
@ ccond_amthmk
Arithmetic-mean thickness and harmonic-mean hydraulic conductivity.
@ ccond_amtlmk
Arithmetic-mean thickness and logarithmic-mean hydraulic conductivity.
@ ccond_lmean
Logarithmic mean.
real(dp) function convertible_standard(ihc, icellavg, satn, satm, hkn, hkm, topn, topm, botn, botm, cln, clm, fawidth)
Convertible cell(s) with standard weighted horizontal conductance.
real(dp) function, public condmean(k1, k2, thick1, thick2, cl1, cl2, width, iavgmeth)
Calculate the conductance between two cells.
real(dp) function, public hcond(ibdn, ibdm, ictn, ictm, iupstream, ihc, icellavg, condsat, hn, hm, satn, satm, hkn, hkm, topn, topm, botn, botm, cln, clm, fawidth)
Horizontal conductance between two cells.
real(dp) function, public staggered_thkfrac(top, bot, sat, topc, botc)
Calculate the thickness fraction for staggered grids.
@, public ccond_hmean
Harmonic mean.
real(dp) function, public vcond(ibdn, ibdm, ictn, ictm, inewton, ivarcv, idewatcv, condsat, hn, hm, vkn, vkm, satn, satm, topn, topm, botn, botm, flowarea)
Vertical conductance between two cells.
This module defines variable data types.