8 common/clump/ bodys(ncmax,5),t0s(5),ts(5),
steps(5),rmaxs(5),
9 & names(ncmax,5),isys(5)
10 common/chainc/ xc(3,ncmax),uc(3,ncmax),bodyc(ncmax),ich,
13 INTEGER nxtlst(nmax),ibl(lmax),
nblist(nmax),listq(nmax),nl(20)
15 SAVE iq,icall,nq,lq,loop,lstepm,stepm,isave,jsave
16 DATA iq,icall,lq,loop,lstepm,stepm /0,2,11,.true.,.false.,0.03125/
20 IF (iphase.NE.1.AND.iphase.NE.2) loop = .true.
23 IF (.NOT.lstepm.AND.nzero.GT.1024)
THEN
24 k = (float(nzero)/1024.0)**0.333333
25 stepm = 0.03125d0/2**(k-1)
30 999
IF (kz(37).GT.0.AND.(iphase.EQ.-1.OR.iphase.GE.2))
THEN
40 DO 1000 i = ifirst,ntot
41 tnew(i) = t0(i) + step(i)
42 dtm = min(dtm,step(i))
48 IF (dtm.EQ.dtk(l))
THEN
55 IF (iq.LT.0) icall = 0
63 IF (time.GE.tlistq.OR.icall.LE.3)
THEN
65 IF (dmod(tlistq,2.0d0).EQ.0.0d0.OR.loop)
THEN
73 IF (step(i).LT.dtk(l)) nl(l) = nl(l) + 1
78 nsq = sqrt(float(n - npairs))
82 IF (nlsum.LE.nsq) lq = l
92 18 tlistq = tlistq + dtk(lq)
94 IF (tnew(i).LE.tlistq)
THEN
97 tmin = min(tnew(i),tmin)
101 IF (nq.EQ.0) go to 18
103 IF (lq.LE.15.AND.nq.LE.2) lq = lq - 1
107 CALL
inext(nq,listq,tmin,nxtlen,nxtlst)
111 time = t0(i) + step(i)
124 IF (time.GT.tlistq) go to 1
127 IF (kz(13).GT.0)
THEN
132 IF (kz(14).EQ.3.OR.kz(14).EQ.4)
THEN
133 IF (kz(14).EQ.3.AND.dmod(time,stepx).EQ.0.0d0)
THEN
137 IF (mpdot.GT.0.0d0.AND.time + toff.GT.tdelay)
THEN
139 mp = mp0/(1.0 + mpdot*(time + toff - tdelay))
145 emdot = emdot + (phi1 - phi2)
168 IF (time.GT.tadj)
THEN
175 IF (time.GT.tnext)
THEN
182 IF (time.GT.tprev)
THEN
184 IF (iq.LT.0) go to 999
189 IF (nxtlen.LE.10)
THEN
192 IF (tnew(j).GE.t0r(j) + stepr(j))
THEN
199 IF (nxtlen.LE.10.AND.ir.EQ.0)
THEN
210 nbpred = nbpred + nnb
216 x(1,j) = ((fdot(1,j)*s + f(1,j))*s +x0dot(1,j))*s +x0(1,j)
217 x(2,j) = ((fdot(2,j)*s + f(2,j))*s +x0dot(2,j))*s +x0(2,j)
218 x(3,j) = ((fdot(3,j)*s + f(3,j))*s +x0dot(3,j))*s +x0(3,j)
219 xdot(1,j) = (fdot(1,j)*s1 + f(1,j))*s2 + x0dot(1,j)
220 xdot(2,j) = (fdot(2,j)*s1 + f(2,j))*s2 + x0dot(2,j)
221 xdot(3,j) = (fdot(3,j)*s1 + f(3,j))*s2 + x0dot(3,j)
225 IF (tnew(ich).GT.tblock)
THEN
232 DO 40 j = ifirst,ntot
233 IF (body(j).EQ.0.0d0) go to 40
237 x(1,j) = ((fdot(1,j)*s + f(1,j))*s +x0dot(1,j))*s +x0(1,j)
238 x(2,j) = ((fdot(2,j)*s + f(2,j))*s +x0dot(2,j))*s +x0(2,j)
239 x(3,j) = ((fdot(3,j)*s + f(3,j))*s +x0dot(3,j))*s +x0(3,j)
240 xdot(1,j) = (fdot(1,j)*s1 + f(1,j))*s2 + x0dot(1,j)
241 xdot(2,j) = (fdot(2,j)*s1 + f(2,j))*s2 + x0dot(2,j)
242 xdot(3,j) = (fdot(3,j)*s1 + f(3,j))*s2 + x0dot(3,j)
248 DO 45 jpair = 1,npairs
250 IF (list(1,jj).GT.0)
THEN
257 x(1,j) = ((fdot(1,j)*s + f(1,j))*s +x0dot(1,j))*s +x0(1,j)
258 x(2,j) = ((fdot(2,j)*s + f(2,j))*s +x0dot(2,j))*s +x0(2,j)
259 x(3,j) = ((fdot(3,j)*s + f(3,j))*s +x0dot(3,j))*s +x0(3,j)
260 xdot(1,j) = (fdot(1,j)*s1 + f(1,j))*s2 + x0dot(1,j)
261 xdot(2,j) = (fdot(2,j)*s1 + f(2,j))*s2 + x0dot(2,j)
262 xdot(3,j) = (fdot(3,j)*s1 + f(3,j))*s2 + x0dot(3,j)
266 IF (gamma(jpair).GT.1.0d-04) zz = 0.0
267 CALL
ksres2(jpair,j1,j2,zz)
283 IF (li.GT.nxtlen) go to 1
285 time = t0(i) + step(i)
288 IF (t0r(i) + stepr(i).LE.time)
THEN
296 CALL
nbint(i,iks,ir,xi,xidot)
299 IF (iks0.EQ.0.AND.iks.GT.0)
THEN
311 tmin = min(tnew(i),tmin)
314 IF (li.EQ.nxtlen)
THEN
319 xdot(k,i) = x0dot(k,i)
326 IF (dmod(time,0.25d0).EQ.0.0d0)
THEN
327 DO 65 j = itail0,nttot
328 IF (tnew(j).LE.time)
THEN
342 IF (iq.GE.4.AND.iq.NE.7)
THEN
353 IF (kz(37).GT.0.AND.listv(1).GT.0)
THEN
354 IF (dmod(time,stepm).EQ.0.0d0)
THEN
356 IF (listv(1).GT.0)
THEN
363 IF (kz(19).GT.0)
THEN
365 IF (time.GT.tmdot.AND.dmod(time,stepx).EQ.0.0d0)
THEN
366 IF (kz(19).GE.3)
THEN
371 IF (iphase.LT.0) go to 999
377 IF (ntimer.LT.nmax) go to 50
380 nsteps = nsteps + nmax
382 IF (nsteps.GE.100*nmax.AND.nsub.EQ.0)
THEN
384 IF (kz(1).GT.1) CALL
mydump(1,1)
388 IF (kz(4).GT.0.AND.time - tlasts.GT.deltas)
THEN
393 OPEN (99,file=
'STOP',
status=
'OLD',form=
'FORMATTED',iostat=io)
396 IF (nsub.EQ.0)
WRITE (6,70)
397 70
FORMAT (/,9x,
'TERMINATION BY MANUAL INTERVENTION')
403 IF (tcomp.LT.cpu) go to 50
417 cputot = cputot + tcomp - cpu0
419 WRITE (6,80) time+toff, tcomp, cputot/60.0, errtot, detot
420 80
FORMAT (/,9x,
'COMMON SAVED AT TIME =',f8.2,
' TCOMP =',f7.1,
421 &
' CPUTOT =',f6.1,
' ERRTOT =',f10.6,
428 100 ttot = time + toff