4 ( ncol , nlm , mbs , mbir, &
5 ib , cldamt , wc_cld, wc_clr, &
6 asym_cld ,asym_clr,tau_cld , tau_clr, &
7 es , bf , fu_all , fu_clr, &
8 fd_all , fd_clr , c_maximal, cf_max,&
32 integer (kind=int_kind),
intent(in):: &
39 real (kind=dbl_kind),
intent(in),
dimension(ncol) :: &
42 real (kind=dbl_kind),
intent(in),
dimension(ncol,mbir):: &
45 real (kind=dbl_kind),
intent(in),
dimension(ncol,nlm):: &
56 real (kind=dbl_kind),
intent(in),
dimension(ncol,nlm+1):: &
61 real (kind=dbl_kind),
intent(out),
dimension(ncol,nlm+1):: &
69 integer (kind=int_kind) :: &
74 real (kind=dbl_kind),
dimension(nlm):: &
88 real (kind=dbl_kind) :: &
108 real (kind=dbl_kind),
dimension(nlm):: &
113 real (kind=dbl_kind),
dimension(nlm+1):: &
122 real (kind=dbl_kind) :: &
132 fact = asym_clr(i,l)*asym_clr(i,l)
133 oms = ((1.-fact)*wc_clr(i,l))/(1.-fact*wc_clr(i,l))
134 taus = (1.-fact*wc_clr(i,l))*tau_clr(i,l)
136 beta0 = (4.+asym_clr(i,l))/(8.*(1.+asym_clr(i,l)))
137 t = diffac*(1.-oms*(1.-beta0))
139 kappa = sqrt(t**2-r**2)
143 denom = (1.-rinf**2*eggtau**2)
144 tr_clr(l) = (1.-rinf**2)*eggtau/denom
145 rr_clr(l) = rinf*(1.-eggtau**2)/denom
147 if(taus .lt. .8e-2)
then
148 sigu_clr(l) = 0.5*diffac*(bf(i,l)+bf(i,l+1))*taus
149 sigd_clr(l) = sigu_clr(l)
151 aa = (t+r)*(1.-rr_clr(l))-(1.+rr_clr(l)-tr_clr(l))/taus
152 bb = -(t+r)*tr_clr(l)+(1.+rr_clr(l)-tr_clr(l))/taus
153 cc = diffac*(1.-oms)/kappa**2
154 sigu_clr(l) = cc*(aa*bf(i,l)+bb*bf(i,l+1))
155 sigd_clr(l) = cc*(bb*bf(i,l)+aa*bf(i,l+1))
163 prop = 1. / (1. - re(l)*rr_clr(l))
164 re(l+1) = rr_clr(l) + tr_clr(l)**2*re(l)*prop
165 vd(l+1) = sigd_clr(l) + (tr_clr(l)*vd(l) &
166 + tr_clr(l)*re(l)*sigu_clr(l))*prop
167 vu(l) = (rr_clr(l)*vd(l) + sigu_clr(l))*prop
172 fu_clr(i,nlm+1) = es(i,ibms)*bf(i,nlm+1)
175 fd_clr(i,l) = re(l)*fu_clr(i,l) + vd(l)
176 fu_clr(i,l-1) = tr_clr(l-1)*fu_clr(i,l)*td(l-1) + vu(l-1)
183 fact = asym_cld(i,l)*asym_cld(i,l)
184 oms = ((1.-fact)*wc_cld(i,l))/(1.-fact*wc_cld(i,l))
185 taus = (1.-fact*wc_cld(i,l))*tau_cld(i,l)
187 beta0 = (4.+asym_cld(i,l))/(8.*(1.+asym_cld(i,l)))
188 t = diffac*(1.-oms*(1.-beta0))
190 kappa = sqrt(t**2-r**2)
194 denom = (1.-rinf**2*eggtau**2)
195 tr_cld(l) = (1.-rinf**2)*eggtau/denom
196 rr_cld(l) = rinf*(1.-eggtau**2)/denom
198 if(taus .lt. .8e-2)
then
199 sigu_cld(l) = 0.5*diffac*(bf(i,l)+bf(i,l+1))*taus
200 sigd_cld(l) = sigu_cld(l)
202 aa = (t+r)*(1.-rr_cld(l))-(1.+rr_cld(l)-tr_cld(l))/taus
203 bb = -(t+r)*tr_cld(l)+(1.+rr_cld(l)-tr_cld(l))/taus
204 cc = diffac*(1.-oms)/kappa**2
205 sigu_cld(l) = cc*(aa*bf(i,l)+bb*bf(i,l+1))
206 sigd_cld(l) = cc*(bb*bf(i,l)+aa*bf(i,l+1))
214 rr_tmp(l) = cf_max(i,l)*rr_cld(l) + (1. - cf_max(i,l))*rr_clr(l)
215 tr_tmp(l) = cf_max(i,l)*tr_cld(l) + (1. - cf_max(i,l))*tr_clr(l)
216 sigu_tmp(l) = cf_max(i,l)*sigu_cld(l) + (1. - cf_max(i,l))*sigu_clr(l)
217 sigd_tmp(l) = cf_max(i,l)*sigd_cld(l) + (1. - cf_max(i,l))*sigd_clr(l)
223 prop = 1. / (1. - re(l)*rr_tmp(l))
224 re(l+1) = rr_tmp(l) + tr_tmp(l)**2*re(l)*prop
225 vd(l+1) = sigd_tmp(l) + (tr_tmp(l)*vd(l) &
226 + tr_tmp(l)*re(l)*sigu_tmp(l))*prop
227 vu(l) = (rr_tmp(l)*vd(l) + sigu_tmp(l))*prop
231 fu_max(nlm+1) = es(i,ibms)*bf(i,nlm+1)
233 fd_max(l) = re(l)*fu_max(l) + vd(l)
234 fu_max(l-1) = tr_tmp(l-1)*fu_max(l)*td(l-1) + vu(l-1)
241 rr_tmp(l) = cf_random(i,l)*rr_cld(l) + (1. - cf_random(i,l))*rr_clr(l)
242 tr_tmp(l) = cf_random(i,l)*tr_cld(l) + (1. - cf_random(i,l))*tr_clr(l)
243 sigu_tmp(l) = cf_random(i,l)*sigu_cld(l) + (1. - cf_random(i,l))*sigu_clr(l)
244 sigd_tmp(l) = cf_random(i,l)*sigd_cld(l) + (1. - cf_random(i,l))*sigd_clr(l)
251 prop = 1./(1. - re(l)*rr_tmp(l))
252 re(l+1) = rr_tmp(l) + tr_tmp(l)*tr_tmp(l)*re(l)*prop
253 vd(l+1) = sigd_tmp(l) + (tr_tmp(l)*vd(l) + tr_tmp(l)*re(l)*sigu_tmp(l))*prop
254 vu(l) = (rr_tmp(l)*vd(l) + sigu_tmp(l))*prop
259 fu_rndm(nlm+1) = es(i,ibms)*bf(i,nlm+1)
261 fd_rndm(l) = re(l)*fu_rndm(l) + vd(l)
262 fu_rndm(l-1) = tr_tmp(l-1)*fu_rndm(l)*td(l-1) + vu(l-1)
269 fu_all(i,nlm+1) = (1. - c_maximal(i))*fu_rndm(nlm+1) + c_maximal(i)*fu_max(nlm+1)
271 fd_all(i,l+1) = (1. - c_maximal(i))*fd_rndm(l+1) + c_maximal(i)*fd_max(l+1)
272 fu_all(i,l) = (1. - c_maximal(i))*fu_rndm(l) + c_maximal(i)*fu_max(l)