12 DATA eccm,eccm2,ttide,ione /0.002,0.00000399,0.0d0,0/
23 zmu = body(i1)*body(i2)/body(i)
28 semi = -0.5d0*body(i)/h(ipair)
29 ecc2 = (1.0 - r(ipair)/semi)**2 + tdot2(ipair)**2/(semi*body(i))
31 am0 = semi*(1.0d0 - ecc**2)
32 peri = semi*(1.0d0 - ecc)
36 r1 = max(radius(i1),radius(i2))
39 IF (ecc.GT.0.95) zf = 50.0
41 IF (abs(qperi - zf*r1).LT.0.01*qperi) go to 50
42 ELSE IF (kz(27).EQ.2)
THEN
49 CALL
chaos(ipair,i1,i2,qperi,ecc,is,zmu,rks,semi1,ecc1,idis)
50 IF (idis.EQ.1) go to 45
53 IF (kstar(i).EQ.-1.OR.h(ipair).GT.0.0)
THEN
61 ELSE IF (kz(27).EQ.3)
THEN
62 CALL
tides3(qperi,body(i1),body(i2),vstar,h(ipair),ecc,de)
66 IF (ecc.LE.eccm.AND.kstar(i).LT.10)
THEN
77 am0 = semi*(1.0 - ecc**2)
79 acirc = am0/(1.0 - eccm2)
80 IF (acirc.LT.zf*r1)
THEN
84 ecc1 = am0/(zf*r1) - 1.0
87 semi1 = am0/(1.0 - ecc1**2)
90 dh = 0.5*body(i)*(1.0/semi - 1.0/semi1)
95 dh = -(de(1) + de(2))/zmu
96 IF (h(ipair) + dh.LT.-0.5*body(i)/r(ipair))
THEN
97 dh = -0.5*body(i)/r(ipair) - h(ipair)
101 semi1 = -0.5*body(i)/(h(ipair) + dh)
102 ecc1 = 1.0 -
peri/semi1
103 ecc1 = max(ecc1,eccm)
107 IF (h(ipair) + dh.GT.0.0) go to 50
110 ecoll = ecoll + (de(1) + de(2))
111 e(10) = e(10) + (de(1) + de(2))
112 egrav = egrav + (de(1) + de(2))
115 h(ipair) = h(ipair) + dh
118 IF (kz(27).EQ.1.AND.(kstar(i).EQ.0.OR.kstar(i).EQ.9))
THEN
119 p = days*semi1*sqrt(semi1/body(i))
120 IF (kstar(i).EQ.0.AND.ecc1.GT.eccm)
THEN
123 WRITE (6,8) which1, name(i1), name(i2), kstar(i1),
124 & kstar(i2), ttot, ecc, ecc1, p, semi1, r1
125 ELSE IF (ecc1.LE.eccm)
THEN
129 WRITE (6,8) which1, name(i1), name(i2), kstar(i1),
130 & kstar(i2), ttot, ecc, ecc1, p, semi1, r1
132 8
FORMAT (
' ',a8,
' NAM K* T E0 EF P AF R* ',
133 & 2i6,2i4,f9.2,2f8.3,f7.1,1p,2e10.2)
137 10 peri1 = semi1*(1.0d0 - ecc1)
140 c1 = sqrt(peri1/
peri)
143 IF (kz(27).EQ.1)
THEN
147 c2 = sqrt((body(i) + h(ipair)*peri1)/(body(i) + hi*
peri))
159 u(k,ipair) = c1*u(k,ipair)
160 udot(k,ipair) = c2*udot(k,ipair)
161 u0(k,ipair) = u(k,ipair)
162 r(ipair) = r(ipair) + u(k,ipair)**2
167 IF (abs(semi1/semi).LT.0.5)
THEN
170 IF (np0.EQ.0.AND.list(1,i1).GT.0)
THEN
171 IF (list(2,i1).EQ.i)
THEN
178 IF (kz(27).EQ.2.AND.list(1,i1).EQ.0)
THEN
187 jpert(l) = list(l+1,i1)
195 CALL
nbpot(2,nnb,pot1)
199 IF (np0.GT.0.OR.ecc.LE.eccm)
THEN
206 CALL
nbpot(2,nnb,pot2)
211 IF (ecc.GT.0.99.AND.abs(ecc - ecc1).GT.0.01.AND.ione.EQ.0)
THEN
212 WRITE (6,20) name(i1), name(i2), semi1, ecc, ecc1, hi,
214 20
FORMAT (
' NEW KSTIDE NAM AF E0 EF HI QP DH DP ',
215 & 2i5,1p,e10.2,0p,2f8.3,f9.1,1p,3e10.2)
219 IF (time + toff.GT.ttide + dtadj) ione = 0
222 IF (kz(27).EQ.2.AND.ecc.GT.0.95.AND.hi.LT.0.0)
THEN
230 rij2 = rij2 + (x(k,i) - x(k,j))**2
231 vij2 = vij2 + (xdot(k,i) - xdot(k,j))**2
232 rdot = rdot + (x(k,i) - x(k,j))*(xdot(k,i) -xdot(k,j))
235 a1 = 2.0/rip - vij2/(body(i) + body(j))
237 IF (1.0/a1.GT.0.1/semi)
THEN
238 ecc2 = (1.0 - rip/a1)**2 +
239 & rdot**2/(a1*(body(i) + body(j)))
240 rp = a1*(1.0 - sqrt(ecc2))
241 ra = semi*(1.0 + ecc)
245 CALL
induce(ipair,emax,emin,icirc,tc,angle,tg,edav)
246 WRITE (6,28) name(j), h(ipair), semi, a1, rp, edav,
247 & sqrt(ecc2), emax, sr
248 28
FORMAT (
' HIERARCHY NMJ H A0 A1 RP EDAV E1 EX SR ',
249 & i7,f7.0,1p,4e9.1,0p,2f8.4,f6.1)
255 ga = gamma(ipair)*(semi1*(1.0 + ecc1)/r(ipair))**3
256 IF (ga.LT.gmin.AND.kz(27).EQ.1)
THEN
257 step(i1) = twopi*semi1*sqrt(semi1/body(i))
262 IF (tdot2(ipair).LT.0.0d0)
THEN
267 IF (semi.LT.0.0.AND.semi1.GT.0.0)
THEN
270 WRITE (6,35) time+toff, name(i1), name(i2), ecc, ecc1, qps,
272 35
FORMAT (
' NEW CAPTURE T NM E EF QP/R* A1 ',
273 & f9.2,2i6,2f9.4,1p,2e10.2)
277 IF (ecc.GT.eccm.AND.ecc1.LT.eccm.AND.kz(27).LE.2)
THEN
279 esync = esync + zmu*h(ipair)
281 WRITE (6,38) name(i1), name(i2), kstar(i1), kstar(i2), semi1,
282 & ecc, ecc1, hi, qperi, r1
283 38
FORMAT (
' CIRCULARIZED NAM K* AF E0 EF HI QP R* ',
284 & 2i6,2i3,1p,e10.2,0p,2f8.3,f9.1,1p,2e10.2)
286 IF (kz(34).GT.0)
THEN
298 rcoll = 0.75*(radius(i1) + radius(i2))
299 IF (abs(semi1).LT.1.5*rcoll.AND.ecc.LT.eccm.AND.
300 & kstar(i).LT.10)
THEN
302 WRITE (6,40) ecc1, semi1, r(ipair), rcoll, r1
303 40
FORMAT (
' INACTIVE PHASE E A R RC R* ',f7.3,1p,4e10.2)
305 IF (kz(34).GT.0)
THEN
317 ecc2 = 1.0 - r(ipair)/semi1
318 IF (kz(27).EQ.1.AND.ecc2.GT.max(ecc,eccm)+1.0d-04)
THEN
319 WRITE (6,42) ttot, ipair, ecc2, ecc, r(ipair), semi1
320 42
FORMAT (
' WARNING! E > E0 T IP E E0 R A ',
321 & f10.4,i5,2f8.4,1p,2e10.2)
325 IF (kz(27).EQ.1.AND.de(1)+de(2).LT.1.0d-07*zmu*abs(hi))
THEN
327 IF (radius(i2).GT.radius(i1)) j1 = i2
329 dr = (0.99*4.0*radius(j1) - qperi)/qperi
330 yf = max(abs(dr),0.01d0)
331 radius(j1) = (1.0 - min(yf,0.1d0))*radius(j1)
332 de1 = (de(1) + de(2))/(zmu*abs(h(ipair)))
333 WRITE (6,44) ttot, kstar(j1), h(ipair), qperi, dr, de1
334 44
FORMAT (
' REDUCED RADIUS T K* H QP DR/R DE/E ',
335 & f9.2,i3,f10.1,1p,3e9.1)
339 45
IF (kz(27).EQ.2.AND.idis.GT.0)
THEN
340 WRITE (6,48) ttot, ipair, list(1,i1), ecc, semi, qperi,
341 & radius(i1), radius(i2)
342 48
FORMAT (
' DISRUPTED CHAOS T KS NP E A QP R* ',
343 & f9.2,i6,i4,f8.4,1p,4e10.2)