The Elk Code
 
Loading...
Searching...
No Matches
eveqnzg.f90
Go to the documentation of this file.
1
2! Copyright (C) 2019 J. K. Dewhurst and S. Sharma.
3! This file is distributed under the terms of the GNU General Public License.
4! See the file COPYING for license details.
5
6subroutine eveqnzg(n,ld,a,w)
7use modomp
8implicit none
9! arguments
10integer, intent(in) :: n,ld
11complex(8), intent(inout) :: a(ld,n)
12complex(8), intent(out) :: w(n)
13! local variables
14integer lwork,info
15integer nthd,nts
16! automatic arrays
17real(8) rwork(2*n)
18! allocatable arrays
19complex(8), allocatable :: vr(:,:),work(:)
20lwork=2*n
21allocate(vr(n,n),work(lwork))
22! enable MKL parallelism
23call holdthd(maxthdmkl,nthd)
24nts=mkl_set_num_threads_local(nthd)
25! determine the eigenvalues and right eigenvectors
26call zgeev('N','V',n,a,ld,w,vr,1,vr,n,work,lwork,rwork,info)
27nts=mkl_set_num_threads_local(0)
28call freethd(nthd)
29if (info /= 0) then
30 write(*,*)
31 write(*,'("Error(eveqnzg): diagonalisation failed")')
32 write(*,'(" ZGEEV returned INFO = ",I8)') info
33 write(*,*)
34 stop
35end if
36! copy right eigenvectors to output array
37a(1:n,1:n)=vr(1:n,1:n)
38deallocate(vr,work)
39end subroutine
40
subroutine eveqnzg(n, ld, a, w)
Definition eveqnzg.f90:7
integer maxthdmkl
Definition modomp.f90:15
subroutine holdthd(nloop, nthd)
Definition modomp.f90:78
subroutine freethd(nthd)
Definition modomp.f90:106