PROGRAM TEST_EXTENDED_PRECISION
USE EXTENDED_PRECISION

IMPLICIT NONE

INTEGER, PARAMETER ::  N = 3
REAL( KIND = EXTRA_LONG_REAL) :: RHS(N,N),  LHS(N,N)

INTEGER :: I, INFO, IPIV(N)

    RHS(:,:) = 0.0_EXTRA_LONG_REAL
    DO I = 1, N
    RHS(I,I) = 1.0_EXTRA_LONG_REAL
    ENDDO
    
    LHS(:,:) = 0.0_EXTRA_LONG_REAL
    DO I = 1, N
    LHS(I,I) = REAL(I, KIND = EXTRA_LONG_REAL)
    ENDDO

   ! PRINT*, LHS
    PRINT*, 'CALLING ILAENV'
     PRINT*, ILAENV( 1, 'DGETRF', ' ', N, N, -1, -1 )
   
    CALL  E_DGETRF(N, N, LHS, N, IPIV, INFO) 
    IF( INFO .NE. 0) THEN
    PRINT*, 'SUBROUTINE COMPUTE_MATRIX_EXPONENTIALS'
    PRINT*, 'CALL TO E_DGETRF GAVE INFO = ', INFO
    STOP
    ENDIF
    
    CALL  E_DGETRS('N', N,N, LHS, N, IPIV, RHS, N, INFO )	
    IF( INFO .NE. 0) THEN
    PRINT*, 'SUBROUTINE COMPUTE_MATRIX_EXPONENTIALS'
    PRINT*, 'CALL TO DGETRS GAVE INFO = ', INFO
    STOP
    ENDIF
  
    
    PRINT*, RHS

      


END PROGRAM TEST_EXTENDED_PRECISION
