anchor.diff:                      deltaz = turbineZ(turbI) - turbineZ(turb)
                   
                       ! horizontal spread at far wake onset
  -                    call sigmay_func(ky, 0.0_dp, rotorDiameter(turb), yaw(turb), sigmay0)
  +                    call sigmay_func(ky_local, 0.0_dp, rotorDiameter(turb), yaw(turb), sigmay0)
                   
                       ! vertical spread at far wake onset
  -                    call sigmaz_func(kz, 0.0_dp, rotorDiameter(turb), sigmaz0)
  +                    call sigmaz_func(kz_local, 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, &
  
positive.code:     
      ! initialize TI of all turbines to free-stream value
      TIturbs = TI
  
      do, d=1, nTurbines
      
  
negative.code:                     call theta_c_0_func(yaw(turb), Ct(turb), theta_c_0)
              
                      ! horizontal spread
                      call sigmay_func(ky_local, deltax0, rotorDiameter(turb), yaw(turb), sigmay)
                  
                      ! vertical spread
                      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_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)
  