source: trunk/LMDZ.COMMON/libf/evolution/NS_tridag.F90 @ 3514

Last change on this file since 3514 was 3498, checked in by jbclement, 2 weeks ago

PEM:

  • Correction of the variable name for the ice table depth in "pemetat0.F90". So it is now got as intended from the "startpem.nc" file;
  • Renaming of the tendencies in the PEM with the prefix 'd_' instead of 'tend_';
  • Modification of the PEM time step type from integer to real. As a consequence, all time variables are now of real type. This change adds the possibility to consider fractions of year as time step.

JBC

File size: 849 bytes
Line 
1!================================================
2! Tridiagonal solver
3!================================================
4      SUBROUTINE tridag(a,b,c,r,u,n)
5      INTEGER n,NMAX
6      REAL*8 a(n),b(n),c(n),r(n),u(n)
7      PARAMETER (NMAX=1000)
8      INTEGER j
9      REAL*8 bet,gam(NMAX)
10      if(b(1).eq.0.) then
11         stop 'tridag: rewrite equations'
12      endif
13!      if(n.gt.NMAX) then
14!         print *, 'tridag: too many points, set NMAX>',n
15!         stop
16!      endif
17      bet=b(1)
18      u(1)=r(1)/bet
19      do j=2,n
20        gam(j)=c(j-1)/bet
21        bet=b(j)-a(j)*gam(j)
22!        if(bet.eq.0.)pause 'tridag failed'
23        u(j)=(r(j)-a(j)*u(j-1))/bet
24      enddo
25      do j=n-1,1,-1
26        u(j)=u(j)-gam(j+1)*u(j+1)
27      enddo
28!      return
29      END SUBROUTINE tridag
30!  (C) Copr. 1986-92 Numerical Recipes Software 0(9p#31&#5(+.
Note: See TracBrowser for help on using the repository browser.