Nbody6
 All Files Functions Variables
fclose.f
Go to the documentation of this file.
1  SUBROUTINE fclose(I,NNB)
2 *
3 *
4 * Force & first derivative from close bodies.
5 * -------------------------------------------
6 *
7  include 'common6.h'
8  REAL*8 a(9)
9 *
10 *
11 * Initialize F & FDOT for body #I.
12  DO 10 k = 1,3
13  f(k,i) = 0.0d0
14  fdot(k,i) = 0.0d0
15  10 CONTINUE
16 *
17 * Obtain F & FDOT due to NNB members of JLIST.
18  DO 50 l = 1,nnb
19  j = jlist(l)
20  IF (j.EQ.i) go to 50
21 *
22  rij2 = 0.0d0
23  rijdot = 0.0d0
24  DO 20 k = 1,3
25  a(k) = x(k,j) - x(k,i)
26  a(k+3) = xdot(k,j) - xdot(k,i)
27  rij2 = rij2 + a(k)**2
28  rijdot = rijdot + a(k)*a(k+3)
29  20 CONTINUE
30  a(8) = body(j)/(rij2*sqrt(rij2))
31  a(9) = 3.0*rijdot/rij2
32 *
33 * Set approximate F & FDOT to be used by body #I in FPOLY2.
34  DO 30 k = 1,3
35  f(k,i) = f(k,i) + a(k)*a(8)
36  fdot(k,i) = fdot(k,i) + (a(k+3) - a(k)*a(9))*a(8)
37  30 CONTINUE
38  50 CONTINUE
39 *
40 * Initialize time of last force (prevents prediction in FPOLY2).
41  t0(i) = time
42 *
43  RETURN
44 *
45  END