anchor.diff:      integer, parameter :: dp = kind(0.d0)
   
       ! in
  -    integer, intent(in) :: nTurbines, nSamples, nRotorPoints
  +    integer, intent(in) :: nTurbines, nSamples, nRotorPoints, nCtPoints
  +    integer, intent(in) :: wake_combination_method, TI_calculation_method, wake_model_version
  +    logical, intent(in) :: calc_k_star, use_ct_curve
       real(dp), dimension(nTurbines), intent(in) :: turbineXw, turbineYw, turbineZ
       integer, dimension(nTurbines), intent(in) :: sorted_x_idx
       real(dp), dimension(nTurbines), intent(in) :: rotorDiameter, yawDeg
       real(dp), dimension(nTurbines), intent(in) :: Ct
       real(dp), intent(in) :: ky, kz, alpha, beta, TI, wind_speed, z_ref, z_0, shear_exp, opt_exp_fac
       real(dp), dimension(nRotorPoints), intent(in) :: RotorPointsY, RotorPointsZ
  +    real(dp), dimension(nCtPoints), intent(in) :: ct_curve_wind_speed, ct_curve_ct
       real(dp), dimension(nSamples), intent(in) :: velX, velY, velZ
  -    integer, intent(in) :: wake_combination_method, TI_calculation_method
  -    logical, intent(in) :: calc_k_star
   
       ! local (General)
       real(dp), dimension(nTurbines) :: yaw, TIturbs, wtVelocity
  +    real(dp) :: ti_area_ratio
       real(dp) :: x0, deltax0, deltay, theta_c_0, sigmay, sigmaz, wake_offset, discontinuity_point
       real(dp) :: x, deltav, deltaz, sigmay_dp, sigmaz_dp, deltax0_dp, deficit_sum, tol, k_star
       real(dp) :: LocalRotorPointY, LocalRotorPointZ, point_velocity, point_z, point_velocity_with_shear
  
positive.code:                         call deltav_near_wake_lin_func(deltay, deltaz, &
                                           & Ct(turb), yaw(turb), sigmay_dp, sigmaz_dp, & 
                                           & rotorDiameter(turb), x, discontinuity_point, sigmay_dp, sigmaz_dp, & 
                                           & opt_exp_fac, deltav)
                
                      end if
                  
  
negative.code:         turbI = sorted_x_idx(d) + 1
          
          do, p=1, nRotorPoints
          
              ! initialize the TI_area_ratio to 0.0 for each turbine
              ti_area_ratio = 0.0_dp
      
              ! initialize deficit summation term to zero
              deficit_sum = 0.0_dp
  