| [5246] | 1 | SUBROUTINE grad_p(klevel, pg,pgx,pgy ) |
|---|
| 2 | ! |
|---|
| 3 | ! P. Le Van |
|---|
| 4 | ! |
|---|
| 5 | ! ****************************************************************** |
|---|
| 6 | ! .. calcul des composantes covariantes en x et y du gradient de g |
|---|
| 7 | ! |
|---|
| 8 | ! ****************************************************************** |
|---|
| 9 | ! pg est un argument d'entree pour le s-prog |
|---|
| 10 | ! pgx et pgy sont des arguments de sortie pour le s-prog |
|---|
| 11 | ! |
|---|
| 12 | USE parallel_lmdz |
|---|
| [5271] | 13 | USE dimensions_mod, ONLY: iim, jjm, llm, ndm |
|---|
| [5285] | 14 | USE paramet_mod_h |
|---|
| [5271] | 15 | IMPLICIT NONE |
|---|
| [5246] | 16 | ! |
|---|
| [5271] | 17 | |
|---|
| [5272] | 18 | |
|---|
| [5246] | 19 | INTEGER :: klevel |
|---|
| 20 | REAL :: pg( ip1jmp1,klevel ) |
|---|
| 21 | REAL :: pgx( ip1jmp1,klevel ) , pgy( ip1jm,klevel ) |
|---|
| 22 | INTEGER :: l,ij |
|---|
| 23 | INTEGER :: ijb,ije,jjb,jje |
|---|
| 24 | ! |
|---|
| 25 | ! |
|---|
| 26 | !$OMP DO SCHEDULE(STATIC,OMP_CHUNK) |
|---|
| 27 | DO l = 1,klevel |
|---|
| 28 | ! |
|---|
| 29 | ijb=ij_begin |
|---|
| 30 | ije=ij_end |
|---|
| 31 | DO ij = ijb, ije - 1 |
|---|
| 32 | pgx( ij,l ) = pg( ij +1,l ) - pg( ij,l ) |
|---|
| 33 | END DO |
|---|
| 34 | ! |
|---|
| 35 | ! .... correction pour pgx(ip1,j,l) .... |
|---|
| 36 | ! ... pgx(iip1,j,l)= pgx(1,j,l) .... |
|---|
| 37 | !DIR$ IVDEP |
|---|
| 38 | DO ij = ijb+iip1-1, ije, iip1 |
|---|
| 39 | pgx( ij,l ) = pgx( ij -iim,l ) |
|---|
| 40 | END DO |
|---|
| 41 | ! |
|---|
| 42 | ijb=ij_begin-iip1 |
|---|
| 43 | ije=ij_end |
|---|
| 44 | if (pole_nord) ijb=ij_begin |
|---|
| 45 | if (pole_sud) ije=ij_end-iip1 |
|---|
| [1632] | 46 | |
|---|
| [5246] | 47 | DO ij = ijb,ije |
|---|
| 48 | pgy( ij,l ) = pg( ij,l ) - pg( ij +iip1,l ) |
|---|
| 49 | END DO |
|---|
| 50 | ! |
|---|
| 51 | END DO |
|---|
| 52 | !$OMP END DO NOWAIT |
|---|
| 53 | |
|---|
| 54 | RETURN |
|---|
| 55 | END SUBROUTINE grad_p |
|---|