anchor.diff:      ! initialize local k values to free-stream values
       ky_local = ky
       kz_local = kz
  +    
  +    !print *, "entering turbine calculation loops"
       
       do, d=1, nTurbines
       
  
positive.code:             
              end if
              
              ! if (x < 0.0_dp ) then
  !                 print *, "deltav: ", deltav
  !                 print *, "deficit sum at ", turb, ": ", deficit_sum 
  !                 print *, "deltax: ", x
  !                 print *, "deltav: ", deltav
  !             end if
              
          end do
          
          ! find velocity at point p due to the wake of turbine turb
          point_velocity = wind_speed - deficit_sum
  
negative.code:             ! downstream distance from far wake onset to downstream turbine
              deltax0 = x - x0
              
              !print *, "entering logic statements"
              
              if (x > 0.0_dp) then
              
                  !print *, "entering first if logic"
              
                  ! horizontal spread
                  call sigmay_func(ky, deltax0, rotorDiameter(turb), yaw(turb), sigmay)
  