1 | SUBROUTINE DTRIDGL(L,AF,BF,CF,DF,XK) |
---|
2 | C DOUBLE PRESCISION VERSION OF TRIDGL |
---|
3 | c PARAMETER (NMAX=201) |
---|
4 | PARAMETER (NMAX=401) |
---|
5 | IMPLICIT REAL (A-H,O-Z) |
---|
6 | DIMENSION AF(L),BF(L),CF(L),DF(L),XK(L) |
---|
7 | DIMENSION AS(NMAX),DS(NMAX) |
---|
8 | C* THIS SUBROUTINE SOLVES A SYSTEM OF TRIDIAGIONAL MATRIX |
---|
9 | C* EQUATIONS. THE FORM OF THE EQUATIONS ARE: |
---|
10 | C* A(I)*X(I-1) + B(I)*X(I) + C(I)*X(I+1) = D(I) |
---|
11 | C* WHERE I=1,L LESS THAN 103. |
---|
12 | C* ..............REVIEWED -CP........ |
---|
13 | AS(L) = AF(L)/BF(L) |
---|
14 | DS(L) = DF(L)/BF(L) |
---|
15 | DO 10 I=2,L |
---|
16 | X=1./(BF(L+1-I) - CF(L+1-I)*AS(L+2-I)) |
---|
17 | AS(L+1-I)=AF(L+1-I)*X |
---|
18 | DS(L+1-I)=(DF(L+1-I)-CF(L+1-I)*DS(L+2-I))*X |
---|
19 | 10 CONTINUE |
---|
20 | XK(1)=DS(1) |
---|
21 | DO 20 I=2,L |
---|
22 | XKB=XK(I-1) |
---|
23 | XK(I)=DS(I)-AS(I)*XKB |
---|
24 | 20 CONTINUE |
---|
25 | 910 FORMAT(/,8X,'AF(I)',7X,'BF(I)',7X,'CF(I)',7X,'DF(I)',7X, |
---|
26 | * 'AS(I)',7X,'DS(I)',7X,'XK(I)',/) |
---|
27 | 915 FORMAT((3X,7(1X,1PE11.4))) |
---|
28 | RETURN |
---|
29 | END |
---|