! $Header$ #include "cctk.h" #include "cctk_Parameters.h" module matinv use constants use lapack implicit none DECLARE_CCTK_PARAMETERS private public calc_inv3 public calc_inv4 contains subroutine calc_inv3 (g3, gu3) CCTK_REAL, intent(in) :: g3(3,3) CCTK_REAL, intent(out) :: gu3(3,3) CCTK_REAL :: tmp(3,3) integer :: ipiv(3) integer :: info character :: msg*1000 tmp = g3 gu3 = delta3 call gesv (3, 3, tmp, 3, ipiv, gu3, 3, info) if (info /= 0) then write (msg, '("Error in call to GESV, info=",i2)') info call CCTK_WARN (0, trim(msg)) end if end subroutine calc_inv3 subroutine calc_inv4 (g4, gu4) CCTK_REAL, intent(in) :: g4(0:3,0:3) CCTK_REAL, intent(out) :: gu4(0:3,0:3) CCTK_REAL :: tmp(0:3,0:3) integer :: ipiv(0:3) integer :: info character :: msg*1000 tmp = g4 gu4 = delta4 call gesv (4, 4, tmp, 4, ipiv, gu4, 4, info) if (info /= 0) then write (msg, '("Error in call to GESV, info=",i2)') info call CCTK_WARN (0, trim(msg)) end if end subroutine calc_inv4 end module matinv