10 + ncol , nlm , mbs , mbir
11 +, ib , cldamt , wc , wcclr
12 +, asym , asyclr , tau , tauclr
14 +, sel_rules , b1 , b2 , b3
50 logical (kind=log_kind),
intent(in)::
53 integer (kind=int_kind),
intent(in)::
60 real (kind=dbl_kind),
intent(in),
dimension(ncol,mbir)::
63 real (kind=dbl_kind),
intent(in),
dimension(ncol,nlm)::
76 real (kind=dbl_kind),
intent(in),
dimension(ncol,nlm+1)::
81 real (kind=dbl_kind),
intent(out),
dimension(ncol,nlm+1)::
87 integer(kind=int_kind)
100 integer (kind=int_kind),
dimension(16*nlm-6)::
103 integer (kind=int_kind),
dimension(4*nlm+2)::
106 real (kind=dbl_kind),
dimension(nlm)::
117 real (kind=dbl_kind),
dimension(4*nlm+2)::
123 real (kind=dbl_kind),
dimension(16*nlm-6)::
127 & aa , bb , beta0 , cc
128 &, diffac , denom , fact , eggtau
130 &, kappa , oms , prop ,r, rinf
136 logical (kind=log_kind)::
139 real (kind=dbl_kind)::
143 data tausthresh / 0.001 /
144 data wcthresh / 0.975 /
159 fact = asym(i,l)*asym(i,l)
160 oms = ((1.-fact)*wc(i,l))/(1.-fact*wc(i,l))
161 taus = (1.-fact*wc(i,l))*tau(i,l)
163 beta0 = (4.+asym(i,l))/(8.*(1.+asym(i,l)))
164 t = diffac*(1.-oms*(1.-beta0))
166 kappa = sqrt(t**2-r**2)
172 denom = (1.-rinf**2*eggtau**2)
173 trcld(l) = (1.-rinf**2)*eggtau/denom
174 rrcld(l) = rinf*(1.-eggtau**2)/denom
176 if(taus .lt. .8e-2)
then
177 sigucld(l) = cldamt(i,l)*0.5*diffac*(bf(i,l)+
179 sigdcld(l) = cldamt(i,l)*sigucld(l)
181 aa = (t+r)*(1.-rrcld(l))-(1.+rrcld(l)-trcld(l))/taus
182 bb = -(t+r)*trcld(l)+(1.+rrcld(l)-trcld(l))/taus
183 cc = diffac*(1.-oms)/kappa**2
184 sigucld(l) = cldamt(i,l)*cc*(aa*bf(i,l)+bb*bf(i,l+1))
185 sigdcld(l) = cldamt(i,l)*cc*(bb*bf(i,l)+aa*bf(i,l+1))
189 fact = asyclr(i,l)*asyclr(i,l)
190 oms = ((1.-fact)*wcclr(i,l))/(1.-fact*wcclr(i,l))
191 taus = (1.-fact*wcclr(i,l))*tauclr(i,l)
193 beta0 = (4.+asyclr(i,l))/(8.*(1.+asyclr(i,l)))
194 t = diffac*(1.-oms*(1.-beta0))
196 kappa = sqrt(t**2-r**2)
202 denom = (1.-rinf**2*eggtau**2)
203 trclr(l) = (1.-rinf**2)*eggtau/denom
204 rrclr(l) = rinf*(1.-eggtau**2)/denom
206 if(taus .lt. .8e-2)
then
207 siguclr(l) = (1.0-cldamt(i,l))*0.5*diffac*(bf(i,l)+
209 sigdclr(l) = (1.0-cldamt(i,l))*siguclr(l)
211 aa = (t+r)*(1.-rrclr(l))-(1.+rrclr(l)-trclr(l))/taus
212 bb = -(t+r)*trclr(l)+(1.+rrclr(l)-trclr(l))/taus
213 cc = diffac*(1.-oms)/kappa**2
214 siguclr(l) = (1.0-cldamt(i,l))*cc*(aa*bf(i,l)+
216 sigdclr(l) = (1.0-cldamt(i,l))*cc*(bb*bf(i,l)+
228 smx(1) = -trcld(1) * b4(i,1)
229 smx(2) = -trcld(1) * (1.-b2(i,1))
234 smx(3) = -trclr(1) * (1.-b4(i,1))
235 smx(4) = -trclr(1) * b2(i,1)
240 smx(5) = -rrcld(1) * b4(i,1)
241 smx(6) = -rrcld(1) * (1.-b2(i,1))
246 smx(7) = -rrclr(1) * (1.-b4(i,1))
247 smx(8) = -rrclr(1) * b2(i,1)
258 smx(n) = -rrcld(l+1) * b3(i,l+1)
259 smx(n+1) = -rrcld(l+1) * (1.-b1(i,l+1))
260 smx(n+2) = -trcld(l+1) * b4(i,l+1)
261 smx(n+3) = -trcld(l+1) * (1.-b2(i,l+1))
267 smx(n+4) = -rrclr(l+1) * (1.-b3(i,l+1))
268 smx(n+5) = -rrclr(l+1) * b1(i,l+1)
269 smx(n+6) = -trclr(l+1) * (1.-b4(i,l+1))
270 smx(n+7) = -trclr(l+1) * b2(i,l+1)
276 smx(n+8) = -trcld(l+1) * b3(i,l+1)
277 smx(n+9) = -trcld(l+1) * (1.-b1(i,l+1))
278 smx(n+10) = -rrcld(l+1) * b4(i,l+1)
279 smx(n+11) = -rrcld(l+1) * (1.-b2(i,l+1))
285 smx(n+12) = -trclr(l+1) * (1.-b3(i,l+1))
286 smx(n+13) = -trclr(l+1) * b1(i,l+1)
287 smx(n+14) = -rrclr(l+1) * (1.-b4(i,l+1))
288 smx(n+15) = -rrclr(l+1) * b2(i,l+1)
293 idc(16*nlm-7) = 4*nlm-1
294 idc(16*nlm-6) = 4*nlm
302 b(l*4-3) = sigucld(l)
303 b(l*4-2) = siguclr(l)
304 b(l*4-1) = sigdcld(l)
307 b(nlm*4+1) = cldamt(i,nlm)*es(i,ibms)*bf(i,nlm+1)
308 b(nlm*4+2) = (1.-cldamt(i,nlm))*es(i,ibms)*bf(i,nlm+1)
324 t = t + smx(kk) * fvc(jj)
328 fvc(ii) = fvc(ii) + omega * (b(ii)-t)
329 error(ii) = b(ii) - t
332 if (maxval(abs(error)) .le. 0.05)
then
341 fu(i,l) = fvc(l*4-3)+fvc(l*4-2)
344 fd(i,l+1) = fvc(l*4-1)+fvc(l*4)