8 REAL*8 q(3),rdot(3),ui(4),vi(4),a1(3,4)
20 IF (list(1,icomp).EQ.0)
THEN
28 body(ntot) = body(icomp) + body(jcomp)
30 name(ntot) = nzero + name(icomp)
34 body0(ntot) = body(ntot)
35 epoch(ntot) = time*tstar
41 x(k,ntot) = (body(icomp)*x(k,icomp) + body(jcomp)*x(k,jcomp))/
43 x0dot(k,ntot) = (body(icomp)*x0dot(k,icomp) + body(jcomp)*
44 & x0dot(k,jcomp))/body(ntot)
45 xdot(k,ntot) = x0dot(k,ntot)
46 xdot(k,icomp) = x0dot(k,icomp)
47 xdot(k,jcomp) = x0dot(k,jcomp)
68 q(k) = x(k,icomp) - x(k,jcomp)
69 rdot(k) = x0dot(k,icomp) - x0dot(k,jcomp)
73 r(ipair) = sqrt(q(1)**2 + q(2)**2 + q(3)**2)
76 IF (q(1).LE.0.0d0)
THEN
78 ui(2) = sqrt(0.5d0*(r(ipair) - q(1)))
79 ui(1) = 0.5d0*q(2)/ui(2)
80 ui(4) = 0.5d0*q(3)/ui(2)
83 ui(1) = sqrt(0.5d0*(r(ipair) + q(1)))
84 ui(2) = 0.5d0*q(2)/ui(1)
85 ui(3) = 0.5d0*q(3)/ui(1)
94 udot(k,ipair) = 0.50d0*(a1(1,k)*rdot(1) + a1(2,k)*rdot(2) +
98 u0(k,ipair) = u(k,ipair)
99 tdot2(ipair) = tdot2(ipair) + 2.0d0*ui(k)*udot(k,ipair)
103 h(ipair) = (2.0d0*(udot(1,ipair)**2 + udot(2,ipair)**2 +
104 & udot(3,ipair)**2 + udot(4,ipair)**2) -
105 & body(ntot))/r(ipair)
106 eb = h(ipair)*body(icomp)*body(jcomp)/body(ntot)
112 semi = -0.5*body(ntot)/h(ipair)
113 IF (list(1,icomp).EQ.0.AND.eb.LT.ebh.AND.semi.LT.rmin)
THEN
114 tk = twopi*semi*sqrt(semi/body(ntot))
116 IF (iphase.NE.7.AND.iphase.NE.8)
THEN
118 vi(k) = udot(k,ipair)
121 CALL
tperi(semi,ui,vi,body(ntot),tp)
123 step(icomp) = 0.5*min(tk,step(ntot)) - tp
125 IF (abs(tdot2(ipair)).GT.1.0e-12.OR.r(ipair).LT.semi)
THEN
131 time = max(time,0.0d0)
132 ELSE IF (tdot2(ipair).GT.0.0)
THEN
133 tdot2(ipair) = -1.0e-20
139 IF (list(1,icomp).EQ.0.AND.semi.GT.0.0)
THEN
140 tk = twopi*semi*sqrt(semi/body(ntot))
141 IF (kz(26).GT.0.AND.step(ntot).GT.tk)
THEN
142 imod = 1 + log(step(ntot)/tk)/0.69
150 step(jcomp) = 1.0e+06
151 stepr(jcomp) = 1.0e+06
157 semi = -0.5*body(ntot)/h(ipair)
158 ecc2 = (1.0-r(ipair)/semi)**2 + tdot2(ipair)**2/(body(ntot)*semi)
159 rap = semi*(1.0 + sqrt(ecc2))
169 IF (eb.LT.ebh.AND.rap.LT.0.05*rs(ntot))
THEN
170 r0(ipair) = max(rmin,-body(ntot)/h(ipair))
171 r0(ipair) = min(r0(ipair),5.0*rmin)
178 IF (h(ipair).GT.0.0) nkshyp = nkshyp + 1
181 IF (kz(10).GT.0)
THEN
182 ri = sqrt((x(1,ntot) - rdens(1))**2 +
183 & (x(2,ntot) - rdens(2))**2 +
184 & (x(3,ntot) - rdens(3))**2)
185 WRITE (6,60) time+toff, name(icomp), name(jcomp),dtau(ipair),
186 & r(ipair), ri, h(ipair), ipair, gamma(ipair),
187 & step(ntot), list(1,icomp), list(1,ntot)
188 60
FORMAT (/,
' NEW KSREG TIME =',f8.2,2i6,f12.3,1p,e10.1,
189 & 0p,f7.2,f9.2,i5,f8.3,1p,e10.1,2i5)
193 IF (max(kstar(icomp),kstar(jcomp)).GE.13.AND.eb.LT.ebh.AND.
199 IF (ipipe(j).EQ.name(icomp).OR.
200 & ipipe(j).EQ.name(jcomp)) id = id + 1
204 pd = days*semi*sqrt(abs(semi)/body(ntot))
205 WRITE (6,65) time+toff, name(icomp), name(jcomp),
206 & kstar(icomp), kstar(jcomp), kstar(ntot),
208 65
FORMAT (
' NS/BH BINARY T NM K* E P EB ',
209 & f8.1,2i6,3i4,f7.3,1p,e9.1,e11.2)
215 ipipe(j) = ipipe(j+2)
216 ipipe(j+1) = ipipe(j+3)
221 ipipe(np+2) = name(icomp)
222 ipipe(np+3) = name(jcomp)
227 IF (npairs.GT.kmax - 3) gmax = 0.8*gmax
228 IF (npairs.LT.kmax - 5.AND.gmax.LT.0.001) gmax = 1.2*gmax
229 IF (npairs.EQ.kmax)
WRITE (6,70) npairs, time+toff
230 70
FORMAT (5x,
'WARNING! MAXIMUM KS PAIRS NPAIRS TIME',i5,f9.2)
234 jdum = 2*npairs - 2 + kcomp
236 x0(k,jdum) = x(k,jdum)
237 x0dot(k,jdum) = 0.0d0
251 IF (iabs(name(icomp) - name(jcomp)).EQ.1)
THEN
252 IF (name(icomp).LE.2*nbin0) k = -1
255 IF (name(icomp).EQ.listd(l).OR.name(jcomp).EQ.listd(l)) k = -1
257 IF (h(ipair).GT.0.0) k = 0
260 IF (iphase.EQ.6)
THEN
262 ELSE IF (k.EQ.0)
THEN
263 IF (iphase.EQ.8.OR.eb.LT.ebh) k = -1
269 IF (kz(8).GT.0.AND.k.EQ.0)
THEN
270 IF (eb.GT.ebh) go to 100
271 semi = -0.5*body(ntot)/h(ipair)
272 ri = sqrt((x(1,ntot) - rdens(1))**2 +
273 & (x(2,ntot) - rdens(2))**2 +
274 & (x(3,ntot) - rdens(3))**2)
275 WRITE (8,90) time+toff, name(icomp), name(jcomp), k,
276 & body(icomp),body(jcomp), eb, semi, r(ipair),
278 90
FORMAT (
' NEW BINARY T =',f7.1,
' NAME = ',2i6,i3,
279 &
' M =',1p,2e9.1,
' EB =',e9.1,
280 &
' A =',e9.1,
' R =',e9.1,
' G =',e9.1,