c
c
c***********************************************************************
c
      subroutine ORPLOT ( t, m, ior )
c
c-----------------------------------------------------------------------
c
c  arrange the independent variables to be used in ascending
c  order.  the indexing is stored in array ior.
c
      PARAMETER ( mmax = 3000 )
c
      dimension  ior(m)
c
      real  t(m), sav(mmax), hn, h
c
c------------------------------------------------------------------------
c
      do 430 i=1,m
         sav(i)=t(i)
430   continue
      h=sav(1)
      ix=1
      do 440 i=2,m
         hn=amax1(sav(i),h)
         if (hn.ne.h) ix=i
         h=hn
440   continue
      ior(m)=ix
      max=ix
      mm1=m-1
      do 460 j=1,mm1
         h=sav(1)
         ix=1
         do 450 i=2,m
            hn=amin1(sav(i),h)
            if (hn.ne.h) ix=i 
            h=hn
450      continue
         ior(j)=ix
         sav(ix)=sav(max)
460   continue
c
      return
c
      end 
