source: LMDZ6/trunk/libf/dyn3d_common/divgrad2.f90 @ 5271

Last change on this file since 5271 was 5271, checked in by abarral, 24 hours ago

Move dimensions.h into a module
Nb: doesn't compile yet

  • 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.9 KB
Line 
1!
2! $Header$
3!
4SUBROUTINE divgrad2 ( klevel, h, deltapres, lh, divgra )
5  !
6  ! P. Le Van
7  !
8  !   ***************************************************************
9  !
10  ! .....   calcul de  (div( grad ))   de (  pext * h ) .....
11  !   ****************************************************************
12  !   h ,klevel,lh et pext  sont des arguments  d'entree pour le s-prg
13  !     divgra     est  un argument  de sortie pour le s-prg
14  !
15  USE dimensions_mod, ONLY: iim, jjm, llm, ndm
16IMPLICIT NONE
17  !
18
19  INCLUDE "paramet.h"
20  INCLUDE "comgeom2.h"
21  INCLUDE "comdissipn.h"
22
23  !    .......    variables en arguments   .......
24  !
25  INTEGER :: klevel
26  REAL :: h( ip1jmp1,klevel ), deltapres( ip1jmp1,klevel )
27  REAL :: divgra( ip1jmp1,klevel)
28  !
29  !    .......    variables  locales    ..........
30  !
31  REAL :: signe, nudivgrs, sqrtps( ip1jmp1,llm )
32  INTEGER :: l,ij,iter,lh
33  !    ...................................................................
34
35  !
36  signe    = (-1.)**lh
37  nudivgrs = signe * cdivh
38
39  CALL SCOPY ( ip1jmp1 * klevel, h, 1, divgra, 1 )
40
41  !
42  CALL laplacien( klevel, divgra, divgra )
43
44  DO l = 1, klevel
45   DO ij = 1, ip1jmp1
46    sqrtps( ij,l ) = SQRT( deltapres(ij,l) )
47   ENDDO
48  ENDDO
49  !
50  DO l = 1, klevel
51    DO ij = 1, ip1jmp1
52     divgra(ij,l) = divgra(ij,l) * sqrtps(ij,l)
53    ENDDO
54  ENDDO
55
56  !    ........    Iteration de l'operateur  laplacien_gam    ........
57  !
58  DO  iter = 1, lh - 2
59   CALL laplacien_gam ( klevel,cuvscvgam2,cvuscugam2,unsair_gam2, &
60         unsapolnga2, unsapolsga2,  divgra, divgra )
61  ENDDO
62  !
63  !    ...............................................................
64
65  DO l = 1, klevel
66    DO ij = 1, ip1jmp1
67      divgra(ij,l) = divgra(ij,l) * sqrtps(ij,l)
68    ENDDO
69  ENDDO
70  !
71  CALL laplacien ( klevel, divgra, divgra )
72  !
73  DO l  = 1,klevel
74  DO ij = 1,ip1jmp1
75  divgra(ij,l) =  nudivgrs * divgra(ij,l) / deltapres(ij,l)
76  ENDDO
77  ENDDO
78
79  RETURN
80END SUBROUTINE divgrad2
Note: See TracBrowser for help on using the repository browser.