9 common/chreg/ timec,tmax,rmaxc,cm(10),namec(6),nstep1,kz27,kz30
10 common/cpert/ rgrav,gpert,ipert,npert
11 REAL*8 m,mb,mb1,r2(nmx,nmx),xcm(3),vcm(3),xx(3,3),vv(3,3),
12 & a1(3),a2(3),xrel(3),vrel(3),ei(3),hi(3),ho(3)
34 vrel2 = vrel2 + (v(j1) - v(j2))**2
35 rdot = rdot + (x(j1) - x(j2))*(v(j1) - v(j2))
36 xcm(k) = (m(i1)*x(j1) + m(i2)*x(j2))/mb
37 vcm(k) = (m(i1)*v(j1) + m(i2)*v(j2))/mb
38 r3 = r3 + (x(j3) - xcm(k))**2
39 vrel21 = vrel21 + (v(j3) - vcm(k))**2
40 rdot3 = rdot3 + (x(j3) - xcm(k))*(v(j3) - vcm(k))
52 semi = 2.0d0/rb - vrel2/mb
54 ecc = sqrt((1.0d0 - rb/semi)**2 + rdot**2/(semi*mb))
55 semi1 = 2.0/r3 - vrel21/mb1
57 ecc1 = sqrt((1.0d0 - r3/semi1)**2 + rdot3**2/(semi1*mb1))
58 pmin = semi1*(1.0d0 - ecc1)
69 CALL
inclin(xx,vv,xcm,vcm,alpha)
77 IF (ecc1.LT.1.0.AND.ecc.LT.1.0)
THEN
78 nst = nstab(semi,semi1,ecc,ecc1,alpha,m(i1),m(i2),m(i3))
91 xrel(k) = xx(k,1) - xx(k,2)
92 vrel(k) = vv(k,1) - vv(k,2)
105 a1(k) = xrel(k1)*vrel(k2) - xrel(k2)*vrel(k1)
106 a2(k) = (xx(k1,3) - xcm(k1))*(vv(k2,3) - vcm(k2))
107 & - (xx(k2,3) - xcm(k2))*(vv(k1,3) - vcm(k1))
110 a1a2 = a1a2 + a1(k)*a2(k)
111 ri2 = ri2 + xrel(k)**2
112 vi2 = vi2 + vrel(k)**2
113 rvi = rvi + xrel(k)*vrel(k)
119 ei(k) = (vi2*xrel(k) - rvi*vrel(k))/mb - xrel(k)/sqrt(ri2)
122 ei2 = min(ei2,0.9999d0)
128 ei(k) = ei(k)/sqrt(ei2)
129 hi(k) = a1(k)/sqrt(a12)
130 ho(k) = a2(k)/sqrt(a22)
131 cosj = cosj + hi(k)*ho(k)
132 sjsg = sjsg + ei(k)*ho(k)
136 a = cosj*sqrt(1.0 - ei2)
137 z = (1.0 - ei2)*(2.0 - cosj**2) + 5.0*ei2*sjsg**2
140 z2 = z**2 + 25.0 + 16.0*a**4 - 10.0*z - 20.0*a**2 - 8.0*a**2*z
142 emax = (z + 1.0 - 4.0*a**2 + sqrt(z2))/6.0
143 emax = max(emax,0.0001d0)
148 alpha = 180.0*alpha/3.1415
149 IF (pmin.GT.pcrit.AND.semi.GT.0.0.AND.semi1.GT.0.0.AND.
152 IF (r3.GT.semi1.AND.gpert.LT.1.0d-06)
THEN
154 WRITE (6,20) namec(i1), namec(i2), namec(i3), ecc, emax,
155 & ecc1, semi, semi1, pmin, pcrit, alpha
156 20
FORMAT (
' NEW HIARCH NM =',3i6,
' E =',f6.3,
' EX =',f7.4,
157 &
' E1 =',f6.3,
' A =',1p,e8.1,
158 &
' A1 =',e8.1,
' PM =',e9.2,
159 &
' PC =',e9.2,
' IN =',0p,f7.1)
160 ri = sqrt(cm(1)**2 + cm(2)**2 + cm(3)**2)
162 WRITE (81,30) timec, ri, namec(i3), q0, ecc, emax, ecc1,
163 & semi, semi1, pcrit/pmin, alpha
164 30
FORMAT (2f8.4,i6,f6.2,3f6.3,1p,2e10.2,0p,f5.2,f8.1)
168 ELSE IF (pmin.GT.3.0*semi*(1.0 + ecc).AND.semi.GT.0.0.AND.
171 IF (rb.GT.semi.AND.r3.GT.semi1.AND.rdot3.GT.0.0)
THEN
172 apo = semi*(1.0 + ecc)
173 WRITE (6,40) ecc, ecc1, alpha, rb, r3, pcrit, pmin, apo
174 40
FORMAT (
' WIDE CHAIN E E1 IN RB R3 PC PM APO ',
175 & 2f7.3,f7.1,1p,5e10.2)
180 ELSE IF (nstep1.GT.50000.AND.pmin.GT.0.9*pcrit.AND.
183 ELSE IF (nstep1.GT.500000.AND.r3.GT.semi1)
THEN