16 semi = -0.5d0*body(i)/h(ipair)
19 tk = twopi*semi*sqrt(semi/body(i))
20 IF (time - t0(i1).LT.2.0e+09*tk)
THEN
21 k = nint((time - t0(i1))/tk)
29 IF (nksper.GT.2000000000.OR.nksper.LT.0)
THEN
36 IF (tdot2(ipair).GE.0.0d0)
THEN
43 IF (kstar(i).LT.11)
THEN
44 IF (step(i1).LT.tk)
THEN
45 IF (step(i1).LT.0.0001*step(i)) go to 9
47 IF (time - t0(i).GT.2.0*step(i1))
THEN
48 dt = min(3.0d0*step(i1),step(i))
59 CALL
tpert(ipair,gmin,dt)
65 IF (list(1,i1).GT.0)
THEN
67 IF (r(ipair).LT.semi.AND.semi.LT.5.0*rmin)
THEN
82 jpert(l) = list(l+1,i1)
84 CALL
nbpot(1,nnb,pot1)
87 CALL
nbpot(2,nnb,pot2)
90 emerge = emerge + (pot2 - pot1)
91 be(3) = be(3) + (pot2 - pot1)
99 20
IF (kz(27).GT.0.AND.
100 & (semi.LT.rmin.OR.tdot2(ipair).GT.0.0d0).AND.
101 & (kstar(i).EQ.0.OR.kstar(i).EQ.-1).AND.
102 & (name(i).GT.0))
THEN
105 ecc2 = (1.0 - r(ipair)/semi)**2 +
106 & tdot2(ipair)**2/(body(i)*semi)
108 rp = semi*(1.0d0 - ecc)
109 rt = 4.0*max(radius(i1),radius(i1+1))
113 IF (kz(27).EQ.1.AND.ttot.GT.tcall)
THEN
114 IF (rp.LT.rt) icirc = 1
116 ELSE IF (rp.LT.2.5*rt.AND.kstar(i).EQ.0.AND.
117 & ttot.GT.tcall)
THEN
119 CALL
tcirc(rp,ecc,i1,i1+1,icirc,tc)
121 ELSE IF (kstar(i).EQ.-1)
THEN
127 IF (icirc.GT.0.AND.ecc.GT.0.002)
THEN
129 IF (r(ipair).GT.semi)
THEN
134 IF (iphase.LT.0) go to 30
135 semi = -0.5d0*body(i)/h(ipair)
136 tk = twopi*semi*sqrt(semi/body(i))
138 IF (r(ipair).LT.0.99*rt.AND.kstar(i).NE.10)
THEN
140 tdot2(ipair) = 1.0e-20
145 ecc2 = (1.0 - r(ipair)/semi)**2 +
146 & tdot2(ipair)**2/(body(i)*semi)
149 IF (abs(rt - rp)/rt.GT.0.1.AND.kz(27).LE.1)
THEN
150 WRITE(6,25) ecc, semi, r(ipair), rp, radius(i1)
151 25
FORMAT (
' INACTIVE PHASE E A R RP R* ',
154 IF (semi.LT.0.001*rmin) step(i1) = step(i)
156 IF (ecc.LT.0.002.AND.semi.LT.0.01*rmin)
THEN
167 IF (kstar(i).EQ.13.AND.min(tev(i1),tev(i1+1)).LT.time + dt)
THEN
170 IF (kstar(i).GT.13) ir = 1
171 IF (kz(34).GT.0.AND.(kstar(i).GE.10.AND.kstar(i).LE.12))
THEN
172 tm = min(tev(i1),tev(i1+1),tev(i))
184 IF (dtr.LT.step(i1)) go to 30
196 IF (kz(19).GE.3.AND.name(i).GT.0)
THEN
200 uidot(k) = udot(k,ipair)
203 CALL
peri(ui,uidot,ri,body(i1),body(i1+1),qperi)
204 IF (qperi.LT.0.75*(radius(i1) + radius(i1+1)))
THEN
211 IF (iphase.LT.0) go to 30
216 IF (kpert.GT.0.AND.dt.GT.0.0)
THEN
218 IF (kz(27).GT.0.AND.kpert.GT.1)
THEN
219 tm = min(tev(i1),tev(i1+1))
220 IF (tm - t0(i1).GT.0.0.AND.tm - t0(i1).LT.0.5*dt)
THEN
222 IF (nwarn.LT.1000)
THEN
223 WRITE (25,27) ipair, kstar(i1), kstar(i1+1),
224 & kstar(i), tm-t0(i1), step(i1)
225 27
FORMAT (
' UNPERT WARNING! KS K* TEV-T0 STEP1 ',
229 dt = min(2.0*(tm - t0(i1)),dt)
230 dt = max(dt,tk,stepx)
234 IF (dt.LT.2.0e+09*tk)
THEN
235 k = 1 + int(0.5d0*dt/tk)
237 step(i1) = float(k)*min(tk,step(i))
242 IF (kz(27).GT.1.AND.kstar(i).EQ.-2)
THEN
244 IF (r(ipair).GT.semi)
THEN
247 IF (tdot2(ipair).LT.0.0d0)
THEN
254 IF (iphase.LT.0) go to 30
259 28
IF (kz(15).GT.0.AND.ir.GE.0.AND.time+step(i1).GT.tblock)
THEN
260 IF (step(i).LT.dtmin)
THEN
262 ELSE IF (jclose.GT.0.AND.step(i).LT.10.0*dtmin)
THEN
263 CALL
histab(ipair,jclose,pmin,rstab)
264 IF (rstab.LT.pmin)
THEN
268 ELSE IF (jclose.GT.n)
THEN
269 fac = 2.0*(body(i) + body(jclose))/bodym
270 IF (step(i).LT.fac*dtmin)
THEN
271 CALL
histab(ipair,jclose,pmin,rstab)
272 IF (rstab.LT.pmin)
THEN
280 IF (kz(27).EQ.-1.AND.kz(13).LT.0)
THEN
281 ecc2 = (1.0 - r(ipair)/semi)**2 +
282 & tdot2(ipair)**2/(body(i)*semi)
284 qperi = semi*(1.0 - ecc)
287 IF (qperi.LT.rfac*max(radius(i1),radius(i2)))
THEN
289 IF (radius(i2).GT.radius(i1)) j1 = i2
290 fac = 0.5*body(i)/body(j1)
292 rcoll = 1.7*fac**0.3333*radius(j1)
293 IF (qperi.LT.rcoll)
THEN
294 CALL
touch(ipair,i1,i2,rcoll)