anchor.diff:            endif
             offset_u=ndof2*(l-1)+ndof*(idof-1)
             do jdof=1,ndof
  -            if (spMAT%type==SPARSE_MATRIX_TYPE_COO .and. spMAT%IRN(m)/=ii) &
  -              stop "ERROR: sparse_matrix_contact_set_a"
  +            if ( spMAT%type==SPARSE_MATRIX_TYPE_COO ) then
  +              if( spMAT%IRN(m)/=ii ) stop "ERROR: sparse_matrix_contact_set_a"
  +            end if
               if (spMAT%JCN(m)/=j0+jdof) stop "ERROR: sparse_matrix_contact_set_a"
               spMAT%A(m)=hecMAT%AU(offset_u+jdof)
               m=m+1
  
positive.code:     ! Lower Lagrange
      if (fstrMAT%num_lagrange > 0) then
        i0=spMAT%offset+ndof*hecMAT%N
        if (.not. sparse_matrix_is_sym(spMAT)) then
          do i=1,fstrMAT%num_lagrange
            ii=i0+i
            if (spMAT%type==SPARSE_MATRIX_TYPE_CSR) spMAT%IRN(ii-spMAT%offset)=m
            ls=fstrMAT%indexL_lagrange(i-1)+1
            le=fstrMAT%indexL_lagrange(i)
            do l=ls,le
  
negative.code:           ls=fstrMAT%indexU_lagrange(i-1)+1
            le=fstrMAT%indexU_lagrange(i)
            do l=ls,le
              if ( spMAT%type==SPARSE_MATRIX_TYPE_COO ) then
                if( spMAT%IRN(m)/=ii ) stop "ERROR: sparse_matrix_contact_set_a"
              end if
              if (spMAT%JCN(m)/=j0+fstrMAT%itemU_lagrange(l)) &
                stop "ERROR: sparse_matrix_contact_set_a"
              spMAT%A(m)=fstrMAT%AU_lagrange((l-1)*ndof+idof)
  