Nbody6
 All Files Functions Variables
renew.f
Go to the documentation of this file.
1  SUBROUTINE renew(I)
2 *
3 *
4 * Re-activation of dormant KS binary.
5 * -----------------------------------
6 *
7  include 'common6.h'
8  common/chainc/ xc(3,ncmax),uc(3,ncmax),bodyc(ncmax),ich,
9  & listc(lmax)
10 *
11 *
12 * Restore masses of binary components and initialize time.
13  ipair = i - n
14  i1 = 2*ipair - 1
15  i2 = i1 + 1
16  body(i1) = bodyc(9)
17  body(i2) = bodyc(10)
18  t0(i1) = time
19 *
20 * Specify semi-major axis and Kepler period.
21  semi = -0.5d0*body(i)/h(ipair)
22  tk = twopi*semi*sqrt(semi/body(i))
23 *
24 * Estimate consistent unperturbed interval.
25  ip = ipair
26  CALL tpert(ipair,gmin,dt)
27  ipair = ip
28 *
29 * Specify unperturbed motion (subject to DT > 0).
30  k = 1 + int(0.5d0*dt/tk)
31  k = max(k,1)
32  step(i1) = float(k)*tk
33 *
34 * Obtain coordinates & velocities of unperturbed binary.
35  CALL resolv(ipair,1)
36 *
37 * Copy global indices of all chain members to JPERT for routine NBPOT.
38  DO 1 l = 1,nch
39  jpert(l) = jlist(l)
40  1 CONTINUE
41 *
42 * Evaluate potential energy with respect to inner components.
43  jlist(1) = i1
44  jlist(2) = i2
45  CALL nbpot(2,nch,pot1)
46 *
47 * Include interaction of inner c.m. & other members to give net effect.
48  jlist(1) = i
49  CALL nbpot(1,nch,pot2)
50  dphi = pot1 - pot2
51 *
52 * Form new KS polynomials if nearest perturber is significant (> GMIN).
53  IF (dt.LT.0.0) THEN
54  CALL kslist(ipair)
55  CALL kspoly(ipair,1)
56  END IF
57 *
58 * Subtract binding energy from temporary save in ECOLL.
59  eb = body(i1)*body(i2)*h(ipair)/body(i)
60  ecoll = ecoll - eb + dphi
61 *
62  IF (kz(30).GT.1) THEN
63  WRITE (6,5) ipair, eb, r(ipair), gamma(ipair), dphi, k
64  5 FORMAT (' RENEW: KS =',i3,' EB =',f8.2,' R =',1p,e8.1,
65  & ' G =',e8.1,' DPHI =',e8.1,' DT/TK =',0p,i4)
66  END IF
67 *
68  RETURN
69 *
70  END