[709] | 1 | SUBROUTINE divgrad2_p ( klevel, h, deltapres, lh, divgra_out ) |
---|
[630] | 2 | c |
---|
| 3 | c P. Le Van |
---|
| 4 | c |
---|
| 5 | c *************************************************************** |
---|
| 6 | c |
---|
| 7 | c ..... calcul de (div( grad )) de ( pext * h ) ..... |
---|
| 8 | c **************************************************************** |
---|
| 9 | c h ,klevel,lh et pext sont des arguments d'entree pour le s-prg |
---|
| 10 | c divgra est un argument de sortie pour le s-prg |
---|
| 11 | c |
---|
| 12 | USE parallel |
---|
| 13 | USE times |
---|
| 14 | IMPLICIT NONE |
---|
| 15 | c |
---|
| 16 | #include "dimensions.h" |
---|
| 17 | #include "paramet.h" |
---|
| 18 | #include "comgeom2.h" |
---|
| 19 | #include "comdissipn.h" |
---|
| 20 | |
---|
| 21 | c ....... variables en arguments ....... |
---|
| 22 | c |
---|
| 23 | INTEGER klevel |
---|
| 24 | REAL h( ip1jmp1,klevel ), deltapres( ip1jmp1,klevel ) |
---|
[709] | 25 | REAL divgra_out( ip1jmp1,klevel) |
---|
| 26 | REAL,SAVE :: divgra( ip1jmp1,llm) |
---|
| 27 | |
---|
[630] | 28 | c |
---|
| 29 | c ....... variables locales .......... |
---|
| 30 | c |
---|
| 31 | REAL signe, nudivgrs, sqrtps( ip1jmp1,llm ) |
---|
| 32 | INTEGER l,ij,iter,lh |
---|
| 33 | c ................................................................... |
---|
| 34 | |
---|
| 35 | INTEGER ijb,ije |
---|
| 36 | c |
---|
| 37 | signe = (-1.)**lh |
---|
| 38 | nudivgrs = signe * cdivh |
---|
| 39 | |
---|
| 40 | c CALL SCOPY ( ip1jmp1 * klevel, h, 1, divgra, 1 ) |
---|
| 41 | ijb=ij_begin |
---|
| 42 | ije=ij_end |
---|
[709] | 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 |
---|
[709] | 49 | c$OMP BARRIER |
---|
| 50 | c$OMP MASTER |
---|
[630] | 51 | call suspend_timer(timer_dissip) |
---|
| 52 | call exchange_Hallo(divgra,ip1jmp1,llm,1,1) |
---|
| 53 | call resume_timer(timer_dissip) |
---|
[709] | 54 | c$OMP END MASTER |
---|
| 55 | c$OMP BARRIER |
---|
[630] | 56 | CALL laplacien_p( klevel, divgra, divgra ) |
---|
[709] | 57 | |
---|
| 58 | c$OMP DO SCHEDULE(STATIC,OMP_CHUNK) |
---|
[630] | 59 | DO l = 1, klevel |
---|
| 60 | DO ij = ijb, ije |
---|
| 61 | sqrtps( ij,l ) = SQRT( deltapres(ij,l) ) |
---|
| 62 | ENDDO |
---|
| 63 | ENDDO |
---|
[709] | 64 | c$OMP END DO NOWAIT |
---|
| 65 | |
---|
[630] | 66 | c |
---|
[709] | 67 | c$OMP DO SCHEDULE(STATIC,OMP_CHUNK) |
---|
[630] | 68 | DO l = 1, klevel |
---|
| 69 | DO ij = ijb, ije |
---|
| 70 | divgra(ij,l) = divgra(ij,l) * sqrtps(ij,l) |
---|
| 71 | ENDDO |
---|
| 72 | ENDDO |
---|
[709] | 73 | c$OMP END DO NOWAIT |
---|
[630] | 74 | |
---|
| 75 | c ........ Iteration de l'operateur laplacien_gam ........ |
---|
| 76 | c |
---|
| 77 | DO iter = 1, lh - 2 |
---|
[709] | 78 | c$OMP BARRIER |
---|
| 79 | c$OMP MASTER |
---|
[630] | 80 | call suspend_timer(timer_dissip) |
---|
| 81 | call exchange_Hallo(divgra,ip1jmp1,llm,1,1) |
---|
| 82 | call resume_timer(timer_dissip) |
---|
[709] | 83 | c$OMP END MASTER |
---|
| 84 | c$OMP BARRIER |
---|
[630] | 85 | CALL laplacien_gam_p ( klevel,cuvscvgam2,cvuscugam2,unsair_gam2, |
---|
| 86 | * unsapolnga2, unsapolsga2, divgra, divgra ) |
---|
| 87 | ENDDO |
---|
| 88 | c |
---|
| 89 | c ............................................................... |
---|
[709] | 90 | |
---|
| 91 | c$OMP DO SCHEDULE(STATIC,OMP_CHUNK) |
---|
[630] | 92 | DO l = 1, klevel |
---|
| 93 | DO ij = ijb, ije |
---|
| 94 | divgra(ij,l) = divgra(ij,l) * sqrtps(ij,l) |
---|
| 95 | ENDDO |
---|
| 96 | ENDDO |
---|
[709] | 97 | c$OMP END DO NOWAIT |
---|
[630] | 98 | c |
---|
[709] | 99 | c$OMP BARRIER |
---|
| 100 | c$OMP MASTER |
---|
[630] | 101 | call suspend_timer(timer_dissip) |
---|
| 102 | call exchange_Hallo(divgra,ip1jmp1,llm,1,1) |
---|
| 103 | call resume_timer(timer_dissip) |
---|
[709] | 104 | c$OMP END MASTER |
---|
| 105 | c$OMP BARRIER |
---|
| 106 | |
---|
[630] | 107 | CALL laplacien_p ( klevel, divgra, divgra ) |
---|
| 108 | c |
---|
[709] | 109 | c$OMP DO SCHEDULE(STATIC,OMP_CHUNK) |
---|
[630] | 110 | DO l = 1,klevel |
---|
| 111 | DO ij = ijb,ije |
---|
[709] | 112 | divgra_out(ij,l) = nudivgrs * divgra(ij,l) / deltapres(ij,l) |
---|
[630] | 113 | ENDDO |
---|
| 114 | ENDDO |
---|
[709] | 115 | c$OMP END DO NOWAIT |
---|
[630] | 116 | |
---|
| 117 | RETURN |
---|
| 118 | END |
---|