*DECK ALLUF
      SUBROUTINE ALLUF(L4,ASS,MU1,IMA)
*
*-----------------------------------------------------------------------
*
* LU FACTORIZATION OF A GENERAL POSITIVE DEFINITE MATRIX IN COMPRESSED
* DIAGONAL STORAGE MODE.
*
* INPUT PARAMETERS:
*    L4 : ORDER OF THE COEFFICIENT MATRIX.
*   ASS : COEFFICIENT MATRIX IN COMPRESSED DIAGONAL STORAGE MODE.
*         A(I,J)=ASS(MU1(I)-I+J) IF J.LE.I AND J.GT.I+IMA(I-1)-MU1(I)
*               =ASS(MU1(J)+J-I) IF I.LE.J AND I.GE.J-IMA(J)+MU1(J)
*               =0.0             ELSE
*         DIMENSION ASS(IMA(L4))
*   MU1 : POSITION OF EACH DIAGONAL ELEMENT IN VECTOR ASS.
*   IMA : POSITION OF THE FIRST NON-ZERO COLUMN ELEMENT IN VECTOR ASS.
*         DIMENSION MU1(L4),IMA(L4)
*
* OUTPUT PARAMETER:
*   ASS : LU FACTORS.
*
*-------------------------------------- AUTHOR: A. HEBERT ; 15/09/89 ---
*
      DIMENSION ASS(*),MU1(*),IMA(*)
      DO 120 I=2,L4
      MU1IMI=MU1(I)-I
      MU1IPI=MU1(I)+I
      IND1=IMA(I-1)-MU1IMI+1
      IND2=MU1IPI-IMA(I)
      IF (IND1.LE.IND2) THEN
         DO 20 J=IND1,IND2-1
         MU1JPJ=MU1(J)+J
         SUM=0.0
         DO 10 K=MAX(IND1,MU1JPJ-IMA(J)),J-1
   10    SUM=SUM+ASS(MU1IMI+K)*ASS(MU1JPJ-K)
   20    ASS(MU1IMI+J)=ASS(MU1IMI+J)-SUM
         DO 50 J=IND2,I-1
         MU1JMJ=MU1(J)-J
         MU1JPJ=MU1(J)+J
         SUM=0.0
         DO 30 K=MAX(IND1,MU1JPJ-IMA(J)),J-1
   30    SUM=SUM+ASS(MU1IMI+K)*ASS(MU1JPJ-K)
         ASS(MU1IMI+J)=ASS(MU1IMI+J)-SUM
         SUM=0.0
         IF(J.GT.1) THEN
            DO 40 K=MAX(IND2,IMA(J-1)-MU1JMJ+1),J-1
   40       SUM=SUM+ASS(MU1JMJ+K)*ASS(MU1IPI-K)
         ENDIF
   50    ASS(MU1IPI-J)=(ASS(MU1IPI-J)-SUM)/ASS(MU1JMJ+J)
      ELSE
         DO 70 J=IND2,IND1-1
         MU1JMJ=MU1(J)-J
         SUM=0.0
         IF(J.GT.1) THEN
            DO 60 K=MAX(IND2,IMA(J-1)-MU1JMJ+1),J-1
   60       SUM=SUM+ASS(MU1JMJ+K)*ASS(MU1IPI-K)
         ENDIF
   70    ASS(MU1IPI-J)=(ASS(MU1IPI-J)-SUM)/ASS(MU1JMJ+J)
         DO 100 J=IND1,I-1
         MU1JMJ=MU1(J)-J
         MU1JPJ=MU1(J)+J
         SUM=0.0
         DO 80 K=MAX(IND1,MU1JPJ-IMA(J)),J-1
   80    SUM=SUM+ASS(MU1IMI+K)*ASS(MU1JPJ-K)
         ASS(MU1IMI+J)=ASS(MU1IMI+J)-SUM
         SUM=0.0
         DO 90 K=MAX(IND2,IMA(J-1)-MU1JMJ+1),J-1
   90    SUM=SUM+ASS(MU1JMJ+K)*ASS(MU1IPI-K)
  100    ASS(MU1IPI-J)=(ASS(MU1IPI-J)-SUM)/ASS(MU1JMJ+J)
      ENDIF
      SUM=0.0
      DO 110 K=MAX(IND1,IND2),I-1
  110 SUM=SUM+ASS(MU1IMI+K)*ASS(MU1IPI-K)
  120 ASS(MU1IMI+I)=ASS(MU1IMI+I)-SUM
      RETURN
      END
