Nbody6
Main Page
Files
File List
File Members
All
Files
Functions
Variables
xtf.f
Go to the documentation of this file.
1
SUBROUTINE
xtf
(FW,FV,XCM,CHTIME)
2
*
3
*
4
* External chain force.
5
* ---------------------
6
*
7
include
'commonc.h'
8
REAL*8
fw(nmx3),fv(3),xcm(3)
9
REAL*8
acc(nmx3),ddp(nmx3),q0(3)
10
*
11
*
12
DO
k=1,3
13
q0(k)=0.0
14
END DO
15
*
16
DO
i=1,n
17
l=3*(i-1)
18
DO
k=1,3
19
q0(k)=q0(k)+xi(l+k)*mc(i)/mass
20
END DO
21
END DO
22
*
23
* Re-arrange according to INAME(I) and add c.m. (if needed).
24
DO
i=1,n
25
l=3*(i-1)
26
lf=3*(iname(i)-1)
27
DO
k=1,3
28
x(lf+k)=xi(l+k)-q0(k)
29
* & +XCM(K)
30
END DO
31
END DO
32
*
33
* Obtain the perturbing accelerations.
34
CALL
xtpert
(acc,chtime)
35
*
36
* Centre of mass force.
37
DO
k=1,3
38
fv(k)=0.0
39
END DO
40
DO
i=1,n
41
l=3*(i-1)
42
DO
k=1,3
43
fv(k)=fv(k)+m(i)/mass*acc(l+k)
44
END DO
45
END DO
46
*
47
* Physical chain forces.
48
DO
i=1,n
49
l=3*(i-1)
50
lf=3*(iname(i)-1)
51
DO
k=1,3
52
ddp(l+k)=mc(i)*(acc(lf+k)-fv(k))
53
END DO
54
END DO
55
*
56
l=3*(n-2)
57
DO
k=1,3
58
fw(k)=-ddp(k)
59
fw(l+k)=ddp(l+k+3)
60
END DO
61
DO
i=2,n-2
62
l=3*(i-1)
63
DO
k=1,3
64
fw(l+k)=fw(l+k-3)-ddp(l+k)
65
END DO
66
END DO
67
*
68
RETURN
69
END
Nbody6
Chain
xtf.f
Generated on Sat Nov 30 2013 19:04:36 for Nbody6 by
1.8.2