anchor.diff:     CHARACTER(*),          INTENT(  OUT)      :: ErrMsg      ! Error message if ErrStat /= ErrID_None   
      ! local variables
      REAL(ReKi), ALLOCATABLE  :: FGR(:), FGL(:), FGB(:), FGM(:) !< Partitioned Force (R/L), and CB reduced forces(B/M)
  +   REAL(ReKi), ALLOCATABLE  :: PhiRb(:, :)  ! Purely to avoid loosing these modes for output ! TODO, kept for backward compatibility of Summary file
      REAL(ReKi)               :: JDamping1 ! temporary storage for first element of JDamping array 
      INTEGER(IntKi)           :: i
      INTEGER(IntKi)           :: nR     !< Dimension of R DOFs (to switch between __R and R__)
  
positive.code:       IF(ALLOCATED(FGL)  ) DEALLOCATE(FGL) 
        IF(ALLOCATED(FGM)  ) DEALLOCATE(FGM) 
        IF(ALLOCATED(FGB)  ) DEALLOCATE(FGB) 
     end subroutine CleanUpCB
  
     !> Remove fixed DOF from system, this is in case the CB was done on an unconstrained system
     !! NOTE: PhiL and OmegaL are not modified
     subroutine applyConstr(CBParams, FGB)
        TYPE(CB_MatArrays),  INTENT(INOUT) :: CBparams    !< NOTE: data will be reduced (andw hence reallocated)
        REAL(ReKi),ALLOCATABLE,INTENT(INOUT) :: FGB(:)      !< NOTE: data will be reduced (andw hence reallocated)
        REAL(ReKi), ALLOCATABLE  :: MBBb(:, :)
        REAL(ReKi), ALLOCATABLE  :: MBMb(:, :)
        REAL(ReKi), ALLOCATABLE  :: KBBb(:, :)
        REAL(ReKi), ALLOCATABLE  :: PhiRb(:, :)   
        REAL(ReKi), ALLOCATABLE  :: FGBb(:) 
        ! "b" stands for "bar"
        CALL AllocAry( MBBb,  p%nDOF__Rb, p%nDOF__Rb, 'matrix MBBb',  ErrStat2, ErrMsg2 );
        CALL AllocAry( MBmb,  p%nDOF__Rb, p%nDOFM,    'matrix MBmb',  ErrStat2, ErrMsg2 );
        CALL AllocAry( KBBb,  p%nDOF__Rb, p%nDOF__Rb, 'matrix KBBb',  ErrStat2, ErrMsg2 );
        CALL AllocAry( PhiRb, p%nDOF__L , p%nDOF__Rb, 'matrix PhiRb', ErrStat2, ErrMsg2 );
        CALL AllocAry( FGBb,  p%nDOF__Rb,             'array FGBb',   ErrStat2, ErrMsg2 );
        !................................
        ! Convert CBparams%MBB , CBparams%MBM , CBparams%KBB , CBparams%PhiR , FGB to
        !                  MBBb,          MBMb,          KBBb,          PHiRb, FGBb
  
negative.code:       deallocate(CBparams%MBB)
        deallocate(CBparams%KBB)
        deallocate(CBparams%MBM)
        !deallocate(CBparams%PhiR)
        call move_alloc(MBBb,  CBparams%MBB)
        call move_alloc(KBBb,  CBparams%KBB)
        call move_alloc(MBMb,  CBparams%MBM)
        call move_alloc(FGBb,  FGB)
        !call move_alloc(PhiRb, CBparams%PhiR)
     end subroutine applyConstr
  
  END SUBROUTINE SD_Craig_Bampton 
  