source: LMDZ4/branches/pre_V3/libf/dyn3dpar/diverg_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_p(klevel,x,y,div)
2c
3c     P. Le Van
4c
5c  *********************************************************************
6c  ... calcule la divergence a tous les niveaux d'1 vecteur de compos.
7c     x et y...
8c              x et y  etant des composantes covariantes   ...
9c  *********************************************************************
10      USE parallel
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      INTEGER   l,ij
31c
32c    ...............     variables  locales   .........................
33
34      REAL aiy1( iip1 ) , aiy2( iip1 )
35      REAL sumypn,sumyps
36      INTEGER ijb,ije
37c    ...................................................................
38c
39      EXTERNAL  SSUM
40      REAL      SSUM
41c
42c
43      ijb=ij_begin
44      ije=ij_end
45      if (pole_nord) ijb=ij_begin+iip1
46      if(pole_sud)  ije=ij_end-iip1
47     
48      DO 10 l = 1,klevel
49c
50        DO  ij = ijb, ije - 1
51         div( ij + 1, l )     = 
52     *   cvusurcu( ij+1 ) * x( ij+1,l ) - cvusurcu( ij ) * x( ij , l) +
53     *   cuvsurcv(ij-iim) * y(ij-iim,l) - cuvsurcv(ij+1) * y(ij+1,l)
54        ENDDO
55c
56c     ....  correction pour  div( 1,j,l)  ......
57c     ....   div(1,j,l)= div(iip1,j,l) ....
58c
59CDIR$ IVDEP
60        DO  ij = ijb,ije,iip1
61         div( ij,l ) = div( ij + iim,l )
62        ENDDO
63c
64c     ....  calcul  aux poles  .....
65c
66        if (pole_nord) then
67          DO  ij  = 1,iim
68           aiy1(ij) =    cuvsurcv(    ij       ) * y(     ij     , l )
69          ENDDO
70          sumypn = SSUM ( iim,aiy1,1 ) / apoln
71c
72          DO  ij = 1,iip1
73           div(     ij    , l ) = - sumypn
74          ENDDO
75        endif
76         
77       if (pole_sud) then
78          DO  ij  = 1,iim
79           aiy2(ij) =    cuvsurcv( ij+ ip1jmi1 ) * y( ij+ ip1jmi1, l )
80          ENDDO
81          sumyps = SSUM ( iim,aiy2,1 ) / apols
82c
83          DO  ij = 1,iip1
84           div( ij + ip1jm, l ) =   sumyps
85          ENDDO
86        endif
87
88
89  10  CONTINUE
90c
91
92ccc        CALL filtreg( div, jjp1, klevel, 2, 2, .TRUE., 1 )
93     
94c
95        DO l = 1, klevel
96           DO ij = ijb,ije
97            div(ij,l) = div(ij,l) * unsaire(ij)
98          ENDDO
99        ENDDO
100c
101       RETURN
102       END
Note: See TracBrowser for help on using the repository browser.