anchor.diff:  
           call init_lindblad_fit()
   
  +        !write(*,*) 'READING EXTERNAL EVOPS'
  +        call flush()
  +        call open_files('r')
  +        call read_evops()
  +        call close_files('r')
  +
  +        call evops_derivative()
  +        call calculate_coeff()
  +
  +        !write(*,*) 'OUTPUTTING EVOPS'
  +        call flush()
  +        call open_files('w')
  +        call write_evops()
  +        call close_files('w')
  +
  +        !write(*,*) 'OUTPUTTING DISS'
  +        !call flush()
  +        !call open_files('D')
  +        !call write_fitted_diss()
  +        !call close_files('D')
  +
  +    end subroutine do_lindblad_fit_work
  +
  +    subroutine calculate_coeff()
  +        integer(i4b) :: tind, i
  +
  +        do tind=1,STEPS
  +          call superops_4indexed_to_2indexed(Evops(:,:,:,:,tind),Evops2,type)
  +          call superops_4indexed_to_2indexed(DEvops(:,:,:,:,tind),DEvops2,type)
  +
  +          call svd(Evops2,U,EIGVAL,VT)
  +
  +          write(*,*) EIGVAL
  +
  +          if(EIGVAL(1) <= 0) then
  +            write(*,*) 'terrible error in SVD'
  +            stop
  +          end if
  +
  +          ! reciprocal eigvals
  +          do i=1, size(EIGVAL)
  +            if(EIGVAL(i)/EIGVAL(1) > 1e-7*size(EIGVAL)) then
  +              EIGVAL(i) = 1.0_dp / EIGVAL(i)
  +            else
  +              EIGVAL(i) = 0.0_dp
  +            end if
  +          end do
  +
  +          write(*,*) EIGVAL
  +
  +          AAA = 0.0_dp
  +          do i=1, size(AAA,1)
  +            AAA(i,i) = EIGVAL(i)
  +          end do
  +
  +          AAA = matmul(conjg(transpose(VT)),matmul(AAA, transpose(conjg(U))))
  +
  +          call superops_2indexed_to_4indexed(AAA,DEvops(:,:,:,:,tind),type)
  +
  +
  +        end do
  +    end subroutine calculate_coeff
  +
  +    subroutine only_convert_to_exciton()
  +        integer(i4b) :: r
  +
  +        call init_lindblad_fit()
  +
           write(*,*) 'READING EXTERNAL EVOPS'
           call flush()
           call open_files('r')
           call read_evops()
           call close_files('r')
   
  -        write(*,*) 'OUTPUTTING EVOPS'
  -        call flush()
  -        call open_files('w')
  -        call write_fitted_evops()
  -        call close_files('w')
  -
  -        write(*,*) 'OUTPUTTING DISS'
  -        call flush()
  -        call open_files('D')
  -        call write_fitted_diss()
  -        call close_files('D')
  -
  -    end subroutine do_lindblad_fit_work
  -
  -    subroutine only_convert_to_exciton()
  -        integer(i4b) :: r
  -
  -        allocate_SVD = .false.
  -        call init_lindblad_fit()
  -
  -        write(*,*) 'READING EXTERNAL EVOPS'
  -        call flush()
  -        call open_files('r')
  -        call read_evops()
  -        call close_files('r')
  -
           do r=1,STEPS
             call superops_to_exc_4indexed(Evops(:,:,:,:,r),type)
           end do
  
positive.code:       end if
  
      end function ind
  
      subroutine read_evops()
        integer (i4b)       :: i, file_ios
  
negative.code:                     BB = 1.0/300,    &
                      CC = 1.0/100
  
          STEPS = 500
          call init_lindblad_fit()
  
  