anchor.diff:                m=m+1
               enddo
             enddo
  -        enddo
  -        !!$#ifdef NEED_DIAG
  -        !!$      else
  -        !!$        do i=1,fstrMAT%num_lagrange
  -        !!$          ii=i0+i
  -        !!$          if (spMAT%type==SPARSE_MATRIX_TYPE_CSR) spMAT%IRN(ii-spMAT%OFFSET)=m
  -        !!$          if (spMAT%type==SPARSE_MATRIX_TYPE_COO) spMAT%IRN(m)=ii
  -        !!$          spMAT%JCN(m)=ii
  -        !!$          m=m+1
  -        !!$        enddo
  -        !!$#endif
  -      endif
  +        endif
  +        ! Diag( Only for CSR )
  +        if (spMAT%type==SPARSE_MATRIX_TYPE_CSR) then
  +          spMAT%JCN(m)=ii
  +          m=m+1
  +        end if
  +      enddo
       endif
       if (spMAT%type == SPARSE_MATRIX_TYPE_CSR) spMAT%IRN(ii+1-spMAT%offset)=m
  -    if (sparse_matrix_is_sym(spMAT) .and. m-1 < spMAT%NZ) spMAT%NZ=m-1
  +    if (m-1 < spMAT%NZ) spMAT%NZ=m-1
       if (m-1 /= spMAT%NZ) then
         write(*,*) 'ERROR: sparse_matrix_contact_set_prof on rank ',myrank
         write(*,*) 'm-1 = ',m-1,', NZ=',spMAT%NZ,',num_lagrange=',fstrMAT%num_lagrange
  
positive.code:         offset_d=ndof2*(i-1)+ndof*(idof-1)
          if (sparse_matrix_is_sym(spMAT)) then; jdofs=idof; else; jdofs=1; endif
          do jdof=jdofs,ndof
            if (spMAT%type==SPARSE_MATRIX_TYPE_COO .and. spMAT%IRN(m)/=ii) &
              stop "ERROR: sparse_matrix_contact_set_a"
            if (spMAT%JCN(m)/=i0+jdof) stop "ERROR: sparse_matrix_contact_set_a"
            spMAT%A(m)=hecMAT%D(offset_d+jdof)
            m=m+1
  
negative.code:       NU=hecMAT%indexU(NN)
        NZ=NN*(ndof2+ndof)/2+NU*ndof2 &
          +fstrMAT%numU_lagrange*ndof
      else
        NL=hecMAT%indexL(NN)
        NU=hecMAT%indexU(NN)
        NZ=(NN+NU+NL)*ndof2 &
          +(fstrMAT%numL_lagrange+fstrMAT%numU_lagrange)*ndof
      endif
      ! diagonal elements must be allocated for CRS format even if they are all zero
      if (spMAT%type==SPARSE_MATRIX_TYPE_CSR) NZ=NZ+fstrMAT%numL_lagrange
      call sparse_matrix_init(spMAT, N_loc, NZ)
      call sparse_matrix_hec_set_conv_ext(spMAT, hecMESH, ndof)
      if(fstrMAT%num_lagrange > 0) &
  