PHYEX 0.9.5
PHYsique EXternalisée
Loading...
Searching...
No Matches
mode_gradient_u_phy.F90
Go to the documentation of this file.
2
3!$ACDC singlecolumn
4
5IMPLICIT NONE
6CONTAINS
7
8! #######################################################
9 SUBROUTINE gy_u_uv_phy(D,OFLAT,PA,PDYY,PDZZ,PDZY,PGY_U_UV)
10 USE yomhook , ONLY : lhook, dr_hook, jphook
11! #########################################################
12!
13!!**** *GY_U_UV* - Cartesian Gradient operator:
14!! computes the gradient in the cartesian Y
15!! direction for a variable placed at the
16!! U point and the result is placed at
17!! the UV vorticity point.
18!! PURPOSE
19!! -------
20! The purpose of this function is to compute the discrete gradient
21! along the Y cartesian direction for a field PA placed at the
22! U point. The result is placed at the UV vorticity point.
23!
24!
25!
26! ( _________________z )
27! ( (___x _________y ) )
28! 1 ( (d*zy (dzm(PA))) ) )
29! PGY_U_UV= ---- (dym(PA) - ( (------ ) ) )
30! ___x ( ( ( ___x ) ) )
31! d*yy ( ( ( d*zz ) ) )
32!
33!
34!
35!!** METHOD
36!! ------
37!! The Chain rule of differencing is applied to variables expressed
38!! in the Gal-Chen & Somerville coordinates to obtain the gradient in
39!! the cartesian system
40!!
41!! EXTERNAL
42!! --------
43!! MXM,MYM,MZF : Shuman functions (mean operators)
44!! DYM,DZM : Shuman functions (finite difference operators)
45!!
46!! IMPLICIT ARGUMENTS
47!! ------------------
48!! NONE
49!!
50!! REFERENCE
51!! ---------
52!! Book2 of documentation of Meso-NH (GRAD_CAR operators)
53!! A Turbulence scheme for the Meso-NH model (Chapter 6)
54!!
55!! AUTHOR
56!! ------
57!! Joan Cuxart *INM and Meteo-France*
58!!
59!! MODIFICATIONS
60!! -------------
61!! Original 20/07/94
62!! 18/10/00 (V.Masson) add OFLAT switch
63!-------------------------------------------------------------------------
64!
65!* 0. DECLARATIONS
66!
67!
70!
71IMPLICIT NONE
72!
73!
74!* 0.1 declarations of arguments and result
75!
76TYPE(dimphyex_t), INTENT(IN) :: D
77LOGICAL, INTENT(IN) :: OFLAT ! Logical for zero ororography
78REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PA ! variable at the U point
79REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PDYY ! metric coefficient dyy
80REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PDZZ ! metric coefficient dzz
81REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PDZY ! metric coefficient dzy
82!
83REAL, DIMENSION(D%NIJT,D%NKT), INTENT(OUT) :: PGY_U_UV ! result UV point
84!
85!
86!* 0.2 declaration of local variables
87!
88REAL, DIMENSION(D%NIJT,D%NKT) :: ZWORK1, ZWORK2, ZWORK3, ZWORK4, ZWORK5
89INTEGER :: IIJB,IIJE,IKT
90INTEGER :: JIJ, JK
91!
92!----------------------------------------------------------------------------
93!
94!* 1. DEFINITION of GY_U_UV
95! ---------------------
96!
97REAL(KIND=jphook) :: zhook_handle
98IF (lhook) CALL dr_hook('GY_U_UV',0,zhook_handle)
99iijb=d%NIJB
100iije=d%NIJE
101ikt=d%NKT
102!
103CALL dym_phy(d,pa,zwork1)
104CALL mxm_phy(d,pdyy,zwork2)
105
106IF (.NOT. oflat) THEN
107 CALL dzm_phy(d,pa,zwork3)
108 CALL mxm_phy(d,pdzz,zwork5)
109 !$acc kernels
110 !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
111 zwork3(iijb:iije,1:ikt) = zwork3(iijb:iije,1:ikt) / zwork5(iijb:iije,1:ikt)
112 !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
113 !$acc end kernels
114 CALL mym_phy(d,zwork3,zwork4)
115 CALL mxm_phy(d,pdzy,zwork5)
116 !$acc kernels
117 !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
118 zwork4(iijb:iije,1:ikt) = zwork4(iijb:iije,1:ikt) * zwork5(iijb:iije,1:ikt)
119 !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
120 !$acc end kernels
121 CALL mzf_phy(d,zwork4,zwork3)
122 !$acc kernels
123 !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
124 pgy_u_uv(iijb:iije,1:ikt) = ( zwork1(iijb:iije,1:ikt) - zwork3(iijb:iije,1:ikt)) &
125 / zwork2(iijb:iije,1:ikt)
126 !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
127 !$acc end kernels
128ELSE
129 !$acc kernels
130 !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
131 pgy_u_uv(iijb:iije,1:ikt)= zwork1(iijb:iije,1:ikt) / zwork2(iijb:iije,1:ikt)
132 !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
133 !$acc end kernels
134END IF
135!
136!----------------------------------------------------------------------------
137!
138IF (lhook) CALL dr_hook('GY_U_UV',1,zhook_handle)
139END SUBROUTINE gy_u_uv_phy
140
141! #######################################################
142 SUBROUTINE gz_u_uw_phy(D,PA,PDZZ,PGZ_U_UW)
143! #######################################################
144!
145!!**** *GZ_U_UW - Cartesian Gradient operator:
146!! computes the gradient in the cartesian Z
147!! direction for a variable placed at the
148!! U point and the result is placed at
149!! the UW vorticity point.
150!! PURPOSE
151!! -------
152! The purpose of this function is to compute the discrete gradient
153! along the Z cartesian direction for a field PA placed at the
154! U point. The result is placed at the UW vorticity point.
155!
156! dzm(PA)
157! PGZ_U_UW = ------
158! ____x
159! d*zz
160!
161!!** METHOD
162!! ------
163!! The Chain rule of differencing is applied to variables expressed
164!! in the Gal-Chen & Somerville coordinates to obtain the gradient in
165!! the cartesian system
166!!
167!! EXTERNAL
168!! --------
169!! MXM : Shuman functions (mean operators)
170!! DZM : Shuman functions (finite difference operators)
171!!
172!! IMPLICIT ARGUMENTS
173!! ------------------
174!! NONE
175!!
176!! REFERENCE
177!! ---------
178!! Book2 of documentation of Meso-NH (GRAD_CAR operators)
179!! A Turbulence scheme for the Meso-NH model (Chapter 6)
180!!
181!! AUTHOR
182!! ------
183!! Joan Cuxart *INM and Meteo-France*
184!!
185!! MODIFICATIONS
186!! -------------
187!! Original 20/07/94
188!-------------------------------------------------------------------------
189!
190!* 0. DECLARATIONS
191!
192!
194USE modd_dimphyex, ONLY: dimphyex_t
195!
196IMPLICIT NONE
197!
198!
199!* 0.1 declarations of arguments and result
200!
201TYPE(dimphyex_t), INTENT(IN) :: d
202!
203REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: pa ! variable at the U point
204REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: pdzz ! metric coefficient dzz
205!
206REAL, DIMENSION(D%NIJT,D%NKT), INTENT(OUT) :: pgz_u_uw ! result UW point
207REAL, DIMENSION(D%NIJT,D%NKT) :: pa_work, pdzz_work
208!
209INTEGER :: jij,jk,iijb,iije,ikt
210
211!
212!* 0.2 declaration of local variables
213!
214! NONE
215!
216!----------------------------------------------------------------------------
217!
218!* 1. DEFINITION of GZ_U_UW
219! ---------------------
220!
221iijb=d%NIJB
222iije=d%NIJE
223ikt=d%NKT
224!
225CALL dzm_phy(d,pa,pa_work)
226CALL mxm_phy(d,pdzz,pdzz_work)
227!
228!$acc kernels
229!$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
230pgz_u_uw(iijb:iije,1:ikt)= pa_work(iijb:iije,1:ikt) / pdzz_work(iijb:iije,1:ikt)
231!$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
232!$acc end kernels
233!
234!----------------------------------------------------------------------------
235!
236END SUBROUTINE gz_u_uw_phy
237!
238 SUBROUTINE gx_u_m_phy(D,OFLAT,PA,PDXX,PDZZ,PDZX,PGX_U_M)
239 USE yomhook , ONLY : lhook, dr_hook, jphook
240! #######################################################
241!
242!!**** *GX_U_M* - Cartesian Gradient operator:
243!! computes the gradient in the cartesian X
244!! direction for a variable placed at the
245!! U point and the result is placed at
246!! the mass point.
247!! PURPOSE
248!! -------
249! The purpose of this function is to compute the discrete gradient
250! along the X cartesian direction for a field PA placed at the
251! U point. The result is placed at the mass point.
252!
253!
254! ( ______________z )
255! ( (___________x ) )
256! 1 ( (d*zx dzm(PA) ) )
257! PGX_U_M = ---- (dxf(PA) - (------------)) )
258! ___x ( ( ) )
259! d*xx ( ( d*zz ) )
260!
261!
262!
263!!** METHOD
264!! ------
265!! The Chain rule of differencing is applied to variables expressed
266!! in the Gal-Chen & Somerville coordinates to obtain the gradient in
267!! the cartesian system
268!!
269!! EXTERNAL
270!! --------
271!! MXF,MZF : Shuman functions (mean operators)
272!! DXF,DZF : Shuman functions (finite difference operators)
273!!
274!! IMPLICIT ARGUMENTS
275!! ------------------
276!! NONE
277!!
278!! REFERENCE
279!! ---------
280!! Book2 of documentation of Meso-NH (GRAD_CAR operators)
281!! A Turbulence scheme for the Meso-NH model (Chapter 6)
282!!
283!! AUTHOR
284!! ------
285!! Joan Cuxart *INM and Meteo-France*
286!!
287!! MODIFICATIONS
288!! -------------
289!! Original 19/07/94
290!! 18/10/00 (V.Masson) add LFLAT switch
291!-------------------------------------------------------------------------
292!
293!* 0. DECLARATIONS
294!
295!
297USE modd_dimphyex, ONLY: dimphyex_t
298!
299IMPLICIT NONE
300!
301!
302!* 0.1 declarations of arguments and result
303!
304TYPE(dimphyex_t), INTENT(IN) :: D
305!
306LOGICAL, INTENT(IN) :: OFLAT
307REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PA ! variable at the U point
308REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PDXX ! metric coefficient dxx
309REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PDZZ ! metric coefficient dzz
310REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PDZX ! metric coefficient dzx
311!
312REAL, DIMENSION(D%NIJT,D%NKT), INTENT(OUT) :: PGX_U_M ! result mass point
313!
314REAL, DIMENSION(D%NIJT,D%NKT) :: ZWORK1, ZWORK2, ZWORK3, ZWORK4
315INTEGER :: IIJB,IIJE,IKT
316INTEGER :: JIJ, JK
317!
318!* 0.2 declaration of local variables
319!
320! NONE
321!
322!----------------------------------------------------------------------------
323!
324!* 1. DEFINITION of GX_U_M
325! --------------------
326!
327REAL(KIND=jphook) :: zhook_handle
328IF (lhook) CALL dr_hook('GX_U_M',0,zhook_handle)
329!
330iijb=d%NIJB
331iije=d%NIJE
332ikt=d%NKT
333!
334CALL dxf_phy(d,pa,zwork1)
335CALL mxf_phy(d,pdxx,zwork2)
336
337IF (.NOT. oflat) THEN
338 CALL dzm_phy(d,pa,zwork3)
339 !$acc kernels
340 !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
341 zwork3(iijb:iije,1:ikt) = zwork3(iijb:iije,1:ikt) * pdzx(iijb:iije,1:ikt)
342 !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
343 !$acc end kernels
344 CALL mxf_phy(d,zwork3,zwork4)
345 !$acc kernels
346 !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
347 zwork4(iijb:iije,1:ikt) = zwork4(iijb:iije,1:ikt) / pdzz(iijb:iije,1:ikt)
348 !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
349 !$acc end kernels
350 CALL mzf_phy(d,zwork4,zwork3)
351 !$acc kernels
352 !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
353 pgx_u_m(iijb:iije,1:ikt) = ( zwork1(iijb:iije,1:ikt) - zwork3(iijb:iije,1:ikt)) &
354 / zwork2(iijb:iije,1:ikt)
355 !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
356 !$acc end kernels
357ELSE
358 !$acc kernels
359 !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
360 pgx_u_m(iijb:iije,1:ikt)= zwork1(iijb:iije,1:ikt) / zwork2(iijb:iije,1:ikt)
361 !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
362 !$acc end kernels
363END IF
364!
365!----------------------------------------------------------------------------
366!
367IF (lhook) CALL dr_hook('GX_U_M',1,zhook_handle)
368END SUBROUTINE gx_u_m_phy
369!
370END MODULE mode_gradient_u_phy
subroutine gy_u_uv_phy(d, oflat, pa, pdyy, pdzz, pdzy, pgy_u_uv)
subroutine gz_u_uw_phy(d, pa, pdzz, pgz_u_uw)
subroutine gx_u_m_phy(d, oflat, pa, pdxx, pdzz, pdzx, pgx_u_m)
subroutine mym_phy(d, pa, pmym)
subroutine mxf_phy(d, pa, pmxf)
subroutine dym_phy(d, pa, pdym)
subroutine dzm_phy(d, pa, pdzm)
subroutine mzf_phy(d, pa, pmzf)
subroutine dxf_phy(d, pa, pdxf)
subroutine mxm_phy(d, pa, pmxm)