anchor.diff:              enddo
               icnt=icnt+1
               iw(icnt)=ll
  -            !if (i==1) write(*,*) 'l', icnt, jj, kk, ll
  +            !if (i==1) write(0,*) 'l', icnt, jj, kk, ll
             enddo ll1
           enddo
           ! diagonal
  
positive.code:     ndof2=ndof*ndof
  
      if (mod(Tmat%n, ndof) /= 0) then
        write(*,*) Tmat%n, ndof
        stop 'ERROR: blocking_Tmat failed'
      endif
      BTmat%n=Tmat%n/ndof
  
negative.code:       enddo
        if (icnt == 0) icnt=1
        ! error check!
        !write(0,*) BTtKT%item(ms:ms-1+icnt)
        !write(0,*) BTtKT%index(i)-BTtKT%index(i-1), icnt
        if (ms-1+icnt /= BTtKT%index(i)) stop 'ERROR: trimatmul'
      enddo
  
  