PHYEX 0.9.5
PHYsique EXternalisée
Loading...
Searching...
No Matches
mode_gradient_m_phy.F90
Go to the documentation of this file.
2
3!$ACDC singlecolumn
4
5IMPLICIT NONE
6CONTAINS
7! #########################################
8 SUBROUTINE gz_m_w_phy(D,PY,PDZZ,PGZ_M_W)
9! #########################################
10!
11!!**** *GZ_M_W * - Compute the gradient along z direction for a
12!! variable localized at a mass point
13!!
14!! PURPOSE
15!! -------
16! The purpose of this routine is to compute a gradient along x,y,z
17! directions for a field PY localized at a mass point. The result PGZ_M_W
18! is localized at a z-flux point (w point)
19!
20!
21! dzm(PY)
22! PGZ_M_W = -------
23! d*zz
24!
25!!** METHOD
26!! ------
27!! We employ the Shuman operators to compute the derivatives and the
28!! averages. The metric coefficients PDZZ are dummy arguments.
29!!
30!!
31!! EXTERNAL
32!! --------
33!! FUNCTION DZM : compute a finite difference along the z
34!! direction for a variable at a mass localization
35!!
36!! IMPLICIT ARGUMENTS
37!! ------------------
38!!
39!! REFERENCE
40!! ---------
41!! Book2 of documentation (function GZ_M_W)
42!!
43!!
44!! AUTHOR
45!! ------
46!! P. Hereil and J. Stein * Meteo France *
47!!
48!! MODIFICATIONS
49!! -------------
50!! Original 05/07/94
51!! Modification 16/03/95 change the order of the arguments
52!! 19/07/00 inlining(J. Stein)
53!-------------------------------------------------------------------------------
54!
55!* 0. DECLARATIONS
56! ------------
57!
59!
60IMPLICIT NONE
61!
62!* 0.1 Declarations of arguments and results
63! -------------------------------------
64!
65TYPE(dimphyex_t), INTENT(IN) :: D
66!
67REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PDZZ !d*zz
68!
69REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PY ! variable at mass
70 ! localization
71REAL, DIMENSION(D%NIJT,D%NKT), INTENT(OUT) :: PGZ_M_W ! result at flux
72 ! side
73!
74INTEGER :: IKT,IKTB,IKTE,IIJB,IIJE,IKA,IKU,IKL
75INTEGER :: JIJ,JK
76!-------------------------------------------------------------------------------
77!
78!* 1. COMPUTE THE GRADIENT ALONG Z
79! -----------------------------
80!
81ikt=d%NKT
82iktb=d%NKTB
83ikte=d%NKTE
84iije=d%NIJE
85iijb=d%NIJB
86ikt=d%NKT
87ika=d%NKA
88iku=d%NKU
89ikl=d%NKL
90!
91!$acc kernels
92!$mnh_expand_array(JIJ=IIJB:IIJE,JK=IKTB:IKTE)
93pgz_m_w(iijb:iije,iktb:ikte) = (py(iijb:iije,iktb:ikte)-py(iijb:iije,iktb-ikl:ikte-ikl)) &
94 / pdzz(iijb:iije,iktb:ikte)
95!$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=IKTB:IKTE)
96!$mnh_expand_array(JIJ=IIJB:IIJE)
97pgz_m_w(iijb:iije,iku)= (py(iijb:iije,iku)-py(iijb:iije,iku-ikl)) &
98 / pdzz(iijb:iije,iku)
99pgz_m_w(iijb:iije,ika)= pgz_m_w(iijb:iije,iku) ! -999.
100!$mnh_end_expand_array(JIJ=IIJB:IIJE)
101!$acc end kernels
102!
103!-------------------------------------------------------------------------------
104!
105END SUBROUTINE gz_m_w_phy
106!
107SUBROUTINE gx_m_m_phy(D,OFLAT,PA,PDXX,PDZZ,PDZX,PGX_M_M)
108 USE yomhook , ONLY : lhook, dr_hook, jphook
109! #######################################################
110!
111!!**** *GX_M_M* - Cartesian Gradient operator:
112!! computes the gradient in the cartesian X
113!! direction for a variable placed at the
114!! mass point and the result is placed at
115!! the mass point.
116!! PURPOSE
117!! -------
118! The purpose of this function is to compute the discrete gradient
119! along the X cartesian direction for a field PA placed at the
120! mass point. The result is placed at the mass point.
121!
122!
123! ( ______________z )
124! ( (___x ) )
125! 1 ( _x (d*zx dzm(PA) ) )
126! PGX_M_M = ---- (dxf(PA) - (------------)) )
127! ___x ( ( ) )
128! d*xx ( ( d*zz ) )
129!
130!
131!
132!!** METHOD
133!! ------
134!! The Chain rule of differencing is applied to variables expressed
135!! in the Gal-Chen & Somerville coordinates to obtain the gradient in
136!! the cartesian system
137!!
138!! EXTERNAL
139!! --------
140!! MXM,MXF,MZF : Shuman functions (mean operators)
141!! DXF,DZF : Shuman functions (finite difference operators)
142!!
143!! IMPLICIT ARGUMENTS
144!! ------------------
145!!
146!! REFERENCE
147!! ---------
148!! Book2 of documentation of Meso-NH (GRAD_CAR operators)
149!! A Turbulence scheme for the Meso-NH model (Chapter 6)
150!!
151!! AUTHOR
152!! ------
153!! Joan Cuxart *INM and Meteo-France*
154!!
155!! MODIFICATIONS
156!! -------------
157!! Original 18/07/94
158!! 19/07/00 add the LFLAT switch (J. Stein)
159!! J.Escobar : 15/09/2015 : WENO5 & JPHEXT <> 1
160!-------------------------------------------------------------------------
161!
162!* 0. DECLARATIONS
163!
164!
165USE modd_dimphyex, ONLY: dimphyex_t
167!
168IMPLICIT NONE
169!
170!
171!* 0.1 declarations of arguments and result
172!
173TYPE(dimphyex_t), INTENT(IN) :: D
174REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PA ! variable at the mass point
175REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PDXX ! metric coefficient dxx
176REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PDZZ ! metric coefficient dzz
177REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PDZX ! metric coefficient dzx
178LOGICAL, INTENT(IN) :: OFLAT
179!
180REAL, DIMENSION(D%NIJT,D%NKT), INTENT(OUT) :: PGX_M_M ! result mass point
181REAL, DIMENSION(D%NIJT,D%NKT) :: ZWORK1, ZWORK2, ZWORK3, ZWORK4, ZWORK5, ZWORK6, ZMXF_PDXX
182!
183INTEGER :: IIJB,IIJE,IKT
184INTEGER :: JIJ,JK
185!
186!* 0.2 declaration of local variables
187!
188! NONE
189!
190!----------------------------------------------------------------------------
191!
192!* 1. DEFINITION of GX_M_M
193! --------------------
194!
195REAL(KIND=jphook) :: zhook_handle
196IF (lhook) CALL dr_hook('GX_M_M',0,zhook_handle)
197!
198iijb=d%NIJB
199iije=d%NIJE
200ikt=d%NKT
201!
202CALL mxf_phy(d,pdxx,zmxf_pdxx)
203CALL mxm_phy(d,pa,zwork1)
204CALL dxf_phy(d,zwork1,zwork2)
205!
206IF (.NOT. oflat) THEN
207 CALL dzm_phy(d,pa,zwork3)
208 CALL mxf_phy(d,pdzx,zwork4)
209 !$acc kernels
210 !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
211 zwork5(iijb:iije,1:ikt) = zwork3(iijb:iije,1:ikt) * zwork4(iijb:iije,1:ikt) &
212 / pdzz(iijb:iije,1:ikt)
213 !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
214 !$acc end kernels
215 CALL mzf_phy(d,zwork5,zwork6)
216 !$acc kernels
217 !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
218 pgx_m_m(iijb:iije,1:ikt)= (zwork2(iijb:iije,1:ikt) - zwork6(iijb:iije,1:ikt)) &
219 / zmxf_pdxx(iijb:iije,1:ikt)
220 !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
221 !$acc end kernels
222ELSE
223 !$acc kernels
224 !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
225 pgx_m_m(iijb:iije,1:ikt)= zwork2(iijb:iije,1:ikt) / zmxf_pdxx(iijb:iije,1:ikt)
226 !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
227 !$acc end kernels
228END IF
229!
230!----------------------------------------------------------------------------
231!
232IF (lhook) CALL dr_hook('GX_M_M',1,zhook_handle)
233END SUBROUTINE gx_m_m_phy
234!
235 SUBROUTINE gy_m_m_phy(D,OFLAT,PA,PDYY,PDZZ,PDZY,PGY_M_M)
236 USE yomhook , ONLY : lhook, dr_hook, jphook
237! #######################################################
238!
239!!**** *GY_M_M* - Cartesian Gradient operator:
240!! computes the gradient in the cartesian Y
241!! direction for a variable placed at the
242!! mass point and the result is placed at
243!! the mass point.
244!! PURPOSE
245!! -------
246! The purpose of this function is to compute the discrete gradient
247! along the Y cartesian direction for a field PA placed at the
248! mass point. The result is placed at the mass point.
249!
250!
251! ( ______________z )
252! ( (___y ) )
253! 1 ( _y (d*zy dzm(PA) ) )
254! PGY_M_M = ---- (dyf(PA) - (------------)) )
255! ___y ( ( ) )
256! d*yy ( ( d*zz ) )
257!
258!
259!!** METHOD
260!! ------
261!! The Chain rule of differencing is applied to variables expressed
262!! in the Gal-Chen & Somerville coordinates to obtain the gradient in
263!! the cartesian system
264!!
265!! EXTERNAL
266!! --------
267!! MYM,MYF,MZF : Shuman functions (mean operators)
268!! DYF,DZF : Shuman functions (finite difference operators)
269!!
270!! IMPLICIT ARGUMENTS
271!! ------------------
272!!
273!! REFERENCE
274!! ---------
275!! Book2 of documentation of Meso-NH (GRAD_CAR operators)
276!! A Turbulence scheme for the Meso-NH model (Chapter 6)
277!!
278!! AUTHOR
279!! ------
280!! Joan Cuxart *INM and Meteo-France*
281!!
282!! MODIFICATIONS
283!! -------------
284!! Original 18/07/94
285!! 19/07/00 add the LFLAT switch (J. Stein)
286!-------------------------------------------------------------------------
287!
288!* 0. DECLARATIONS
289!
290!
291USE modd_dimphyex, ONLY: dimphyex_t
293!
294IMPLICIT NONE
295!
296!
297!* 0.1 declarations of arguments and result
298!
299TYPE(dimphyex_t), INTENT(IN) :: d
300REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: pa ! variable at the mass point
301REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: pdyy ! metric coefficient dyy
302REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: pdzz ! metric coefficient dzz
303REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: pdzy ! metric coefficient dzy
304LOGICAL, INTENT(IN) :: oflat
305!
306REAL, DIMENSION(D%NIJT,D%NKT),INTENT(OUT) :: pgy_m_m ! result mass point
307REAL, DIMENSION(D%NIJT,D%NKT) :: zwork1, zwork2, zwork3, zwork4, zwork5, zmyf_pdyy
308!
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_M_M',0,zhook_handle)
316!
317iije=d%NIJE
318iijb=d%NIJB
319ikt=d%NKT
320!
321!----------------------------------------------------------------------------
322!
323!* 1. DEFINITION of GY_M_M
324! --------------------
325!
326CALL mym_phy(d,pa,zwork1)
327CALL dyf_phy(d,zwork1,zwork2)
328CALL myf_phy(d,pdyy,zmyf_pdyy)
329!
330IF (.NOT. oflat) THEN
331 !
332 CALL dzm_phy(d,pa,zwork3)
333 CALL myf_phy(d,pdzy,zwork4)
334 !$acc kernels
335 !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
336 zwork5(iijb:iije,1:ikt) = zwork4(iijb:iije,1:ikt) * zwork3(iijb:iije,1:ikt) &
337 / pdzz(iijb:iije,1:ikt)
338 !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
339 !$acc end kernels
340 CALL mzf_phy(d,zwork5,zwork4)
341 !$acc kernels
342 !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
343 pgy_m_m(iijb:iije,1:ikt)= (zwork2(iijb:iije,1:ikt)-zwork4(iijb:iije,1:ikt)) &
344 /zmyf_pdyy(iijb:iije,1:ikt)
345 !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
346 !$acc end kernels
347ELSE
348 !$acc kernels
349 !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
350 pgy_m_m(iijb:iije,1:ikt) = zwork2(iijb:iije,1:ikt)/zmyf_pdyy(iijb:iije,1:ikt)
351 !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
352 !$acc end kernels
353ENDIF
354!
355!----------------------------------------------------------------------------
356!
357IF (lhook) CALL dr_hook('GY_M_M',1,zhook_handle)
358END SUBROUTINE gy_m_m_phy
359!
360! #######################################################
361 SUBROUTINE gz_m_m_phy(D, PA,PDZZ, PGZ_M_M)
362 USE yomhook , ONLY : lhook, dr_hook, jphook
363! #######################################################
364!
365!!**** *GZ_M_M* - Cartesian Gradient operator:
366!! computes the gradient in the cartesian Z
367!! direction for a variable placed at the
368!! mass point and the result is placed at
369!! the mass point.
370!! PURPOSE
371!! -------
372! The purpose of this function is to compute the discrete gradient
373! along the Z cartesian direction for a field PA placed at the
374! mass point. The result is placed at the mass point.
375!
376! _________z
377! (dzm(PA))
378! PGZ_M_M = (------ )
379! ( d*zz )
380!
381!
382!!** METHOD
383!! ------
384!! The Chain rule of differencing is applied to variables expressed
385!! in the Gal-Chen & Somerville coordinates to obtain the gradient in
386!! the cartesian system
387!!
388!! EXTERNAL
389!! --------
390!! MZF : Shuman functions (mean operators)
391!! DZM : Shuman functions (finite difference operators)
392!!
393!! IMPLICIT ARGUMENTS
394!! ------------------
395!! NONE
396!!
397!! REFERENCE
398!! ---------
399!! Book2 of documentation of Meso-NH (GRAD_CAR operators)
400!! A Turbulence scheme for the Meso-NH model (Chapter 6)
401!!
402!! AUTHOR
403!! ------
404!! Joan Cuxart *INM and Meteo-France*
405!!
406!! MODIFICATIONS
407!! -------------
408!! Original 18/07/94
409!-------------------------------------------------------------------------
410!
411!* 0. DECLARATIONS
412!
413!
414USE modd_dimphyex, ONLY: dimphyex_t
416!
417IMPLICIT NONE
418!
419!
420!* 0.1 declarations of arguments and result
421!
422TYPE(dimphyex_t), INTENT(IN) :: d
423REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: pa ! variable at the mass point
424REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: pdzz ! metric coefficient dzz
425!
426REAL, DIMENSION(D%NIJT,D%NKT), INTENT(OUT) :: pgz_m_m ! result mass point
427!
428!
429!* 0.2 declaration of local variables
430!
431INTEGER :: jij, jk, iijb,iije,ikt
432REAL, DIMENSION(D%NIJT,D%NKT) :: pa_work, zwork
433REAL(kind=jphook) :: zhook_handle
434!
435!----------------------------------------------------------------------------
436!
437!* 1. DEFINITION of GZ_M_M
438! --------------------
439!
440IF (lhook) CALL dr_hook('GZ_M_M_PHY',0,zhook_handle)
441iijb=d%NIJB
442iije=d%NIJE
443ikt=d%NKT
444!
445CALL dzm_phy(d,pa,pa_work)
446!
447!$acc kernels
448!$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
449zwork(iijb:iije,1:ikt)= pa_work(iijb:iije,1:ikt) &
450 / pdzz(iijb:iije,1:ikt)
451!$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
452!$acc end kernels
453!
454CALL mzf_phy(d, zwork, pgz_m_m)
455!
456!----------------------------------------------------------------------------
457!
458IF (lhook) CALL dr_hook('GZ_M_M_PHY',1,zhook_handle)
459END SUBROUTINE gz_m_m_phy
460!
461! #######################################################
462 SUBROUTINE gx_m_u_phy(D,OFLAT,PY,PDXX,PDZZ,PDZX,PGX_M_U)
463 USE yomhook , ONLY : lhook, dr_hook, jphook
464! ##################################################
465!
466!!**** *GX_M_U * - Compute the gradient along x for a variable localized at
467!! a mass point
468!!
469!! PURPOSE
470!! -------
471! The purpose of this routine is to compute a gradient along x
472! direction for a field PY localized at a mass point. The result PGX_M_U
473! is localized at a x-flux point (u point).
474!
475! ( ____________z )
476! ( ________x )
477! 1 ( dzm(PY) )
478! PGX_M_U = ---- (dxm(PY) - d*zx -------- )
479! d*xx ( d*zz )
480!
481!
482!
483!!** METHOD
484!! ------
485!! We employ the Shuman operators to compute the derivatives and the
486!! averages. The metric coefficients PDXX,PDZX,PDZZ are dummy arguments.
487!!
488!!
489!! EXTERNAL
490!! --------
491!! FUNCTION DXM: compute a finite difference along the x direction for
492!! a variable at a mass localization
493!! FUNCTION DZM: compute a finite difference along the y direction for
494!! a variable at a mass localization
495!! FUNCTION MXM: compute an average in the x direction for a variable
496!! at a mass localization
497!! FUNCTION MZF: compute an average in the z direction for a variable
498!! at a flux side
499!!
500!! IMPLICIT ARGUMENTS
501!! ------------------
502!!
503!! REFERENCE
504!! ---------
505!! Book2 of documentation (function GX_M_U)
506!!
507!!
508!! AUTHOR
509!! ------
510!! P. Hereil and J. Stein * Meteo France *
511!!
512!! MODIFICATIONS
513!! -------------
514!! Original 05/07/94
515!! Modification 16/03/95 change the order of the arguments
516!! 19/07/00 add the LFLAT switch + inlining(J. Stein)
517!! 20/08/00 optimization (J. Escobar)
518!-------------------------------------------------------------------------------
519!
520!* 0. DECLARATIONS
521! ------------
522!
523USE modd_dimphyex, ONLY: dimphyex_t
525!
526IMPLICIT NONE
527!
528!* 0.1 Declarations of arguments and result
529! ------------------------------------
530!
531TYPE(dimphyex_t), INTENT(IN) :: d
532LOGICAL, INTENT(IN) :: oflat
533REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: py ! variable at the mass point
534REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: pdxx ! metric coefficient dxx
535REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: pdzz ! metric coefficient dzz
536REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: pdzx ! metric coefficient dzx
537!
538REAL, DIMENSION(D%NIJT,D%NKT), INTENT(OUT) :: pgx_m_u ! result at flux
539 ! side
540REAL, DIMENSION(D%NIJT,D%NKT) :: zwork1, zwork2, zwork3
541INTEGER :: iijb,iije,ikt,ika,iku
542INTEGER :: jij,jk
543!
544!-------------------------------------------------------------------------------
545!
546!* 1. COMPUTE THE GRADIENT ALONG X
547! -----------------------------
548!
549REAL(kind=jphook) :: zhook_handle
550IF (lhook) CALL dr_hook('GX_M_U',0,zhook_handle)
551iijb=d%NIJB
552iije=d%NIJE
553ikt=d%NKT
554ika=d%NKA
555iku=d%NKU
556!
557CALL dxm_phy(d,py,zwork1)
558IF (.NOT. oflat) THEN
559 CALL dzm_phy(d,py,zwork2)
560 !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
561 zwork2(iijb:iije,1:ikt) = zwork2(iijb:iije,1:ikt) / pdzz(iijb:iije,1:ikt)
562 !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
563 CALL mxm_phy(d,zwork2,zwork3)
564 !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
565 zwork3(iijb:iije,1:ikt) = zwork3(iijb:iije,1:ikt) * pdzx(iijb:iije,1:ikt)
566 !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
567 CALL mzf_phy(d,zwork3,zwork2)
568 !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
569 pgx_m_u(iijb:iije,1:ikt) = ( zwork1(iijb:iije,1:ikt) - zwork2(iijb:iije,1:ikt) ) &
570 / pdxx(iijb:iije,1:ikt)
571 !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
572 ! Upper level without the slope correction, lower level equal to the upper one
573 !$mnh_expand_array(JIJ=IIJB:IIJE)
574 pgx_m_u(iijb:iije,iku) = zwork1(iijb:iije,iku) / pdxx(iijb:iije,iku)
575 pgx_m_u(iijb:iije,ika) = pgx_m_u(iijb:iije,iku) ! -999.
576 !$mnh_end_expand_array(JIJ=IIJB:IIJE)
577ELSE
578 !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
579 pgx_m_u(iijb:iije,1:ikt) = zwork1(iijb:iije,1:ikt) / pdxx(iijb:iije,1:ikt)
580 !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
581ENDIF
582!
583!-------------------------------------------------------------------------------
584!
585IF (lhook) CALL dr_hook('GX_M_U',1,zhook_handle)
586END SUBROUTINE gx_m_u_phy
587!
588 SUBROUTINE gy_m_v_phy(D,OFLAT,PY,PDYY,PDZZ,PDZY,PGY_M_V)
589 USE yomhook , ONLY : lhook, dr_hook, jphook
590! ##################################################
591!
592!!**** *GY_M_V * - Compute the gradient along y for a variable localized at
593!! a mass point
594!!
595!! PURPOSE
596!! -------
597! The purpose of this routine is to compute a gradient along y
598! direction for a field PY localized at a mass point. The result PGY_M_V
599! is localized at a y-flux point (v point).
600!
601! ( ____________z )
602! ( ________y )
603! 1 ( dzm(PY) )
604! PGY_M_V = ---- (dym(PY) - d*zy -------- )
605! d*yy ( d*zz )
606!
607!
608!
609!
610!!** METHOD
611!! ------
612!! We employ the Shuman operators to compute the derivatives and the
613!! averages. The metric coefficients PDYY,PDZY,PDZZ are dummy arguments.
614!!
615!!
616!! EXTERNAL
617!! --------
618!! FUNCTION DYM: compute a finite difference along the y direction for
619!! a variable at a mass localization
620!! FUNCTION DZM: compute a finite difference along the y direction for
621!! a variable at a mass localization
622!! FUNCTION MYM: compute an average in the x direction for a variable
623!! at a mass localization
624!! FUNCTION MZF: compute an average in the z direction for a variable
625!! at a flux side
626!!
627!! IMPLICIT ARGUMENTS
628!! ------------------
629!!
630!! REFERENCE
631!! ---------
632!! Book2 of documentation (function GY_M_V)
633!!
634!!
635!! AUTHOR
636!! ------
637!! P. Hereil and J. Stein * Meteo France *
638!!
639!! MODIFICATIONS
640!! -------------
641!! Original 05/07/94
642!! Modification 16/03/95 change the order of the arguments
643!! 19/07/00 add the LFLAT switch + inlining(J. Stein)
644!-------------------------------------------------------------------------------
645!
646!* 0. DECLARATIONS
647! ------------
648!
649USE modd_dimphyex, ONLY: dimphyex_t
651!
652IMPLICIT NONE
653!
654!* 0.1 Declarations of arguments and result
655! ------------------------------------
656!
657TYPE(dimphyex_t), INTENT(IN) :: d
658LOGICAL, INTENT(IN) :: oflat
659REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: pdyy !d*yy
660REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: pdzy !d*zy
661REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: pdzz !d*zz
662!
663REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: py ! variable at mass
664 ! localization
665REAL, DIMENSION(D%NIJT,D%NKT),INTENT(OUT) :: pgy_m_v ! result at flux
666 ! side
667REAL, DIMENSION(D%NIJT,D%NKT) :: zwork1, zwork2, zwork3
668INTEGER :: iijb,iije,ikt,ika,iku
669INTEGER :: jij,jk
670!
671!-------------------------------------------------------------------------------
672!
673!* 1. COMPUTE THE GRADIENT ALONG Y
674! ----------------------------
675!
676REAL(kind=jphook) :: zhook_handle
677IF (lhook) CALL dr_hook('GY_M_V',0,zhook_handle)
678iijb=d%NIJB
679iije=d%NIJE
680ikt=d%NKT
681ika=d%NKA
682iku=d%NKU
683!
684CALL dym_phy(d,py,zwork1)
685IF (.NOT. oflat) THEN
686 CALL dzm_phy(d,py,zwork2)
687 !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
688 zwork2(iijb:iije,1:ikt) = zwork2(iijb:iije,1:ikt) / pdzz(iijb:iije,1:ikt)
689 !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
690 CALL mym_phy(d,zwork2,zwork3)
691 !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
692 zwork3(iijb:iije,1:ikt) = zwork3(iijb:iije,1:ikt) * pdzy(iijb:iije,1:ikt)
693 !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
694 CALL mzf_phy(d,zwork3,zwork2)
695 !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
696 pgy_m_v(iijb:iije,1:ikt) = ( zwork1(iijb:iije,1:ikt) - zwork2(iijb:iije,1:ikt) ) &
697 / pdyy(iijb:iije,1:ikt)
698 !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
699 ! Upper level without the slope correction, lower level undefined
700 !$mnh_expand_array(JIJ=IIJB:IIJE)
701 pgy_m_v(iijb:iije,iku) = zwork1(iijb:iije,iku) / pdyy(iijb:iije,iku)
702 pgy_m_v(iijb:iije,ika) = -999.
703 !$mnh_end_expand_array(JIJ=IIJB:IIJE)
704ELSE
705 !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
706 pgy_m_v(iijb:iije,1:ikt) = zwork1(iijb:iije,1:ikt) / pdyy(iijb:iije,1:ikt)
707 !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
708ENDIF
709!
710!-------------------------------------------------------------------------------
711!
712IF (lhook) CALL dr_hook('GY_M_V',1,zhook_handle)
713END SUBROUTINE gy_m_v_phy
714!
715END MODULE mode_gradient_m_phy
subroutine gx_m_m_phy(d, oflat, pa, pdxx, pdzz, pdzx, pgx_m_m)
subroutine gx_m_u_phy(d, oflat, py, pdxx, pdzz, pdzx, pgx_m_u)
subroutine gy_m_m_phy(d, oflat, pa, pdyy, pdzz, pdzy, pgy_m_m)
subroutine gy_m_v_phy(d, oflat, py, pdyy, pdzz, pdzy, pgy_m_v)
subroutine gz_m_m_phy(d, pa, pdzz, pgz_m_m)
subroutine gz_m_w_phy(d, py, pdzz, pgz_m_w)
subroutine mym_phy(d, pa, pmym)
subroutine dyf_phy(d, pa, pdyf)
subroutine mxf_phy(d, pa, pmxf)
subroutine dym_phy(d, pa, pdym)
subroutine dzm_phy(d, pa, pdzm)
subroutine dxm_phy(d, pa, pdxm)
subroutine mzf_phy(d, pa, pmzf)
subroutine dxf_phy(d, pa, pdxf)
subroutine mxm_phy(d, pa, pmxm)
subroutine myf_phy(d, pa, pmyf)