anchor.diff:     INTEGER(IntKi)                             :: temp_id
      REAL(ReKi)                                 :: temp3(3)
      REAL(ReKi)                                 :: temp_p0(3)
  +   REAL(ReKi)                                 :: temp_ref(3)
  +   REAL(ReKi)                                 :: temp_root(3)
      REAL(ReKi)                                 :: temp_glb(3)
      TYPE(BD_InputType)                         :: u_tmp
      INTEGER(IntKi)                             :: ErrStat2                     ! Temporary Error status
  
positive.code:            ! Step 2: Compose step1 with rotation vector from p%GlbRot
             ! Initial position (undeformed) rotation vector in global frame obtained
             ! R_0^{T} in global frame
             CALL BD_CrvCompose(temp_p0,temp_p0,temp_glb,0,ErrStat2,ErrMsg2)
             temp_id = ((i-1)*(p%node_elem-1)+j-1)*p%dof_node
             ! Step 3: R = R_{ini} R_0^{T}
             CALL BD_CrvCompose(x%q(temp_id+4:temp_id+6),temp3,temp_p0,2,ErrStat2,ErrMsg2)
             ! Step 4: Rotate rotation parameter (displacement) from global frame to blade frame
             x%q(temp_id+4:temp_id+6) = MATMUL(TRANSPOSE(p%GlbRot),x%q(temp_id+4:temp_id+6))
         ENDDO
  
negative.code: 
     call BD_Input_extrapinterp( u, utimes, u_interp, t+p%dt, ErrStat2, ErrMsg2 )
        call SetErrStat(ErrStat2,ErrMsg2,ErrStat,ErrMsg,RoutineName)
  !WRITE(*,*) 'u_interp'
  !DO i=1,3
  !WRITE(*,*) u_interp%RootMotion%Orientation(i,:,1)
  !ENDDO
  !WRITE(*,*) 'END u_interp'
                   
     ! GA2: prediction        
     CALL BD_TiSchmPredictorStep( x_tmp%q,x_tmp%dqdt,OS_tmp%acc,OS_tmp%xcc,             &
                                  p%coef,p%dt,x%q,x%dqdt,OtherState%acc,OtherState%xcc, &
  