11 IMPLICIT REAL*8 (a-h,m,o-z)
13 common/azreg/ time3,tmax,q(8),p(8),r1,r2,r3,
energy,m(3),x3(3,3),
14 & xdot3(3,3),cm(10),c11,c12,c19,c20,c24,c25,
15 & nstep3,name3(3),kz15,kz27
16 common/close/ rij(4,4),rcoll,qperi,
SIZE(4),ecoll3,ip(4)
17 common/azcoll/ rk(3),qk(8),pk(8),icall,icoll,ndiss3
18 common/bssave/ ep(4),dsc,facm,tfac,itfac,jc
20 common/azconf/ iconf(3)
21 common/clump/ bodys(ncmax,5),t0s(5),ts(5),
steps(5),rmaxs(5),
22 & names(ncmax,5),isys(5)
73 tmax = time3 +
steps(isub)
74 IF (
steps(isub).LE.0.0d0) dtau3 = 0.01*dtau3
124 rgrav = (m(1)*m(2) + m(1)*m(3) + m(2)*m(3))/(0.5d0*abs(
energy))
127 facm = (m(1)*m(2) + m(1)*m(3) + m(2)*m(3))/3.0
130 r1 = q(1)**2 + q(2)**2 + q(3)**2 + q(4)**2
131 r2 = q(5)**2 + q(6)**2 + q(7)**2 + q(8)**2
132 IF (rmaxs(isub).LT.r1 + r2) rmaxs(isub) = r1 + r2
135 rcrit = max(rgrav,sqrt(rgrav*rmaxs(isub)))
138 tcr = (m(1) + m(2) + m(3))**2.5/abs(
energy)**1.5
142 tstar = rmax*sqrt(rmax/cm(7))
151 vp2 = 2.0*(m(im) + m(3))/rm
153 tstar = min(tp,tstar)
156 tpr = r1*r2/sqrt(r1 + r2)
157 dtau3 = min(tcr,tstar)*tol**0.1/tpr
160 vrel2 = (xdot3(1,2) - xdot3(1,3))**2 +
161 & (xdot3(2,2) - xdot3(2,3))**2 +
162 & (xdot3(3,2) - xdot3(3,3))**2
163 eb0 = (0.5d0*vrel2/(m(2) + m(3)) - 1.0/r2)*m(2)*m(3)
173 30 CALL
difsy3(neq,tol,dtau3,tau3,y)
184 r1 = q(1)**2 + q(2)**2 + q(3)**2 + q(4)**2
185 r2 = q(5)**2 + q(6)**2 + q(7)**2 + q(8)**2
188 r3min = min(r3min,r3)
190 r12min = min(r12min,rm)
206 rij(i,j) = min(rij(i,j),rk(kk))
207 rij(j,i) = min(rij(j,i),rk(kk))
212 IF (time3.GT.time0.AND.jc.EQ.0)
THEN
221 IF (icoll.LT.0) icall = 1
222 IF (rm.LT.rstar.AND.nstep3.GT.next)
THEN
223 IF (zmi3.GT.zmi2.AND.zmi2.LT.zmi1)
THEN
229 IF (icoll.LE.0) go to 48
238 r1 = q(1)**2 + q(2)**2 + q(3)**2 + q(4)**2
239 r2 = q(5)**2 + q(6)**2 + q(7)**2 + q(8)**2
247 IF (qperi.LT.4.0*max(
SIZE(im),
SIZE(3)))
THEN
248 IF (qperi.LT.0.75*(
SIZE(im) +
SIZE(3)))
THEN
259 h3 = 0.5d0*
energy + 0.5d0*cm(7)*(cm(4)**2 + cm(5)**2 +
263 CALL
erel3(im,ebs,semi)
264 dminc = min(rcoll,dminc)
277 r1 = q(1)**2 + q(2)**2 + q(3)**2 + q(4)**2
278 r2 = q(5)**2 + q(6)**2 + q(7)**2 + q(8)**2
279 IF (iterm.LT.0) go to 90
286 48
IF (r3.GT.rm) go to 70
290 IF (r2.LT.r1) imin = 2
299 xdot3(k,3) = xdot3(k,imin)
301 xdot3(k,imin) = temp2
311 name3(3) = name3(imin)
314 iconf(3) = iconf(imin)
331 r1 = q(1)**2 + q(2)**2 + q(3)**2 + q(4)**2
332 r2 = q(5)**2 + q(6)**2 + q(7)**2 + q(8)**2
336 70
IF (r3.GT.rmaxs(isub)) go to 90
337 IF (iterm.LT.0) go to 74
340 IF (ndiss3.GT.0)
THEN
342 an = int(nstep3/float(iskip)) - float(nstep3)/float(iskip)
344 IF (abs(an).LT.0.01)
THEN
346 IF (iterm.LT.0) go to 90
351 IF (time3.GT.tmax)
THEN
352 IF (
steps(isub).LE.0.0d0) go to 90
357 IF (r1 + r2 + r3.LT.3.0*rcrit) go to 30
364 IF (r2.LT.r1) imin = 2
368 ridot = x3(1,i)*xdot3(1,i) + x3(2,i)*xdot3(2,i) +
370 IF (ridot.LT.0.0) go to 30
375 ri = sqrt(x3(1,i)**2 + x3(2,i)**2 + x3(3,i)**2)
380 ratio = rgrav/(mb*ri)
381 vcrit2 = 2.0*cm(7)*(1.0/ri + m(3)*m(imin)*ratio**2/(ri - rgrav))
382 IF (ridot**2.LT.vcrit2.OR.ri.LT.rgrav) go to 30
385 74
IF (iterm.LT.0.AND.ndiss3.GT.0)
THEN
392 CALL
erel3(im,ebs,semi)
403 & (x3(k,3) - x3(k,imin))*(xdot3(k,3) - xdot3(k,imin))
404 vrel2 = vrel2 + (xdot3(k,3) - xdot3(k,imin))**2
405 vi2 = vi2 + xdot3(k,i)**2
410 semi1 = 2.0d0/ri - vi2/cm(7)
415 semi = 2.0d0/rb - vrel2/mb
417 e = sqrt((1.0d0 - rb/semi)**2 + rdot**2/(semi*mb))
421 IF (rb.LT.semi.AND.itry.LE.10) go to 30
424 eb = -m(imin)*m(3)/(semi*
energy)
425 et = -m(imin)*m(3)/(2.0*semi*cm(8))
427 gb = 2.0*m(i)/mb*(rb/ri)**3
428 db = (eb*
energy - eb0)/eb0
432 WRITE (6,80) name3(imin), name3(3), mb, semi, e, eb, gb, rb,
434 80
FORMAT (/,
' TRIPLE BINARY ',2i5,
' MB =',f7.4,
' A =',1p,e8.1,
435 &
' E =',0p,f5.2,
' EB =',f5.2,
' GB =',1p,e8.1,
' RB =',e8.1,
436 &
' MI =',0p,f7.4,
' RI =',1p,e8.1,
' ET =',0p,f6.3)
440 IF (
steps(isub).GT.0.0d0)
THEN
450 IF (r2.LT.r1) imin = 2
452 vrel2 = (xdot3(1,imin) - xdot3(1,3))**2 +
453 & (xdot3(2,imin) - xdot3(2,3))**2 +
454 & (xdot3(3,imin) - xdot3(3,3))**2
457 semi = 2.0d0/rb - vrel2/(m(imin) + m(3))
459 eb = -0.5d0*m(imin)*m(3)/semi
463 IF (rb.LT.abs(semi).AND.itry.LE.10)
THEN
468 IF (
steps(isub).GT.0.0d0)
THEN
474 IF (kz15.GT.1.OR.db.GT.0.1)
THEN
478 WRITE (6,95) nreg, r12min, r3min, r3, rgrav, tc, nstep3, db,
480 95
FORMAT (/,
' END TRIPLE NREG =',i3,
' MIN(RB&R3) =',1p,e8.1,
481 & e9.1,
' R3 =',e8.1,
' RG =',e8.1,
' TC =',0p,f5.1,
482 &
' STEPS =',i4,
' DB =',f6.2,
' NMESC =',i5)
495 100
IF (iterm.GE.0) ts(isub) = t0s(isub) + time3