11 IMPLICIT REAL*8 (a-h,o-z)
13 REAL*8 m,mij,mb,mb1,savex(12),savexd(12)
14 LOGICAL switch,gtype,gtype0
15 common/creg/ m(4),x(12),xd(12),p(12),q(12),time4,
energy,epsr2,
16 &
xr(9),w(9),r(6),ta(6),mij(6),cm(10),rmax4,tmax,
17 & ds,
tstep,eps,nstep4,name4(4),kz15,kz27,nreg,nfn
18 common/tpr/
switch,gtype,gtype0
19 common/config/ r2(4,4),i1,i2,i3,i4
20 common/close/ rij(4,4),rcoll,qperi,
SIZE(4),ecoll3,ip(4)
21 common/ccoll/ qk(12),pk(12),icall,icoll,ndiss4
22 common/bssave/ ep(4),dsc,facm,tfac,itfac,jc
25 common/clump/ bodys(ncmax,5),t0s(5),ts(5),
steps(5),rmaxs(5),
26 & names(ncmax,5),isys(5)
74 tmax = time4 +
steps(isub)
75 IF (
steps(isub).LE.0.0d0) ds = 0.01*ds
117 rgrav = (mij(1) + mij(2) + mij(3) + mij(4) + mij(5) + mij(6))/
119 facm = rgrav*abs(
energy)/6.0
121 epsr2 = (0.2*rgrav)**2
124 rmax = max(sqrt(r2(i1,i3)),sqrt(r2(i2,i4)))
125 rmax4 = max(rmaxs(isub),1.2*rmax)
128 tcr = (m(1) + m(2) + m(3) + m(4))**2.5/abs(2.0d0*
energy)**1.5
131 tstar = rmax*sqrt(rmax/cm(7))
135 vp2 = 2.0*(m(i1) + m(i2))/rm
137 tstar = min(tp,tstar)
140 tstep = min(tcr,tstar)*eps**0.1
143 ds =
tstep/(r(1)*r(2)*r(3))
153 vrel2 = vrel2 + (xd(j1) - xd(j2))**2
154 vrel21 = vrel21 + (xd(j3) - xd(j4))**2
156 eb0 = 2.0d0/sqrt(r2(i1,i2)) - vrel2/(m(i1) + m(i2))
157 eb10 = 2.0d0/sqrt(r2(i3,i4)) - vrel21/(m(i3) + m(i4))
158 eb0 = -0.5d0*m(i1)*m(i2)*eb0/
energy
159 eb10 = -0.5d0*m(i3)*m(i4)*eb10/
energy
165 IF (time4.GT.tmax)
THEN
166 IF (
steps(isub).GT.0.0d0) go to 100
172 CALL
status(x,j1,j2,j3,j4)
183 IF (icoll.LE.0) go to 40
201 IF (qperi.LT.4.0*max(
SIZE(k1),
SIZE(k2)))
THEN
202 IF (qperi.LT.0.75*(
SIZE(k1) +
SIZE(k2)))
THEN
210 h4 =
energy + 0.5d0*cm(7)*(cm(4)**2 + cm(5)**2 + cm(6)**2)
213 CALL
erel4(im,ebs,semi)
214 dminc = min(rcoll,dminc)
227 IF (iterm.EQ.-1) go to 100
242 vrel2 = vrel2 + (xd(j1) - xd(j2))**2
243 vrel21 = vrel21 + (xd(j3) - xd(j4))**2
244 rdot = rdot + (x(j1) - x(j2))*(xd(j1) - xd(j2))
249 rb1 = sqrt(r2(i3,i4))
250 r13 = sqrt(r2(i1,i3))
251 r24 = sqrt(r2(i2,i4))
253 semi = 2.0d0/rb - vrel2/mb
255 ecc = sqrt((1.0d0 - rb/semi)**2 + rdot**2/(semi*mb))
256 eb = -m(i1)*m(i2)/(2.0d0*semi*
energy)
257 et = -m(i1)*m(i2)/(2.0d0*semi*cm(8))
259 semi1 = 2.0d0/rb1 - vrel21/mb1
261 eb1 = -m(i3)*m(i4)/(2.0d0*semi1*
energy)
263 e1 = (1.0 - eb - eb1)/eb0
279 gb = 2.0*mb1/mb*(rb/rm)**3
280 IF (eb1.LT.0.0) gb = gb*m(im)/mb1
281 g4 = 2.0*m(imax)/(mb + m(im))*(rm/rmax)**3
283 IF (itry.LT.0) go to 70
287 IF (rm/semi.LT.ratio) go to 60
288 IF (rb.LT.semi.OR.rb1.LT.semi1) go to 60
292 60
IF (ratio.LT.5.0.AND.itry.LE.5.
293 & or.ratio.LT.3.0.AND.itry.LE.10)
THEN
297 IF (isave.EQ.itry) go to 70
310 70
IF (
steps(isub).GT.0.0d0)
THEN
317 WRITE (6,80) mb, semi, ecc, eb, gb, g4, rb1, eb1, e1, et
318 80
FORMAT (/,
' QUAD BINARY',
' MB =',f7.4,
' A =',1p,e8.1,
319 &
' E =',0p,f5.2,
' EB =',f7.4,
' GB =',1p,e8.1,
' G4 =',e8.1,
320 &
' RB1 =',e8.1,
' EB1 =',0p,f5.2,
' E1 =',f5.2,
' ET =',f6.3)
327 WRITE (6,90) i1, i2, i3, i4, rb, r13, r24, rgrav, tc, nstep4,
329 90
FORMAT (/,
' END QUAD ',4i3,
' RB =',1p,e8.1,
' R13 =',e8.1,
330 &
' R24 =',e8.1,
' RG =',e8.1,
' TC =',0p,f5.1,
' #',
331 & i5,i4,
' DB =',f5.2,
' EC =',f6.3)
335 cm(9) = (eb - eb0 - eb10)*
energy
336 IF (eb1.GT.0.0) cm(9) = cm(9) + eb1*
energy
345 100
IF (iterm.GE.0) ts(isub) = t0s(isub) + time4