35 integer function nstab(ai,a0,ei0,eo,relinc,m1,m2,m3)
37 implicit real*8 (a-h,m,o-z)
38 common/params2/mm1,mm2,mm3
44 if(a0*(1.-eo).lt.ai*(1.+ei0))
then
63 sigma=sqrt(a0ai**3*m12/m123)
71 mo2=(m1*m2/m12**2)*(m12/m123)**(2./3.)
72 mi3=(m3/m12)*(m12/m123)**(4./3.)*(m1-m2)/m12
73 mo3=(m1*m2/m12**2)*(m12/m123)*(m1-m2)/m12
86 a=sqrt(1-ei0**2)*cos(relinc)
87 z=(1-ei0**2)*(1+sin(relinc)**2)+5*ei0**2*
88 & (sin(win)*sin(relinc))**2
89 del=z**2+25+16*a**4-10*z-20*a**2-8*a**2*z
91 ek=sqrt(abs((z+1-4*a**2+sqrt(del))/6.))
93 sinik=sqrt(1-cosik**2)
95 gam222=0.25*(1+cosik)**2
96 gam22m2=0.25*(1-cosik)**2
97 gam220=0.5*sqrt(1.5)*sinik**2
98 gam200=0.5*(3*cosik**2-1)
101 ei=ein_induced(sigma,ei0,e,relinc)
105 eoctmax=eoct(sigma,ei0,e)
116 s221=-3*ei+(13./8.)*ei**3+(5./192.)*ei**5
118 f22n=flmn(2,2,n,e)/(1-e)**3
120 an=abs(6*c22*s221*f22n*(mi2+mo2*sigma**0.666)*gam222)
122 en=0.5*(sigma-n)**2-an*(1+cos(phi))
125 f22n=flmn(2,2,n+1,e)/(1-e)**3
127 an=abs(6*c22*s221*f22n*(mi2+mo2*sigma**0.666)*gam222)
129 enp1=0.5*(sigma-(n+1))**2-an*(1+cos(phi))
130 if(en.lt.0.and.enp1.lt.0)nstab=1
133 s22m1=-(ei**3*(4480 + 1880*ei**2 + 1091*ei**4))/15360.
135 f22n=flmn(2,2,n,e)/(1-e)**3
137 an=abs(6*c22*s22m1*f22n*(mi2+mo2*sigma**0.666)*gam22m2)
140 en=0.5*(sigma-n)**2-an*(1+cos(phi))
143 f22n=flmn(2,2,n+1,e)/(1-e)**3
145 an=abs(6*c22*s22m1*f22n*(mi2+mo2*sigma**0.666)*gam22m2)
147 enp1=0.5*(sigma-(n+1))**2-an*(1+cos(phi))
148 if(en.lt.0.and.enp1.lt.0)nstab=1
151 s201=(ei*(-9216 + 1152*ei**2 - 48*ei**4 + ei**6))/9216.
153 f22n=flmn(2,2,n,e)/(1-e)**3
155 an=abs(6*sqrt(c20*c22)*s201*f22n*(mi2+mo2*sigma**0.666)*gam220)
158 en=0.5*(sigma-n)**2-an*(1+cos(phi))
161 f22n=flmn(2,2,n+1,e)/(1-e)**3
163 an=abs(6*sqrt(c20*c22)*s201*f22n*(mi2+mo2*sigma**0.666)*gam220)
165 enp1=0.5*(sigma-(n+1))**2-an*(1+cos(phi))
166 if(en.lt.0.and.enp1.lt.0)nstab=1
169 s201=(ei*(-9216 + 1152*ei**2 - 48*ei**4 + ei**6))/9216.
171 f20n=flmn(2,0,n,e)/(1-e)**3
173 an=abs(3*c20*s201*f20n*(mi2+mo2*sigma**0.666)*gam200)
176 en=0.5*(sigma-n)**2-an*(1+cos(phi))
179 f20n=flmn(2,0,n+1,e)/(1-e)**3
181 an=abs(3*c20*s201*f20n*(mi2+mo2*sigma**0.666)*gam200)
183 enp1=0.5*(sigma-(n+1))**2-an*(1+cos(phi))
184 if(en.lt.0.and.enp1.lt.0)nstab=1
191 real*8 function flmn(l,m,n,e)
193 implicit real*8 (a-h,o-z)
207 xi=(acosh(1/e)-sqrt(1-e**2))/(1-e)**1.5
209 flmn=(1/(2*pi*n))*2.0**m*(sqrt(2*pi)/facfac(l,m))*
210 . ((1+e)**(
real(3*m-l-1)/4.)/e**m)*
211 . (rho**(
real(l+m+1)/2.))*
218 real*8 function ein_induced(sigma,ei0,e,relinc)
220 implicit real*8 (a-h,m,o-z)
221 common/params2/m1,m2,m3
227 gam222=0.25*(1+cos(relinc))**2
228 gam220=0.5*sqrt(1.5)*sin(relinc)**2
229 gam200=0.5*(3*cos(relinc)**2-1)
231 f22n=flmn(2,2,n,e)/(1-e)**3
232 f20n=flmn(2,0,n,e)/(1-e)**3
238 prod=max(prod222,prod220,prod200)
240 a=4.5*(m3/m123)*(2*pi*n)*prod/sigma**2
242 ein_induced=sqrt(ei0**2+a**2)
251 real*8 function eoct(sigma,ei0,eo)
252 implicit real*8 (a-h,m,o-z)
253 common/params2/m1,m2,m3
258 aoai=((m123/m12)*sigma**2)**0.3333
263 eeq=1.25*al*eo/epso**2/abs(1-sqrt(al)*(m2/m3)/epso)
276 real*8 function acosh(x)
279 acosh=dlog(x+dsqrt(x**2-1.d0))
283 real*8 function sgn(x)
294 real*8 function facfac(l,m)
295 implicit real*8 (a-h,o-z)