anchor.diff:        TYPE(SD_MiscVarType),           INTENT(INOUT)  :: m           !< Misc/optimization variables
         INTEGER(IntKi),                 INTENT(  OUT)  :: ErrStat     !< Error status of the operation
         CHARACTER(*),                   INTENT(  OUT)  :: ErrMsg      !< Error message if ErrStat /= ErrID_None
  -
  -
         ! local variables
         TYPE(SD_ContinuousStateType) :: xdot       ! Continuous state derivs at t
         TYPE(SD_InputType)           :: u_interp
  -         
  -
  -      ! Initialize ErrStat
   
         ErrStat = ErrID_None
         ErrMsg  = "" 
  
positive.code:    
           x%qmdot = x%qmdot + (p%SDDeltaT / 24.) * ( 9. * xdot_pred%qmdot + 19. * OtherState%xdot(1)%qmdot - 5. * OtherState%xdot(2)%qmdot &
                                            + 1. * OtherState%xdot(3)%qmdot )
           
           CALL SD_DestroyContState( xdot_pred, ErrStat, ErrMsg) ! local copy no longer needed
  
        else
  
           x%qm    = x_pred%qm
           x%qmdot = x_pred%qmdot
  
        endif
  
        CALL SD_DestroyContState( x_pred, ErrStat, ErrMsg) ! local copy no longer needed
  
negative.code:    
              
     IF(Init%CBMod) THEN ! C-B reduction         
        ! check number of internal modes
        IF(p%Nmodes > p%DOFL) THEN
           CALL SetErrStat(ErrID_Fatal,'Number of internal modes is larger than maximum. ',ErrStat,ErrMsg,'Craig_Bampton')
           CALL CleanupCB()
  