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),iflag(mmax)
31 5 ri2 = (x(1,i) - rdens(1))**2 + (x(2,i) - rdens(2))**2 +
32 & (x(3,i) - rdens(3))**2
33 IF (ri2.LT.rtide2) ncrit1 = ncrit1 + 1
34 vi2 = xdot(1,i)**2 + xdot(2,i)**2 + xdot(3,i)**2
37 IF (ri2.GT.resc2.AND.ri2.LT.1.0d+10)
THEN
43 rij2 = (x(1,i) - x(1,j))**2 + (x(2,i) - x(2,j))**2 +
44 & (x(3,i) - x(3,j))**2
46 IF (rij2.LT.rjmin2)
THEN
53 IF (kz(14).EQ.4.OR.kz(14).EQ.3)
THEN
54 ei = ei - mp/sqrt(ri2 + ap2)
55 IF (body(i).EQ.0.0d0) go to 30
57 IF ((kz(14).GT.0.AND.kz(14).NE.4).OR.ei.GT.0.0) go to 30
61 12
IF (n.EQ.2) go to 13
63 IF (i.LE.ntot) go to 5
64 IF (ncorr.EQ.0) go to 25
69 cmr(k) = cmr(k) + body(i)*x(k,i)/zmass
70 cmrdot(k) = cmrdot(k) + body(i)*xdot(k,i)/zmass
73 cmr(4) = sqrt(cmr(1)**2 + cmr(2)**2 + cmr(3)**2)
76 jlast = min(ncorr,nmax)
77 WRITE (6,18) n, nsesc, nbesc, zmass, be(3), cmr(4), resc,
stepi,
78 & rsi, zmass/float(n), ncrit1, (jlist(j),j=1,jlast)
79 18
FORMAT (/,
' ESCAPE N =',2i6,i4,f8.4,f12.6,2f7.2,f7.3,f7.2,f9.5,
80 & i6,2x,6i6,/,5(6x,20i6,/))
98 30 a2 = (x(1,jmin) - rdens(1))**2 + (x(2,jmin) - rdens(2))**2 +
99 & (x(3,jmin) - rdens(3))**2
101 IF (a2.GT.resc2.AND.kz(14).GT.0) go to 40
102 IF (rjmin2.GT.100.0*rmin2) go to 40
103 a3 = xdot(1,jmin)**2 + xdot(2,jmin)**2 + xdot(3,jmin)**2
104 a4 = (xdot(1,i) - xdot(1,jmin))**2 +
105 & (xdot(2,i) - xdot(2,jmin))**2 +
106 & (xdot(3,i) - xdot(3,jmin))**2
107 a5 = (body(i) + body(jmin))/sqrt(rjmin2)
110 IF (a6.GT.1.0.AND.a3.GT.2.0*zmass/sqrt(a2)) go to 40
112 IF (a6.GT.0.01) go to 10
115 40 x1 = x(1,i) - rdens(1)
116 y1 = x(2,i) - rdens(2)
117 z1 = x(3,i) - rdens(3)
119 a4 = abs(z1)/sqrt(x1**2 + y1**2)
120 ilist(2*ncorr+1) = datan(a3)*180.0/3.14159
121 ilist(2*ncorr+2) = datan(a4)*180.0/3.14159
129 jlist(ncorr) = name(i)
133 IF (name(i).EQ.0)
THEN
134 nsub = max(nsub - 1,0)
137 42
FORMAT (
' CHAIN ESCAPE!!!!! ECH EI ',2f10.6)
141 IF (name(i).LT.0) kstari = kstari + 30
142 IF (body(i).LE.0.0d0) go to 50
145 IF (kz(23).GE.3.AND.kz(14).EQ.3)
THEN
150 zk = 0.5d0*body(i)*vi2
151 IF (kz(14).GT.0.AND.kz(14).LT.3)
THEN
154 rtide = (zmass/tidal(1))**0.3333
155 ELSE IF (kz(14).EQ.4.OR.kz(14).EQ.3)
THEN
156 rtide = rtide0*zmass**0.3333
158 ei = zk - body(i)*
poti
163 pot = pot - body(i)*
poti
167 zmass = zmass - body(i)
169 npop(4) = npop(4) + 1
177 IF (kz(23).GT.1)
THEN
179 OPEN (unit=11,
status=
'NEW',form=
'FORMATTED',file=
'ESC')
186 IF (kz(14).GT.0.AND.kz(14).LE.2)
THEN
187 ecrit = -1.5*(tidal(1)*zmass**2)**0.3333
188 eesc = 2.0*(eesc - ecrit)/vb2
189 eesc = min(eesc,999.0d0)
195 vkm = sqrt(vi2)*vstar
196 WRITE (11,45) tesc, besc, eesc, vkm, kstari, name(i)
197 45
FORMAT (f8.1,3f6.1,i4,i7)
204 nnbmax = min((n - npairs)/2,nnbmax)
206 znbmin = max(0.2*nnbmax,1.0)
211 IF (i.GT.n + 1.AND.kstar(i).GE.10)
THEN
212 ii = -(n + 1 + ipair)
222 IF (nnb.EQ.0) go to 150
224 70
IF (list(l,j).NE.i) go to 130
228 list(k,j) = list(k+1,j)
230 list(1,j) = list(1,j) - 1
234 IF (list(1,j).GT.0) go to 130
239 rjk2 = (x(1,j) - x(1,k))**2 + (x(2,j) - x(2,k))**2 +
240 & (x(3,j) - x(3,k))**2
241 IF (rjk2.LT.resc2.AND.k.LT.n) go to 100
247 130
IF (list(l,j).GT.i) list(l,j) = list(l,j) - 1
249 IF (l.LE.list(1,j) + 1) go to 70
255 IF (listr(l).EQ.i)
THEN
259 listr(k) = listr(k+2)
261 listr(1) = listr(1) - 2
267 IF (listr(l).GT.i) listr(l) = listr(l) - 1
273 IF (listv(l).EQ.i)
THEN
276 listv(k) = listv(k+1)
278 listv(1) = listv(1) - 1
281 IF (listv(l).GT.i)
THEN
282 listv(l) = listv(l) - 1
283 IF (i.GT.n + 1) listv(l) = listv(l) - 2
288 IF (kcase.GT.1) go to 205
291 IF (i.LE.n + 1) go to 12
294 IF (namei.NE.0.AND.body(2*ipair-1).GT.0.0d0)
THEN
295 zmb = body(2*ipair-1) + body(2*ipair)
297 eb = h(ipair)*body(2*ipair-1)*body(2*ipair)/zmb
298 semi = -0.5*zmb/h(ipair)
299 ecc2 = (1.0 - r(ipair)/semi)**2 + tdot2(ipair)**2/(semi*zmb)
301 pmin = semi*(1.0 - ecc)
302 ratio = max(radius(2*ipair-1),radius(2*ipair))/pmin
303 name1 = name(2*ipair-1)
304 kstar1 = kstar(2*ipair-1)
305 pb = days*semi*sqrt(semi/zmb)
310 bodycm = cm(3,im) + cm(4,im)
311 semi = -0.5*bodycm/h(jpair)
312 zmu = cm(3,im)*cm(4,im)/bodycm
313 pb = days*semi*sqrt(semi/bodycm)
314 ecc2 = (1.0-r(jpair)/semi)**2 + tdot2(jpair)**2/(bodycm*semi)
318 emerge = emerge - eb1
327 IF (namei.LE.0.AND.(kz(18).EQ.1.OR.kz(18).EQ.3))
THEN
333 IF (body(2*ipair-1).GT.0.0d0)
THEN
334 name2 = name(2*ipair)
337 IF (namei.LT.-2*nzero)
THEN
340 IF (namem(k).EQ.namei) jm = k
343 DO 196 j = ifirst,ntot
344 IF (name(j).EQ.nameg(jm)) i3hj = j
347 IF (name2.LE.nzero.AND.name(i3hj).LE.nzero)
THEN
350 ELSE IF (name2.LE.nzero.OR.name(i3hj).LE.nzero)
THEN
351 which1 =
' QUINTUPLET'
353 which1 =
' SEXTUPLET '
357 zm3 = (cm(3,jm) + cm(4,jm))*zmbar
358 eb3 = cm(1,jm)*cm(2,jm)*hm(jm)/(cm(1,jm) + cm(2,jm))
359 semi3 = -0.5*(cm(1,jm) + cm(2,jm))/hm(jm)
360 pb3 = days*semi3*sqrt(semi3/(cm(1,jm) + cm(2,jm)))
361 WRITE (6,199) which1, name(2*ipair-1), name(2*ipair),
362 & name(i3hj), zm1, zm2, zm3, eb3, semi3, pb3
363 199
FORMAT (/,a11,
' ESCAPE NM =',3i6,
' M =',3f6.2,
364 &
' EB3 =',f8.4,
' A3 =',1p,e8.1,
' P3 =',e8.1)
369 vi = sqrt(0.5*vi2*zmass/abs(zkin))
370 WRITE (6,200) ipair, name(2*ipair-1), name2,
371 & kstar(2*ipair-1), kstar(2*ipair), kstari,
372 & list(2,2*ipair), body(2*ipair-1)*zmbar,
373 & body(2*ipair)*zmbar, eb, ratio, vi, ecc, ei, pb
374 200
FORMAT (/,
' BINARY ESCAPE KS =',i5,
' NM =',2i6,
375 &
' K* =',4i3,
' M =',2f5.1,
' EB =',f8.4,
376 &
' R*/PM =',f5.2,
' V/<V> =',f5.2,
' E =',f5.2,
377 &
' EI =',f8.5,
' P =',1p,e8.1)
379 WRITE (6,202) ipair, name(2*ipair-1), name(2*ipair),
380 & kstar(2*ipair-1), kstar(2*ipair), kstar(i),
381 & cm(3,im)*smu, cm(4,im)*smu, eb1, ecc, semi, pb
382 202
FORMAT (/,
' QUAD ESCAPE KS =',i5,
' NM =',2i6,
383 &
' K* =',3i3,
' M =',2f5.1,
' EB =',f8.4,
384 &
' E =',f7.3,
' A =',1p,e8.1,
' P =',e8.1)
390 IF (list(2,2*ipair).EQ.-1)
THEN
393 npop(5) = npop(5) + 1
397 npop(6) = npop(6) + 1
410 ifirst = 2*npairs + 1
413 IF (ipair.LE.npairs)
THEN
418 205 kcase = kcase + 1
421 i = 2*ipair + 2 - kcase
431 DO 208 j = ifirst,ntot
432 IF (name(j).EQ.nameg(jm))
THEN
443 IF (namei.GE.0) go to 250
448 IF (namem(k).EQ.namei) im = k
451 IF (im.EQ.0) go to 250
458 DO 215 j = ifirst,ntot
459 IF (name(j).EQ.nameg(im)) i3hi = j
471 IF (namei.LT.-2*nzero)
THEN
473 IF (namem(k).EQ.namei + 2*nzero) jm = k
477 DO 225 j = ifirst,ntot
478 IF (name(j).EQ.nameg(jm)) i3hi = j
492 zmu = cm(1,jm)*cm(2,jm)/(cm(1,jm) + cm(2,jm))
493 IF (min(name1,nameg(jm)).LE.2*nbin0)
THEN
494 e(5) = e(5) + zmu*hm(jm) + deb
496 e(7) = e(7) + zmu*hm(jm) + deb
498 emesc = emesc + zmu*hm(jm)
501 IF (im.EQ.nmerge)
THEN
507 DO 230 j = ifirst,ntot
508 IF (body(j).EQ.0.0d0.AND.name(j).EQ.nameg(im)) jcomp = j
511 IF (jcomp.EQ.-1.AND.i3hi.GT.0)
THEN
512 DO 232 j = ifirst,ntot
513 IF (body(j).EQ.0.0d0.AND.name(j).EQ.nameg(jm)) jcomp = j
522 npop(7) = npop(7) + 1
523 bodycm = cm(1,jm) + cm(2,jm)
524 semi0 = -0.5*bodycm/hm(jm)
525 zmu = cm(1,jm)*cm(2,jm)/bodycm
527 pb = days*semi0*sqrt(semi0/bodycm)
532 zmu2 = cm(1,im)*cm(2,im)/(cm(1,im) + cm(2,im))
535 emerge = emerge - eb2
536 IF (jm.EQ.nmerge) nmerge = nmerge - 1
541 rj = rj + um(k,jm)**2
542 td2 = td2 + 2.0*um(k,jm)*umdot(k,jm)
544 ecc2 = (1.0 - rj/semi0)**2 + td2**2/(bodycm*semi0)
546 pcrit =
stability(cm(1,jm),cm(2,jm),body(jcomp),ecc0,ecc,
550 WRITE (6,240) name1, nameg(jm), kstar1, kstar(jcomp),
551 & kstarm(jm), cm(1,jm)*zmbar, cm(2,jm)*zmbar,
552 & eb, ecc0, pmin/pcrit, semi0, pb
553 240
FORMAT (/,
' HIARCH ESCAPE NM =',2i6,
' K* =',3i3,
554 &
' M =',2f5.1,
' EB =',f8.4,
' E =',f7.3,
555 &
' PM/PC =',1p,e8.1,
' A =',e8.1,
' P =',e8.1)