anchor.diff:      real(kind=kreal) :: num
   
       ! perform three matrices multiplication for elimination
  -    call hecmw_localmat_init_with_hecmat(BKmat, hecMAT, num_lagrange)
  -    if (DEBUG >= 4) then
  +    call hecmw_localmat_init_with_hecmat(BKmat, hecMAT)
  +    if (DEBUG >= 3) then
         write(700+hecmw_comm_get_rank(),*) 'BKmat (hecMAT)'
  -      call hecmw_localmat_write(BKmat, 700+hecmw_comm_get_rank())
  +      if (DEBUG == 3) then
  +        call hecmw_localmat_write_ij(BKmat, 700+hecmw_comm_get_rank())
  +      else
  +        call hecmw_localmat_write(BKmat, 700+hecmw_comm_get_rank())
  +      endif
       endif
   
       call hecmw_localmat_multmat(BTtmat, BKmat, hecMESH, BTtKmat)
       if (DEBUG >= 2) write(0,*) '  DEBUG2: multiply Tt and K done'
  -    if (DEBUG >= 4) then
  +    if (DEBUG >= 3) then
         write(700+hecmw_comm_get_rank(),*) 'BTtKmat'
  -      call hecmw_localmat_write(BTtKmat, 700+hecmw_comm_get_rank())
  +      if (DEBUG == 3) then
  +        call hecmw_localmat_write_ij(BTtKmat, 700+hecmw_comm_get_rank())
  +      else
  +        call hecmw_localmat_write(BTtKmat, 700+hecmw_comm_get_rank())
  +      endif
       endif
       call hecmw_localmat_free(BKmat)
   
       call hecmw_localmat_multmat(BTtKmat, BTmat, hecMESH, BTtKTmat)
       if (DEBUG >= 2) write(0,*) '  DEBUG2: multiply TtK and T done'
  -    if (DEBUG >= 4) then
  +    if (DEBUG >= 3) then
         write(700+hecmw_comm_get_rank(),*) 'BTtKTmat'
  -      call hecmw_localmat_write(BTtKTmat, 700+hecmw_comm_get_rank())
  +      if (DEBUG == 3) then
  +        call hecmw_localmat_write_ij(BTtKTmat, 700+hecmw_comm_get_rank())
  +      else
  +        call hecmw_localmat_write(BTtKTmat, 700+hecmw_comm_get_rank())
  +      endif
       endif
       call hecmw_localmat_free(BTtKmat)
   
  
positive.code:     call hecmw_localmat_init_with_hecmat(W1mat, hecMAT)
      if (DEBUG >= 3) then
        write(700+hecmw_comm_get_rank(),*) 'BKmat (hecMAT)'
        call hecmw_localmat_write(W1mat, 700+hecmw_comm_get_rank())
      endif
      call hecmw_localmat_add(BKmat, W1mat, W2mat)
      call hecmw_localmat_free(BKmat)
  
negative.code:     enddo
    end subroutine hecmw_localmat_write
  
    subroutine hecmw_localmat_write_ij(Tmat,iunit)
      implicit none
      type (hecmwST_local_matrix), intent(in) :: Tmat
      integer(kind=kint), intent(in) :: iunit
      integer(kind=kint) :: nr, nc, nnz, ndof, i, js, je, j, jj
      nr=Tmat%nr
      nc=Tmat%nc
      nnz=Tmat%nnz
      ndof=Tmat%ndof
      write(iunit,*) 'nr, nc, nnz, ndof', nr, nc, nnz, ndof
      write(iunit,*) 'i, j'
      do i=1,nr
        js=Tmat%index(i-1)+1
        je=Tmat%index(i)
        do j=js,je
          jj=Tmat%item(j)
          write(iunit,*) i, jj
        enddo
      enddo
    end subroutine hecmw_localmat_write_ij
  
    subroutine hecmw_localmat_blocking(Tmat, ndof, BTmat)
      implicit none
      type (hecmwST_local_matrix), intent(in) :: Tmat
  