The Elk Code
rminv.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 
6 subroutine rminv(n,a)
7 implicit none
8 ! arguments
9 integer, intent(in) :: n
10 real(8), intent(inout) :: a(n,n)
11 ! local variables
12 integer info
13 ! automatic arrays
14 integer ipiv(n)
15 real(8) work(n)
16 call dgetrf(n,n,a,n,ipiv,info)
17 if (info /= 0) then
18  write(*,*)
19  write(*,'("Error(rminv): unable to invert matrix")')
20  write(*,'(" DGETRF returned INFO = ",I8)') info
21  write(*,*)
22  stop
23 end if
24 call dgetri(n,a,n,ipiv,work,n,info)
25 if (info /= 0) then
26  write(*,*)
27  write(*,'("Error(rminv): unable to invert matrix")')
28  write(*,'(" DGETRI returned INFO = ",I8)') info
29  write(*,*)
30  stop
31 end if
32 end subroutine
33 
subroutine rminv(n, a)
Definition: rminv.f90:7