anchor.diff:  !------------------------------------------------------------------------------
   !> This subroutine determines whether R is a valid rotation matrix and, if not,
   !> replaces it with the closest orthongonal rotation matrix
  -SUBROUTINE BD_CheckRotMat(R, Rout, ErrStat, ErrMsg)
   
      REAL(BDKi),       INTENT(IN   )  :: R(3,3)        !< Rotation Matrix input
      REAL(BDKi),       INTENT(  OUT)  :: Rout(3,3)     !< Rotation Matrix output
  
positive.code:    !! It does, however, match equation 5.17 in the March 2016 "BeamDyn User's Guide and Theory Manual"
  
     ! mjs--determine whether R is a valid rotation matrix and correct it if not
     call BD_CheckRotMat(R, Rr, ErrStat2, ErrMsg2)
     CALL SetErrStat(ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName)
     if (ErrStat >= AbortErrLev) return
  
  
negative.code:    ErrStat = ErrID_None
     ErrMsg  = ""
  
  SUBROUTINE BD_CheckRotMat(R, ErrStat, ErrMsg)
     REAL(BDKi),       INTENT(INOUT)  :: R(3,3)               !< Rotation Matrix
     ! mjs--Start by determining if R is a valid rotation matrix using the properties:
        ! 1) the eigenvalues of an orthogonal matrix have complex modulus == 1, where
           ! the leading eigenvalue is +1 and the other two are a comples conjugate pair
  