      SUBROUTINE SMSLV(MO,N,M,A,B,KB,DET,RCOND,INERT,IERR,IPVT,WK)
C     ------------------
      REAL A(1),B(1)
      REAL DET(2),RCOND,T,WK(N)
      INTEGER INERT(3),IPVT(N),ONEJ
C     ------------------
C
C          MATRIX FACTORIZATION AND COMPUTATION OF RCOND
C
      IERR = 0
      CALL SSPCO(A,N,IPVT,RCOND,WK)
      T = 1.0 + RCOND
      IF (T .EQ. 1.0) GO TO 30
C
C                  SOLUTION OF THE EQUATION AX=B
C
      IF (M .LT. 1) GO TO 20
      ONEJ = 1
      DO 10 J=1,M
      CALL SSPSL(A,N,IPVT,B(ONEJ))
   10 ONEJ = ONEJ + KB
C
C             CALCULATION OF DET AND THE INVERSE OF A
C
   20 JOB = 110
      IF (MO .EQ. 0) JOB = 111
      CALL SSPDI(A,N,IPVT,DET,INERT,WK,JOB)
      RETURN
C
C                  THE PROBLEM CANNOT BE SOLVED
C
   30 IERR = 1
      RETURN
      END
