anchor.diff:         DO j=1,p%node_elem
              temp_id = ((i-1)*(p%node_elem-1)+j-1)*p%dof_node
              temp_id2= (i-1)*p%node_elem+j
  -           y%BldMotion%TranslationDisp(1:3,temp_id2) = MATMUL(p%GlbRot,x%q(temp_id+1:temp_id+3))
  +           temp_cc(:) = MATMUL(p%GlbRot,x%q(temp_id+1:temp_id+3))
  +           y%BldMotion%TranslationDisp(1,temp_id2) = temp_cc(2)
  +           y%BldMotion%TranslationDisp(2,temp_id2) = temp_cc(3)
  +           y%BldMotion%TranslationDisp(3,temp_id2) = temp_cc(1)
              cc(1:3) = x%q(temp_id+4:temp_id+6)
              temp_id = (j-1)*p%dof_node
              cc0(1:3) = p%uuN0(temp_id+4:temp_id+6,i)
              CALL BD_CrvCompose(temp_cc,cc0,cc,0,ErrStat2,ErrMsg2)
                  CALL SetErrStat( ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName )
              temp_cc = MATMUL(p%GlbRot,temp_cc)
  -           CALL BD_CrvCompose(temp_cc,temp_cc,temp_glb,0,ErrStat2,ErrMsg2)
  +           CALL BD_CrvCompose(cc,temp_cc,temp_glb,0,ErrStat2,ErrMsg2)
                  CALL SetErrStat( ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName )
  +           temp_cc(1) = cc(2)
  +           temp_cc(2) = cc(3)
  +           temp_cc(3) = cc(1)
              CALL BD_CrvMatrixR(temp_cc,temp_R,ErrStat2,ErrMsg2)
                  CALL SetErrStat( ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName )
              y%BldMotion%Orientation(1:3,1:3,temp_id2) = TRANSPOSE(temp_R(1:3,1:3))
   
              temp_id = ((i-1)*(p%node_elem-1)+j-1)*p%dof_node
  -           y%BldMotion%TranslationVel(1:3,temp_id2) = MATMUL(p%GlbRot,x%dqdt(temp_id+1:temp_id+3))
  -           y%BldMotion%RotationVel(1:3,temp_id2) = MATMUL(p%GlbRot,x%dqdt(temp_id+4:temp_id+6))
  +           temp_cc(:) = MATMUL(p%GlbRot,x%dqdt(temp_id+1:temp_id+3))
  +           y%BldMotion%TranslationVel(1,temp_id2) = temp_cc(2)
  +           y%BldMotion%TranslationVel(2,temp_id2) = temp_cc(3)
  +           y%BldMotion%TranslationVel(3,temp_id2) = temp_cc(1)
  +           temp_cc(:) = MATMUL(p%GlbRot,x%dqdt(temp_id+4:temp_id+6))
  +           y%BldMotion%RotationVel(1,temp_id2) = temp_cc(2)
  +           y%BldMotion%RotationVel(2,temp_id2) = temp_cc(3)
  +           y%BldMotion%RotationVel(3,temp_id2) = temp_cc(1)
          ENDDO
      ENDDO
   
  
positive.code:    CHARACTER(*),           INTENT(  OUT):: ErrMsg        ! Error message if ErrStat /= ErrID_None
                                                             ! 1: Blade to Global
     REAL(ReKi)                           :: RotTen(3,3)
     INTEGER(IntKi)                       :: i
  
     ErrStat = ErrID_None
     ErrMsg  = ""
  
     RotTen(1:3,1:3) = p%GlbRot(:,:)
     ! Transform Root Motion from Global to Local (Blade) frame
     u%RootMotion%TranslationDisp(:,1) = MATMUL(TRANSPOSE(RotTen),u%RootMotion%TranslationDisp(:,1))
     u%RootMotion%TranslationVel(:,1)  = MATMUL(TRANSPOSE(RotTen),u%RootMotion%TranslationVel(:,1))
  
negative.code:    temp6(:) = 0.0D0
     IF(p%analysis_type .EQ. 2) THEN
         temp6(1:6) = -OS_tmp%Acc(1:6)
         temp_cc(:) = MATMUL(p%GlbRot,temp6(1:3))
         y%ReactionForce%Force(1,1) = temp_cc(2)
         y%ReactionForce%Force(2,1) = temp_cc(3)
         y%ReactionForce%Force(3,1) = temp_cc(1)
         temp_cc(:) = MATMUL(p%GlbRot,temp6(4:6))
         y%ReactionForce%Moment(1,1) = temp_cc(2)
         y%ReactionForce%Moment(2,1) = temp_cc(3)
         y%ReactionForce%Moment(3,1) = temp_cc(1)
     ENDIF
     DO i=1,p%node_total
         temp_id = (i-1)*p%dof_node
         temp6(:) = 0.0D0
         temp6(:) = temp_Force(temp_id+1:temp_id+6)
         temp_cc(:) = MATMUL(p%GlbRot,temp6(1:3))
         y%BldForce%Force(1,i) = temp_cc(2)
         y%BldForce%Force(2,i) = temp_cc(3)
         y%BldForce%Force(3,i) = temp_cc(1)
         temp_cc(:) = MATMUL(p%GlbRot,temp6(4:6))
         y%BldForce%Moment(1,i) = temp_cc(2)
         y%BldForce%Moment(2,i) = temp_cc(3)
         y%BldForce%Moment(3,i) = temp_cc(1)
     ENDDO
  
     call cleanup()
  