1 | SUBROUTINE nxgraro2_loc(klevel,xcov,ycov,lr,grx_out,gry_out) |
---|
2 | ! |
---|
3 | ! P.Le Van . |
---|
4 | ! *********************************************************** |
---|
5 | ! lr |
---|
6 | ! calcul de ( nxgrad (rot) ) du vect. v .... |
---|
7 | ! |
---|
8 | ! xcov et ycov etant les compos. covariantes de v |
---|
9 | ! *********************************************************** |
---|
10 | ! xcov , ycov et lr sont des arguments d'entree pour le s-prog |
---|
11 | ! grx et gry sont des arguments de sortie pour le s-prog |
---|
12 | ! |
---|
13 | ! |
---|
14 | USE write_Field_p |
---|
15 | USE parallel_lmdz |
---|
16 | USE times |
---|
17 | USE mod_hallo |
---|
18 | USE lmdz_filtreg_p |
---|
19 | USE nxgraro2_mod |
---|
20 | USE lmdz_comdissipn, ONLY: tetaudiv, tetaurot, tetah, cdivu, crot, cdivh |
---|
21 | |
---|
22 | IMPLICIT NONE |
---|
23 | ! |
---|
24 | INCLUDE "dimensions.h" |
---|
25 | INCLUDE "paramet.h" |
---|
26 | ! |
---|
27 | ! ...... variables en arguments ....... |
---|
28 | ! |
---|
29 | INTEGER :: klevel |
---|
30 | REAL :: xcov( ijb_u:ije_u,klevel ), ycov( ijb_v:ije_v,klevel ) |
---|
31 | REAL :: grx_out( ijb_u:ije_u,klevel ),gry_out(ijb_v:ije_v,klevel) |
---|
32 | ! |
---|
33 | ! ...... variables locales ........ |
---|
34 | ! |
---|
35 | REAL :: signe, nugradrs |
---|
36 | INTEGER :: l,ij,iter,lr |
---|
37 | Type(Request),SAVE :: Request_dissip |
---|
38 | !$OMP THREADPRIVATE(Request_dissip) |
---|
39 | ! ........................................................ |
---|
40 | ! |
---|
41 | INTEGER :: ijb,ije,jjb,jje |
---|
42 | |
---|
43 | ! |
---|
44 | ! |
---|
45 | signe = (-1.)**lr |
---|
46 | nugradrs = signe * crot |
---|
47 | ! |
---|
48 | ! CALL SCOPY ( ip1jmp1* klevel, xcov, 1, grx, 1 ) |
---|
49 | ! CALL SCOPY ( ip1jm * klevel, ycov, 1, gry, 1 ) |
---|
50 | |
---|
51 | ijb=ij_begin |
---|
52 | ije=ij_end |
---|
53 | |
---|
54 | !$OMP DO SCHEDULE(STATIC,OMP_CHUNK) |
---|
55 | DO l = 1, klevel |
---|
56 | grx(ijb:ije,l)=xcov(ijb:ije,l) |
---|
57 | ENDDO |
---|
58 | !$OMP END DO NOWAIT |
---|
59 | |
---|
60 | !$OMP BARRIER |
---|
61 | CALL Register_Hallo_u(grx,llm,0,1,1,0,Request_dissip) |
---|
62 | CALL SendRequest(Request_dissip) |
---|
63 | !$OMP BARRIER |
---|
64 | CALL WaitRequest(Request_dissip) |
---|
65 | !$OMP BARRIER |
---|
66 | |
---|
67 | ijb=ij_begin |
---|
68 | ije=ij_end |
---|
69 | IF(pole_sud) ije=ij_end-iip1 |
---|
70 | |
---|
71 | !$OMP DO SCHEDULE(STATIC,OMP_CHUNK) |
---|
72 | DO l = 1, klevel |
---|
73 | gry(ijb:ije,l)=ycov(ijb:ije,l) |
---|
74 | ENDDO |
---|
75 | !$OMP END DO NOWAIT |
---|
76 | |
---|
77 | ! |
---|
78 | CALL rotatf_loc ( klevel, grx, gry, rot ) |
---|
79 | ! CALL write_field3d_p('rot1',reshape(rot,(/iip1,jjm,llm/))) |
---|
80 | |
---|
81 | !$OMP BARRIER |
---|
82 | CALL Register_Hallo_v(rot,llm,1,1,1,1,Request_dissip) |
---|
83 | CALL SendRequest(Request_dissip) |
---|
84 | !$OMP BARRIER |
---|
85 | CALL WaitRequest(Request_dissip) |
---|
86 | !$OMP BARRIER |
---|
87 | |
---|
88 | CALL laplacien_rot_loc ( klevel, rot, rot,grx,gry ) |
---|
89 | ! CALL write_field3d_p('rot2',reshape(rot,(/iip1,jjm,llm/))) |
---|
90 | ! |
---|
91 | ! ..... Iteration de l'operateur laplacien_rotgam ..... |
---|
92 | ! |
---|
93 | DO iter = 1, lr -2 |
---|
94 | !$OMP BARRIER |
---|
95 | CALL Register_Hallo_v(rot,llm,1,1,1,1,Request_dissip) |
---|
96 | CALL SendRequest(Request_dissip) |
---|
97 | !$OMP BARRIER |
---|
98 | CALL WaitRequest(Request_dissip) |
---|
99 | !$OMP BARRIER |
---|
100 | |
---|
101 | CALL laplacien_rotgam_loc( klevel, rot, rot ) |
---|
102 | ENDDO |
---|
103 | |
---|
104 | ! CALL write_field3d_p('rot3',reshape(rot,(/iip1,jjm,llm/))) |
---|
105 | |
---|
106 | ! |
---|
107 | ! |
---|
108 | jjb=jj_begin |
---|
109 | jje=jj_end |
---|
110 | IF (pole_sud) jje=jj_end-1 |
---|
111 | |
---|
112 | CALL filtreg_p( rot, jjb_v,jje_v, jjb,jje,jjm, & |
---|
113 | klevel, 2,1, .FALSE.,1) |
---|
114 | !$OMP BARRIER |
---|
115 | CALL Register_Hallo_v(rot,llm,1,0,0,1,Request_dissip) |
---|
116 | CALL SendRequest(Request_dissip) |
---|
117 | !$OMP BARRIER |
---|
118 | CALL WaitRequest(Request_dissip) |
---|
119 | !$OMP BARRIER |
---|
120 | |
---|
121 | CALL nxgrad_loc ( klevel, rot, grx, gry ) |
---|
122 | |
---|
123 | ! |
---|
124 | ijb=ij_begin |
---|
125 | ije=ij_end |
---|
126 | |
---|
127 | !$OMP DO SCHEDULE(STATIC,OMP_CHUNK) |
---|
128 | DO l = 1, klevel |
---|
129 | |
---|
130 | IF(pole_sud) ije=ij_end-iip1 |
---|
131 | DO ij = ijb, ije |
---|
132 | gry_out( ij,l ) = gry( ij,l ) * nugradrs |
---|
133 | ENDDO |
---|
134 | |
---|
135 | IF(pole_sud) ije=ij_end |
---|
136 | DO ij = ijb, ije |
---|
137 | grx_out( ij,l ) = grx( ij,l ) * nugradrs |
---|
138 | ENDDO |
---|
139 | |
---|
140 | ENDDO |
---|
141 | !$OMP END DO NOWAIT |
---|
142 | ! |
---|
143 | |
---|
144 | END SUBROUTINE nxgraro2_loc |
---|