anchor.diff:                 ! 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,'SetParameters')
  +            CALL SetErrStat(ErrStat2,ErrMsg2,ErrStat,ErrMsg,RoutineName)
               IF ( ErrStat >= AbortErrLev ) RETURN
                   
         END IF     
  
positive.code:          OmegaL(I) = 0.0_ReKi
        END DO     
     
        !....................................................
        ! Set p%PhiL_T and p%PhiLInvOmgL2 for static improvement
        !....................................................
  
negative.code:             
        
        ! D2_53, D2_63, D2_64 
        p%D2_63 = MATMUL( p%PhiM, p%MMB )
        p%D2_63 = p%PhiRb_TI - p%D2_63
  
        !p%D2_64 = MATMUL( p%PhiM, p%PhiM_T )  !bjj: why does this use stack space?
        CALL LAPACK_GEMM( 'N', 'N', 1.0_ReKi, p%PhiM, p%PhiM_T, 0.0_ReKi, p%D2_64, ErrStat2, ErrMsg2 ) !bjj: replaced MATMUL with this routine to avoid issues with stack size
           CALL SetErrStat(ErrStat2,ErrMsg2,ErrStat,ErrMsg,RoutineName)
              
        ! F2_61
        p%F2_61 = MATMUL( p%D2_64, FGL )       
                                
  