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)
12 REAL*8 xx(3,3),vv(3,3)
20 e1 = body(2*ipair-1)*body(2*ipair)*h(ipair)/body(i)
23 semi1 = -0.5*body(i)/h(ipair)
24 ecc2 = (1.0 - r1/semi1)**2 + tdot2(ipair)**2/(body(i)*semi1)
30 IF (namem(k).EQ.name(i)) imerge = k
34 IF (nameg(imerge).GT.nzero)
THEN
37 ri2 = ri2 + (x(k,i) - rdens(k))**2
40 pmin = semi1*(1.0 - ecc)
41 eb = 0.5*body(2*ipair-1)*body(2*ipair)/semi1
42 eb = eb*float(n-npairs)/zkin
44 which1 =
' QUINTUPLET'
48 IF (namem(k).EQ.name(i) + 2*nzero) jm = k
52 IF (name(j).EQ.nameg(jm)) jg = j
54 IF (jg.GT.n) which1 =
' SEXTUPLET '
55 WRITE (6,5) which1, time+toff, zm, name(2*ipair-1),
56 & name(2*ipair), nameg(imerge), ri, ecc, eb, semi1,
58 5
FORMAT (
' END',a11,
' T MT NM1 NM2 NM3 RI E1 EB1 A1 PM G1 ',
59 & f9.2,f6.2,3i6,2f6.2,f6.1,1p,3e10.2)
63 IF (nameg(imerge).GT.0.AND.nameg(imerge).LE.nzero)
THEN
68 IF (name(i2).LE.nzero)
THEN
69 WRITE (6,9) time+toff, zm, name(i1), name(i2), name(jg),
71 9
FORMAT (/,
' END QUARTET T MT NM1 NMG NM3 E1 A1 R1 G1 ',
72 & f9.2,f6.2,3i6,f6.2,1p,3e10.2)
74 WRITE (6,11) time+toff, zm, name(i1), name(i2), name(jg),
76 11
FORMAT (/,
' END QUINTUP2 T MT NM1 NMG NM3 E1 A1 R1 G1',
77 & f10.2,f6.2,3i6,f6.2,1p,3e10.2)
82 IF (nameg(imerge).LT.0)
THEN
91 IF (namem(k).EQ.name(i) + 2*nzero) im = k
92 IF (namem(k).EQ.nameg(jg)) jm = k
94 ai = -0.5*(cm(1,im) + cm(2,im))/hm(im)
95 aj = -0.5*(cm(1,jm) + cm(2,jm))/hm(jm)
96 pmin = semi1*(1.0 - ecc)
98 WRITE (6,18) time+toff, zm, name(i1), nameg(im), -namem(jm),
99 & nameg(jm), ecc, ai, aj, r(ipair), semi1, pmin,
101 18
FORMAT (/,
' END HITRIP T MT NM E1 AI AJ R1 A1 PM G1 ',
102 & f9.2,f6.2,4i6,f6.2,1p,6e10.2)
106 IF ((kz(18).EQ.1.OR.kz(18).EQ.3).AND.kstar(imerge).LE.20)
THEN
132 body(i) = body(icomp)
135 xdot(k,i) = xdot(k,icomp)
136 x0dot(k,i) = xdot(k,icomp)
144 CALL
nbpot(1,nnb,pot1)
150 IF (body(i).EQ.0.0d0.AND.name(i).EQ.nameg(imerge)) jcomp1 = i
154 IF (jcomp.EQ.jcomp1)
THEN
155 WRITE (6,12) imerge, nameg(imerge), jcomp
156 12
FORMAT (/,5x,
'WARNING! RESET2 JCOMP NOT IDENTIFIED ',
157 &
' IM =',i3,
' NAMEG =',i6,
' JCOMP =',i6)
169 xdot(k,j1) = xdot(k,j)
170 x0dot(k,j1) = xdot(k,j)
179 body(icomp) = cm(1,imerge)
180 body(jcomp) = cm(2,imerge)
181 zm = -body(icomp)/(body(icomp) + body(jcomp))
187 x(k,i) = x(k,icomp) + zm*xrel(k,imerge)
188 x0dot(k,i) = x0dot(k,icomp) + zm*vrel(k,imerge)
189 xdot(k,i) = x0dot(k,i)
193 zm = body(jcomp)/(body(icomp) + body(jcomp))
200 h(ipair) = hm(imerge)
204 u(k,ipair) = um(k,imerge)
205 u0(k,ipair) = u(k,ipair)
206 udot(k,ipair) = umdot(k,imerge)
207 r(ipair) = r(ipair) + u(k,ipair)**2
228 CALL
fpoly1(jcomp1,jcomp1,0)
229 CALL
fpoly2(jcomp1,jcomp1,0)
235 name(icm) = name(icm) + 2*nzero
240 IF (namem(k).EQ.name(icm)) im = k
251 vv(k,3) = xdot(k,jcomp)
252 rv = rv + xrel(k,im)*vrel(k,im)
254 CALL
inclin(xx,vv,x(1,icm),xdot(1,icm),angle)
257 semi0 = -0.5*body(icomp)/hm(im)
258 semi = -0.5*body(icm)/h(ipair)
259 ecc2 = (1.0 - r(ipair)/semi)**2 + tdot2(ipair)**2/(body(icm)*semi)
262 rin = sqrt(xrel(1,im)**2 + xrel(2,im)**2 + xrel(3,im)**2)
263 ecc2 = (1.0 - rin/semi0)**2 + rv**2/(body(icomp)*semi0)
267 IF (ecc1.LT.1.0)
THEN
268 nst = nstab(semi0,semi,ecc,ecc1,angle,cm(1,imerge),
269 & cm(2,imerge),body(jcomp))
271 pcrit = 0.98*semi*(1.0 - ecc1)
272 pcr =
stability(cm(1,imerge),cm(2,imerge),body(jcomp),
273 & ecc,ecc1,angle)*semi0
275 IF (istab.LT.50)
THEN
276 WRITE (6,41) ecc, ecc1, semi0, semi, pcrit, pcr
277 41
FORMAT (
' STABLE2 E E1 A A1 PCR PC99 ',
281 pcrit = 1.02*semi*(1.0 - ecc1)
284 pcrit =
stability(cm(1,imerge),cm(2,imerge),body(jcomp),
285 & ecc,ecc1,angle)*semi0
292 nnb1 = list(1,icm) + 1
298 rij2 = rij2 + (x(k,icm) - x(k,j))**2
300 IF (rij2.LT.rs2.AND.j.NE.jcomp1.AND.j.LE.n)
THEN
303 x0dot(k,j) = xdot(k,j)
314 kstar(icm) = kstarm(imerge)
319 IF (jcomp1.LE.n) go to 50
323 body(2*jpair-1) = cm(3,imerge)
324 body(2*jpair) = cm(4,imerge)
327 IF (kz(19).GE.3)
THEN
328 IF (kstar(jcomp1).GT.0.AND.kstar(jcomp1).LE.10)
THEN
330 tev(jcomp1) = time + dtr
331 tmdot = min(tev(jcomp1),tmdot)
332 tmdot = min(tev(2*jpair),tmdot)
344 jlist(1) = 2*jpair - 1
346 CALL
nbpot(2,nnb,pot3)
348 CALL
nbpot(1,nnb,pot4)
351 eb2 = body(2*jpair-1)*body(2*jpair)*h(jpair)/body(jcomp1)
352 emerge = emerge - eb2
357 IF (kz(15).GT.1)
THEN
358 WRITE (6,48) jpair, h(jpair), body(2*jpair-1),
359 & body(2*jpair), e2, eb2, r(jpair), gamma(jpair),
361 48
FORMAT (
' END OUTER MERGER',i5,
' H =',f7.1,
' M =',2f7.4,
362 &
' E1 =',f6.3,
' EB2 =',f6.3,
' RB2 =',1pe8.1,
363 &
' G2 =',e8.1,
' DP =',e8.1)
369 CALL
nbpot(2,nnb,pot2)
373 dphi = (pot2 - pot1) + (pot4 - pot3)
383 eb = body(2*ipair-1)*body(2*ipair)*h(ipair)/body(icm)
384 emerge = emerge - eb + dphi
388 IF (kz(15).GT.1)
THEN
389 WRITE (6,65) imerge, time+toff, body(2*ipair-1),
390 & body(2*ipair), r1, semi1, eb, e1,
391 & gamma(ipair), g1, nnb-1
392 65
FORMAT (
' END MERGE2',i3,
' T =',f8.2,
' M =',2f7.4,
393 &
' R1 =',1pe8.1,
' A1 =',e8.1,
' EB =',0pf6.3,
394 &
' E1 =',f6.3,
' GB =',1pe8.1,
' G =',0pf6.3,
399 IF (kstar(icm).GT.0.AND.kstar(icm).LE.10)
THEN
402 tev(icm) = min(tev(icm),time + dtr)
403 tmdot = min(tev(icm),tmdot)
407 70 nmerge = nmerge - 1
408 DO 80 l = imerge,nmerge
413 kstarm(l) = kstarm(l1)
415 xrel(k,l) = xrel(k,l1)
416 vrel(k,l) = vrel(k,l1)
421 umdot(k,l) = umdot(k,l1)
428 IF (namem(l).EQ.name(n+j).OR.
429 & namem(l).EQ.name(n+j) + 2*nzero.OR.
430 & namem(l).EQ.name(n+j) + 4*nzero) go to 90