source: LMDZ5/trunk/libf/dyn3dmem/divergf.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
File size: 2.3 KB
Line 
1!
2! $Header$
3!
4      SUBROUTINE divergf(klevel,x,y,div)
5c
6c     P. Le Van
7c
8c  *********************************************************************
9c  ... calcule la divergence a tous les niveaux d'1 vecteur de compos.
10c     x et y...
11c              x et y  etant des composantes covariantes   ...
12c  *********************************************************************
13      IMPLICIT NONE
14c
15c      x  et  y  sont des arguments  d'entree pour le s-prog
16c        div      est  un argument  de sortie pour le s-prog
17c
18c
19c   ---------------------------------------------------------------------
20c
21c    ATTENTION : pendant ce s-pg , ne pas toucher au COMMON/scratch/  .
22c
23c   ---------------------------------------------------------------------
24#include "dimensions.h"
25#include "paramet.h"
26#include "comgeom.h"
27c
28c    ..........          variables en arguments    ...................
29c
30      INTEGER klevel
31      REAL x( ip1jmp1,klevel ),y( ip1jm,klevel ),div( ip1jmp1,klevel )
32      INTEGER   l,ij
33c
34c    ...............     variables  locales   .........................
35
36      REAL aiy1( iip1 ) , aiy2( iip1 )
37      REAL sumypn,sumyps
38c    ...................................................................
39c
40      REAL      SSUM
41c
42c
43      DO 10 l = 1,klevel
44c
45        DO  ij = iip2, ip1jm - 1
46         div( ij + 1, l )     = 
47     *   cvusurcu( ij+1 ) * x( ij+1,l ) - cvusurcu( ij ) * x( ij , l) +
48     *   cuvsurcv(ij-iim) * y(ij-iim,l) - cuvsurcv(ij+1) * y(ij+1,l)
49        ENDDO
50c
51c     ....  correction pour  div( 1,j,l)  ......
52c     ....   div(1,j,l)= div(iip1,j,l) ....
53c
54CDIR$ IVDEP
55        DO  ij = iip2,ip1jm,iip1
56         div( ij,l ) = div( ij + iim,l )
57        ENDDO
58c
59c     ....  calcul  aux poles  .....
60c
61        DO  ij  = 1,iim
62         aiy1(ij) =    cuvsurcv(    ij       ) * y(     ij     , l )
63         aiy2(ij) =    cuvsurcv( ij+ ip1jmi1 ) * y( ij+ ip1jmi1, l )
64        ENDDO
65        sumypn = SSUM ( iim,aiy1,1 ) / apoln
66        sumyps = SSUM ( iim,aiy2,1 ) / apols
67c
68        DO  ij = 1,iip1
69         div(     ij    , l ) = - sumypn
70         div( ij + ip1jm, l ) =   sumyps
71        ENDDO
72  10  CONTINUE
73c
74
75        CALL filtreg( div, jjp1, klevel, 2, 2, .TRUE., 1 )
76     
77c
78        DO l = 1, klevel
79           DO ij = iip2,ip1jm
80            div(ij,l) = div(ij,l) * unsaire(ij)
81          ENDDO
82        ENDDO
83c
84       RETURN
85       END
Note: See TracBrowser for help on using the repository browser.