anchor.diff:        IF(ALLOCATED(FGB)  ) DEALLOCATE(FGB) 
         IF(ALLOCATED(PhiRb)) DEALLOCATE(PhiRb) 
      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, PhiRb)
  -      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,INTENT(INOUT) :: PhiRb(:,:)!< NOTE: data will be reduced (andw hence reallocated)
  -      !REAL(ReKi), ALLOCATABLE  :: PhiRb(:, :)   
  -      REAL(ReKi), ALLOCATABLE  :: MBBb(:, :)
  -      REAL(ReKi), ALLOCATABLE  :: MBMb(:, :)
  -      REAL(ReKi), ALLOCATABLE  :: KBBb(:, :)
  -      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( FGBb,  p%nDOF__Rb,             'array FGBb',   ErrStat2, ErrMsg2 );
  -      !CALL AllocAry( PhiRb, p%nDOF__L , p%nDOF__Rb, 'matrix PhiRb', ErrStat2, ErrMsg2 );
  -      !................................
  -      ! Convert CBparams%MBB , CBparams%MBM , CBparams%KBB , CBparams%PhiR , FGB to
  -      !                  MBBb,          MBMb,          KBBb,          PHiRb, FGBb
  -      ! (throw out rows/columns of first matrices to create second matrices)
  -      !................................
  -      ! TODO avoid this all together
  -      MBBb  = CBparams%MBB(p%nDOFR__-p%nDOFI__+1:p%nDOFR__, p%nDOFR__-p%nDOFI__+1:p%nDOFR__) 
  -      KBBb  = CBparams%KBB(p%nDOFR__-p%nDOFI__+1:p%nDOFR__, p%nDOFR__-p%nDOFI__+1:p%nDOFR__)    
  -      IF (p%nDOFM > 0) THEN   
  -         MBMb  = CBparams%MBM(p%nDOFR__-p%nDOFI__+1:p%nDOFR__, :               )
  -      END IF
  -      FGBb  = FGB         (p%nDOFR__-p%nDOFI__+1:p%nDOFR__ )
  -      PhiRb = CBparams%PhiR(              :, p%nDOFR__-p%nDOFI__+1:p%nDOFR__)
  -      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 
   
  
positive.code:    ENDIF  
     nL = p%nDOF__L
     nM = p%nDOFM
  
     CALL WrScr('   Performing Craig-Bampton reduction '//trim(Num2LStr(p%nDOF_red))//' DOFs -> '//trim(Num2LStr(p%nDOFM))//' modes + '//trim(Num2LStr(p%nDOF__Rb))//' DOFs')
     CALL AllocAry( FGL,       nL,        'array FGL', ErrStat2, ErrMsg2 ); CALL SetErrStat(ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName)  
  
negative.code:    ! --- Reduced vector of external force
     m%Fext_red = matmul(transpose(p%T_red), m%Fext)
     UFL=0
     UFL= m%Fext_red(p%ID__L)
  
  END SUBROUTINE ConstructUFL
  
  