Nbody6
 All Files Functions Variables
cfuncs.f
Go to the documentation of this file.
1  SUBROUTINE cfuncs(Z,C)
2 *
3 *
4 * C-functions for two-body iteration.
5 * -----------------------------------
6 *
7 * Coded by Seppo Mikkola (11/99).
8 * Reference: New Astron. 3, 309, 1998.
9 * ------------------------------------
10 *
11  IMPLICIT REAL*8 (a-h,o-z)
12  parameter(c6=1.d0/6.d0,c132=1.d0/132.d0,c56=1.d0/56.d0,
13  & c30=1.d0/30d0,c24=1.d0/24.d0,c156=1.d0/156.d0,
14  & c90=1.d0/90.d0,c110=1.d0/110.d0,c16=1.d0/16.d0,c8=1.d0/8.d0,
15  & c72=1.d0/72.d0,c42=1.d0/42.d0,c120=1.d0/120.d0,u=1.d0)
16  REAL*8 c(5)
17  data large/0/
18 *
19 *
20 * Reduce the argument by 4 until < 0.07.
21  h=z
22  DO 1 k=0,20
23  kk = k
24  IF (abs(h).lt. 0.07) go to 5
25  h=0.25d0*h
26  1 CONTINUE
27 *
28  if (large.lt.100) then
29  large=large+1
30  WRITE (6,3) large, k, z, h
31  3 FORMAT (' WARNING! CFUNCS # k Z h ',2i4,1p,2e10.2)
32  end if
33 *
34 * Form the two highest c-functions.
35  5 c(4)=(u-h*(u-h*(u-h*c90/(u+h*c132))*c56)*c30)*c24
36  c(5)=(u-h*(u-h*(u-h*c110/(u+h*c156))*c72)*c42)*c120
37 *
38 * Obtain the lower c-function by recursion.
39  DO 4 i=1,kk
40  c3=c6-h*c(5)
41  c2=.5d0-h*c(4)
42  c(5)=(c(5)+c(4)+c2*c3)*c16
43  c(4)=c3*(2.d0-h*c3)*c8
44  h=4.d0*h
45  4 CONTINUE
46 *
47  c(3)=c6-z*c(5)
48  c(2)=.5d0-z*c(4)
49  c(1)=1.d0-z*c(3)
50 *
51  RETURN
52 *
53  END