[5106] | 1 | SUBROUTINE divgrad2_loc( klevel, h, deltapres, lh, divgra_out ) |
---|
[5159] | 2 | |
---|
[5105] | 3 | ! P. Le Van |
---|
[5159] | 4 | |
---|
[5105] | 5 | ! *************************************************************** |
---|
[5159] | 6 | |
---|
[5105] | 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 |
---|
[5159] | 11 | |
---|
[5105] | 12 | USE parallel_lmdz |
---|
| 13 | USE times |
---|
| 14 | USE mod_hallo |
---|
| 15 | USE divgrad2_mod |
---|
[5134] | 16 | USE lmdz_comdissipn, ONLY: tetaudiv, tetaurot, tetah, cdivu, crot, cdivh |
---|
[5136] | 17 | USE lmdz_comgeom2 |
---|
[5134] | 18 | |
---|
[5159] | 19 | USE lmdz_dimensions, ONLY: iim, jjm, llm, ndm |
---|
| 20 | USE lmdz_paramet |
---|
[5105] | 21 | IMPLICIT NONE |
---|
| 22 | ! |
---|
[1632] | 23 | |
---|
[5159] | 24 | |
---|
| 25 | |
---|
[5105] | 26 | ! ....... variables en arguments ....... |
---|
[5159] | 27 | |
---|
[5105] | 28 | INTEGER :: klevel |
---|
| 29 | REAL :: h( ijb_u:ije_u,klevel ), deltapres( ijb_u:ije_u,klevel ) |
---|
| 30 | REAL :: divgra_out( ijb_u:ije_u,klevel) |
---|
| 31 | ! ....... variables locales .......... |
---|
[5159] | 32 | |
---|
[5105] | 33 | REAL :: signe, nudivgrs, sqrtps( ijb_u:ije_u,llm ) |
---|
| 34 | INTEGER :: l,ij,iter,lh |
---|
| 35 | ! ................................................................... |
---|
| 36 | Type(Request),SAVE :: request_dissip |
---|
[1848] | 37 | !$OMP THREADPRIVATE(request_dissip) |
---|
[5105] | 38 | INTEGER :: ijb,ije |
---|
[1632] | 39 | |
---|
[5159] | 40 | |
---|
| 41 | |
---|
[5105] | 42 | signe = (-1.)**lh |
---|
| 43 | nudivgrs = signe * cdivh |
---|
[1632] | 44 | |
---|
[5105] | 45 | ! CALL SCOPY ( ip1jmp1 * klevel, h, 1, divgra, 1 ) |
---|
| 46 | ijb=ij_begin |
---|
| 47 | ije=ij_end |
---|
| 48 | !$OMP DO SCHEDULE(STATIC,OMP_CHUNK) |
---|
| 49 | DO l = 1, klevel |
---|
| 50 | divgra(ijb:ije,l)=h(ijb:ije,l) |
---|
| 51 | ENDDO |
---|
| 52 | !$OMP END DO NOWAIT |
---|
[5159] | 53 | |
---|
[5105] | 54 | !$OMP BARRIER |
---|
| 55 | CALL Register_Hallo_u(divgra,llm,1,1,1,1,Request_dissip) |
---|
| 56 | CALL SendRequest(Request_dissip) |
---|
| 57 | !$OMP BARRIER |
---|
| 58 | CALL WaitRequest(Request_dissip) |
---|
| 59 | !$OMP BARRIER |
---|
[1632] | 60 | |
---|
[5105] | 61 | CALL laplacien_loc( klevel, divgra, divgra ) |
---|
[1632] | 62 | |
---|
[5105] | 63 | !$OMP DO SCHEDULE(STATIC,OMP_CHUNK) |
---|
| 64 | DO l = 1, klevel |
---|
| 65 | DO ij = ijb, ije |
---|
| 66 | sqrtps( ij,l ) = SQRT( deltapres(ij,l) ) |
---|
| 67 | ENDDO |
---|
| 68 | ENDDO |
---|
| 69 | !$OMP END DO NOWAIT |
---|
[1632] | 70 | |
---|
[5159] | 71 | |
---|
[5105] | 72 | !$OMP DO SCHEDULE(STATIC,OMP_CHUNK) |
---|
| 73 | DO l = 1, klevel |
---|
| 74 | DO ij = ijb, ije |
---|
| 75 | divgra(ij,l) = divgra(ij,l) * sqrtps(ij,l) |
---|
| 76 | ENDDO |
---|
| 77 | ENDDO |
---|
| 78 | !$OMP END DO NOWAIT |
---|
[1632] | 79 | |
---|
[5105] | 80 | ! ........ Iteration de l'operateur laplacien_gam ........ |
---|
[5159] | 81 | |
---|
[5105] | 82 | DO iter = 1, lh - 2 |
---|
| 83 | !$OMP BARRIER |
---|
| 84 | CALL Register_Hallo_u(divgra,llm,1,1,1,1,Request_dissip) |
---|
| 85 | CALL SendRequest(Request_dissip) |
---|
| 86 | !$OMP BARRIER |
---|
| 87 | CALL WaitRequest(Request_dissip) |
---|
[1632] | 88 | |
---|
[5105] | 89 | !$OMP BARRIER |
---|
[1632] | 90 | |
---|
| 91 | |
---|
[5105] | 92 | CALL laplacien_gam_loc(klevel,cuvscvgam2,cvuscugam2,unsair_gam2, & |
---|
| 93 | unsapolnga2, unsapolsga2, divgra, divgra ) |
---|
| 94 | ENDDO |
---|
[5159] | 95 | |
---|
[5105] | 96 | ! ............................................................... |
---|
[1632] | 97 | |
---|
[5105] | 98 | !$OMP DO SCHEDULE(STATIC,OMP_CHUNK) |
---|
| 99 | DO l = 1, klevel |
---|
| 100 | DO ij = ijb, ije |
---|
| 101 | divgra(ij,l) = divgra(ij,l) * sqrtps(ij,l) |
---|
| 102 | ENDDO |
---|
| 103 | ENDDO |
---|
| 104 | !$OMP END DO NOWAIT |
---|
[5159] | 105 | |
---|
[5105] | 106 | !$OMP BARRIER |
---|
| 107 | CALL Register_Hallo_u(divgra,llm,1,1,1,1,Request_dissip) |
---|
| 108 | CALL SendRequest(Request_dissip) |
---|
| 109 | !$OMP BARRIER |
---|
| 110 | CALL WaitRequest(Request_dissip) |
---|
| 111 | !$OMP BARRIER |
---|
[1632] | 112 | |
---|
[5105] | 113 | CALL laplacien_loc ( klevel, divgra, divgra ) |
---|
[5159] | 114 | |
---|
[5105] | 115 | !$OMP DO SCHEDULE(STATIC,OMP_CHUNK) |
---|
| 116 | DO l = 1,klevel |
---|
| 117 | DO ij = ijb,ije |
---|
| 118 | divgra_out(ij,l) = nudivgrs * divgra(ij,l) / deltapres(ij,l) |
---|
| 119 | ENDDO |
---|
| 120 | ENDDO |
---|
| 121 | !$OMP END DO NOWAIT |
---|
| 122 | |
---|
| 123 | |
---|
| 124 | END SUBROUTINE divgrad2_loc |
---|