The Elk Code
 
Loading...
Searching...
No Matches
zminv.f90
Go to the documentation of this file.
1
2! Copyright (C) 2019 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
6subroutine zminv(n,a)
7use modomp
8implicit none
9! arguments
10integer, intent(in) :: n
11complex(8), intent(inout) :: a(n,n)
12! local variables
13integer info,nthd,nts
14! automatic arrays
15integer ipiv(n)
16complex(8) work(n)
17! enable MKL parallelism
18call holdthd(maxthdmkl,nthd)
19nts=mkl_set_num_threads_local(nthd)
20call zgetrf(n,n,a,n,ipiv,info)
21if (info /= 0) then
22 write(*,*)
23 write(*,'("Error(zminv): unable to invert matrix")')
24 write(*,'(" ZGETRF returned INFO = ",I8)') info
25 write(*,*)
26 stop
27end if
28call zgetri(n,a,n,ipiv,work,n,info)
29if (info /= 0) then
30 write(*,*)
31 write(*,'("Error(zminv): unable to invert matrix")')
32 write(*,'(" ZGETRI returned INFO = ",I8)') info
33 write(*,*)
34 stop
35end if
36nts=mkl_set_num_threads_local(0)
37call freethd(nthd)
38end subroutine
39
integer maxthdmkl
Definition modomp.f90:15
subroutine holdthd(nloop, nthd)
Definition modomp.f90:78
subroutine freethd(nthd)
Definition modomp.f90:106
subroutine zminv(n, a)
Definition zminv.f90:7