C   07/06/96 606071911  MEMBER NAME  SORTP    (S4)          FORTG1
      SUBROUTINE SORTP(X,NSTP,LIST,NA,NB)
      REAL X(NSTP,1),NEW
      INTEGER LIST(1)
C
C     STORE IN   LIST(NA) TO LIST(NB)  INDICES
C     FOR ELEMENTS X(1,INDEX), INDEX = NA . . . NB
C     IN ASCENDING ORDER
C
      IF(NA.GT.NB) GOTO 100
      I=NA
      GOTO 40
   10 IF(I.GE.NB) GOTO 100
      NEW=X(1,I+1)
      K=I
      GOTO 30
C     EXCHANGE
   20 LIST(K+1)=LIST(K)
      K=K-1
      IF(K.LT.NA) GOTO 40
   30 IF(NEW.LT.X(1,LIST(K))) GOTO 20
   40 LIST(K+1)=I+1
      I=I+1
      GOTO 10
  100 RETURN
      END
