1c     $Id$
2*     *****************************
3*     *                           *
4*     *       Order_Values        *
5*     *                           *
6*     *****************************
7*
8*   this subroutine makes f(indx(1)) < f(indx(2)) < f(indx(3)) < ....
9*   via a bubble sort
10*
11*   Entry - n,f
12*   Exit - returns indx
13*
14
15      subroutine Order_Values(n,f,indx)
16      implicit none
17      integer n
18      real*8 f(*)
19      integer indx(*)
20
21*     ****** local variables *****
22      integer i,j,idum
23
24      do i=1,n
25         indx(i) = i
26      end do
27      do i=1,n-1
28        do j=i+1,n
29           if (f(indx(j)).lt.f(indx(i))) then
30              idum    = indx(i)
31              indx(i) = indx(j)
32              indx(j) = idum
33           end if
34         end do
35       end do
36
37      return
38      end
39
40