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