git push -u origin main
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
SUBROUTINE TRIDAG(A,B,C,R,U,N)
|
||||
C ==============================
|
||||
C
|
||||
C Solve tridiagonal system of equations
|
||||
C from Numerical Recipes (standard Gaussian elimination)
|
||||
C
|
||||
INCLUDE 'PARAMS.FOR'
|
||||
INCLUDE 'WINCOM.FOR'
|
||||
DIMENSION A(N),B(N),C(N),R(N),U(N)
|
||||
DIMENSION GTRID(MKU)
|
||||
C
|
||||
BTRID=B(1)
|
||||
U(1)=R(1)/BTRID
|
||||
DO J=2,N
|
||||
GTRID(J)=C(J-1)/BTRID
|
||||
BTRID=B(J)-A(J)*GTRID(J)
|
||||
U(J)=(R(J)-A(J)*U(J-1))/BTRID
|
||||
ENDDO
|
||||
DO J=N-1,1,-1
|
||||
U(J)=U(J)-GTRID(J+1)*U(J+1)
|
||||
ENDDO
|
||||
C
|
||||
RETURN
|
||||
END
|
||||
Reference in New Issue
Block a user