exchangers,I have run into a bit of a puzzling problem. To solve an complex eigenvalue-problem, I make use of the LAPACK library function ZHEEV. To test the implementation I used a real symmetric matrix:\begin{align*}\left[\begin{array}{c c c c}   2 & 0 & 2 & 0 \\     0 & 2 & 0 & 2 \\   2 & 0 & 2 & 0 \\   0 & 2 & 0 & 2 \\\end{array}\right]\end{align*}which should have eigenvalues: 2x0, 2x4Using ZHEEV I get however 2x -2 and 2x 2.Modifying the implementation to use DSYEV on the other hand gives the correct results.I am missing something very trivial here, but I do not see what it is. This is the subroutine:subroutine solvearray(m)                                                                                         complex(16), dimension(:,:),allocatable :: dmcomplex(16), dimension(:), allocatable :: freq, workcomplex(16) :: Onedoubleprecision, dimension(:),allocatable :: w, rworkinteger,dimension(:,:),allocatable, intent(inout) :: m integer :: n, k, h, l, infoOne = cmplx(1.0,0.0,kind=SELECTED_REAL_KIND(15,300))write(*,'(A)',advance='no') 'order of matrix = '   read(*,*) n  l = 2*n - 1 allocate(work(2*l), rwork(3*n-2), w(n))  w = 0.0  work = 0.0 *One rwork = 0.0  info = 0allocate(dm(1:n,1:n))dm(1:n,1:n) = m(1:n,1:n)*Onewrite(*,*) 'Setup for lapack workspace has been completed.'call ZHEEV('V','U', n, dm, n, w, work, 2*l, rwork, info)write(*,*) 'This is the eigenvector matrix:'do k=1,n      write(*,'(255F8.4)') dm(k,1:n)end do write(*,*) 'These are the eigenvalues :'write(*,'(255F8.4)') w  deallocate(m)           deallocate(W,Work,rwork)end subroutine   
LAPACK: ZHEEV and DSYEV give different eigenvalues for real symmetric matrix
eigenvalues;lapack
Following a similar problem answered by Ian Bush , the problem is solved by knowing that complex(16) is not the same as complex*16. In the specific case of the 64bit compiler used complex*16 needed to be translated to complex(8)...or even better use SELECT_REAL_KIND to define a compiler independent definition:C_double=SELECTED_REAL_KIND(15,307).Thank you all for the help and useful remarks.Danny