anchor.diff:      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())
  +      if (DEBUG == 3) then
  +        call hecmw_localmat_write_ij(W1mat, 700+hecmw_comm_get_rank())
  +      else
  +        call hecmw_localmat_write(W1mat, 700+hecmw_comm_get_rank())
  +      endif
       endif
       call hecmw_localmat_add(BKmat, W1mat, W2mat)
       call hecmw_localmat_free(BKmat)
  
positive.code:     ! else
      !   write(0,*) 'DEBUG: BTtmat2 is correct'
      ! endif
      if (DEBUG >= 4) then
        write(700+hecmw_comm_get_rank(),*) 'DEBUG: BTtmat(MPC)'
        call hecmw_localmat_write(BTtmat,700+hecmw_comm_get_rank())
      endif
      call hecmw_trimatmul_TtKT(hecMESH, BTtmat, hecMAT, BTmat, iwS, n_mpc, hecTKT)
  
  
negative.code:     real(kind=kreal) :: num
  
      ! perform three matrices multiplication for elimination
      call hecmw_localmat_init_with_hecmat(BKmat, hecMAT)
      if (DEBUG >= 3) then
        write(700+hecmw_comm_get_rank(),*) 'BKmat (hecMAT)'
        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 >= 3) then
        write(700+hecmw_comm_get_rank(),*) 'BTtKmat'
        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 >= 3) then
        write(700+hecmw_comm_get_rank(),*) 'BTtKTmat'
        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)
  
  