!Testing the QR_SHIFT subroutine... !NB: A and n are changed during QR decomposition! program SHIFT_TEST implicit none integer, parameter :: dbl=SELECTED_REAL_KIND(14), n=3, n_save=3 real(KIND=dbl), dimension(n,n) :: A, Q, R real(KIND=dbl) :: e(n) integer :: i A(1,1)=1 ; A(1,2)=-2 ; A(1,3)=0 A(2,1)=-2 ; A(2,2)=7 ; A(2,3)=5 A(3,1)=0 ; A(3,2)=5 ; A(3,3)=-3 call MATOUT("A is:", A, n, n) CALL QR_SHIFT(A, n, e) call MATOUT("Eigenvalues of A are:", e, n, 1) end program SHIFT_TEST