9 + ( ncol , nlm , mbs , ib
10 +, slr , amu0 , wc , wcclr
11 +, asym , asyclr , tau , tauclr
12 +, asdir , asdif , fudif , fddir
13 +, fddif ,sel_rules , b1 , b2
51 logical (kind=log_kind),
intent(in)::
54 integer (kind=int_kind),
intent(in)::
60 real (kind=dbl_kind),
intent(in),
dimension(ncol)::
64 real (kind=dbl_kind),
intent(in),
dimension(ncol,mbs)::
68 real (kind=dbl_kind),
intent(in),
dimension(ncol,nlm)::
82 real (kind=dbl_kind),
intent(out),
dimension(ncol,nlm+1)::
89 integer(kind=int_kind)
93 integer (kind=int_kind),
dimension(nlm*4+2)::
96 real (kind=dbl_kind),
dimension(nlm)::
106 real (kind=dbl_kind),
dimension(nlm*4+2,11)::
110 real (kind=dbl_kind),
dimension(nlm*4+2)::
121 & aa , bb , cc , denom
122 &, eggtau , eps , g3 , g4
123 &, ggtau , kappa , r , rinf
124 &, t , oms , taus , fact
128 real (kind=dbl_kind),
dimension(nlm+1)::
133 logical (kind=log_kind)::
136 real (kind=dbl_kind)::
147 data tausthresh / 0.01 /
148 data wcthresh / 0.98 /
182 2000 directcld(1) = 0.
191 fact = asym(i,l)*asym(i,l)
192 oms = ((1.-fact)*wc(i,l))/(1.-fact*wc(i,l))
193 taus = (1.-fact*wc(i,l))*tau(i,l)
194 asy = asym(i,l)/(1.+asym(i,l))
196 exptaucld =
exp(-taus/amu0(i))
199 t = 0.25 * (7. - oms*(4.+3.*asy))
200 r = -0.25 * (1. - oms*(4.-3.*asy))
201 kappa = sqrt(t**2-r**2)
206 denom = (1.-rinf**2*eggtau**2)
207 trcld(l) = (1.-rinf**2)*eggtau/denom
208 rrcld(l) = rinf*(1.-eggtau**2)/denom
210 if(abs(kappa**2-1./amu0(i)**2) .lt. eps)
then
213 fact = 1./(kappa**2-1./amu0(i)**2)
217 g3 = 0.5-0.75*asy*amu0(i)
219 aa = g3*(t-1./amu0(i))+g4*r
220 bb = g4*(t+1./amu0(i))+g3*r
222 sigucld(l) = cc*((aa-rrcld(l)*bb)-aa*trcld(l)*exptaucld) *
223 & (b3(i,l)*directcld(l)+(1.-b1(i,l))*directclr(l))
224 sigdcld(l) = cc*(-bb*trcld(l)+(bb-rrcld(l)*aa)*exptaucld) *
225 & (b3(i,l)*directcld(l)+(1.-b1(i,l))*directclr(l))
228 fact = asyclr(i,l)*asyclr(i,l)
229 oms = ((1.-fact)*wcclr(i,l))/(1.-fact*wcclr(i,l))
230 taus = (1.-fact*wcclr(i,l))*tauclr(i,l)
231 asy = asyclr(i,l)/(1.+asyclr(i,l))
233 exptauclr =
exp(-taus/amu0(i))
237 t = 0.25 * (7. - oms*(4.+3.*asy))
238 r = -0.25 * (1. - oms*(4.-3.*asy))
239 kappa = sqrt(t**2-r**2)
245 denom = (1.-rinf**2*eggtau**2)
246 trclr(l) = (1.-rinf**2)*eggtau/denom
247 rrclr(l) = rinf*(1.-eggtau**2)/denom
249 if(abs(kappa**2-1./amu0(i)**2) .lt. eps)
then
252 fact = 1./(kappa**2-1./amu0(i)**2)
256 g3 = 0.5-0.75*asy*amu0(i)
258 aa = g3*(t-1./amu0(i))+g4*r
259 bb = g4*(t+1./amu0(i))+g3*r
261 siguclr(l) = cc*((aa-rrclr(l)*bb)-aa*trclr(l)*exptauclr) *
262 & (b1(i,l)*directclr(l)+(1.-b3(i,l))*directcld(l))
263 sigdclr(l) = cc*(-bb*trclr(l)+(bb-rrclr(l)*aa)*exptauclr) *
264 & (b1(i,l)*directclr(l)+(1.-b3(i,l))*directcld(l))
266 directclr(l+1) = exptauclr *
267 & ((1.-b3(i,l))*directcld(l) + b1(i,l)*directclr(l))
268 directcld(l+1) = exptaucld *
269 & (b3(i,l)*directcld(l) + (1.-b1(i,l))*directclr(l))
276 a(1,10) = trcld(1) * b4(i,1)
277 a(1,11) = trcld(1) * (1.-b2(i,1))
280 a(2,9) = trclr(1) * (1.-b4(i,1))
281 a(2,10) = trclr(1) * b2(i,1)
284 a(3,8) = rrcld(1) * b4(i,1)
285 a(3,9) = rrcld(1) * (1.-b2(i,1))
288 a(4,7) = rrclr(1) * (1.-b4(i,1))
289 a(4,8) = rrclr(1) * b2(i,1)
292 a(l*4-3,4) = rrcld(l) * b3(i,l)
293 a(l*4-3,5) = rrcld(l) * (1.-b1(i,l))
295 a(l*4-3,10) = trcld(l) * b4(i,l)
296 a(l*4-3,11) = trcld(l) * (1.-b2(i,l))
298 a(l*4-2,3) = rrclr(l) * (1.-b3(i,l))
299 a(l*4-2,4) = rrclr(l) * b1(i,l)
301 a(l*4-2,9) = trclr(l) * (1.-b4(i,l))
302 a(l*4-2,10) = trclr(l) * b2(i,l)
304 a(l*4-1,2) = trcld(l) * b3(i,l)
305 a(l*4-1,3) = trcld(l) * (1.-b1(i,l))
307 a(l*4-1,8) = rrcld(l) * b4(i,l)
308 a(l*4-1,9) = rrcld(l) * (1.-b2(i,l))
310 a(l*4,1) = trclr(l) * (1.-b3(i,l))
311 a(l*4,2) = trclr(l) * b1(i,l)
313 a(l*4,7) = rrclr(l) * (1.-b4(i,l))
314 a(l*4,8) = rrclr(l) * b2(i,l)
317 a(nlm*4+1,4) = asdif(i,ib)
319 a(nlm*4+2,4) = asdif(i,ib)
328 b(l*4-3) = -sigucld(l)
329 b(l*4-2) = -siguclr(l)
330 b(l*4-1) = -sigdcld(l)
333 b(nlm*4+1) = -asdir(i,ib)*directcld(nlm+1)*amu0(i)
334 b(nlm*4+2) = -asdir(i,ib)*directclr(nlm+1)*amu0(i)
344 call
bandec(a,nlm*4+2,5,5,nlm*4+2,11,al,11,indx,d)
345 call
banbks(a,nlm*4+2,5,5,nlm*4+2,11,al,11,indx,b)
349 fudif(i,l) = slr(i)*(b(l*4-3)+b(l*4-2))
352 fddif(i,l+1) = slr(i)*(b(l*4-1)+b(l*4))
355 fddir(i,1) = amu0(i)*slr(i)
357 fddir(i,l+1) = amu0(i)*slr(i)*
358 & (directcld(l+1)+directclr(l+1))