inv.F90
Go to the documentation of this file.00001 subroutine invmat(nm,mat)
00002 implicit none
00003 integer , intent(in) :: nm
00004 real(8) , intent(inout) :: mat(nm,nm)
00005 integer :: ipiv(nm)
00006 integer :: Lwork
00007 real(8) , allocatable :: work(:)
00008 integer :: info
00009
00010 Lwork = 10*nm
00011 allocate (work(Lwork))
00012 info = 0
00013 call dgetrf(nm,nm,mat,nm,ipiv,info)
00014 call dgetri(nm,mat,nm,ipiv,work,Lwork,info)
00015
00016 if(info /= 0) then
00017 write(6,*) 'info (subrouitine inv):' , info
00018 stop
00019 end if
00020 deallocate(work)
00021 return
00022 end subroutine
00023