[764] | 1 | SUBROUTINE divgrad_p (klevel,h, lh, divgra_out ) |
---|
[630] | 2 | USE parallel |
---|
| 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 | #include "logic.h" |
---|
| 26 | c |
---|
| 27 | INTEGER klevel |
---|
[764] | 28 | REAL h( ip1jmp1,klevel ), divgra_out( ip1jmp1,klevel ) |
---|
| 29 | REAL,SAVE :: divgra( ip1jmp1,llm ) |
---|
| 30 | |
---|
[630] | 31 | c |
---|
| 32 | REAL ghy(ip1jm,llm), ghx(ip1jmp1,llm) |
---|
| 33 | |
---|
| 34 | INTEGER l,ij,iter,lh |
---|
| 35 | c |
---|
| 36 | INTEGER ijb,ije,jjb,jje |
---|
| 37 | c |
---|
| 38 | c |
---|
| 39 | c CALL SCOPY ( ip1jmp1*klevel,h,1,divgra,1 ) |
---|
| 40 | |
---|
| 41 | ijb=ij_begin |
---|
| 42 | ije=ij_end |
---|
[764] | 43 | c$OMP DO SCHEDULE(STATIC,OMP_CHUNK) |
---|
| 44 | DO l = 1, klevel |
---|
| 45 | divgra(ijb:ije,l)=h(ijb:ije,l) |
---|
| 46 | ENDDO |
---|
| 47 | c$OMP END DO NOWAIT |
---|
[630] | 48 | c |
---|
| 49 | |
---|
| 50 | c |
---|
| 51 | DO 10 iter = 1,lh |
---|
| 52 | |
---|
| 53 | jjb=jj_begin |
---|
| 54 | jje=jj_end |
---|
| 55 | CALL filtreg_p ( divgra,jjb,jje,jjp1,klevel,2,1,.true.,1 ) |
---|
| 56 | |
---|
| 57 | c call exchange_Hallo(divgra,ip1jmp1,llm,0,1) |
---|
[764] | 58 | c$OMP BARRIER |
---|
| 59 | c$OMP MASTER |
---|
[630] | 60 | call suspend_timer(timer_dissip) |
---|
| 61 | call exchange_Hallo(divgra,ip1jmp1,llm,1,1) |
---|
| 62 | call resume_timer(timer_dissip) |
---|
[764] | 63 | c$OMP END MASTER |
---|
| 64 | c$OMP BARRIER |
---|
[630] | 65 | CALL grad_p (klevel,divgra, ghx , ghy ) |
---|
| 66 | |
---|
[764] | 67 | c$OMP BARRIER |
---|
| 68 | c$OMP MASTER |
---|
[630] | 69 | call suspend_timer(timer_dissip) |
---|
| 70 | call exchange_Hallo(ghy,ip1jm,llm,1,0) |
---|
| 71 | call resume_timer(timer_dissip) |
---|
[764] | 72 | c$OMP END MASTER |
---|
| 73 | c$OMP BARRIER |
---|
| 74 | |
---|
[630] | 75 | CALL diverg_p (klevel, ghx , ghy , divgra ) |
---|
| 76 | |
---|
| 77 | jjb=jj_begin |
---|
| 78 | jje=jj_end |
---|
| 79 | CALL filtreg_p( divgra,jjb,jje,jjp1,klevel,2,1,.true.,1) |
---|
| 80 | |
---|
[764] | 81 | c$OMP DO SCHEDULE(STATIC,OMP_CHUNK) |
---|
[630] | 82 | DO 5 l = 1,klevel |
---|
| 83 | DO 4 ij = ijb, ije |
---|
[764] | 84 | divgra_out( ij,l ) = - cdivh * divgra( ij,l ) |
---|
[630] | 85 | 4 CONTINUE |
---|
| 86 | 5 CONTINUE |
---|
[764] | 87 | c$OMP END DO NOWAIT |
---|
[630] | 88 | c |
---|
| 89 | 10 CONTINUE |
---|
| 90 | RETURN |
---|
| 91 | END |
---|