      SUBROUTINE RSLV1 (N,R,C,IC,D,T,IT,JT,IU,B,X,Y)
      INTEGER   R(N), C(N), IC(N)
      DIMENSION T(1), IT(1), JT(1), IU(N)
      DIMENSION D(N), B(N), X(N), Y(N)
C
C            SOLVE LY = B BY FORWARD SUBSTITUTION
C
      DO 11 K = 1,N
      LK = R(K)
      SUM = B(LK)
      JMIN = IT(K)
      JMAX = IU(K) - 1
      IF (JMIN .GT. JMAX) GO TO 11
      DO 10 JJ = JMIN,JMAX
      LJ = JT(JJ)
      J = IC(LJ)
   10 SUM = SUM - T(JJ)*Y(J)
   11 Y(K) = SUM/D(K)
C
C            SOLVE UX = B BY BACKWARD SUBSTITUTION
C             AND REORDER X TO CORRESPOND WITH A
C
      K = N
      DO 22 I = 1,N
      SUM = Y(K)
      JMIN = IU(K)
      JMAX = IT(K+1) - 1
      IF (JMIN .GT. JMAX) GO TO 21
      DO 20 JJ = JMIN,JMAX
      LJ = JT(JJ)
      J = IC(LJ)
   20 SUM = SUM - T(JJ)*Y(J)
   21 Y(K) = SUM
      LK = C(K)
      X(LK) = Y(K)
   22 K = K - 1
      RETURN
      END
