Nbody6
 All Files Functions Variables
tchain.f
Go to the documentation of this file.
1  SUBROUTINE tchain(ISUB,TSMIN)
2 *
3 *
4 * Time interval for next chain perturber or c.m.
5 * ----------------------------------------------
6 *
7  include 'common6.h'
8  common/chainc/ xc(3,ncmax),uc(3,ncmax),bodyc(ncmax),ich,
9  & listc(lmax)
10  common/clump/ bodys(ncmax,5),t0s(5),ts(5),steps(5),rmaxs(5),
11  & names(ncmax,5),isys(5)
12 *
13 *
14 * Include chain c.m. in time-step search.
15  npc = listc(1) + 2
16  listc(npc) = ich
17  tsmin = 100.0
18  timec = ts(isub)
19 *
20 * Determine time of next chain perturber or c.m. itself.
21  DO 10 l = 2,npc
22  j = listc(l)
23  tsj = t0(j) + step(j)
24  tsmin = min(tsmin,tsj - timec)
25  10 CONTINUE
26 *
27 * Impose half curent step as minimum time interval.
28  tsmin = max(tsmin,0.5d0*step(ich))
29 *
30 * Include safety check for large c.m. step (TPREV = TBLOCK first time).
31  IF (tblock.GT.tprev) THEN
32  tsmin = min(tsmin,tblock - tprev)
33  ELSE
34  tsmin = min(tsmin,dtmin)
35  END IF
36 *
37 * Specify next interval unless termination.
38  IF (steps(isub).GT.0.0d0) THEN
39  steps(isub) = tsmin
40  END IF
41 *
42  RETURN
43 *
44  END