source: LMDZ5/trunk/libf/dyn3dmem/grad_p.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: 1.3 KB
Line 
1      SUBROUTINE  grad_p(klevel, pg,pgx,pgy )
2c
3c      P. Le Van
4c
5c    ******************************************************************
6c     .. calcul des composantes covariantes en x et y du gradient de g
7c
8c    ******************************************************************
9c             pg        est un   argument  d'entree pour le s-prog
10c       pgx  et  pgy    sont des arguments de sortie pour le s-prog
11c
12      USE parallel
13      IMPLICIT NONE
14c
15#include "dimensions.h"
16#include "paramet.h"
17      INTEGER klevel
18      REAL  pg( ip1jmp1,klevel )
19      REAL pgx( ip1jmp1,klevel ) , pgy( ip1jm,klevel )
20      INTEGER  l,ij
21      INTEGER :: ijb,ije,jjb,jje
22c
23c
24c$OMP DO SCHEDULE(STATIC,OMP_CHUNK)
25      DO 6 l = 1,klevel
26c
27      ijb=ij_begin
28      ije=ij_end
29      DO 2  ij = ijb, ije - 1
30        pgx( ij,l ) = pg( ij +1,l ) - pg( ij,l )
31   2  CONTINUE
32c
33c    .... correction pour  pgx(ip1,j,l)  ....
34c    ...    pgx(iip1,j,l)= pgx(1,j,l)  ....
35CDIR$ IVDEP
36      DO 3  ij = ijb+iip1-1, ije, iip1
37        pgx( ij,l ) = pgx( ij -iim,l )
38   3  CONTINUE
39c
40      ijb=ij_begin-iip1
41      ije=ij_end
42      if (pole_nord) ijb=ij_begin
43      if (pole_sud)  ije=ij_end-iip1
44     
45      DO 4 ij = ijb,ije
46        pgy( ij,l ) = pg( ij,l ) - pg( ij +iip1,l )
47   4  CONTINUE
48c
49   6  CONTINUE
50c$OMP END DO NOWAIT
51
52      RETURN
53      END
Note: See TracBrowser for help on using the repository browser.