Nbody6
 All Files Functions Variables
rsort.f
Go to the documentation of this file.
1  SUBROUTINE rsort(R,SWITCH,IND)
2 *
3 *
4 * Sorting of mutual distances.
5 * ----------------------------
6 *
7  REAL*8 r(6)
8  INTEGER ind(6)
9  LOGICAL switch
10 *
11 *
12 * Sort particle separations in increasing order.
13  1 nsw = 0
14  DO 2 k = 1,5
15  IF (r(ind(k+1)).GE.r(ind(k))) go to 2
16  ind1 = ind(k)
17  ind(k) = ind(k+1)
18  ind(k+1) = ind1
19  nsw = 1
20  2 CONTINUE
21 *
22  IF (nsw.GT.0) go to 1
23 *
24 * Check the switching conditions.
25  switch = .false.
26  IF (ind(1).GT.3.OR.ind(2).EQ.6) switch = .true.
27 *
28  RETURN
29 *
30  END