[764] | 1 | SUBROUTINE gradiv_p(klevel, xcov, ycov, ld, gdx_out, gdy_out ) |
---|
[630] | 2 | c |
---|
| 3 | c Auteur : P. Le Van |
---|
| 4 | c |
---|
| 5 | c *************************************************************** |
---|
| 6 | c |
---|
| 7 | c ld |
---|
| 8 | c calcul de (grad (div) ) du vect. v .... |
---|
| 9 | c |
---|
| 10 | c xcov et ycov etant les composant.covariantes de v |
---|
| 11 | c **************************************************************** |
---|
| 12 | c xcov , ycov et ld sont des arguments d'entree pour le s-prog |
---|
| 13 | c gdx et gdy sont des arguments de sortie pour le s-prog |
---|
| 14 | c |
---|
| 15 | c |
---|
[1823] | 16 | USE parallel_lmdz |
---|
[630] | 17 | USE times |
---|
| 18 | IMPLICIT NONE |
---|
| 19 | c |
---|
| 20 | #include "dimensions.h" |
---|
| 21 | #include "paramet.h" |
---|
| 22 | #include "comdissipn.h" |
---|
| 23 | |
---|
| 24 | INTEGER klevel |
---|
| 25 | c |
---|
| 26 | REAL xcov( ip1jmp1,klevel ), ycov( ip1jm,klevel ) |
---|
[764] | 27 | REAL,SAVE :: gdx( ip1jmp1,llm ), gdy( ip1jm,llm ) |
---|
[630] | 28 | |
---|
[764] | 29 | REAL gdx_out( ip1jmp1,klevel ), gdy_out( ip1jm,klevel ) |
---|
[630] | 30 | |
---|
[764] | 31 | REAL,SAVE :: div(ip1jmp1,llm) |
---|
| 32 | |
---|
[630] | 33 | INTEGER l,ij,iter,ld |
---|
| 34 | c |
---|
| 35 | INTEGER ijb,ije,jjb,jje |
---|
| 36 | c |
---|
| 37 | c |
---|
| 38 | c CALL SCOPY( ip1jmp1*klevel,xcov,1,gdx,1 ) |
---|
| 39 | c CALL SCOPY( ip1jm*klevel, ycov,1,gdy,1 ) |
---|
| 40 | |
---|
| 41 | ijb=ij_begin |
---|
| 42 | ije=ij_end |
---|
| 43 | |
---|
[764] | 44 | c$OMP DO SCHEDULE(STATIC,OMP_CHUNK) |
---|
| 45 | DO l = 1,klevel |
---|
| 46 | gdx(ijb:ije,l)=xcov(ijb:ije,l) |
---|
| 47 | ENDDO |
---|
| 48 | c$OMP END DO NOWAIT |
---|
| 49 | |
---|
[630] | 50 | ijb=ij_begin |
---|
| 51 | ije=ij_end |
---|
| 52 | if(pole_sud) ije=ij_end-iip1 |
---|
[764] | 53 | |
---|
| 54 | c$OMP DO SCHEDULE(STATIC,OMP_CHUNK) |
---|
| 55 | DO l = 1,klevel |
---|
| 56 | gdy(ijb:ije,l)=ycov(ijb:ije,l) |
---|
| 57 | ENDDO |
---|
| 58 | c$OMP END DO NOWAIT |
---|
| 59 | |
---|
[630] | 60 | c |
---|
| 61 | DO 10 iter = 1,ld |
---|
[764] | 62 | |
---|
| 63 | c$OMP BARRIER |
---|
| 64 | c$OMP MASTER |
---|
[630] | 65 | call suspend_timer(timer_dissip) |
---|
| 66 | call exchange_Hallo(gdy,ip1jm,llm,1,0) |
---|
| 67 | call resume_timer(timer_dissip) |
---|
[764] | 68 | c$OMP END MASTER |
---|
| 69 | c$OMP BARRIER |
---|
| 70 | |
---|
[630] | 71 | CALL diverg_p( klevel, gdx , gdy, div ) |
---|
| 72 | |
---|
| 73 | jjb=jj_begin |
---|
| 74 | jje=jj_end |
---|
| 75 | CALL filtreg_p( div,jjb,jje, jjp1, klevel, 2,1, .true.,2 ) |
---|
| 76 | |
---|
| 77 | c call exchange_Hallo(div,ip1jmp1,llm,0,1) |
---|
[764] | 78 | |
---|
| 79 | c$OMP BARRIER |
---|
| 80 | c$OMP MASTER |
---|
[630] | 81 | call suspend_timer(timer_dissip) |
---|
| 82 | call exchange_Hallo(div,ip1jmp1,llm,1,1) |
---|
| 83 | call resume_timer(timer_dissip) |
---|
[764] | 84 | c$OMP END MASTER |
---|
| 85 | c$OMP BARRIER |
---|
[630] | 86 | |
---|
| 87 | CALL grad_p( klevel, div, gdx, gdy ) |
---|
| 88 | c |
---|
[764] | 89 | |
---|
| 90 | c$OMP DO SCHEDULE(STATIC,OMP_CHUNK) |
---|
[630] | 91 | DO 5 l = 1, klevel |
---|
| 92 | |
---|
| 93 | if(pole_sud) ije=ij_end |
---|
| 94 | DO 3 ij = ijb, ije |
---|
[764] | 95 | gdx_out( ij,l ) = - gdx( ij,l ) * cdivu |
---|
[630] | 96 | 3 CONTINUE |
---|
| 97 | |
---|
| 98 | if(pole_sud) ije=ij_end-iip1 |
---|
| 99 | DO 4 ij = ijb, ije |
---|
[764] | 100 | gdy_out( ij,l ) = - gdy( ij,l ) * cdivu |
---|
[630] | 101 | 4 CONTINUE |
---|
| 102 | |
---|
| 103 | 5 CONTINUE |
---|
[764] | 104 | c$OMP END DO NOWAIT |
---|
[630] | 105 | c |
---|
| 106 | 10 CONTINUE |
---|
| 107 | RETURN |
---|
| 108 | END |
---|