      SUBROUTINE SMPLX (A,B0,C,KA,M,N0,IND,IBASIS,X,Z,ITER,MXITER,
     X                       NUMLE,NUMGE,BI,WK,IWK)
C     ******************************************************************
C     SIMPLEX PROCEDURE FOR SOLVING LINEAR PROGRAMMING PROBLEMS
C     ******************************************************************
C     WRITTEN BY ALFRED H. MORRIS JR.
C     NAVAL SURFACE WEAPONS CENTER
C     DAHLGREN, VIRGINIA
C     DATE - JUNE 1983
C     -------------------
      DIMENSION A(KA,N0),B0(M),C(N0)
      DIMENSION IBASIS(M),BI(M,M)
      DIMENSION X(1),WK(1),IWK(1)
C     -------------------
C     DIMENSION X(N0+NUMLE+NUMGE)
C     DIMENSION WK(2*M),IWK(2*M+N0)
C     -------------------
C
C     ********** EPS0 IS A MACHINE DEPENDENT PARAMETER. ASSIGN EPS0
C                THE VALUE U WHERE U IS THE SMALLEST POSITIVE FLOATING
C                POINT NUMBER SUCH THAT 1.0 + U .GT. 1.0.
C
      EPS0 = SPMPAR(1)
C
C     ********** IT IS ASSUMED THAT EPS0 .LE. 1.E-8.
C
      RERRMN = AMIN1(1.E-7,100.0*EPS0)
      IF (EPS0 .LT. 1.E-13) GO TO 11
      IF (EPS0 .LT. 1.E-10) GO TO 10
      RERRMX = 1.E-3
      GO TO 20
   10 RERRMX = 1.E-4
      GO TO 20
   11 RERRMX = 1.E-5
C
   20 IP = M + N0 + 1
      CALL SMPLX1(A,B0,C,KA,M,N0,IND,IBASIS,X,Z,ITER,MXITER,
     1    EPS0,RERRMN,RERRMX,RERR,NUMLE,NUMGE,BI,
     2    WK(1),WK(M+1),IWK(1),IWK(IP))
      RETURN
      END
