9 common/chreg/ timec,tmax,rmaxc,cm(10),namec(6),nstep1,kz27,kz30
10 REAL*8 m,mb,mb1,r2(nmx,nmx),xcm(3),vcm(3),xx(3,3),vv(3,3),
40 rb0 = rb0 + (x(j1) - x(j2))**2
41 vrel2 = vrel2 + (v(j1) - v(j2))**2
42 rdot = rdot + (x(j1) - x(j2))*(v(j1) - v(j2))
43 xcm(k) = (m(i1)*x(j1) + m(i2)*x(j2))/mb
44 vcm(k) = (m(i1)*v(j1) + m(i2)*v(j2))/mb
45 ri2 = ri2 + (x(j3) - xcm(k))**2
46 vrel21 = vrel21 + (v(j3) - vcm(k))**2
47 rdot3 = rdot3 + (x(j3) - xcm(k))*(v(j3) - vcm(k))
48 xcm3(k) = (m(i3)*x(j3) + mb*xcm(k))/mb1
49 vcm3(k) = (m(i3)*v(j3) + mb*vcm(k))/mb1
50 r4 = r4 + (x(j4) - xcm3(k))**2
51 v4 = v4 + (v(j4) - vcm3(k))**2
52 rdot4 = rdot4 + (x(j4) - xcm3(k))*(v(j4) - vcm3(k))
55 xx(k,3) = x(j4) - xcm3(k)
58 vv(k,3) = v(j4) - vcm3(k)
64 semi = 2.0d0/rb - vrel21/mb1
66 ecc = sqrt((1.0d0 - rb/semi)**2 + rdot3**2/(semi*mb1))
67 semi1 = 2.0/r4 - v4/mb2
69 ecc1 = sqrt((1.0d0 - r4/semi1)**2 + rdot4**2/(semi1*mb2))
73 semi0 = 2.0/rb0 - vrel2/mb
75 IF (semi0.LT.0.0.OR.ecc.GT.1.0) go to 40
76 ecc0 = sqrt((1.0 - rb0/semi0)**2 + rdot**2/(semi0*mb))
77 pcrit0 =
stability(m(i1),m(i2),m(i3),ecc0,ecc,0.0d0)*semi0
79 pmin0 = 1.1*semi*(1.0 - ecc)
80 IF (pmin0.LT.pcrit0) go to 40
90 pmin = semi1*(1.0d0 - ecc1)
93 CALL
inclin(xx,vv,xcm3,vcm3,alpha)
96 pc99 =
stability(mb,m(i3),m(i4),ecc,ecc1,alpha)*semi
100 nst = nstab(semi,semi1,ecc,ecc1,alpha,mb,m(i3),m(i4))
112 IF (pmin.GT.pcrit.AND.semi.GT.0.0.AND.semi1.GT.0.0)
THEN
114 WRITE (6,20) ecc, ecc1, semi, semi1, pmin, pcrit, pc99
115 20
FORMAT (
' CSTAB2 E =',f6.3,
' E1 =',f6.3,
' A =',1p,e8.1,
116 &
' A1 =',e8.1,
' PM =',e9.2,
' PC =',e9.2,
118 WRITE (6,25) namec(i1), namec(i2), ecc0, semi0, pmin0, pcrit0
119 25
FORMAT (
' INNER TRIPLE NAM E0 A0 PM0 PC0 ',
120 & 2i6,f7.3,1p,3e10.2)
121 ri = sqrt(cm(1)**2 + cm(2)**2 + cm(3)**2)
123 WRITE (81,30) timec, ri, namec(i3), ql, q1, ecc, ecc1,
124 & semi, semi1, pcrit/pmin, 180.*alpha/3.14, emax
125 30
FORMAT (f9.5,f5.1,i6,2f6.2,2f6.3,1p,2e10.2,0p,f5.2,f6.1,f6.3)