source: LMDZ.3.3/branches/rel-LF/libf/dyn3d/diverg_gam.F @ 462

Last change on this file since 462 was 2, checked in by lmdz, 25 years ago

Initial revision

  • Property svn:eol-style set to native
  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 2.4 KB
Line 
1      SUBROUTINE diverg_gam(klevel,cuvscvgam,cvuscugam,unsairegam ,
2     *                       unsapolnga,unsapolsga,  x, y,  div )
3c
4c     P. Le Van
5c
6c  *********************************************************************
7c  ... calcule la divergence a tous les niveaux d'1 vecteur de compos.
8c     x et y...
9c              x et y  etant des composantes covariantes   ...
10c  *********************************************************************
11      IMPLICIT NONE
12c
13c      x  et  y  sont des arguments  d'entree pour le s-prog
14c        div      est  un argument  de sortie pour le s-prog
15c
16c
17c   ---------------------------------------------------------------------
18c
19c    ATTENTION : pendant ce s-pg , ne pas toucher au COMMON/scratch/  .
20c
21c   ---------------------------------------------------------------------
22#include "dimensions.h"
23#include "paramet.h"
24#include "comgeom.h"
25c
26c    ..........          variables en arguments    ...................
27c
28      INTEGER klevel
29      REAL x( ip1jmp1,klevel ),y( ip1jm,klevel ),div( ip1jmp1,klevel )
30      REAL cuvscvgam(ip1jm),cvuscugam(ip1jmp1),unsairegam(ip1jmp1)
31      REAL unsapolnga,unsapolsga
32c
33c    ...............     variables  locales   .........................
34
35      REAL aiy1( iip1 ) , aiy2( iip1 )
36      REAL sumypn,sumyps
37      INTEGER   l,ij
38c    ...................................................................
39c
40      EXTERNAL  SSUM
41      REAL      SSUM
42c
43c
44      DO 10 l = 1,klevel
45c
46        DO  ij = iip2, ip1jm - 1
47         div( ij + 1, l )     = ( 
48     *  cvuscugam( ij+1 ) * x( ij+1,l ) - cvuscugam( ij ) * x( ij , l) +
49     *  cuvscvgam(ij-iim) * y(ij-iim,l) - cuvscvgam(ij+1) * y(ij+1,l) )*
50     *         unsairegam( ij+1 )
51        ENDDO
52c
53c     ....  correction pour  div( 1,j,l)  ......
54c     ....   div(1,j,l)= div(iip1,j,l) ....
55c
56CDIR$ IVDEP
57        DO  ij = iip2,ip1jm,iip1
58         div( ij,l ) = div( ij + iim,l )
59        ENDDO
60c
61c     ....  calcul  aux poles  .....
62c
63        DO  ij  = 1,iim
64         aiy1(ij) =    cuvscvgam(    ij       ) * y(     ij     , l )
65         aiy2(ij) =    cuvscvgam( ij+ ip1jmi1 ) * y( ij+ ip1jmi1, l )
66        ENDDO
67        sumypn = SSUM ( iim,aiy1,1 ) * unsapolnga
68        sumyps = SSUM ( iim,aiy2,1 ) * unsapolsga
69c
70        DO  ij = 1,iip1
71         div(     ij    , l ) = - sumypn
72         div( ij + ip1jm, l ) =   sumyps
73        ENDDO
74  10  CONTINUE
75c
76
77       RETURN
78       END
Note: See TracBrowser for help on using the repository browser.