source: LMDZ5/trunk/libf/dyn3dmem/diverg_gam.F @ 1632

Last change on this file since 1632 was 1632, checked in by Laurent Fairhead, 12 years ago

Import initial du répertoire dyn3dmem

Attention! ceci n'est qu'une version préliminaire du code "basse mémoire":
le code contenu dans ce répertoire est basé sur la r1320 et a donc besoin
d'être mis à jour par rapport à la dynamique parallèle d'aujourd'hui.
Ce code est toutefois mis à disposition pour circonvenir à des problèmes
de mémoire que certaines configurations du modèle pourraient rencontrer.
Dans l'état, il compile et tourne sur vargas et au CCRT


Initial import of dyn3dmem

Warning! this is just a preliminary version of the memory light code:
it is based on r1320 of the code and thus needs to be updated before
it can replace the present dyn3dpar code. It is nevertheless put at your
disposal to circumvent some memory problems some LMDZ configurations may
encounter. In its present state, it will compile and run on vargas and CCRT

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