source: codes/icosagcm/branches/SATURN_DYNAMICO/LMDZ.COMMON/config/ppsrc/dyn/grad_p.f @ 224

Last change on this file since 224 was 224, checked in by ymipsl, 10 years ago
File size: 2.7 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_lmdz
13      IMPLICIT NONE
14c
15!-----------------------------------------------------------------------
16!   INCLUDE 'dimensions.h'
17!
18!   dimensions.h contient les dimensions du modele
19!   ndm est tel que iim=2**ndm
20!-----------------------------------------------------------------------
21
22      INTEGER iim,jjm,llm,ndm
23
24      PARAMETER (iim= 128,jjm=96,llm=64,ndm=1)
25
26!-----------------------------------------------------------------------
27!
28! $Header$
29!
30!
31!  ATTENTION!!!!: ce fichier include est compatible format fixe/format libre
32!                 veillez  n'utiliser que des ! pour les commentaires
33!                 et  bien positionner les & des lignes de continuation
34!                 (les placer en colonne 6 et en colonne 73)
35!
36!
37!-----------------------------------------------------------------------
38!   INCLUDE 'paramet.h'
39
40      INTEGER  iip1,iip2,iip3,jjp1,llmp1,llmp2,llmm1
41      INTEGER  kftd,ip1jm,ip1jmp1,ip1jmi1,ijp1llm
42      INTEGER  ijmllm,mvar
43      INTEGER jcfil,jcfllm
44
45      PARAMETER( iip1= iim+1,iip2=iim+2,iip3=iim+3                       &
46     &    ,jjp1=jjm+1-1/jjm)
47      PARAMETER( llmp1 = llm+1,  llmp2 = llm+2, llmm1 = llm-1 )
48      PARAMETER( kftd  = iim/2 -ndm )
49      PARAMETER( ip1jm  = iip1*jjm,  ip1jmp1= iip1*jjp1 )
50      PARAMETER( ip1jmi1= ip1jm - iip1 )
51      PARAMETER( ijp1llm= ip1jmp1 * llm, ijmllm= ip1jm * llm )
52      PARAMETER( mvar= ip1jmp1*( 2*llm+1) + ijmllm )
53      PARAMETER( jcfil=jjm/2+5, jcfllm=jcfil*llm )
54
55!-----------------------------------------------------------------------
56      INTEGER klevel
57      REAL  pg( ip1jmp1,klevel )
58      REAL pgx( ip1jmp1,klevel ) , pgy( ip1jm,klevel )
59      INTEGER  l,ij
60      INTEGER :: ijb,ije,jjb,jje
61c
62c
63c$OMP DO SCHEDULE(STATIC,OMP_CHUNK)
64      DO 6 l = 1,klevel
65c
66      ijb=ij_begin
67      ije=ij_end
68      DO 2  ij = ijb, ije - 1
69        pgx( ij,l ) = pg( ij +1,l ) - pg( ij,l )
70   2  CONTINUE
71c
72c    .... correction pour  pgx(ip1,j,l)  ....
73c    ...    pgx(iip1,j,l)= pgx(1,j,l)  ....
74CDIR$ IVDEP
75      DO 3  ij = ijb+iip1-1, ije, iip1
76        pgx( ij,l ) = pgx( ij -iim,l )
77   3  CONTINUE
78c
79      ijb=ij_begin-iip1
80      ije=ij_end
81      if (pole_nord) ijb=ij_begin
82      if (pole_sud)  ije=ij_end-iip1
83     
84      DO 4 ij = ijb,ije
85        pgy( ij,l ) = pg( ij,l ) - pg( ij +iip1,l )
86   4  CONTINUE
87c
88   6  CONTINUE
89c$OMP END DO NOWAIT
90
91      RETURN
92      END
Note: See TracBrowser for help on using the repository browser.