anchor.diff:     INTEGER(IntKi)                            :: ErrStat2
      CHARACTER(LEN(ErrMsg))                    :: ErrMsg2
   
  +   CHARACTER(*), PARAMETER                   :: RoutineName = 'SetParameters'
      
      ErrStat = ErrID_None 
      ErrMsg  = ''
  
positive.code:    !....................................................
     IF ( DOFvar > 0 ) THEN ! Only time this wouldn't happen is if no modes retained and no static improvement...
        CALL EigenSolve(KLL, MLL, p%DOFL, DOFvar, .False.,Init,p, PhiL(:,1:DOFvar), OmegaL(1:DOFvar),  ErrStat2, ErrMsg2)
           CALL SetErrStat(ErrStat2,ErrMsg2,ErrStat,ErrMsg,'CBMatrix')
           IF ( ErrStat >= AbortErrLev ) RETURN
           
        ! normalize PhiL
        MU = MATMUL ( MATMUL( TRANSPOSE(PhiL), MLL ), PhiL )
     
     
        ! PhiL = MATMUL( PhiL, MU2 )  !this is the nondimensionalization (MU2 is diagonal)   
        DO I = 1, DOFvar
           PhiL(:,I) = PhiL(:,I) / SQRT( MU(I, I) )
  
negative.code:                ! Now need to factor it:        
           !I think it could be improved and made more efficient if we can say the matrix is positive definite
           CALL LAPACK_getrf( n, n, p%AM2Jac, p%AM2JacPiv, ErrStat2, ErrMsg2)
              CALL SetErrStat(ErrStat2,ErrMsg2,ErrStat,ErrMsg,RoutineName)
              IF ( ErrStat >= AbortErrLev ) RETURN
                  
        END IF     
  