anchor.diff:     ! Root rotations
      CALL BD_CrvExtractCrv(u%RootMotion%Orientation(1:3,1:3,1),x%q(4:6),ErrStat2,ErrMsg2)
         CALL SetErrStat( ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName )
  +   CALL BD_CrvExtractCrv(p%GlbRot,temp_glb,ErrStat2,ErrMsg2)
  +      CALL SetErrStat( ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName )
      temp_cc(:) = MATMUL(p%GlbRot,p%uuN0(4:6,1))
  +   CALL BD_CrvCompose(temp_cc,temp_cc,temp_glb,0,ErrStat2,ErrMsg2)
  +      CALL SetErrStat( ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName )
      CALL BD_CrvCompose(x%q(4:6),x%q(4:6),temp_cc,2,ErrStat2,ErrMsg2)
         CALL SetErrStat( ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName )
      x%q(4:6) = MATMUL(TRANSPOSE(p%GlbRot),x%q(4:6))
  
positive.code:    REAL(ReKi):: cc(3)
     REAL(ReKi):: cc0(3)
     REAL(ReKi):: temp_cc(3)
     REAL(ReKi):: temp_R(3,3)
     REAL(ReKi):: temp6(6)
     REAL(ReKi):: temp_Force(p%dof_total)
  
negative.code:    INTEGER(IntKi)                             :: temp_id
     REAL(ReKi)                                 :: temp3(3)
     REAL(ReKi)                                 :: temp_p0(3)
     REAL(ReKi)                                 :: temp_glb(3)
     TYPE(BD_InputType)                         :: u_tmp
     INTEGER(IntKi)                             :: ErrStat2                     ! Temporary Error status
     CHARACTER(ErrMsgLen)                       :: ErrMsg2                      ! Temporary Error message
  