anchor.diff:        END DO
       END DO
       
  -    TI_apprant = ((TI_apprant_accumulation / REAL(counter2))**0.5)
  +    TI_apprant = ((TI_apprant_accumulation / REAL(counter2,ReKi))**0.5)
     
       
      !-------------------------------------------------------------------------------------------------
  
positive.code:     TYPE(DWM_MiscVarType),           INTENT(INOUT)   :: m
      TYPE(DWM_OutputType),            INTENT(INOUT)   :: y
      
      REAL             ::       TI_downstream_total     ! TI of a downstream turbine
      REAL             ::       spacing                 ! the spacing between the downwind turbine and this upwind turbine
      REAL             ::       angle                   ! the angle between the downwind turbine and the line connecting this upwind turbine and the wind direction
      REAL             ::       velocity_matrix(:,:)    ! the velocity matrix at the certain downswind turbine
      
      ! local variables
      REAL, ALLOCATABLE  ::  TI_downstream_matrix(:,:)
      INTEGER            ::  i,j,k
      INTEGER            ::  cross_plane_position_ds   ! the cross plane position which to be investigated in term of the flying time
      INTEGER            ::  cross_plane_position_TI   ! the cross plane position which to be investigated in term of the m%DWDD%n_x_vector
  
negative.code:     
      INTEGER           ::    num_element
      INTEGER           ::    i
      REAL(ReKi)              ::    r_t ( num_element )              ! The distance from the node to the hub
      REAL(ReKi)              ::    turbine_mean_velocity            ! turbine mean velocity
      REAL(ReKi)              ::    node_radius    ( num_element )
      REAL(ReKi)              ::    element_length ( num_element )
      REAL(ReKi)              ::    TI_normalization
      REAL(ReKi)              ::    FAST_Time
      
      ! check if the meandering simulation time is valid
      IF (p%WakePosition_1 < FAST_Time/ ( (20*p%RotorR/p%p_p_r)/(0.32*p%Uambient) ) + 1 ) THEN
  