source: LMDZ5/trunk/libf/dyn3d_common/limz.F @ 2603

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

Cleanup in the dynamics: turn logic.h into module logic_mod.F90
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.1 KB
Line 
1!
2! $Header$
3!
4      SUBROUTINE limz(s0,sz,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 "comgeom.h"
20c
21c
22c   Arguments:
23c   ----------
24      real pente_max
25      REAL s0(ip1jmp1,llm),sm(ip1jmp1,llm)
26      real sz(ip1jmp1,llm)
27c
28c      Local
29c   ---------
30c
31      INTEGER ij,l,j,i,iju,ijq,indu(ip1jmp1),niju
32      integer n0,iadvplus(ip1jmp1,llm),nl(llm)
33c
34      REAL q(ip1jmp1,llm)
35      real dzq(ip1jmp1,llm)
36
37
38      REAL new_m,zm
39      real dzqw(ip1jmp1)
40      real adzqw(ip1jmp1),dzqmax(ip1jmp1)
41
42      Logical extremum,first
43      save first
44
45      REAL      SSUM,CVMGP,CVMGT
46      integer ismax,ismin
47      EXTERNAL  SSUM, ismin,ismax
48
49      data first/.true./
50
51
52       DO  l = 1,llm
53         DO  ij=1,ip1jmp1
54               q(ij,l) = s0(ij,l) / sm ( ij,l )
55               dzq(ij,l) = sz(ij,l) /sm(ij,l)
56         ENDDO
57       ENDDO
58
59c   calcul de la pente en haut et en bas de la maille
60       do ij=1,ip1jmp1
61       do l = 1, llm-1
62            dzqw(l)=q(ij,l+1)-q(ij,l)
63         enddo
64            dzqw(llm)=0.
65
66         do  l=1,llm
67            adzqw(l)=abs(dzqw(l))
68         enddo
69
70c   calcul de la pente maximum dans la maille en valeur absolue
71
72         do l=2,llm-1
73            dzqmax(l)=pente_max*min(adzqw(l-1),adzqw(l))
74         enddo
75
76c   calcul de la pente avec limitation
77
78         do l=2,llm-1
79            if(     dzqw(l-1)*dzqw(l).gt.0.
80     &         .and. dzq(ij,l)*dzqw(l).gt.0.) then
81              dzq(ij,l)=
82     &         sign(min(abs(dzq(ij,l)),dzqmax(l)),dzq(ij,l))
83            else
84c   extremum local
85               dzq(ij,l)=0.
86            endif
87         enddo
88
89         DO  l=1,llm
90               sz(ij,l) = dzq(ij,l)*sm(ij,l)
91         ENDDO
92
93       ENDDO
94
95      RETURN
96      END
Note: See TracBrowser for help on using the repository browser.