1 SUBROUTINE nbint(I,IKS,IR,XI,XIDOT)
8 common/chainc/ xc(3,ncmax),uc(3,ncmax),bodyc(ncmax),ich,
10 REAL*8 xi(3),xidot(3),firr(3),freg(3),fd(3),fdum(3),dv(3)
22 IF (step(i).LT.dtmin.AND.i.LE.n)
THEN
30 IF (iks.EQ.0.AND.step(i).LT.8.0*dtmin.AND.tcall.LT.ttot)
THEN
32 IF (i.LE.n.AND.body(i).GT.2.0*bodym.AND.nsub.EQ.0)
THEN
37 CALL
orbit(i,jmin,semi,ecc,gi)
39 eb = -0.5*body(i)*body(jmin)/semi
40 IF (eb.LT.ebh.AND.gi.LT.0.25.AND.jmin.GE.ifirst)
THEN
41 apo = semi*(1.0 + ecc)
43 IF (ecc.LT.0.5.AND.apo.LT.0.02*rs(i))
THEN
50 tcall = ttot - 1.0d-04
67 ri2 = xi(1)**2 + xi(2)**2 + xi(3)**2
68 fij = 0.01*bodym/(ri2*sqrt(ri2))
69 rdot = 3.0*(xi(1)*xidot(1) + xi(2)*xidot(2) +
73 fd(k) = -(xidot(k) - rdot*xi(k))*fij
75 IF (i.GT.n) ipair = i - n
88 IF (list(1,i1).GT.0)
THEN
90 CALL
cmfirr(i,ipair,xi,xidot,firr,fd)
105 25
IF (list(nnb2,i).LE.n) go to 30
107 IF (nnb2.GT.1) go to 25
117 dv(1) = xdot(1,k) - xidot(1)
118 dv(2) = xdot(2,k) - xidot(2)
119 dv(3) = xdot(3,k) - xidot(3)
120 rij2 = a1*a1 + a2*a2 + a3*a3
123 dr3i = body(k)*dr2i*sqrt(dr2i)
124 drdv = 3.0*(a1*dv(1) + a2*dv(2) + a3*dv(3))*dr2i
126 firr(1) = firr(1) + a1*dr3i
127 firr(2) = firr(2) + a2*dr3i
128 firr(3) = firr(3) + a3*dr3i
129 fd(1) = fd(1) + (dv(1) - a1*drdv)*dr3i
130 fd(2) = fd(2) + (dv(2) - a2*drdv)*dr3i
131 fd(3) = fd(3) + (dv(3) - a3*drdv)*dr3i
135 IF (nnb2.EQ.nnb1) go to 60
147 dv(1) = xdot(1,k) - xidot(1)
148 dv(2) = xdot(2,k) - xidot(2)
149 dv(3) = xdot(3,k) - xidot(3)
150 rij2 = a1*a1 + a2*a2 + a3*a3
155 IF (rij2.GT.cmsep2*r(j)**2.OR.list(1,kdum).EQ.0) go to 48
160 45 a1 = x(1,k) - xi(1)
163 dv(1) = xdot(1,k) - xidot(1)
164 dv(2) = xdot(2,k) - xidot(2)
165 dv(3) = xdot(3,k) - xidot(3)
166 rij2 = a1*a1 + a2*a2 + a3*a3
170 dr3i = body(k)*dr2i*sqrt(dr2i)
171 drdv = 3.0*(a1*dv(1) + a2*dv(2) + a3*dv(3))*dr2i
173 firr(1) = firr(1) + a1*dr3i
174 firr(2) = firr(2) + a2*dr3i
175 firr(3) = firr(3) + a3*dr3i
176 fd(1) = fd(1) + (dv(1) - a1*drdv)*dr3i
177 fd(2) = fd(2) + (dv(2) - a2*drdv)*dr3i
178 fd(3) = fd(3) + (dv(3) - a3*drdv)*dr3i
186 60
IF (nch.GT.0)
THEN
188 IF (name(i).EQ.0)
THEN
189 CALL
chfirr(i,0,xi,xidot,firr,fd)
197 CALL
fchain(i,0,xi,xidot,firr,fd)
206 IF (kz(14).GT.0)
THEN
208 freg(k) = fr(k,i) + frdot(k,i)*dt
210 CALL
xtrnlf(xi,xidot,firr,freg,fd,fdum,0)
215 dt6 = 6.0d0/(dt*dtsq)
222 df = fi(k,i) - firr(k)
225 at3 = 2.0d0*df + dt*sum
226 bt2 = -3.0d0*df - dt*(sum + fid)
228 x0(k,i) = xi(k) + (0.6d0*at3 + bt2)*dtsq12
229 x0dot(k,i) = xidot(k) + (0.75d0*at3 + bt2)*dt13
237 fdum(k) = firr(k) + fr(k,i)
241 d2(k,i) = (3.0d0*at3 + bt2)*dt2
247 ttmp =
tstep(fdum,fd,d2(1,i),d3(1,i),etai)
261 IF (ttmp.GT.stepj.AND.n.GT.1000)
THEN
265 dv2 = dv2 + (xdot(k,i) - x0dot(k,i))**2
269 dtj = step(i)*(1.0d-06*step(i)**2*f2/dv2)**0.1
274 IF (ttmp.GT.2.0*step(i))
THEN
275 IF (dmod(time,2.0*step(i)).EQ.0.0d0)
THEN
276 ttmp = min(2.0*step(i),smax)
280 ELSE IF (ttmp.LT.step(i))
THEN
282 IF (ttmp.GT.dt0)
THEN
291 tnew(i) = step(i) + t0(i)
294 IF (iks.GT.0.AND.i.EQ.icomp)
THEN
296 IF (t0(jcomp).EQ.t0(icomp))
THEN
297 icomp = min(icomp,jcomp)
299 ELSE IF (t0(jcomp) + step(jcomp).LT.t0(icomp))
THEN
300 step(icomp) = 0.5d0*step(icomp)
301 tnew(icomp) = step(icomp) + t0(icomp)
313 f(k,i) = 0.5d0*(frdot(k,i)*dtr + fr(k,i) + firr(k))
314 fdot(k,i) = one6*(frdot(k,i) + fd(k))
321 IF (list(1,2*ipair-1).GT.0) nstepb = nstepb + 1