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