      subroutine triinit(d, du, dl, desca)
*
*     triinit generates distributed tridiagonal matrix a
*     assumes d's to be block-column distributed
*
*     globally: 
*               a(i,j) = 4*delta(i,j) + delta(i, j-1) + delta(i, j+1)
*
      integer            desca(*)
      double precision   d(*), dl(*), du(*)

      integer            n, nb, nloc, i
      integer            ictxt, mycol, myrow, npcol, nprow

*     get matrix and grid infos
      ictxt = desca(2)
      n     = desca(3)
      nb    = desca(4)
      call blacs_gridinfo(ictxt, nprow, npcol, myrow, mycol)
      nloc = numroc(n, nb, mycol, 0, npcol)

*     compute array values
      do i=1, nloc
         d(i)  = 4.0
         dl(i) = 1.0
         du(i) = 1.0
      enddo

      return
      end
