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 | USE lmdz_comdissipn, ONLY: tetaudiv, tetaurot, tetah, cdivu, crot, cdivh |
---|
17 | USE lmdz_comgeom2 |
---|
18 | |
---|
19 | USE lmdz_dimensions, ONLY: iim, jjm, llm, ndm |
---|
20 | USE lmdz_paramet |
---|
21 | IMPLICIT NONE |
---|
22 | ! |
---|
23 | |
---|
24 | |
---|
25 | |
---|
26 | ! ....... variables en arguments ....... |
---|
27 | |
---|
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 .......... |
---|
32 | |
---|
33 | REAL :: signe, nudivgrs, sqrtps( ijb_u:ije_u,llm ) |
---|
34 | INTEGER :: l,ij,iter,lh |
---|
35 | ! ................................................................... |
---|
36 | Type(Request),SAVE :: request_dissip |
---|
37 | !$OMP THREADPRIVATE(request_dissip) |
---|
38 | INTEGER :: ijb,ije |
---|
39 | |
---|
40 | |
---|
41 | |
---|
42 | signe = (-1.)**lh |
---|
43 | nudivgrs = signe * cdivh |
---|
44 | |
---|
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 |
---|
53 | |
---|
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 |
---|
60 | |
---|
61 | CALL laplacien_loc( klevel, divgra, divgra ) |
---|
62 | |
---|
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 |
---|
70 | |
---|
71 | |
---|
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 |
---|
79 | |
---|
80 | ! ........ Iteration de l'operateur laplacien_gam ........ |
---|
81 | |
---|
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) |
---|
88 | |
---|
89 | !$OMP BARRIER |
---|
90 | |
---|
91 | |
---|
92 | CALL laplacien_gam_loc(klevel,cuvscvgam2,cvuscugam2,unsair_gam2, & |
---|
93 | unsapolnga2, unsapolsga2, divgra, divgra ) |
---|
94 | ENDDO |
---|
95 | |
---|
96 | ! ............................................................... |
---|
97 | |
---|
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 |
---|
105 | |
---|
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 |
---|
112 | |
---|
113 | CALL laplacien_loc ( klevel, divgra, divgra ) |
---|
114 | |
---|
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 |
---|