source: trunk/LMDZ.PLUTO.old/libf/phypluto/dtridgl.F @ 3436

Last change on this file since 3436 was 3175, checked in by emillour, 11 months ago

Pluto PCM:
Add the old Pluto LMDZ for reference (required prior step to making
an LMDZ.PLUTO using the same framework as the other physics packages).
TB+EM

File size: 1.1 KB
Line 
1      SUBROUTINE DTRIDGL(L,AF,BF,CF,DF,XK)
2
3C  GCM2.0  Feb 2003
4
5C     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(NMAX),DS(NMAX)
11      DIMENSION AS(2*L),DS(2*L)
12
13C*    THIS SUBROUTINE SOLVES A SYSTEM OF TRIDIAGIONAL MATRIX
14C*    EQUATIONS. THE FORM OF THE EQUATIONS ARE:
15C*    A(I)*X(I-1) + B(I)*X(I) + C(I)*X(I+1) = D(I)
16C*    WHERE I=1,L  LESS THAN 103.
17C* ..............REVIEWED -CP........
18
19C======================================================================C
20
21      AS(L) = AF(L)/BF(L)
22      DS(L) = DF(L)/BF(L)
23
24      DO I=2,L
25        !print*, 'BF=',BF(L+1-I)
26        !print*, 'AS=',AS(L+2-I)
27        !print*, 'CF=',CF(L+1-I)
28        !!! modif TB22:
29        !BF(L+1-I)=max(BF(L+1-I),1e-20)
30        X         = 1./(BF(L+1-I) - CF(L+1-I)*AS(L+2-I))
31        AS(L+1-I) = AF(L+1-I)*X
32        DS(L+1-I) = (DF(L+1-I)-CF(L+1-I)*DS(L+2-I))*X
33      END DO
34 
35      XK(1)=DS(1)
36      DO I=2,L
37        XKB   = XK(I-1)
38        XK(I) = DS(I)-AS(I)*XKB
39      END DO
40      !print*, 'TB22 dtrigl done'
41
42      RETURN
43      END
Note: See TracBrowser for help on using the repository browser.