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