Last change
on this file since 1477 was
1420,
checked in by sglmd, 10 years ago
|
some clean-up: hard coded parameters removed
|
File size:
907 bytes
|
Line | |
---|
1 | SUBROUTINE DTRIDGL(L,AF,BF,CF,DF,XK) |
---|
2 | |
---|
3 | C GCM2.0 Feb 2003 |
---|
4 | |
---|
5 | C DOUBLE PRECISION VERSION OF TRIDGL |
---|
6 | |
---|
7 | !! PARAMETER (NMAX=201) |
---|
8 | IMPLICIT REAL*8 (A-H,O-Z) |
---|
9 | DIMENSION AF(L),BF(L),CF(L),DF(L),XK(L) |
---|
10 | DIMENSION AS(2*L),DS(2*L) |
---|
11 | |
---|
12 | C* THIS SUBROUTINE SOLVES A SYSTEM OF TRIDIAGIONAL MATRIX |
---|
13 | C* EQUATIONS. THE FORM OF THE EQUATIONS ARE: |
---|
14 | C* A(I)*X(I-1) + B(I)*X(I) + C(I)*X(I+1) = D(I) |
---|
15 | C* WHERE I=1,L LESS THAN 103. |
---|
16 | C* ..............REVIEWED -CP........ |
---|
17 | |
---|
18 | C======================================================================C |
---|
19 | |
---|
20 | AS(L) = AF(L)/BF(L) |
---|
21 | DS(L) = DF(L)/BF(L) |
---|
22 | |
---|
23 | DO I=2,L |
---|
24 | X = 1./(BF(L+1-I) - CF(L+1-I)*AS(L+2-I)) |
---|
25 | AS(L+1-I) = AF(L+1-I)*X |
---|
26 | DS(L+1-I) = (DF(L+1-I)-CF(L+1-I)*DS(L+2-I))*X |
---|
27 | END DO |
---|
28 | |
---|
29 | XK(1)=DS(1) |
---|
30 | DO I=2,L |
---|
31 | XKB = XK(I-1) |
---|
32 | XK(I) = DS(I)-AS(I)*XKB |
---|
33 | END DO |
---|
34 | |
---|
35 | RETURN |
---|
36 | END |
---|
Note: See
TracBrowser
for help on using the repository browser.