Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=r64), | intent(out) | :: | X(:) | |||
real(kind=r64), | intent(in) | :: | AP(:) | |||
real(kind=r64), | intent(in) | :: | AE(:) | |||
real(kind=r64), | intent(in) | :: | AW(:) | |||
real(kind=r64), | intent(in) | :: | BP(:) | |||
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.
SUBROUTINE TDMA(X,AP,AE,AW,BP,N)
!
! SUBROUTINE INFORMATION:
! AUTHOR JOHN L. WRIGHT
! DATE WRITTEN unknown
! MODIFIED na
!
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! Matrix solver
!
! METHODOLOGY EMPLOYED:
! 1-D TDMA solver.
!
! REFERENCES:
! na
!
! USE STATEMENTS:
! na
!
!
IMPLICIT NONE
! SUBROUTINE ARGUMENT DEFINITIONS:
REAL(r64), INTENT(OUT) :: X(:)
REAL(r64), INTENT(IN) :: AP(:)
REAL(r64), INTENT(IN) :: AE(:)
REAL(r64), INTENT(IN) :: AW(:)
REAL(r64), INTENT(IN) :: BP(:)
INTEGER, INTENT(IN) :: N
!
! SUBROUTINE PARAMETER DEFINITIONS:
! na
! INTERFACE BLOCK SPECIFICATIONS
! na
! DERIVED TYPE DEFINITIONS
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
INTEGER :: J
REAL(r64) :: ALPHA( N), BETA( N), D
! Flow
ALPHA(1)=AE(1)/AP(1)
BETA(1) =BP(1)/AP(1)
DO J=2,N
D = AP(J)-(ALPHA(J-1)*AW(J))
IF ( ABS( D) < .0001d0) THEN
ALPHA( J) = 0.0d0
BETA( J) = 0.0d0
ELSE
ALPHA(J)= AE(J) / D
BETA(J) = ((AW(J)*BETA(J-1)) + BP(J)) / D
END IF
END DO
X( N) = BETA(N)
DO J=N-1,1,-1
X( J)=( ALPHA(J)*X(J+1) ) + BETA(J)
END DO
RETURN
END SUBROUTINE TDMA