source: LMDZ6/branches/Amaury_dev/libf/dyn3d_common/geopot.f90 @ 5209

Last change on this file since 5209 was 5159, checked in by abarral, 7 weeks ago

Put dimensions.h and paramet.h into modules

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