      program main

      implicit none
*
*     .. Parameters..
      integer, parameter :: COL = 1024
      integer, parameter :: LDA = 1024
*
*     .. Scalars..
      integer :: INFO, NB, N 
      integer :: i, j 
      real    :: temp
*
*     .. Arrays..
      real, array(LDA,COL) :: A 
      real, array(LDA) :: X
*
*     .. External Subroutine
      external SLLTBK 
*     
*     .. Executable Statements
*
  10  print *,'THE MATRIX SIZE(0 FOR STOP) N(N*N) =  '
      read *, N
      if (N .eq. 0) goto 20
      forall (i=1:N,j=1:N) A(i,j)= 1.0 / real(i+j-1)
      do i = 1, n
        A(i,i) = 1.0
      end do
      X = 1.0
      print *, 'THE BLOCK SIZE(0 FOR NEW MATRIX) NB =  '
      read *, NB
      if (NB .eq. 0) goto 10
*    
*     .. L*L**T Factorization
*
      call SLLTBK(N,A(:N,:N),N,INFO,NB)

*  
*     .. Forward Substitution..
*
      do i = 1, N
         X(i) = X(i) / A(i,i)
         temp = X(i)
         X(i+1:N) = X(i+1:N) - A(i+1:N,i) * temp
      end do
*
*     .. Back Substitution..
*
      do i = N, 1, -1
         X(i) = X(i) / A(i,i)
         temp = X(i)
         X(1:i-1) = X(1:i-1) - A(i, 1:i-1) * temp 
      end do
*
*     .. The Result..
*
      print *,  X(1:N)
*
      goto 10
  20  continue
      end

