      implicit none

      integer n
      parameter(n=10)
      real*8 arr1(n)
      real*8 arr2(n)

      integer i

      do i=1,n
         arr1(i)=dble(i)
      enddo

      arr1(5)=12
      arr1(1)=3
      arr1(9)=1

      do i=1,n
         arr2(i)=arr1(i)+1
      enddo

      do i=1,n
         write(*,*) i,arr1(i),arr2(i)
      enddo

      call sort(n,arr1,arr2)

      do i=1,n
         write(*,*) i,arr1(i),arr2(i)
      enddo

      stop
      end
