[764] | 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 |
---|
[1823] | 12 | USE parallel_lmdz |
---|
[630] | 13 | USE times |
---|
[985] | 14 | USE mod_hallo |
---|
[630] | 15 | IMPLICIT NONE |
---|
| 16 | c |
---|
| 17 | #include "dimensions.h" |
---|
| 18 | #include "paramet.h" |
---|
| 19 | #include "comgeom2.h" |
---|
| 20 | #include "comdissipn.h" |
---|
| 21 | |
---|
| 22 | c ....... variables en arguments ....... |
---|
| 23 | c |
---|
| 24 | INTEGER klevel |
---|
| 25 | REAL h( ip1jmp1,klevel ), deltapres( ip1jmp1,klevel ) |
---|
[764] | 26 | REAL divgra_out( ip1jmp1,klevel) |
---|
| 27 | REAL,SAVE :: divgra( ip1jmp1,llm) |
---|
| 28 | |
---|
[630] | 29 | c |
---|
| 30 | c ....... variables locales .......... |
---|
| 31 | c |
---|
| 32 | REAL signe, nudivgrs, sqrtps( ip1jmp1,llm ) |
---|
| 33 | INTEGER l,ij,iter,lh |
---|
| 34 | c ................................................................... |
---|
[985] | 35 | Type(Request) :: request_dissip |
---|
[630] | 36 | INTEGER ijb,ije |
---|
| 37 | c |
---|
| 38 | signe = (-1.)**lh |
---|
| 39 | nudivgrs = signe * cdivh |
---|
| 40 | |
---|
| 41 | c CALL SCOPY ( ip1jmp1 * klevel, h, 1, divgra, 1 ) |
---|
| 42 | ijb=ij_begin |
---|
| 43 | ije=ij_end |
---|
[764] | 44 | c$OMP DO SCHEDULE(STATIC,OMP_CHUNK) |
---|
| 45 | DO l = 1, klevel |
---|
| 46 | divgra(ijb:ije,l)=h(ijb:ije,l) |
---|
| 47 | ENDDO |
---|
| 48 | c$OMP END DO NOWAIT |
---|
[630] | 49 | c |
---|
[764] | 50 | c$OMP BARRIER |
---|
[985] | 51 | call Register_Hallo(divgra,ip1jmp1,llm,1,1,1,1,Request_dissip) |
---|
| 52 | call SendRequest(Request_dissip) |
---|
[764] | 53 | c$OMP BARRIER |
---|
[985] | 54 | call WaitRequest(Request_dissip) |
---|
| 55 | c$OMP BARRIER |
---|
| 56 | |
---|
[630] | 57 | CALL laplacien_p( klevel, divgra, divgra ) |
---|
[764] | 58 | |
---|
| 59 | c$OMP DO SCHEDULE(STATIC,OMP_CHUNK) |
---|
[630] | 60 | DO l = 1, klevel |
---|
| 61 | DO ij = ijb, ije |
---|
| 62 | sqrtps( ij,l ) = SQRT( deltapres(ij,l) ) |
---|
| 63 | ENDDO |
---|
| 64 | ENDDO |
---|
[764] | 65 | c$OMP END DO NOWAIT |
---|
| 66 | |
---|
[630] | 67 | c |
---|
[764] | 68 | c$OMP DO SCHEDULE(STATIC,OMP_CHUNK) |
---|
[630] | 69 | DO l = 1, klevel |
---|
| 70 | DO ij = ijb, ije |
---|
| 71 | divgra(ij,l) = divgra(ij,l) * sqrtps(ij,l) |
---|
| 72 | ENDDO |
---|
| 73 | ENDDO |
---|
[764] | 74 | c$OMP END DO NOWAIT |
---|
[630] | 75 | |
---|
| 76 | c ........ Iteration de l'operateur laplacien_gam ........ |
---|
| 77 | c |
---|
| 78 | DO iter = 1, lh - 2 |
---|
[764] | 79 | c$OMP BARRIER |
---|
[985] | 80 | call Register_Hallo(divgra,ip1jmp1,llm,1,1,1,1,Request_dissip) |
---|
| 81 | call SendRequest(Request_dissip) |
---|
[764] | 82 | c$OMP BARRIER |
---|
[985] | 83 | call WaitRequest(Request_dissip) |
---|
| 84 | |
---|
| 85 | c$OMP BARRIER |
---|
| 86 | |
---|
| 87 | |
---|
[630] | 88 | CALL laplacien_gam_p ( klevel,cuvscvgam2,cvuscugam2,unsair_gam2, |
---|
| 89 | * unsapolnga2, unsapolsga2, divgra, divgra ) |
---|
| 90 | ENDDO |
---|
| 91 | c |
---|
| 92 | c ............................................................... |
---|
[764] | 93 | |
---|
| 94 | c$OMP DO SCHEDULE(STATIC,OMP_CHUNK) |
---|
[630] | 95 | DO l = 1, klevel |
---|
| 96 | DO ij = ijb, ije |
---|
| 97 | divgra(ij,l) = divgra(ij,l) * sqrtps(ij,l) |
---|
| 98 | ENDDO |
---|
| 99 | ENDDO |
---|
[764] | 100 | c$OMP END DO NOWAIT |
---|
[630] | 101 | c |
---|
[764] | 102 | c$OMP BARRIER |
---|
[985] | 103 | call Register_Hallo(divgra,ip1jmp1,llm,1,1,1,1,Request_dissip) |
---|
| 104 | call SendRequest(Request_dissip) |
---|
[764] | 105 | c$OMP BARRIER |
---|
[985] | 106 | call WaitRequest(Request_dissip) |
---|
| 107 | c$OMP BARRIER |
---|
[764] | 108 | |
---|
[630] | 109 | CALL laplacien_p ( klevel, divgra, divgra ) |
---|
| 110 | c |
---|
[764] | 111 | c$OMP DO SCHEDULE(STATIC,OMP_CHUNK) |
---|
[630] | 112 | DO l = 1,klevel |
---|
| 113 | DO ij = ijb,ije |
---|
[764] | 114 | divgra_out(ij,l) = nudivgrs * divgra(ij,l) / deltapres(ij,l) |
---|
[630] | 115 | ENDDO |
---|
| 116 | ENDDO |
---|
[764] | 117 | c$OMP END DO NOWAIT |
---|
[630] | 118 | |
---|
| 119 | RETURN |
---|
| 120 | END |
---|