anchor.diff:    IMPLICIT NONE
   
     INTEGER, PARAMETER  :: FEKi = R8Ki  ! Define the kind to be used for FEM
  +  INTEGER, PARAMETER  :: LaKi = R8Ki  ! Define the kind to be used for LaPack
    
   CONTAINS
   !------------------------------------------------------------------------------------------------------
  
positive.code: SUBROUTINE EigenSolve(K, M, N, bCheckSingularity, EigVect, Omega, ErrStat, ErrMsg )
     USE NWTC_LAPACK, only: LAPACK_ggev
     INTEGER       ,          INTENT(IN   )    :: N             !< Number of degrees of freedom, size of M and K
     REAL(FEKi),              INTENT(INOUT)    :: K(N, N)       !< Stiffness matrix 
     REAL(FEKi),              INTENT(INOUT)    :: M(N, N)       !< Mass matrix 
     LOGICAL,                 INTENT(IN   )    :: bCheckSingularity                  ! If True, the solver will fail if rigid modes are present 
     REAL(FEKi),              INTENT(INOUT)    :: EigVect(N, N) !< Returned Eigenvectors
     REAL(FEKi),              INTENT(INOUT)    :: Omega(N)      !< Returned Eigenvalues
     INTEGER(IntKi),          INTENT(  OUT)    :: ErrStat       !< Error status of the operation
     CHARACTER(*),            INTENT(  OUT)    :: ErrMsg        !< Error message if ErrStat /= ErrID_None
     ! LOCALS         
     REAL(FEKi), ALLOCATABLE                   :: WORK (:),  VL(:,:), AlphaR(:), AlphaI(:), BETA(:) ! eigensolver variables
     INTEGER                                   :: i  
     INTEGER                                   :: LWORK                          !variables for the eigensolver
     INTEGER,    ALLOCATABLE                   :: KEY(:)
     INTEGER(IntKi)                            :: ErrStat2
     CHARACTER(ErrMsgLen)                      :: ErrMsg2
     REAL(FEKi) :: normA
     REAL(FEKi) :: Omega2(N)  !< Squared eigenvalues
     REAL(FEKi), parameter :: MAX_EIGENVALUE = HUGE(1.0_ReKi) ! To avoid overflow when switching to ReKi
        
     ErrStat = ErrID_None
     ErrMsg  = ''
  
negative.code:    call BreakSysMtrx(MM, KK, IDR, IDL, nR, nL, MRR, MLL, MRL, KRR, KLL, KRL, FG=FG, FGR=FGR, FGL=FGL, CC=CC, CRR=CRR, CLL=CLL, CRL=CRL)
     ! --- CB reduction
     call CraigBamptonReduction_FromPartition( MRR, MLL, MRL, KRR, KLL, KRL, nR, nL, nM, nM_Out,& !< Inputs 
                                MBB, MBM, KBB, PhiL, PhiR, OmegaL, ErrStat2, ErrMsg2, & !< Outputs
                                CRR=CRR, CLL=CLL, CRL=CRL,& !< Optional inputs
                                CBB=CBB, CBM=CBM, CMM=CMM)  !< Optional Outputs
     if(Failed()) return
  
  
     ! --- Reduction of force if provided
     if (present(FG).and.present(FGR).and.present(FGL)) then
  