anchor.diff:      ermax = 0d0
       i = d
       dir = -1
  -    swp = 1
  +    swp = 0
   
       call init_seed()
       ermax = 0d0
  -    swp = 1
       if ( typ .eq. 1 ) then
           tau0 = tau
       else if ( typ .eq. 2  ) then
  
positive.code: 
    end subroutine tt_ksl
  
    subroutine ztt_ksl(d,n,m,ra,crA, crY0, ry, tau, rmax, kickrank, nswp, verb)
      use dispmodule
      use matrix_util ! dqr
      use ttals   ! als stuff
  
negative.code:     integer,allocatable :: pa(:)
      complex(8), allocatable :: tmp1(:), tmp2(:),tmp3(:,:,:)
      integer :: i,j, k, sz,swp, dir, lwork, mm, nn, rnew, max_matvecs, rmax2 
      integer :: typ
      double precision :: err, ermax, res, res_old, min_res
      double precision anorm
      real(8) dznrm2
      complex(8) ZERO, ONE
      parameter( ZERO=(0.0d0,0.0d0), ONE=(1.0d0,0.0d0) )
  
      typ = 2 ! 1 - KSL, 2 - KSL-symm
      if ( present(typ0) ) then
          typ = typ0 
      endif
  
      min_res = 1d-1
      rmax2 = rmax 
  