source: LMDZ5/trunk/libf/dyn3d/limx.F @ 1907

Last change on this file since 1907 was 1907, checked in by lguez, 10 years ago

Added a copyright property to every file of the distribution, except
for the fcm files (which have their own copyright). Use svn propget on
a file to see the copyright. For instance:

$ svn propget copyright libf/phylmd/physiq.F90
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

Also added the files defining the CeCILL version 2 license, in French
and English, at the top of the LMDZ tree.

  • 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.5 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 "comconst.h"
22#include "comgeom.h"
23c
24c
25c   Arguments:
26c   ----------
27      real pente_max
28      REAL s0(ip1jmp1,llm),sm(ip1jmp1,llm)
29      real sx(ip1jmp1,llm)
30c
31c      Local
32c   ---------
33c
34      INTEGER ij,l,j,i,iju,ijq,indu(ip1jmp1),niju
35      integer n0,iadvplus(ip1jmp1,llm),nl(llm)
36c
37      REAL q(ip1jmp1,llm)
38      real dxq(ip1jmp1,llm)
39
40
41      REAL new_m,zm
42      real dxqu(ip1jmp1)
43      real adxqu(ip1jmp1),dxqmax(ip1jmp1)
44
45      Logical extremum,first
46      save first
47
48      REAL      SSUM,CVMGP,CVMGT
49      integer ismax,ismin
50      EXTERNAL  SSUM, convflu,ismin,ismax
51      EXTERNAL filtreg
52
53      data first/.true./
54
55
56       DO  l = 1,llm
57         DO  ij=1,ip1jmp1
58               q(ij,l) = s0(ij,l) / sm ( ij,l )
59               dxq(ij,l) = sx(ij,l) /sm(ij,l)
60         ENDDO
61       ENDDO
62
63c   calcul de la pente a droite et a gauche de la maille
64
65      do l = 1, llm
66         do ij=iip2,ip1jm-1
67            dxqu(ij)=q(ij+1,l)-q(ij,l)
68         enddo
69         do ij=iip1+iip1,ip1jm,iip1
70            dxqu(ij)=dxqu(ij-iim)
71         enddo
72
73         do ij=iip2,ip1jm
74            adxqu(ij)=abs(dxqu(ij))
75         enddo
76
77c   calcul de la pente maximum dans la maille en valeur absolue
78
79         do ij=iip2+1,ip1jm
80            dxqmax(ij)=pente_max*min(adxqu(ij-1),adxqu(ij))
81         enddo
82
83         do ij=iip1+iip1,ip1jm,iip1
84            dxqmax(ij-iim)=dxqmax(ij)
85         enddo
86
87c   calcul de la pente avec limitation
88
89         do ij=iip2+1,ip1jm
90            if(     dxqu(ij-1)*dxqu(ij).gt.0.
91     &         .and. dxq(ij,l)*dxqu(ij).gt.0.) then
92              dxq(ij,l)=
93     &         sign(min(abs(dxq(ij,l)),dxqmax(ij)),dxq(ij,l))
94            else
95c   extremum local
96               dxq(ij,l)=0.
97            endif
98         enddo
99         do ij=iip1+iip1,ip1jm,iip1
100            dxq(ij-iim,l)=dxq(ij,l)
101         enddo
102
103         DO  ij=1,ip1jmp1
104               sx(ij,l) = dxq(ij,l)*sm(ij,l)
105         ENDDO
106
107       ENDDO
108
109      RETURN
110      END
Note: See TracBrowser for help on using the repository browser.