      SUBROUTINE CVRB(A,KA,M,N,ML,MU,B,KB)
C     ******************************************************************
C     CONVERSION OF REAL MATRICES FROM STANDARD TO BANDED FORM
C     ******************************************************************
      REAL A(KA,N),B(KB,1)
C
C     STORE THE NONZERO DATA OF THE FIRST ML ROWS
C
      IF (ML .EQ. 0) GO TO 30
      DO 11 I = 1,ML
      JMAX = MIN0(N,I+MU)
      J = JMAX
        DO 10 JJ = 1,JMAX
        K = J - I + ML + 1
        B(I,K) = A(I,J)
   10   J = J - 1
   11 CONTINUE
C
C     INSERT ZEROS IN THE UPPER LEFT CORNER
C
      IMAX = ML
      DO 21 J = 1,ML
        DO 20 I = 1,IMAX
   20   B(I,J) = 0.0
   21 IMAX = IMAX - 1
C
C     STORE THE REMAINING NONZERO DATA
C
   30 IMIN = ML + 1
      IMAX = MIN0(M,ML+N)
      DO 32 I = IMIN,IMAX
      JMIN = I - ML
      JMAX = MIN0(N,I+MU)
        DO 31 J = JMIN,JMAX
        K = J - I + ML + 1
   31   B(I,K) = A(I,J)
   32 CONTINUE
C
C     INSERT ZEROS IN THE LOWER RIGHT CORNER
C
      JMAX = ML + MU + 1
      IF (K .EQ. JMAX) GO TO 50
      JMIN = K + 1
      IMIN = IMAX
      DO 41 J = JMIN,JMAX
        DO 40 I = IMIN,IMAX
   40   B(I,J) = 0.0
   41 IMIN = IMIN - 1
C
C     STORE ZEROS IN THE FINAL M-IMAX ROWS
C
   50 IF (IMAX .EQ. M) RETURN
      IMIN = IMAX + 1
      DO 52 J = 1,JMAX
        DO 51 I = IMIN,M
   51   B(I,J) = 0.0
   52 CONTINUE
      RETURN
      END
