anchor.diff:     !t1=timef()
      call dgeqrf(mm,nn, u,mm,tau,work,lwork,info)
      if(info.ne.0)then; write(*,*) subnam,': dgeqrf info: ',info; stop; end if
  -   !t2=timef()
  -   !print *,'dgeqrf step:', t2-t1
  -   !t1=timef()
      do j=1,nn
       forall(i=1:min(j,mm))    mat(i+(j-1)*mn)=u(i+(j-1)*mm)
       forall(i=min(j,mm)+1:mn) mat(i+(j-1)*mn)=0.d0
      end do
  -   !t2=timef()
  -   !print *, 'Strange copy step:',t2-t1
  -   !t1=timef()
  -   !print *,'mm=',mm,'mn=',mn
      call dorgqr(mm,mn,mn,u,mm,tau,work,lwork,info)
      if(info.ne.0)then; write(*,*) subnam,': dorgqr info: ',info; stop; end if
  -!    t2=timef()
  -    !print *,'dorgqr step:',t2-t1, 'Matrix size:',mm,mn
  -
  -!    print *,'time for a single qr: ',t2-t1,'Matrix size:',mm,mn
  -!
  -!   nrm=dnrm2(mm*nn,arg%u(k)%p,1)
  -!   call dgemm('n','n',mm,nn,mn,1.d0,u,mm,mat,mn,-1.d0,arg%u(k)%p,mm)
  -!   err=dnrm2(mm*nn,arg%u(k)%p,1)
  -!   if(err.gt.1.d-10*nrm)then; write(*,*)subnam,': qr error: m,n: ',mm,nn;stop;endif
  -!
  -   !t1=timef()
      call dcopy(mm*mn, u,1,arg%u(k)%p,1)
      call dgemm('n','n',mn,kk,nn,1.d0,mat,mn,arg%u(k+1)%p,nn,0.d0,u,mn)
      if(r(k).ne.mn)then
  
positive.code:     call dcopy(mm*mn, mat,1,arg%u(k)%p,1)
     end if
     call dcopy(mn*kk, u,1,arg%u(k+1)%p,1)
     !t2=timef()
     !print *,'Time for the rest:',t2-t1
    end do
    deallocate(work,tau,mat,u)
  
  
negative.code:    call zgesvd('o','s',mm,nn,b,mm,s,b,1,u,mn,work,lwork,rwork,info)
     if(info.ne.0)then;write(*,*)subnam,': info: ',info;stop;endif
     if(s(1).ne.0.d0)then 
         r(k-1)=chop(s(1:mn), tol/dsqrt(dble(m-l)))
     else
         r(k-1)=0
     endif
  