source: LMDZ5/trunk/libf/dyn3d_common/limx.F @ 2597

Last change on this file since 2597 was 2597, checked in by Ehouarn Millour, 8 years ago

Cleanup in the dynamics: get rid of comconst.h, make it a module comconst_mod.
EM

  • Property copyright set to
    Name of program: LMDZ
    Creation date: 1984
    Version: LMDZ5
    License: CeCILL version 2
    Holder: Laboratoire de m\'et\'eorologie dynamique, CNRS, UMR 8539
    See the license file in the root directory
  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.4 KB
Line 
1!
2! $Header$
3!
4      SUBROUTINE limx(s0,sx,sm,pente_max)
5c
6c     Auteurs:   P.Le Van, F.Hourdin, F.Forget
7c
8c    ********************************************************************
9c     Shema  d'advection " pseudo amont " .
10c    ********************************************************************
11c     nq,iq,q,pbaru,pbarv,w sont des arguments d'entree  pour le s-pg ....
12c
13c
14c   --------------------------------------------------------------------
15      IMPLICIT NONE
16c
17      include "dimensions.h"
18      include "paramet.h"
19      include "logic.h"
20      include "comvert.h"
21      include "comgeom.h"
22c
23c
24c   Arguments:
25c   ----------
26      real pente_max
27      REAL s0(ip1jmp1,llm),sm(ip1jmp1,llm)
28      real sx(ip1jmp1,llm)
29c
30c      Local
31c   ---------
32c
33      INTEGER ij,l,j,i,iju,ijq,indu(ip1jmp1),niju
34      integer n0,iadvplus(ip1jmp1,llm),nl(llm)
35c
36      REAL q(ip1jmp1,llm)
37      real dxq(ip1jmp1,llm)
38
39
40      REAL new_m,zm
41      real dxqu(ip1jmp1)
42      real adxqu(ip1jmp1),dxqmax(ip1jmp1)
43
44      Logical extremum,first
45      save first
46
47      REAL      SSUM,CVMGP,CVMGT
48      integer ismax,ismin
49      EXTERNAL  SSUM, ismin,ismax
50
51      data first/.true./
52
53
54       DO  l = 1,llm
55         DO  ij=1,ip1jmp1
56               q(ij,l) = s0(ij,l) / sm ( ij,l )
57               dxq(ij,l) = sx(ij,l) /sm(ij,l)
58         ENDDO
59       ENDDO
60
61c   calcul de la pente a droite et a gauche de la maille
62
63      do l = 1, llm
64         do ij=iip2,ip1jm-1
65            dxqu(ij)=q(ij+1,l)-q(ij,l)
66         enddo
67         do ij=iip1+iip1,ip1jm,iip1
68            dxqu(ij)=dxqu(ij-iim)
69         enddo
70
71         do ij=iip2,ip1jm
72            adxqu(ij)=abs(dxqu(ij))
73         enddo
74
75c   calcul de la pente maximum dans la maille en valeur absolue
76
77         do ij=iip2+1,ip1jm
78            dxqmax(ij)=pente_max*min(adxqu(ij-1),adxqu(ij))
79         enddo
80
81         do ij=iip1+iip1,ip1jm,iip1
82            dxqmax(ij-iim)=dxqmax(ij)
83         enddo
84
85c   calcul de la pente avec limitation
86
87         do ij=iip2+1,ip1jm
88            if(     dxqu(ij-1)*dxqu(ij).gt.0.
89     &         .and. dxq(ij,l)*dxqu(ij).gt.0.) then
90              dxq(ij,l)=
91     &         sign(min(abs(dxq(ij,l)),dxqmax(ij)),dxq(ij,l))
92            else
93c   extremum local
94               dxq(ij,l)=0.
95            endif
96         enddo
97         do ij=iip1+iip1,ip1jm,iip1
98            dxq(ij-iim,l)=dxq(ij,l)
99         enddo
100
101         DO  ij=1,ip1jmp1
102               sx(ij,l) = dxq(ij,l)*sm(ij,l)
103         ENDDO
104
105       ENDDO
106
107      RETURN
108      END
Note: See TracBrowser for help on using the repository browser.