Nbody6
Main Page
Files
File List
File Members
All
Files
Functions
Variables
poti.f
Go to the documentation of this file.
1
***
2
SUBROUTINE
poti
(I,POTJ)
3
*
4
*
5
* Potential of one particle.
6
* --------------------------
7
*
8
include
'common6.h'
9
*
10
*
11
* Obtain the potential of body #I on host.
12
potj = 0.d0
13
kdum = 0
14
DO
30 jdum = ifirst,ntot
15
IF
(jdum.EQ.i) go to 30
16
j = jdum
17
IF
(j.GT.n)
THEN
18
jpair = j - n
19
* Use c.m. approximation for unperturbed binary.
20
IF
(list(1,2*jpair-1).GT.0)
THEN
21
kdum = 2*jpair - 1
22
j = kdum
23
END IF
24
END IF
25
20 rij2 = 0.d0
26
DO
25 k = 1,3
27
rij2 = rij2 + (x(k,i) - x(k,j))**2
28
25
CONTINUE
29
potj = potj - body(j)/sqrt(rij2)
30
IF
(j.EQ.kdum)
THEN
31
j = j + 1
32
go to 20
33
END IF
34
30
CONTINUE
35
*
36
RETURN
37
END
38
***
Nbody6
Ncode
poti.f
Generated on Sat Nov 30 2013 19:04:37 for Nbody6 by
1.8.2