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)
19 IF (name(i).LT.-2*nzero)
THEN
24 e1 = body(2*ipair-1)*body(2*ipair)*h(ipair)/body(i)
27 semi1 = -0.5*body(i)/h(ipair)
32 IF (namem(k).EQ.name(i)) imerge = k
36 IF ((kz(18).EQ.1.OR.kz(18).EQ.3).AND.kstarm(imerge).LE.20)
THEN
45 IF (j.LE.2*npairs.AND.j.GT.2*ipair) j = j - 2
53 name(i) = nzero - name(i)
70 CALL
nbpot(1,nnb,pot1)
77 rij2 = (x(1,j) - x(1,icomp))**2 + (x(2,j) - x(2,icomp))**2 +
78 & (x(3,j) - x(3,icomp))**2
80 IF (rij2.LT.rjmin2.AND.j.NE.jcomp)
THEN
94 IF (body(i).EQ.0.0d0.AND.name(i).EQ.nameg(imerge)) jcomp = i
98 IF (jcomp.EQ.jcomp1)
THEN
99 WRITE (6,12) nameg(imerge)
100 12
FORMAT (/,5x,
'DANGER! JCOMP NOT IDENTIFIED IN RESET',
106 body(icomp) = cm(1,imerge)
107 body(jcomp) = cm(2,imerge)
108 zm = -body(icomp)/(body(icomp) + body(jcomp))
114 x(k,i) = x(k,icomp) + zm*xrel(k,imerge)
115 x0dot(k,i) = x0dot(k,icomp) + zm*vrel(k,imerge)
116 xdot(k,i) = x0dot(k,i)
120 zm = body(jcomp)/(body(icomp) + body(jcomp))
131 IF (list(l,i).GT.icomp) go to 30
135 IF (list(k,i).EQ.jcomp) go to 30
154 CALL
fpoly1(jcomp1,jcomp1,0)
155 CALL
fpoly2(jcomp1,jcomp1,0)
166 u(k,jp1) = um(k,imerge)
168 udot(k,jp1) = umdot(k,imerge)
169 r(jp1) = r(jp1) + u(k,jp1)**2
177 kstar(n+npairs) = kstarm(imerge)
182 IF (jcomp1.LE.n) go to 50
186 body(2*jpair-1) = cm(3,imerge)
187 body(2*jpair) = cm(4,imerge)
190 IF (kz(19).GE.3)
THEN
192 IF (tev(2*jpair-1).LT.time + 0.01*tcr) tev(2*jpair-1) = time
193 IF (tev(2*jpair).LT.time + 0.01*tcr) tev(2*jpair) = time
194 IF (kstar(jcomp1).GT.0.AND.kstar(jcomp1).LE.10)
THEN
196 tev(jcomp1) = time + dtr
197 tmdot = min(tev(jcomp1),tmdot)
198 tmdot = min(tev(2*jpair),tmdot)
210 jlist(1) = 2*jpair - 1
213 CALL
nbpot(2,nnb,pot3)
215 CALL
nbpot(1,nnb,pot4)
218 eb2 = body(2*jpair-1)*body(2*jpair)*h(jpair)/body(jcomp1)
219 emerge = emerge - eb2
224 IF (kz(15).GT.1)
THEN
225 WRITE (6,45) jpair, h(jpair), body(2*jpair-1),
226 & body(2*jpair), e2, eb2, r(jpair), gamma(jpair),
228 45
FORMAT (
' END QUAD',i4,
' H =',f7.1,
' M =',2f7.4,
229 &
' E1 =',f6.3,
' EB2 =',f6.3,
' RB2 =',1pe8.1,
230 &
' G2 =',e8.1,
' DP =',e8.1)
236 CALL
nbpot(2,nnb,pot2)
240 dphi = (pot2 - pot1) + (pot4 - pot3)
250 eb = body(2*npairs-1)*body(2*npairs)*h(npairs)/body(ntot)
252 emerge = emerge - eb + dphi
256 IF (kz(15).GT.1)
THEN
257 WRITE (6,65) imerge, time+toff, body(2*npairs-1),
258 & body(2*npairs), r1, semi1, eb, e1,
259 & gamma(npairs), g1, nnb
260 65
FORMAT (
' END MERGER',i3,
' T =',f8.2,
' M =',2f7.4,
261 &
' R1 =',1pe8.1,
' A1 =',e8.1,
' EB =',0pf6.3,
262 &
' E1 =',f6.3,
' GB =',1pe8.1,
' G =',0pf6.3,
267 IF (kstar(ntot).GE.10.AND.kstar(ntot).LE.20)
THEN
269 IF (tev(2*npairs-1).LT.time + 0.01*tcr) tev(2*npairs-1) = time
272 tev(ntot) = time + max(dtr,0.0d0)
273 tmdot = min(tev(ntot),tev(icomp),tmdot)
277 70 nmerge = nmerge - 1
278 DO 80 l = imerge,nmerge
283 kstarm(l) = kstarm(l1)
285 xrel(k,l) = xrel(k,l1)
286 vrel(k,l) = vrel(k,l1)
291 umdot(k,l) = umdot(k,l1)
298 IF (namem(l).EQ.name(n+j).OR.
299 & namem(l).EQ.name(n+j) + 2*nzero.OR.
300 & namem(l).EQ.name(n+j) + 4*nzero) go to 90
309 IF (name(i).LT.0)
THEN
311 IF (namem(l).EQ.name(i)) go to 96
313 WRITE (6,95) i, name(i), (namem(l),l=1,nmerge)
314 95
FORMAT (
' DANGER! RESET I NAMI NAMEM ',10i6)
320 IF (nmerge.EQ.0)
THEN
321 be(3) = be(3) - emerge