Nbody6
deform2.f
Go to the documentation of this file.
1  SUBROUTINE deform2(IPAIR,ECC0,ECC)
2 *
3 *
4 * Deformation of elliptic orbit.
5 * ------------------------------
6 *
7  include 'common6.h'
8 *
9 *
10 * Evaluate square regularized velocity.
11  v20 = 0.0
12  DO 10 k = 1,4
13  v20 = v20 + udot(k,ipair)**2
14  10 CONTINUE
15 *
16 * Form KS coordinate & velocity scaling factors at peri or apocentre.
17  i = n + ipair
18  semi = -0.5*body(i)/h(ipair)
19  IF (r(ipair).LT.semi) THEN
20  efac = (1.0 - ecc)/(1.0 - ecc0)
21  rnew = semi*(1.0 - ecc)
22  ELSE
23  efac = (1.0 + ecc)/(1.0 + ecc0)
24  rnew = semi*(1.0 + ecc)
25  rnew = efac*r(ipair)
26  END IF
27  c1 = sqrt(efac)
28  v2 = 0.5*(body(i) + h(ipair)*rnew)
29  IF(v2.LE.0.d0)THEN
30  c2 = 1.0d-06
31  ELSE
32  c2 = sqrt(v2/v20)
33  ENDIF
34 *
35 * Re-scale KS variables at constant energy to new eccentricity (ECC).
36  r(ipair) = 0.0d0
37 * Retain sign of radial velocity for unperturbed KS (apo or peri).
38  tdot2(ipair) = 0.0d0
39  DO 20 k = 1,4
40  u(k,ipair) = c1*u(k,ipair)
41  udot(k,ipair) = c2*udot(k,ipair)
42  u0(k,ipair) = u(k,ipair)
43  r(ipair) = r(ipair) + u(k,ipair)**2
44  tdot2(ipair) = tdot2(ipair) + 2.0*u(k,ipair)*udot(k,ipair)
45  20 CONTINUE
46 *
47  RETURN
48 *
49  END