The Elk Code
zheevdi.f90
Go to the documentation of this file.
1 
2 ! Copyright (C) 2016 J. K. Dewhurst, S. Sharma and E. K. U. Gross.
3 ! This file is distributed under the terms of the GNU General Public License.
4 ! See the file COPYING for license details.
5 
6 subroutine zheevdi(n,ld,a,w)
7 use modmain
8 use modomp
9 implicit none
10 ! arguments
11 integer, intent(in) :: n,ld
12 complex(8), intent(inout) :: a(ld,n)
13 real(8), intent(out) :: w(n)
14 ! local variables
15 integer lwork,lrwork,liwork
16 integer nts,info,nthd
17 ! allocatable arrays
18 real(8), allocatable :: rwork(:)
19 complex(8), allocatable :: work(:)
20 lwork=2*n+n**2
21 lrwork=1+5*n+2*n**2
22 liwork=3+5*n
23 allocate(work(lwork),rwork(lrwork))
24 ! enable MKL parallelism
25 call holdthd(maxthdmkl,nthd)
26 nts=mkl_set_num_threads_local(nthd)
27 block
28 integer iwork(liwork)
29 call zheevd('V','U',n,a,ld,w,work,lwork,rwork,lrwork,iwork,liwork,info)
30 end block
31 nts=mkl_set_num_threads_local(0)
32 call freethd(nthd)
33 if (info /= 0) then
34  write(*,*)
35  write(*,'("Error(zheevdi): diagonalisation failed")')
36  write(*,'(" ZHEEVD returned INFO = ",I0)') info
37  write(*,*)
38  stop
39 end if
40 deallocate(rwork,work)
41 end subroutine
42 
Definition: modomp.f90:6
integer maxthdmkl
Definition: modomp.f90:15
subroutine zheevdi(n, ld, a, w)
Definition: zheevdi.f90:7
subroutine freethd(nthd)
Definition: modomp.f90:112
subroutine holdthd(nloop, nthd)
Definition: modomp.f90:78