Nbody6
Main Page
Files
File List
File Members
All
Files
Functions
Variables
r2sort.f
Go to the documentation of this file.
1
SUBROUTINE
r2sort
(IJ,RIJ2)
2
*
3
*
4
* Sorting of square chain distances.
5
* ---------------------------------
6
*
7
include
'commonc.h'
8
REAL*8
rij2(nmx,nmx)
9
INTEGER
ij(nmx)
10
*
11
*
12
rijmin=1.e30
13
fmax = 0.0
14
DO
i=1,n-1
15
DO
j=i+1,n
16
rij2(i,j) = (x(3*i-2)-x(3*j-2))**2+(x(3*i-1)-x(3*j-1))**2+
17
& (x(3*i)-x(3*j))**2
18
rij2(j,i)=rij2(i,j)
19
* IF(RIJ2(I,J).LT.RIJMIN)THEN
20
* RIJMIN=RIJ2(I,J)
21
* Save dominant pair instead of smallest distance (08/09).
22
IF
((m(i)+m(j))/rij2(i,j).GT.fmax)
THEN
23
fmax=(m(i)+m(j))/rij2(i,j)
24
ij(1)=i
25
ij(2)=j
26
END IF
27
END DO
28
END DO
29
*
30
l=2
31
DO
i=1,n
32
IF
(i.NE.ij(1).AND.i.NE.ij(2))
THEN
33
l=l+1
34
ij(l)=i
35
END IF
36
END DO
37
*
38
RETURN
39
END
Nbody6
Chain
r2sort.f
Generated on Sat Nov 30 2013 19:04:35 for Nbody6 by
1.8.2