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 if (botn > botm)
then
214 if (satmtmp <
done)
then
218 if (satntmp <
done)
then
223 bovk1 = satntmp * (topn - botn) *
dhalf / vkn
224 bovk2 = satmtmp * (topm - botm) *
dhalf / vkm
225 denom = (bovk1 + bovk2)
226 if (denom /=
dzero)
then
227 condnm = flowarea / denom
236 function condmean(k1, k2, thick1, thick2, cl1, cl2, width, iavgmeth)
240 real(dp),
intent(in) :: k1
241 real(dp),
intent(in) :: k2
242 real(dp),
intent(in) :: thick1
243 real(dp),
intent(in) :: thick2
244 real(dp),
intent(in) :: cl1
245 real(dp),
intent(in) :: cl2
246 real(dp),
intent(in) :: width
247 integer(I4B),
intent(in) :: iavgmeth
260 select case (iavgmeth)
263 if (t1 * t2 >
dzero)
then
264 condmean = width * t1 * t2 / (t1 * cl2 + t2 * cl1)
270 if (t1 * t2 >
dzero)
then
275 condmean = tmean * width / (cl1 + cl2)
278 if (k1 * k2 >
dzero)
then
283 condmean = kmean *
dhalf * (thick1 + thick2) * width / (cl1 + cl2)
286 denom = (k1 * cl2 + k2 * cl1)
287 if (denom >
dzero)
then
288 kmean = k1 * k2 / denom
304 real(dp),
intent(in) :: d1
305 real(dp),
intent(in) :: d2
311 logmean = (d2 - d1) / log(drat)
319 function thksatnm(ibdn, ibdm, ictn, ictm, iupstream, ihc, &
320 hn, hm, satn, satm, topn, topm, botn, botm)
result(res)
324 integer(I4B),
intent(in) :: ibdn
325 integer(I4B),
intent(in) :: ibdm
326 integer(I4B),
intent(in) :: ictn
327 integer(I4B),
intent(in) :: ictm
328 integer(I4B),
intent(in) :: iupstream
329 integer(I4B),
intent(in) :: ihc
330 real(dp),
intent(in) :: hn
331 real(dp),
intent(in) :: hm
332 real(dp),
intent(in) :: satn
333 real(dp),
intent(in) :: satm
334 real(dp),
intent(in) :: topn
335 real(dp),
intent(in) :: topm
336 real(dp),
intent(in) :: botn
337 real(dp),
intent(in) :: botm
345 if (ibdn == 0 .or. ibdm == 0)
then
349 elseif (ictn == 0 .and. ictm == 0)
then
351 sill_top = min(topn, topm)
352 sill_bot = max(botn, botm)
354 thksatn = max(sill_top - sill_bot,
dzero)
357 thksatn = topn - botn
358 thksatm = topm - botm
360 res =
dhalf * (thksatn + thksatm)
363 elseif (iupstream == 1)
then
365 res = satn * (topn - botn)
367 res = satm * (topm - botm)
376 thksatn = satn * (topn - botn)
377 thksatm = satm * (topm - botm)
379 res =
dhalf * (thksatn + thksatm)
399 sill_top = min(top, topc)
400 sill_bot = max(bot, botc)
401 tp = bot + sat * (top - bot)
402 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.