13 + ( ncol , nlm , mbs , ib
14 +, slr , amu0 , wc , asym
15 +, tau , asdir , asdif , fudif
16 +, fddir , fddif ,sel_rules
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)::
75 real (kind=dbl_kind),
intent(out),
dimension(ncol,nlm+1)::
82 integer(kind=int_kind)
86 real (kind=dbl_kind),
dimension(nlm)::
93 & exptau_s(nlm),direct_s(nlm+1),exptau_us(nlm),direct_us(nlm+1)
96 & aa , bb , cc , denom
97 &, eggtau , eps , g3 , g4
98 &, ggtau , kappa , r , rinf
99 &, t , oms , taus , fact
100 &, asy , prop, fd_total
103 real (kind=dbl_kind),
dimension(nlm)::
106 real (kind=dbl_kind),
dimension(nlm+1)::
111 logical (kind=log_kind)::
114 real (kind=dbl_kind)::
122 data tausthresh / 0.01 /
123 data wcthresh / 0.98 /
134 if (wc(i,l).gt.wcthresh) fail = .true.
135 tauscat = tauscat + wc(i,l)*tau(i,l)
138 if (fail.and.tauscat.ge.tausthresh) goto 2000
141 print *,
'selection rules'
142 fddir(i,1) = amu0(i)*slr(i)
145 fddir(i,l+1) = fddir(i,l) *
exp(-1.*tau(i,l)/amu0(i))
147 fudif(i,nlm+1) = fddir(i,nlm+1) * asdir(i,ib)
150 fudif(i,l) = fudif(i,l+1) *
exp(-2*tau(i,l))
159 2000 direct_s(1) = 1.
166 fact = asym(i,l)*asym(i,l)
167 asy = asym(i,l)/(1.+asym(i,l))
173 oms = ((1.-fact)*wc(i,l))/(1.-fact*wc(i,l))
174 taus = (1.-fact*wc(i,l))*tau(i,l)
177 exptau_s(l) =
exp(-taus/amu0(i))
178 direct_s(l+1) = exptau_s(l)*direct_s(l)
179 exptau_us(l) =
exp(-tau(i,l)/amu0(i))
180 direct_us(l+1) = exptau_us(l)*direct_us(l)
183 t = 0.25 * (7. - oms*(4.+3.*asy))
184 r = -0.25 * (1. - oms*(4.-3.*asy))
185 kappa = sqrt(t**2-r**2)
189 denom = (1.-rinf**2*eggtau**2)
190 tr(l) = (1.-rinf**2)*eggtau/denom
191 rr(l) = rinf*(1.-eggtau**2)/denom
193 if(abs(kappa**2-1./amu0(i)**2) .lt. eps)
then
196 fact = 1./(kappa**2-1./amu0(i)**2)
199 g3 = 0.5-0.75*asy*amu0(i)
201 aa = g3*(t-1./amu0(i))+g4*r
202 bb = g4*(t+1./amu0(i))+g3*r
203 sigu(l) = cc*((aa-rr(l)*bb)-aa*tr(l)*exptau_s(l))
205 sigd(l) = cc*(-bb*tr(l)+(bb-rr(l)*aa)*exptau_s(l))
212 prop = 1. / (1. - re(l)*rr(l))
213 re(l+1) = rr(l) + tr(l)**2*re(l)*prop
214 vd(l+1) = sigd(l) + (tr(l)*vd(l)
215 + + tr(l)*re(l)*sigu(l))*prop
216 vu(l) = (rr(l)*vd(l) + sigu(l))*prop
223 fudif(i,nlm+1) = (asdif(i,ib)*vd(nlm+1)
224 + + asdir(i,ib)*slr(i)*amu0(i)*direct_s(nlm+1))
225 + / (1.-asdif(i,ib)*re(nlm+1))
228 fddif(i,l) = re(l)*fudif(i,l) + vd(l)
229 fudif(i,l-1) = tr(l-1)*fudif(i,l)*td(l-1) + vu(l-1)
233 fddir(i,1) = amu0(i)*slr(i)
235 fd_total = amu0(i)*slr(i)*direct_s(l+1) + fddif(i,l+1)
236 fddir(i,l+1) = amu0(i)*slr(i)*direct_us(l+1)
237 fddif(i,l+1) = fd_total - fddir(i,l+1)