44 function hcond(ibdn, ibdm, ictn, ictm, iupstream, ihc, icellavg, &
45 condsat, hn, hm, satn, satm, hkn, hkm, topn, topm, &
46 botn, botm, cln, clm, fawidth) &
51 integer(I4B),
intent(in) :: ibdn
52 integer(I4B),
intent(in) :: ibdm
53 integer(I4B),
intent(in) :: ictn
54 integer(I4B),
intent(in) :: ictm
55 integer(I4B),
intent(in) :: iupstream
56 integer(I4B),
intent(in) :: ihc
57 integer(I4B),
intent(in) :: icellavg
58 real(dp),
intent(in) :: condsat
59 real(dp),
intent(in) :: hn
60 real(dp),
intent(in) :: hm
61 real(dp),
intent(in) :: satn
62 real(dp),
intent(in) :: satm
63 real(dp),
intent(in) :: hkn
64 real(dp),
intent(in) :: hkm
65 real(dp),
intent(in) :: topn
66 real(dp),
intent(in) :: topm
67 real(dp),
intent(in) :: botn
68 real(dp),
intent(in) :: botm
69 real(dp),
intent(in) :: cln
70 real(dp),
intent(in) :: clm
71 real(dp),
intent(in) :: fawidth
74 if (ibdn == 0 .or. ibdm == 0)
then
77 elseif (ictn == 0 .and. ictm == 0)
then
79 else if (iupstream == 1)
then
83 satn, satm, hkn, hkm, &
84 topn, topm, botn, botm, &
96 real(dp),
intent(in) :: condsat
97 real(dp),
intent(in) :: hn
98 real(dp),
intent(in) :: hm
99 real(dp),
intent(in) :: satn
100 real(dp),
intent(in) :: satm
106 else if (hm > hn)
then
111 sat_up = max(satn, satm)
113 condnm = sat_up * condsat
119 topn, topm, botn, botm, cln, clm, fawidth) &
124 integer(I4B),
intent(in) :: ihc
125 integer(I4B),
intent(in) :: icellavg
126 real(dp),
intent(in) :: satn
127 real(dp),
intent(in) :: satm
128 real(dp),
intent(in) :: hkn
129 real(dp),
intent(in) :: hkm
130 real(dp),
intent(in) :: topn
131 real(dp),
intent(in) :: topm
132 real(dp),
intent(in) :: botn
133 real(dp),
intent(in) :: botm
134 real(dp),
intent(in) :: cln
135 real(dp),
intent(in) :: clm
136 real(dp),
intent(in) :: fawidth
145 thksatn = satn * (topn - botn)
146 thksatm = satm * (topm - botm)
148 condnm =
condmean(hkn, hkm, thksatn, thksatm, cln, clm, &
154 function vcond(ibdn, ibdm, ictn, ictm, inewton, ivarcv, idewatcv, &
155 condsat, hn, hm, vkn, vkm, satn, satm, topn, topm, botn, &
156 botm, flowarea)
result(condnm)
160 integer(I4B),
intent(in) :: ibdn
161 integer(I4B),
intent(in) :: ibdm
162 integer(I4B),
intent(in) :: ictn
163 integer(I4B),
intent(in) :: ictm
164 integer(I4B),
intent(in) :: inewton
165 integer(I4B),
intent(in) :: ivarcv
166 integer(I4B),
intent(in) :: idewatcv
167 real(dp),
intent(in) :: condsat
168 real(dp),
intent(in) :: hn
169 real(dp),
intent(in) :: hm
170 real(dp),
intent(in) :: vkn
171 real(dp),
intent(in) :: vkm
172 real(dp),
intent(in) :: satn
173 real(dp),
intent(in) :: satm
174 real(dp),
intent(in) :: topn
175 real(dp),
intent(in) :: topm
176 real(dp),
intent(in) :: botn
177 real(dp),
intent(in) :: botm
178 real(dp),
intent(in) :: flowarea
187 if (ibdn == 0 .or. ibdm == 0)
then
191 elseif (ivarcv == 0)
then
195 elseif (ictn == 0 .and. ictm == 0)
then
199 elseif (hn >= topn .and. hm >= topm)
then
211 if (idewatcv == 0)
then
212 if (botn > botm)
then
218 if (botn > botm)
then
219 if (satmtmp <
done)
then
223 if (satntmp <
done)
then
228 bovk1 = satntmp * (topn - botn) *
dhalf / vkn
229 bovk2 = satmtmp * (topm - botm) *
dhalf / vkm
230 denom = (bovk1 + bovk2)
231 if (denom /=
dzero)
then
232 condnm = flowarea / denom
241 function condmean(k1, k2, thick1, thick2, cl1, cl2, width, iavgmeth)
245 real(dp),
intent(in) :: k1
246 real(dp),
intent(in) :: k2
247 real(dp),
intent(in) :: thick1
248 real(dp),
intent(in) :: thick2
249 real(dp),
intent(in) :: cl1
250 real(dp),
intent(in) :: cl2
251 real(dp),
intent(in) :: width
252 integer(I4B),
intent(in) :: iavgmeth
265 select case (iavgmeth)
268 if (t1 * t2 >
dzero)
then
269 condmean = width * t1 * t2 / (t1 * cl2 + t2 * cl1)
275 if (t1 * t2 >
dzero)
then
280 condmean = tmean * width / (cl1 + cl2)
283 if (k1 * k2 >
dzero)
then
288 condmean = kmean *
dhalf * (thick1 + thick2) * width / (cl1 + cl2)
291 denom = (k1 * cl2 + k2 * cl1)
292 if (denom >
dzero)
then
293 kmean = k1 * k2 / denom
309 real(dp),
intent(in) :: d1
310 real(dp),
intent(in) :: d2
316 logmean = (d2 - d1) / log(drat)
324 function thksatnm(ibdn, ibdm, ictn, ictm, iupstream, ihc, &
325 hn, hm, satn, satm, topn, topm, botn, botm)
result(res)
329 integer(I4B),
intent(in) :: ibdn
330 integer(I4B),
intent(in) :: ibdm
331 integer(I4B),
intent(in) :: ictn
332 integer(I4B),
intent(in) :: ictm
333 integer(I4B),
intent(in) :: iupstream
334 integer(I4B),
intent(in) :: ihc
335 real(dp),
intent(in) :: hn
336 real(dp),
intent(in) :: hm
337 real(dp),
intent(in) :: satn
338 real(dp),
intent(in) :: satm
339 real(dp),
intent(in) :: topn
340 real(dp),
intent(in) :: topm
341 real(dp),
intent(in) :: botn
342 real(dp),
intent(in) :: botm
350 if (ibdn == 0 .or. ibdm == 0)
then
354 elseif (ictn == 0 .and. ictm == 0)
then
356 sill_top = min(topn, topm)
357 sill_bot = max(botn, botm)
359 thksatn = max(sill_top - sill_bot,
dzero)
362 thksatn = topn - botn
363 thksatm = topm - botm
365 res =
dhalf * (thksatn + thksatm)
368 elseif (iupstream == 1)
then
370 res = satn * (topn - botn)
371 else if (hm > hn)
then
372 res = satm * (topm - botm)
374 res = max(satn * (topn - botn), satm * (topm - botm))
383 thksatn = satn * (topn - botn)
384 thksatm = satm * (topm - botm)
386 res =
dhalf * (thksatn + thksatm)
406 sill_top = min(top, topc)
407 sill_bot = max(bot, botc)
408 tp = bot + sat * (top - bot)
409 res = max(min(tp, sill_top) - sill_bot,
dzero)
419 function flow_area(ihc, hwva, top, bot, sat, topc, botc)
result(res)
423 integer(I4B),
intent(in) :: ihc
424 real(dp),
intent(in) :: hwva
425 real(dp),
intent(in) :: top
426 real(dp),
intent(in) :: bot
427 real(dp),
intent(in) :: sat
428 real(dp),
intent(in) :: topc
429 real(dp),
intent(in) :: botc
439 thksat = (top - bot) * sat
This module contains simulation constants.
@ c3d_staggered
horizontal connection for a vertically staggered grid
@ c3d_vertical
vertical connection
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.
real(dp) function, public flow_area(ihc, hwva, top, bot, sat, topc, botc)
Calculate the saturated flow area of a cell for a connection.
@ ccond_amthmk
Arithmetic-mean thickness and harmonic-mean hydraulic conductivity.
@ ccond_hmean
Harmonic mean.
@ 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.
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.