anchor.diff:                      call wake_combination_func(wind_speed, wtVelocity(turb), deltav,         &
                                                  wake_combination_method, deficit_sum)
                   
  -                    if ((deltax0 > 0.0_dp) .and. (TI_calculation_method > 0)) then
  +                    if ((x > 0.0_dp) .and. (TI_calculation_method > 0)) then
                   
                           ! calculate TI value at each turbine
  -                        call added_ti_func(TI, Ct(turb), deltax0, k_star(turb), rotorDiameter(turb), & 
  +                        call added_ti_func(TI, Ct(turb), x, ky_local(turb), rotorDiameter(turb), & 
                                              & rotorDiameter(turbI), deltay, turbineZ(turb), &
                                              & turbineZ(turbI), TIturbs(turb), &
                                              & TI_calculation_method, &
  
positive.code:         ! print *, "sum of squares = ", sum_of_squares
  !         TI_dst = sqrt(sum_of_squares)
  !         print *, "TI_dst = ", TI_dst
          TI_dst = sqrt(TI_dst**2 + (TI_added*wake_overlap/rotor_area_dst)**2)
          
      
      ! Niayifar and Porte Agel 2015, 2016
  
negative.code:         !print *, "wake_overlap = ", wake_overlap   
          ! Calculate the turbulence added to the inflow of the downstream turbine by the 
          ! wake of the upstream turbine
          TI_added = 0.73_dp*(axial_induction_ust**0.8325_dp)*(TI_ust**0.0325_dp)* & 
                      ((x/rotor_diameter_ust)**(-0.32_dp))
          !print *, "TI_added = ", TI_added
          rotor_area_dst = 0.25_dp*pi*rotor_diameter_dst**2_dp
  