Nbody6
transq.f
Go to the documentation of this file.
1  SUBROUTINE transq
2 *
3 *
4 * Transformations from chain variables to KS.
5 * -------------------------------------------
6 *
7  include 'commonc.h'
8  include 'common2.h'
9  REAL*8 ksch
10  LOGICAL kslow,kcoll
11  common/slow1/ tk2(0:nmx),ejump,ksch(nmx),kslow,kcoll
12 *
13 *
14 * Centre of mass.
15  DO k=1,3
16  cmx(k)=0.0
17  cmv(k)=0.0
18  END DO
19  mass=0.0
20  DO i=1,n
21  l=3*(i-1)
22  mc(i)=m(iname(i))
23  mass=mass+mc(i)
24  DO k=1,3
25  cmx(k)=cmx(k)+m(i)*x(l+k)
26  cmv(k)=cmv(k)+m(i)*v(l+k)
27  END DO
28  END DO
29 *
30  DO k=1,3
31  cmx(k)=cmx(k)/mass
32  cmv(k)=cmv(k)/mass
33  END DO
34 * Auxiliary quantities.
35  DO i=1,n-1
36  tkk(i)=.5d0*(1./mc(i)+1./mc(i+1))
37  tk1(i)=-1./mc(i)
38  mkk(i)=mc(i)*mc(i+1)
39  DO j=i+1,n
40  mij(i,j)=mc(i)*mc(j)
41  mij(j,i)=mij(i,j)
42  END DO
43  END DO
44 *
45 * Initialize the whole slow-down array TK2.
46  DO i=0,n
47  tk2(i)=0.0
48  END DO
49 *
50 * Pysical momenta.
51  DO i=1,n
52  l=3*(i-1)
53  lf=3*iname(i)-3
54  DO k=1,3
55  xi(l+k)=x(lf+k)
56  pi(l+k)=m(iname(i))*(v(lf+k)-cmv(k))
57  END DO
58  END DO
59 *
60 * Chain momenta.
61  l=3*(n-2)
62  DO k=1,3
63  wc(k)=-pi(k)
64  wc(l+k)=pi(l+k+3)
65  END DO
66  DO i=2,n-2
67  l=3*(i-1)
68  DO k=1,3
69  wc(l+k)=wc(l+k-3)-pi(l+k)
70  END DO
71  END DO
72 *
73 * Include artificial STOP to get round compiler bug.
74  IF (xi(4)-xi(1).EQ.0.0d0) stop
75 *
76 * Chain coordinates.
77  DO i=1,n-1
78  l=3*(i-1)
79  DO k=1,3
80  xc(l+k)=xi(l+k+3)-xi(l+k)
81  END DO
82  END DO
83 *
84 * KS-transformations.
85  DO i=1,n-1
86  l1=3*(i-1)+1
87  ks1=4*(i-1)+1
88  CALL physks(xc(l1),wc(l1),q(ks1),p(ks1))
89  END DO
90 *
91  RETURN
92  END