Nodes of different colours represent the following:
Solid arrows point from a parent (sub)module to the submodule which is descended from it. Dashed arrows point from a module being used to the module or program unit using it. Where possible, edges connecting nodes are given different colours to make them easier to distinguish in large graphs.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=r64), | intent(in) | :: | A(3,3) | |||
real(kind=r64), | intent(out) | :: | InverseA(3,3) |
Nodes of different colours represent the following:
Solid arrows point from a procedure to one which it calls. Dashed arrows point from an interface to procedures which implement that interface. This could include the module procedures in a generic interface or the implementation in a submodule of an interface in a parent module. Where possible, edges connecting nodes are given different colours to make them easier to distinguish in large graphs.
SUBROUTINE Invert3By3Matrix(A,InverseA)
! SUBROUTINE INFORMATION:
! AUTHOR George Walton
! DATE WRITTEN August 1976
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! This subroutine computes the inverse of a 3x3 matrix by the
! cofactor method.
! METHODOLOGY EMPLOYED:
! na
! REFERENCES:
! na
! USE STATEMENTS:
USE DataGlobals, ONLY: OutputFileStandard
USE DataInterfaces, ONLY: ShowFatalError
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
REAL(r64), INTENT(IN) :: A(3,3) ! Input 3X3 Matrix
REAL(r64), INTENT(OUT) :: InverseA(3,3) ! Output 3X3 Matrix - Inverse Of A
! SUBROUTINE PARAMETER DEFINITIONS:
! na
! INTERFACE BLOCK SPECIFICATIONS
! na
! DERIVED TYPE DEFINITIONS
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
REAL(r64) :: Determinant ! Determinant of Matrix A
! Compute Determinant
Determinant = A(1,1)*A(2,2)*A(3,3)+A(1,2)*A(2,3)*A(3,1)+A(1,3)*A(2,1)*A(3,2) &
-A(1,1)*A(3,2)*A(2,3)-A(2,1)*A(1,2)*A(3,3)-A(3,1)*A(2,2)*A(1,3)
IF (ABS(Determinant) < .1D-12) THEN
CALL ShowFatalError('Determinant = [Zero] in Invert3By3Matrix',OutputFileStandard)
END IF
! Compute Inverse
InverseA(1,1) = (A(2,2)*A(3,3)-A(3,2)*A(2,3))/Determinant
InverseA(2,1) = (A(3,1)*A(2,3)-A(2,1)*A(3,3))/Determinant
InverseA(3,1) = (A(2,1)*A(3,2)-A(3,1)*A(2,2))/Determinant
InverseA(1,2) = (A(3,2)*A(1,3)-A(1,2)*A(3,3))/Determinant
InverseA(2,2) = (A(1,1)*A(3,3)-A(3,1)*A(1,3))/Determinant
InverseA(3,2) = (A(3,1)*A(1,2)-A(1,1)*A(3,2))/Determinant
InverseA(1,3) = (A(1,2)*A(2,3)-A(2,2)*A(1,3))/Determinant
InverseA(2,3) = (A(2,1)*A(1,3)-A(1,1)*A(2,3))/Determinant
InverseA(3,3) = (A(1,1)*A(2,2)-A(2,1)*A(1,2))/Determinant
RETURN
END SUBROUTINE Invert3By3Matrix