source: trunk/LMDZ.COMMON/libf/dyn3d_common/geopot.F @ 1523

Last change on this file since 1523 was 1422, checked in by milmd, 10 years ago

In GENERIC, MARS and COMMON models replace some include files by modules (usefull for decoupling physics with dynamics).

File size: 1.6 KB
Line 
1!
2! $Header$
3!
4      SUBROUTINE geopot (ngrid, teta, pk, pks, phis, phi )
5      IMPLICIT NONE
6
7c=======================================================================
8c
9c   Auteur:  P. Le Van
10c   -------
11c
12c   Objet:
13c   ------
14c
15c    *******************************************************************
16c    ....   calcul du geopotentiel aux milieux des couches    .....
17c    *******************************************************************
18c
19c     ....   l'integration se fait de bas en haut  ....
20c
21c     .. ngrid,teta,pk,pks,phis sont des argum. d'entree pour le s-pg ..
22c              phi               est un  argum. de sortie pour le s-pg .
23c
24c=======================================================================
25c-----------------------------------------------------------------------
26c   Declarations:
27c   -------------
28
29#include "dimensions.h"
30#include "paramet.h"
31
32c   Arguments:
33c   ----------
34
35      INTEGER ngrid
36      REAL teta(ngrid,llm),pks(ngrid),phis(ngrid),pk(ngrid,llm) ,
37     *       phi(ngrid,llm)
38
39
40c   Local:
41c   ------
42
43      INTEGER  l, ij
44
45
46c-----------------------------------------------------------------------
47c     calcul de phi au niveau 1 pres du sol  .....
48
49      DO   1  ij  = 1, ngrid
50      phi( ij,1 ) = phis( ij ) + teta(ij,1) * ( pks(ij) - pk(ij,1) )
51   1  CONTINUE
52
53c     calcul de phi aux niveaux superieurs  .......
54
55      DO  l = 2,llm
56        DO  ij    = 1,ngrid
57        phi(ij,l) = phi(ij,l-1) + 0.5 * ( teta(ij,l)  + teta(ij,l-1) )
58     *                              *   (  pk(ij,l-1) -  pk(ij,l)    )
59        ENDDO
60      ENDDO
61
62      RETURN
63      END
Note: See TracBrowser for help on using the repository browser.