9 REAL*8 m,mb,mb1,mb2,r2(nmx,nmx),xcm(3),vcm(3),xx(3,3),vv(3,3),
10 & xcm2(3),vcm2(3),xb(3),vb(3),m1,m2,m3
11 INTEGER ij(nmx),isort(nmx)
17 ratio = rinv(i+1)/rinv(i)
18 IF (ratio.GT.0.25.AND.ratio.LT.4.0)
THEN
36 IF (iterm.LT.0) go to 40
38 CALL
hpsort(n-1,rinv,isort)
41 ratio = rinv(ib3)/rinv(ib2)
42 IF (ratio.GT.0.25.AND.ratio.LT.4.0) go to 40
64 IF (j1.EQ.i1.OR.j1.EQ.i2) go to 5
66 IF (j2.EQ.i1.OR.j2.EQ.i2) go to 4
67 IF (r2(j1,j2).LT.rx1.AND.r2(j1,j2).GT.rx0)
THEN
76 IF (i.EQ.i1.OR.i.EQ.i2.OR.i.EQ.i3.OR.i.EQ.i4) go to 8
106 vrel2 = vrel2 + (v(j1) - v(j2))**2
107 rdot = rdot + (x(j1) - x(j2))*(v(j1) - v(j2))
108 xcm(k) = (m(i1)*x(j1) + m(i2)*x(j2))/mb
109 vcm(k) = (m(i1)*v(j1) + m(i2)*v(j2))/mb
110 xcm2(k) = (m(i3)*x(j3) + m(i4)*x(j4))/mb2
111 vcm2(k) = (m(i3)*v(j3) + m(i4)*v(j4))/mb2
112 vrel3 = vrel3 + (v(j3) - v(j4))**2
113 d12 = d12 + (xcm(k) - xcm2(k))**2
114 d15 = d15 + (xcm(k) - x(j5))**2
115 d25 = d25 + (xcm2(k) - x(j5))**2
116 v12 = v12 + (vcm(k) - vcm2(k))**2
117 v15 = v15 + (vcm(k) - v(j5))**2
118 v25 = v25 + (vcm2(k) - v(j5))**2
125 IF (d12.LT.min(d15,d25))
THEN
126 semi = 2.0/sqrt(d12) - v12/(mb + mb2)
133 xb(k) = (mb*xcm(k) + mb2*xcm2(k))/(mb + mb2)
134 vb(k) = (mb*vcm(k) + mb2*vcm2(k))/(mb + mb2)
135 rd1 = rd1 + (xb(k) - x(j5))*(vb(k) - v(j5))
136 rb1 = rb1 + (xb(k) - x(j5))**2
137 vb1 = vb1 + (vb(k) - v(j5))**2
145 ELSE IF (d15.LT.min(d12,d25))
THEN
146 semi = 2.0/sqrt(d15) - v15/(mb + m5)
153 xb(k) = (mb*xcm(k) + m5*x(j5))/(mb + m5)
154 vb(k) = (mb*vcm(k) + m5*v(j5))/(mb + m5)
155 rd1 = rd1 + (xb(k) - xcm2(k))*(vb(k) - vcm2(k))
156 rb1 = rb1 + (xb(k) - xcm2(k))**2
157 vb1 = vb1 + (vb(k) - vcm2(k))**2
166 semi = 2.0/sqrt(d25) - v25/(mb2 + m5)
173 xb(k) = (mb2*xcm2(k) + m5*x(j5))/(mb2 + m5)
174 vb(k) = (mb2*vcm2(k) + m5*v(j5))/(mb2 + m5)
175 rd1 = rd1 + (xb(k) - xcm(k))*(vb(k) - vcm(k))
176 rb1 = rb1 + (xb(k) - xcm(k))**2
177 vb1 = vb1 + (vb(k) - vcm(k))**2
190 semi1 = 2.0/rb1 - vb1/mb1
194 rb0 = sqrt(r2(i1,i2))
195 semi0 = 2.0/rb0 - vrel2/mb
197 ecc0 = sqrt((1.0d0 - rb0/semi0)**2 + rdot**2/(semi0*mb))
198 ecc1 = sqrt((1.0d0 - rb1/semi1)**2 + rd1**2/(semi1*mb1))
199 rb2 = sqrt(r2(i3,i4))
200 semi2 = 2.0/rb2 - vrel3/mb2
204 CALL
inclin(xx,vv,xb,vb,alpha)
207 pcrit =
stability(m1,m2,m3,ecc0,ecc1,alpha)*semi
210 IF (semi2.GT.0.0) pcrit = (1.0 + 0.1*semi2/semi)*pcrit
213 pmin = semi1*(1.0d0 - ecc1)
215 IF (pmin.GT.pcrit.AND.semi.GT.0.0.AND.semi1.GT.0.0.AND.
216 & rb0.GT.semi0.AND.semi2.GT.0.0)
THEN
218 WRITE (6,20) ecc0, ecc1, semi, semi1, pmin, pcrit, semi2,
220 20
FORMAT (
' CSTAB5 E0 =',f6.3,
' E1 =',f6.3,
' A =',1p,e8.1,
221 &
' A1 =',e8.1,
' PM =',e9.2,
' PC =',e9.2,
222 &
' A2 =',e8.1,
' IN =',0p,f6.1)