-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathm33det.f90
45 lines (36 loc) · 1.21 KB
/
m33det.f90
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
!***********************************************************************************************************************************
!
! M 3 3 D E T _ M
! A I N
!
! Subroutine: M33DET_MAIN
!
! Programmer: David G. Simpson
! NASA Goddard Space Flight Center
! Greenbelt, Maryland 20771
!
! Date: July 22, 2005
!
! Language: Fortran-90
!
! Version: 1.00a
!
! Description: M33DET computes the determinant a 3x3 matrix.
!
! Files: Source files:
!
! m33det.f90 Main program
!
!***********************************************************************************************************************************
FUNCTION M33DET (A) RESULT (DET)
IMPLICIT NONE
DOUBLE PRECISION, DIMENSION(3,3), INTENT(IN) :: A
DOUBLE PRECISION :: DET
DET = A(1,1)*A(2,2)*A(3,3) &
- A(1,1)*A(2,3)*A(3,2) &
- A(1,2)*A(2,1)*A(3,3) &
+ A(1,2)*A(2,3)*A(3,1) &
+ A(1,3)*A(2,1)*A(3,2) &
- A(1,3)*A(2,2)*A(3,1)
RETURN
END FUNCTION M33DET