The Elk Code
eveqnzh.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
eveqnzh
(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
16
integer
nts,info,nthd
17
! automatic arrays
18
integer
iwork(3+5*n)
19
! allocatable arrays
20
real(8)
,
allocatable
:: rwork(:)
21
complex(8)
,
allocatable
:: work(:)
22
lwork=2*n+n**2
23
lrwork=1+5*n+2*n**2
24
allocate
(work(lwork),rwork(lrwork))
25
! enable MKL parallelism
26
call
holdthd
(
maxthdmkl
,nthd)
27
nts=mkl_set_num_threads_local(nthd)
28
call
zheevd(
'V'
,
'U'
,n,a,ld,w,work,lwork,rwork,lrwork,iwork,3+5*n,info)
29
nts=mkl_set_num_threads_local(0)
30
call
freethd
(nthd)
31
if
(info /= 0)
then
32
write
(*,*)
33
write
(*,
'("Error(eveqnzh): diagonalisation failed")'
)
34
write
(*,
'(" ZHEEVD returned INFO = ",I0)'
) info
35
write
(*,*)
36
stop
37
end if
38
deallocate
(rwork,work)
39
end subroutine
40
modomp
Definition:
modomp.f90:6
modomp::maxthdmkl
integer maxthdmkl
Definition:
modomp.f90:15
eveqnzh
subroutine eveqnzh(n, ld, a, w)
Definition:
eveqnzh.f90:7
modmain
Definition:
modmain.f90:6
modomp::freethd
subroutine freethd(nthd)
Definition:
modomp.f90:112
modomp::holdthd
subroutine holdthd(nloop, nthd)
Definition:
modomp.f90:78
eveqnzh.f90
Generated by
1.8.14