Nbody6
 All Files Functions Variables
kepler.f
Go to the documentation of this file.
1  SUBROUTINE kepler(I,DTI)
2 *
3 *
4 * Step reduction of hierarchy.
5 * ----------------------------
6 *
7 *
8  include 'common6.h'
9 *
10 *
11 * Only examine hierarchical configurations (NP < 5 OR STEP < DTMIN).
12  i1 = 2*(i - n) - 1
13  IF (list(1,i1).GT.4.AND.dti.GT.dtmin) go to 30
14 *
15 * Set list membership & Kepler period.
16  np1 = list(1,i1) + 1
17  semi = -0.5d0*body(i)/h(i-n)
18  tk = twopi*semi*sqrt(semi/body(i))
19 *
20 * Consider the most dominant perturbers having comparable step to c.m.
21  DO 20 l = 2,np1
22  j = list(l,i1)
23  IF (step(j).GT.4.0*step(i)) go to 20
24  rij2 = (x(1,i) - x(1,j))**2 + (x(2,i) - x(2,j))**2 +
25  & (x(3,i) - x(3,j))**2
26  rij = sqrt(rij2)
27  dt2 = 0.1*rij*sqrt(etai*rij/(body(i) + body(j)))
28  dt = 0.25d0*sqrt(etai)*rij*tk/semi
29 * Compare predicted c.m. step with conservative Kepler expressions.
30  dt = min(dt,dt2)
31  IF (dti.LT.dt) go to 20
32  dti = dt
33 *
34 * Check whether to reduce step of dominant perturber.
35  IF (step(j).LT.dt) go to 20
36  IF (t0(j).EQ.time) THEN
37  step(j) = 0.5d0*step(j)
38  tnew(j) = t0(j) + step(j)
39  go to 20
40  END IF
41  jclose = j
42  20 CONTINUE
43 *
44  30 RETURN
45 *
46  END