source: LMDZ4/branches/pre_V3/libf/dyn3dpar/diverg_gam_p.F @ 1424

Last change on this file since 1424 was 630, checked in by Laurent Fairhead, 19 years ago

Import d'une version parallele de la dynamique YM
LF

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.7 KB
Line 
1      SUBROUTINE diverg_gam_p(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      USE parallel
12      IMPLICIT NONE
13c
14c      x  et  y  sont des arguments  d'entree pour le s-prog
15c        div      est  un argument  de sortie pour le s-prog
16c
17c
18c   ---------------------------------------------------------------------
19c
20c    ATTENTION : pendant ce s-pg , ne pas toucher au COMMON/scratch/  .
21c
22c   ---------------------------------------------------------------------
23#include "dimensions.h"
24#include "paramet.h"
25#include "comgeom.h"
26c
27c    ..........          variables en arguments    ...................
28c
29      INTEGER klevel
30      REAL x( ip1jmp1,klevel ),y( ip1jm,klevel ),div( ip1jmp1,klevel )
31      REAL cuvscvgam(ip1jm),cvuscugam(ip1jmp1),unsairegam(ip1jmp1)
32      REAL unsapolnga,unsapolsga
33c
34c    ...............     variables  locales   .........................
35
36      REAL aiy1( iip1 ) , aiy2( iip1 )
37      REAL sumypn,sumyps
38      INTEGER   l,ij
39c    ...................................................................
40c
41      EXTERNAL  SSUM
42      REAL      SSUM
43      INTEGER :: ijb,ije,jjb,jje
44c
45c
46      ijb=ij_begin
47      ije=ij_end
48      if (pole_nord) ijb=ij_begin+iip1
49      if(pole_sud)  ije=ij_end-iip1
50     
51      DO 10 l = 1,klevel
52c
53        DO  ij = ijb, ije - 1
54         div( ij + 1, l )     = ( 
55     *  cvuscugam( ij+1 ) * x( ij+1,l ) - cvuscugam( ij ) * x( ij , l) +
56     *  cuvscvgam(ij-iim) * y(ij-iim,l) - cuvscvgam(ij+1) * y(ij+1,l) )*
57     *         unsairegam( ij+1 )
58        ENDDO
59c
60c     ....  correction pour  div( 1,j,l)  ......
61c     ....   div(1,j,l)= div(iip1,j,l) ....
62c
63CDIR$ IVDEP
64        DO  ij = ijb,ije,iip1
65         div( ij,l ) = div( ij + iim,l )
66        ENDDO
67c
68c     ....  calcul  aux poles  .....
69c
70       if (pole_nord) then
71          DO  ij  = 1,iim
72           aiy1(ij) =    cuvscvgam(    ij       ) * y(     ij     , l )
73          ENDDO
74          sumypn = SSUM ( iim,aiy1,1 ) * unsapolnga
75
76          DO  ij = 1,iip1
77           div(     ij    , l ) = - sumypn
78          ENDDO
79       endif
80       
81        if (pole_sud) then
82          DO  ij  = 1,iim
83           aiy2(ij) =    cuvscvgam( ij+ ip1jmi1 ) * y( ij+ ip1jmi1, l )
84          ENDDO
85          sumyps = SSUM ( iim,aiy2,1 ) * unsapolsga
86
87          DO  ij = 1,iip1
88           div( ij + ip1jm, l ) =   sumyps
89          ENDDO
90       endif
91  10  CONTINUE
92c
93
94       RETURN
95       END
Note: See TracBrowser for help on using the repository browser.