Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=r64), | intent(inout) | :: | a(np,np) | |||
real(kind=r64), | intent(out) | :: | y(np,np) | |||
integer, | intent(out) | :: | indx(np) | |||
integer, | intent(in) | :: | np | |||
integer, | intent(in) | :: | n |
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.
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 InvertMatrix(a, y, indx, np, n)
! SUBROUTINE INFORMATION:
! AUTHOR Hans Simmler
! DATE WRITTEN July-Aug 1995
! MODIFIED Aug 2001 (FCW): adapt to EnergyPlus
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! Inverts a matrix.
! METHODOLOGY EMPLOYED:
! Uses LU decomposition.
! REFERENCES:na
! USE STATEMENTS:na
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
INTEGER, INTENT(IN) :: np, n ! Dimension of matrix
REAL(r64), INTENT(INOUT) :: a(np,np) ! Matrix to be inverted !Objexx:ArgIN Changed IN to INOUT: LUDCMP is in-place LU decomposition
REAL(r64), INTENT(OUT) :: y(np,np) ! Inverse of matrix a
INTEGER, INTENT(OUT) :: indx(np) ! Index vector for LU decomposition
! SUBROUTINE LOCAL VARIABLE DEFINITIONS:
INTEGER :: i,j ! Array indices
INTEGER :: d
y=0.0d0
DO i=1,n
y(i,i) = 1.0d0
END DO
indx=0
CALL LUDCMP(a,n,np,indx,d) !Objexx:ArgIN a was marked IN but is modified by this in-place LU decomposition
DO j=1,n
CALL LUBKSB(a,n,np,indx,y(1,j))
END DO
RETURN
END SUBROUTINE InvertMatrix