1 SUBROUTINE kozai(IPAIR,IM,ECC1,SEMI1,ITERM)
8 common/binary/ cm(4,mmax),xrel(3,mmax),vrel(3,mmax),
9 & hm(mmax),um(4,mmax),umdot(4,mmax),tmdis(mmax),
10 & namem(mmax),nameg(mmax),kstarm(mmax),iflagm(mmax)
12 REAL*8 ei(3),hi(3),ho(3),a1(3),a2(3)
28 td2 = td2 + 2.0*um(k,im)*umdot(k,im)
30 zmb = cm(1,im) + cm(2,im)
31 semi = -0.5*zmb/hm(im)
32 ecc2 = (1.0 - ri/semi)**2 + td2**2/(zmb*semi)
37 IF (tev(i).GE.1.0d+10) tev(i) = time + 1.0
53 a1(k) = xrel(k1,im)*vrel(k2,im) - xrel(k2,im)*vrel(k1,im)
54 a2(k) = (x(k1,i2) - x(k1,i1))*(xdot(k2,i2) - xdot(k2,i1))
55 & - (x(k2,i2) - x(k2,i1))*(xdot(k1,i2) - xdot(k1,i1))
58 a1a2 = a1a2 + a1(k)*a2(k)
59 ri2 = ri2 + xrel(k,im)**2
60 vi2 = vi2 + vrel(k,im)**2
61 rv = rv + xrel(k,im)*vrel(k,im)
67 ei(k) = (vi2*xrel(k,im) - rv*vrel(k,im))/body(i1) -
68 & xrel(k,im)/sqrt(ri2)
71 ei2 = min(ei2,0.999999d0)
77 ei(k) = ei(k)/sqrt(ei2)
78 hi(k) = a1(k)/sqrt(a12)
79 ho(k) = a2(k)/sqrt(a22)
80 cosj = cosj + hi(k)*ho(k)
81 sjsg = sjsg + ei(k)*ho(k)
85 a = cosj*sqrt(1.0 - ei2)
86 z = (1.0 - ei2)*(2.0 - cosj**2) + 5.0*ei2*sjsg**2
89 z2 = z**2 + 25.0 + 16.0*a**4 - 10.0*z - 20.0*a**2 - 8.0*a**2*z
90 emax = one6*(z + 1.0 - 4.0*a**2 + sqrt(z2))
91 emax = max(emax,0.0001d0)
94 IF (emax.LT.0.0) go to 50
99 az1 = 1.0 + z - 4.0*a**2
100 emin2 = one6*(az1 - sqrt(az1**2 - 12.0*az))
102 emin2 = 1.0 - 0.5*(a**2 + z)
104 emin2 = max(emin2,0.0001d0)
108 tk = twopi*semi*sqrt(semi/body(i1))
109 tk1 = twopi*abs(semi1)*sqrt(abs(semi1)/body(i))
110 tkoz = tk1**2*body(i)*(1.0 - ecc1**2)**1.5/(body(i2)*tk)
116 tkoz =
const*tkoz*tstar
119 fac = min(cosj,1.0d0)
121 zi = angle*360.0/twopi
125 IF ((mod(it,100).EQ.0.AND.emax.GT.0.99).OR.kz(42).GT.1)
THEN
126 WRITE (42,30) time+toff, name(i1), zi, emin, emax, ecc,
127 & semi1/semi, tkoz, tmdis(im)
128 30
FORMAT (
' KOZAI T NAM1 INC EM EX E A1/A TKOZ TMD ',
129 & f9.3,i7,f7.1,f6.2,2f8.4,f6.1,1p,2e9.1)
131 IF (it.GT.2000000000) it = 0
135 IF (emax.GT.0.90.AND.zi.GT.40.0)
THEN
136 CALL
findj(i1,jg,im2)
138 IF (jg.LT.0.OR.jg.GT.n) go to 50
140 IF (semi*(1.0 - emax).LT.2.0*(radius(i1) + radius(jg)).AND.
144 IF (radius(jg).GT.radius(i1))
THEN
147 q1 = cm(2,im)/cm(1,im)
151 q1 = cm(1,im)/cm(2,im)
154 semi0 = semi*(1.0 - emax**2)
155 tcirc = 2.0*q1**2/(1.0 + q1)*(semi0/radius(j1))**8
162 rp = semi*(1.0 - emax)
164 WRITE (6,45) emax, semi, rp, radius(i1)+radius(jg), tt
165 45
FORMAT (
' KOZAI TIDE EX A RP R1+R2 TT ',
166 & f10.6,1p,e12.4,3e10.2)
169 IF (tkoz.LT.1.0.OR.
tcirc.LT.1) iterm = 2