53 SUBROUTINE ainv(ajac,ajacin,det,ndim)
79 REAL*8,
DIMENSION(ndim,ndim) :: ajac, ajacin
84 det = ajac(1,1)*( ajac(2,2)*ajac(3,3) - ajac(2,3)* &
86 - ajac(1,2)*( ajac(2,1)*ajac(3,3) - ajac(2,3)* &
88 + ajac(1,3)*( ajac(2,1)*ajac(3,2) - ajac(2,2)* &
91 IF(dabs(det).LT.asmall)
THEN
92 print*,
'cannot invert matrix in ainv'
93 print*,
'ABS(det) =', dabs(det)
102 ajacin(1,1) = det*( ajac(2,2)*ajac(3,3) &
103 - ajac(2,3)*ajac(3,2) )
104 ajacin(1,2) = -det*( ajac(1,2)*ajac(3,3) &
105 - ajac(1,3)*ajac(3,2) )
106 ajacin(1,3) = det*( ajac(1,2)*ajac(2,3) &
107 - ajac(1,3)*ajac(2,2) )
108 ajacin(2,1) = -det*( ajac(2,1)*ajac(3,3) &
109 - ajac(2,3)*ajac(3,1) )
110 ajacin(2,2) = det*( ajac(1,1)*ajac(3,3) &
111 - ajac(1,3)*ajac(3,1) )
112 ajacin(2,3) = -det*( ajac(1,1)*ajac(2,3) &
113 - ajac(1,3)*ajac(2,1) )
114 ajacin(3,1) = det*( ajac(2,1)*ajac(3,2) &
115 - ajac(2,2)*ajac(3,1) )
116 ajacin(3,2) = -det*( ajac(1,1)*ajac(3,2) &
117 - ajac(1,2)*ajac(3,1) )
118 ajacin(3,3) = det*( ajac(1,1)*ajac(2,2) &
119 - ajac(1,2)*ajac(2,1) )
subroutine ainv(ajac, ajacin, det, ndim)