[764] | 1 | SUBROUTINE divgrad_p (klevel,h, lh, divgra_out ) |
---|
[1823] | 2 | USE parallel_lmdz |
---|
[630] | 3 | USE times |
---|
| 4 | IMPLICIT NONE |
---|
| 5 | c |
---|
| 6 | c======================================================================= |
---|
| 7 | c |
---|
| 8 | c Auteur : P. Le Van |
---|
| 9 | c ---------- |
---|
| 10 | c |
---|
| 11 | c lh |
---|
| 12 | c calcul de (div( grad )) de h ..... |
---|
| 13 | c h et lh sont des arguments d'entree pour le s-prog |
---|
| 14 | c divgra est un argument de sortie pour le s-prog |
---|
| 15 | c |
---|
| 16 | c======================================================================= |
---|
| 17 | c |
---|
| 18 | c declarations: |
---|
| 19 | c ------------- |
---|
| 20 | c |
---|
| 21 | #include "dimensions.h" |
---|
| 22 | #include "paramet.h" |
---|
| 23 | #include "comgeom.h" |
---|
| 24 | #include "comdissipn.h" |
---|
| 25 | c |
---|
| 26 | INTEGER klevel |
---|
[764] | 27 | REAL h( ip1jmp1,klevel ), divgra_out( ip1jmp1,klevel ) |
---|
| 28 | REAL,SAVE :: divgra( ip1jmp1,llm ) |
---|
| 29 | |
---|
[630] | 30 | c |
---|
| 31 | REAL ghy(ip1jm,llm), ghx(ip1jmp1,llm) |
---|
| 32 | |
---|
| 33 | INTEGER l,ij,iter,lh |
---|
| 34 | c |
---|
| 35 | INTEGER ijb,ije,jjb,jje |
---|
| 36 | c |
---|
| 37 | c |
---|
| 38 | c CALL SCOPY ( ip1jmp1*klevel,h,1,divgra,1 ) |
---|
| 39 | |
---|
| 40 | ijb=ij_begin |
---|
| 41 | ije=ij_end |
---|
[764] | 42 | c$OMP DO SCHEDULE(STATIC,OMP_CHUNK) |
---|
| 43 | DO l = 1, klevel |
---|
| 44 | divgra(ijb:ije,l)=h(ijb:ije,l) |
---|
| 45 | ENDDO |
---|
| 46 | c$OMP END DO NOWAIT |
---|
[630] | 47 | c |
---|
| 48 | |
---|
| 49 | c |
---|
| 50 | DO 10 iter = 1,lh |
---|
| 51 | |
---|
| 52 | jjb=jj_begin |
---|
| 53 | jje=jj_end |
---|
| 54 | CALL filtreg_p ( divgra,jjb,jje,jjp1,klevel,2,1,.true.,1 ) |
---|
| 55 | |
---|
| 56 | c call exchange_Hallo(divgra,ip1jmp1,llm,0,1) |
---|
[764] | 57 | c$OMP BARRIER |
---|
| 58 | c$OMP MASTER |
---|
[630] | 59 | call suspend_timer(timer_dissip) |
---|
| 60 | call exchange_Hallo(divgra,ip1jmp1,llm,1,1) |
---|
| 61 | call resume_timer(timer_dissip) |
---|
[764] | 62 | c$OMP END MASTER |
---|
| 63 | c$OMP BARRIER |
---|
[630] | 64 | CALL grad_p (klevel,divgra, ghx , ghy ) |
---|
| 65 | |
---|
[764] | 66 | c$OMP BARRIER |
---|
| 67 | c$OMP MASTER |
---|
[630] | 68 | call suspend_timer(timer_dissip) |
---|
| 69 | call exchange_Hallo(ghy,ip1jm,llm,1,0) |
---|
| 70 | call resume_timer(timer_dissip) |
---|
[764] | 71 | c$OMP END MASTER |
---|
| 72 | c$OMP BARRIER |
---|
| 73 | |
---|
[630] | 74 | CALL diverg_p (klevel, ghx , ghy , divgra ) |
---|
| 75 | |
---|
| 76 | jjb=jj_begin |
---|
| 77 | jje=jj_end |
---|
| 78 | CALL filtreg_p( divgra,jjb,jje,jjp1,klevel,2,1,.true.,1) |
---|
| 79 | |
---|
[764] | 80 | c$OMP DO SCHEDULE(STATIC,OMP_CHUNK) |
---|
[630] | 81 | DO 5 l = 1,klevel |
---|
| 82 | DO 4 ij = ijb, ije |
---|
[764] | 83 | divgra_out( ij,l ) = - cdivh * divgra( ij,l ) |
---|
[630] | 84 | 4 CONTINUE |
---|
| 85 | 5 CONTINUE |
---|
[764] | 86 | c$OMP END DO NOWAIT |
---|
[630] | 87 | c |
---|
| 88 | 10 CONTINUE |
---|
| 89 | RETURN |
---|
| 90 | END |
---|