anchor.diff:                      call theta_c_0_func(yaw(turb), Ct(turb), theta_c_0)
               
                       ! horizontal spread
  -                    call sigmay_func(ky, deltax0, rotorDiameter(turb), yaw(turb), sigmay)
  +                    call sigmay_func(ky_local, deltax0, rotorDiameter(turb), yaw(turb), sigmay)
                   
                       ! vertical spread
  -                    call sigmaz_func(kz, deltax0, rotorDiameter(turb), sigmaz)
  +                    call sigmaz_func(kz_local, deltax0, rotorDiameter(turb), sigmaz)
                   
                       ! horizontal cross-wind wake displacement from hub
                       call wake_offset_func(rotorDiameter(turb), theta_c_0, x0, yaw(turb), &
  -                                         & ky, kz, Ct(turb), sigmay, sigmaz, wake_offset)
  +                                         & ky_local, kz_local, Ct(turb), sigmay, sigmaz, wake_offset)
                                        
                       ! cross wind distance from downstream hub location to wake center
                       deltay = turbineYw(turbI) - (turbineYw(turb) + wake_offset)
  
positive.code:                     deltaz = turbineZ(turbI) - turbineZ(turb)
                  
                      ! horizontal spread at far wake onset
                      call sigmay_func(ky, 0.0_dp, rotorDiameter(turb), yaw(turb), sigmay0)
                  
                      ! vertical spread at far wake onset
                      call sigmaz_func(kz, 0.0_dp, rotorDiameter(turb), sigmaz0)
                  
                      ! velocity deficit in the nearwake (linear model)
                      call deltav_near_wake_lin_func(deltay, deltaz, wake_offset, wind_speed, &
  
negative.code:     integer, parameter :: dp = kind(0.d0)
      
      ! in
      real(dp), intent(in) :: Ct_ust, x, k_star_ust, rotor_diameter_ust, rotor_diameter_dst
      real(dp), intent(in) :: deltay, wake_height, turbine_height, TI_ust
      integer, intent(in) :: TI_calculation_method
      
      ! local
      real(dp) :: axial_induction_ust, beta, epsilon, sigma, wake_diameter, wake_overlap
      real(dp) :: TI_added
      real(dp), parameter :: pi = 3.141592653589793_dp
      
      ! out  
  