PHYEX 0.9.5
PHYsique EXternalisée
Loading...
Searching...
No Matches
mode_shuman_mf.F90
Go to the documentation of this file.
1!MNH_LIC Copyright 1994-2014 CNRS, Meteo-France and Universite Paul Sabatier
2!MNH_LIC This is part of the Meso-NH software governed by the CeCILL-C licence
3!MNH_LIC version 1. See LICENSE, CeCILL-C_V1-en.txt and CeCILL-C_V1-fr.txt
4!MNH_LIC for details. version 1.
5! ##################
7
8!$ACDC singlecolumn
9
10! ##################
11!
12IMPLICIT NONE
13
14CONTAINS
15
16!
17! ###############################
18 SUBROUTINE mzf_mf(D, PA, PMZF)
19! ###############################
20!
21!!**** *MZF* - SHUMAN_MF operator : mean operator in z direction for a
22!! variable at a flux side
23!!
24!! PURPOSE
25!! -------
26! The purpose of this function is to compute a mean
27! along the z direction (K index) for a field PA localized at a z-flux
28! point (w point). The result is localized at a mass point.
29!
30!!** METHOD
31!! ------
32!! The result PMZF(:,:,k) is defined by 0.5*(PA(:,:,k)+PA(:,:,k+1))
33!! At k=size(PA,3), PMZF(:,:,k) is defined by PA(:,:,k).
34!!
35!!
36!! EXTERNAL
37!! --------
38!! NONE
39!!
40!! IMPLICIT ARGUMENTS
41!! ------------------
42!! NONE
43!!
44!! REFERENCE
45!! ---------
46!! Book2 of documentation of Meso-NH (SHUMAN_MF operators)
47!! Technical specifications Report of The Meso-NH (chapters 3)
48!!
49!!
50!! AUTHOR
51!! ------
52!! V. Ducrocq * Meteo France *
53!!
54!! MODIFICATIONS
55!! -------------
56!! Original 04/07/94
57!! optimisation 20/08/00 J. Escobar
58!! S. Riette, Jan 2012: Simplification and suppression of array overflow
59!-------------------------------------------------------------------------------
60!
61!* 0. DECLARATIONS
62! ------------
63!
65IMPLICIT NONE
66!
67!* 0.1 Declarations of argument and result
68! ------------------------------------
69!
70TYPE(dimphyex_t), INTENT(IN) :: D
71REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PA ! variable at flux side
72REAL, DIMENSION(D%NIJT,D%NKT), INTENT(OUT) :: PMZF ! result at mass
73 ! localization
74!
75!* 0.2 Declarations of local variables
76! -------------------------------
77!
78INTEGER :: JK, JIJ
79INTEGER :: IIJB,IIJE ! physical horizontal domain indices
80INTEGER :: IKA,IKU,IKT
81INTEGER :: IKL
82!
83iije=d%NIJE
84iijb=d%NIJB
85ika=d%NKA
86iku=d%NKU
87ikt=d%NKT
88ikl=d%NKL
89!
90!
91!-------------------------------------------------------------------------------
92!
93!* 1. DEFINITION OF MZF
94! ------------------
95!
96DO jk=2,ikt-1
97 !$mnh_expand_array(JIJ=IIJB:IIJE)
98 pmzf(iijb:iije,jk) = 0.5*( pa(iijb:iije,jk)+pa(iijb:iije,jk+ikl) )
99 !$mnh_end_expand_array(JIJ=IIJB:IIJE)
100END DO
101!$mnh_expand_array(JIJ=IIJB:IIJE)
102pmzf(iijb:iije,ika) = 0.5*( pa(iijb:iije,ika)+pa(iijb:iije,ika+ikl) )
103pmzf(iijb:iije,iku) = pa(iijb:iije,iku)
104!$mnh_end_expand_array(JIJ=IIJB:IIJE)
105!
106!-------------------------------------------------------------------------------
107!
108END SUBROUTINE mzf_mf
109! ###############################
110 SUBROUTINE mzm_mf(D, PA, PMZM)
111! ###############################
112!
113!!**** *MZM* - SHUMAN_MF operator : mean operator in z direction for a
114!! mass variable
115!!
116!! PURPOSE
117!! -------
118! The purpose of this function is to compute a mean
119! along the z direction (K index) for a field PA localized at a mass
120! point. The result is localized at a z-flux point (w point).
121!
122!!** METHOD
123!! ------
124!! The result PMZM(:,:,k) is defined by 0.5*(PA(:,:,k)+PA(:,:,k-1))
125!! At k=1, PMZM(:,:,1) is defined by PA(:,:,1).
126!!
127!!
128!! EXTERNAL
129!! --------
130!! NONE
131!!
132!! IMPLICIT ARGUMENTS
133!! ------------------
134!! NONE
135!!
136!! REFERENCE
137!! ---------
138!! Book2 of documentation of Meso-NH (SHUMAN_MF operators)
139!! Technical specifications Report of The Meso-NH (chapters 3)
140!!
141!!
142!! AUTHOR
143!! ------
144!! V. Ducrocq * Meteo France *
145!!
146!! MODIFICATIONS
147!! -------------
148!! Original 04/07/94
149!! optimisation 20/08/00 J. Escobar
150!! S. Riette, Jan 2012: Simplification and suppression of array overflow
151!-------------------------------------------------------------------------------
152!
153!* 0. DECLARATIONS
154! ------------
155!
156USE modd_dimphyex, ONLY: dimphyex_t
157IMPLICIT NONE
158!
159!* 0.1 Declarations of argument and result
160! ------------------------------------
161!
162TYPE(dimphyex_t), INTENT(IN) :: D
163REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PA ! variable at mass localization
164REAL, DIMENSION(D%NIJT,D%NKT), INTENT(OUT) :: PMZM ! result at flux localization
165!
166!* 0.2 Declarations of local variables
167! -------------------------------
168!
169INTEGER :: JK, JIJ
170INTEGER :: IIJB,IIJE ! physical horizontal domain indices
171INTEGER :: IKA,IKU,IKT,IKL
172!
173!
174iije=d%NIJE
175iijb=d%NIJB
176ika=d%NKA
177iku=d%NKU
178ikt=d%NKT
179ikl=d%NKL
180!
181!-------------------------------------------------------------------------------
182!
183!* 1. DEFINITION OF MZM
184! ------------------
185!
186DO jk=2,ikt-1
187 !$mnh_expand_array(JIJ=IIJB:IIJE)
188 pmzm(iijb:iije,jk) = 0.5*( pa(iijb:iije,jk)+pa(iijb:iije,jk-ikl) )
189 !$mnh_end_expand_array(JIJ=IIJB:IIJE)
190END DO
191!$mnh_expand_array(JIJ=IIJB:IIJE)
192pmzm(iijb:iije,ika) = pa(iijb:iije,ika)
193pmzm(iijb:iije,iku) = 0.5*( pa(iijb:iije,iku)+pa(iijb:iije,iku-ikl) )
194!$mnh_end_expand_array(JIJ=IIJB:IIJE)
195!
196!-------------------------------------------------------------------------------
197!
198END SUBROUTINE mzm_mf
199! ###############################
200 SUBROUTINE dzf_mf(D, PA, PDZF)
201! ###############################
202!
203!!**** *DZF* - SHUMAN_MF operator : finite difference operator in z direction
204!! for a variable at a flux side
205!!
206!! PURPOSE
207!! -------
208! The purpose of this function is to compute a finite difference
209! along the z direction (K index) for a field PA localized at a z-flux
210! point (w point). The result is localized at a mass point.
211!
212!!** METHOD
213!! ------
214!! The result PDZF(:,:,k) is defined by (PA(:,:,k+1)-PA(:,:,k))
215!! At k=size(PA,3), PDZF(:,:,k) is defined by 0.
216!!
217!!
218!! EXTERNAL
219!! --------
220!! NONE
221!!
222!! IMPLICIT ARGUMENTS
223!! ------------------
224!! NONE
225!!
226!! REFERENCE
227!! ---------
228!! Book2 of documentation of Meso-NH (SHUMAN_MF operators)
229!! Technical specifications Report of The Meso-NH (chapters 3)
230!!
231!!
232!! AUTHOR
233!! ------
234!! V. Ducrocq * Meteo France *
235!!
236!! MODIFICATIONS
237!! -------------
238!! Original 05/07/94
239!! optimisation 20/08/00 J. Escobar
240!! S. Riette, Jan 2012: Simplification and suppression of array overflow
241!-------------------------------------------------------------------------------
242!
243!* 0. DECLARATIONS
244! ------------
245!
246USE modd_dimphyex, ONLY: dimphyex_t
247IMPLICIT NONE
248!
249!* 0.1 Declarations of argument and result
250! ------------------------------------
251!
252TYPE(dimphyex_t), INTENT(IN) :: D
253REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PA ! variable at flux side
254REAL, DIMENSION(D%NIJT,D%NKT), INTENT(OUT) :: PDZF ! result at mass
255 ! localization
256!
257!* 0.2 Declarations of local variables
258! -------------------------------
259!
260INTEGER :: JK, JIJ
261INTEGER :: IIJB,IIJE ! physical horizontal domain indices
262INTEGER :: IKA,IKU,IKT,IKL
263!
264!-------------------------------------------------------------------------------
265!
266iije=d%NIJE
267iijb=d%NIJB
268ika=d%NKA
269iku=d%NKU
270ikt=d%NKT
271ikl=d%NKL
272!
273!* 1. DEFINITION OF DZF
274! ------------------
275!
276DO jk=2,ikt-1
277 !$mnh_expand_array(JIJ=IIJB:IIJE)
278 pdzf(iijb:iije,jk) = pa(iijb:iije,jk+ikl) - pa(iijb:iije,jk)
279 !$mnh_end_expand_array(JIJ=IIJB:IIJE)
280END DO
281!$mnh_expand_array(JIJ=IIJB:IIJE)
282pdzf(iijb:iije,ika) = pa(iijb:iije,ika+ikl) - pa(iijb:iije,ika)
283pdzf(iijb:iije,iku) = 0.
284!$mnh_end_expand_array(JIJ=IIJB:IIJE)
285!
286!-------------------------------------------------------------------------------
287!
288END SUBROUTINE dzf_mf
289! ###############################
290 SUBROUTINE dzm_mf(D, PA, PDZM)
291! ###############################
292!
293!!**** *DZM* - SHUMAN_MF operator : finite difference operator in z direction
294!! for a variable at a mass localization
295!!
296!! PURPOSE
297!! -------
298! The purpose of this function is to compute a finite difference
299! along the z direction (K index) for a field PA localized at a mass
300! point. The result is localized at a z-flux point (w point).
301!
302!!** METHOD
303!! ------
304!! The result PDZM(:,j,:) is defined by (PA(:,:,k)-PA(:,:,k-1))
305!! At k=1, PDZM(:,:,k) is defined by 0.
306!!
307!!
308!! EXTERNAL
309!! --------
310!! NONE
311!!
312!! IMPLICIT ARGUMENTS
313!! ------------------
314!! NONE
315!!
316!! REFERENCE
317!! ---------
318!! Book2 of documentation of Meso-NH (SHUMAN_MF operators)
319!! Technical specifications Report of The Meso-NH (chapters 3)
320!!
321!!
322!! AUTHOR
323!! ------
324!! V. Ducrocq * Meteo France *
325!!
326!! MODIFICATIONS
327!! -------------
328!! Original 05/07/94
329!! optimisation 20/08/00 J. Escobar
330!! S. Riette, Jan 2012: Simplification and suppression of array overflow
331!-------------------------------------------------------------------------------
332!
333!* 0. DECLARATIONS
334! ------------
335!
336USE modd_dimphyex, ONLY: dimphyex_t
337IMPLICIT NONE
338!
339!* 0.1 Declarations of argument and result
340! ------------------------------------
341!
342TYPE(dimphyex_t), INTENT(IN) :: D
343REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PA ! variable at mass localization
344REAL, DIMENSION(D%NIJT,D%NKT), INTENT(OUT) :: PDZM ! result at flux
345 ! side
346!
347!* 0.2 Declarations of local variables
348! -------------------------------
349!
350INTEGER :: JK, JIJ
351INTEGER :: IIJB,IIJE ! physical horizontal domain indices
352INTEGER :: IKA,IKU,IKT,IKL
353!
354!-------------------------------------------------------------------------------
355!
356iije=d%NIJE
357iijb=d%NIJB
358ika=d%NKA
359iku=d%NKU
360ikt=d%NKT
361ikl=d%NKL
362!
363!* 1. DEFINITION OF DZM
364! ------------------
365!
366DO jk=2,ikt-1
367 !$mnh_expand_array(JIJ=IIJB:IIJE)
368 pdzm(iijb:iije,jk) = pa(iijb:iije,jk) - pa(iijb:iije,jk-ikl)
369 !$mnh_end_expand_array(JIJ=IIJB:IIJE)
370END DO
371!$mnh_expand_array(JIJ=IIJB:IIJE)
372pdzm(iijb:iije,ika) = 0.
373pdzm(iijb:iije,iku) = pa(iijb:iije,iku) - pa(iijb:iije,iku-ikl)
374!$mnh_end_expand_array(JIJ=IIJB:IIJE)
375!
376!-------------------------------------------------------------------------------
377!
378END SUBROUTINE dzm_mf
379
380! ###############################
381 SUBROUTINE gz_m_w_mf(D, PY, PDZZ, PGZ_M_W)
382! ###############################
383!
384!!**** *GZ_M_W * - Compute the gradient along z direction for a
385!! variable localized at a mass point
386!!
387!! PURPOSE
388!! -------
389!
390!!** METHOD
391!! ------
392! dzm(PY)
393! PGZ_M_W = -------
394! d*zz
395!!
396!!
397!! EXTERNAL
398!! --------
399!! NONE
400!!
401!! IMPLICIT ARGUMENTS
402!! ------------------
403!! NONE
404!!
405!! REFERENCE
406!! ---------
407!!
408!!
409!! AUTHOR
410!! ------
411!! S.Riette moving of code previously in compute_mf_cloud code
412!!
413!! MODIFICATIONS
414!! -------------
415!! Original 25 Aug 2011
416!! S. Riette, Jan 2012: Simplification and suppression of array overflow
417!!
418!-------------------------------------------------------------------------------
419!
420!* 0. DECLARATIONS
421! ------------
422!
423!!
424!
425!-------------------------------------------------------------------------------
426!
427USE modd_dimphyex, ONLY: dimphyex_t
428IMPLICIT NONE
429!
430!* 0.1 Declarations of argument and result
431! ------------------------------------
432!
433TYPE(dimphyex_t), INTENT(IN) :: D
434REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PDZZ ! Metric coefficient d*zz
435REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PY ! variable at mass localization
436REAL, DIMENSION(D%NIJT,D%NKT), INTENT(OUT) :: PGZ_M_W ! result at flux side
437!
438!* 0.2 Declarations of local variables
439! -------------------------------
440!
441INTEGER JK, JIJ
442INTEGER :: IIJB,IIJE ! physical horizontal domain indices
443INTEGER :: IKA,IKU,IKT,IKL
444!-------------------------------------------------------------------------------
445!
446iije=d%NIJE
447iijb=d%NIJB
448ika=d%NKA
449iku=d%NKU
450ikt=d%NKT
451ikl=d%NKL
452!
453!* 1. COMPUTE THE GRADIENT ALONG Z
454! -----------------------------
455!
456DO jk=2,ikt-1
457 !$mnh_expand_array(JIJ=IIJB:IIJE)
458 pgz_m_w(iijb:iije,jk) = (py(iijb:iije,jk) - py(iijb:iije,jk-ikl)) / pdzz(iijb:iije,jk)
459 !$mnh_end_expand_array(JIJ=IIJB:IIJE)
460END DO
461!$mnh_expand_array(JIJ=IIJB:IIJE)
462pgz_m_w(iijb:iije,ika) = 0.
463pgz_m_w(iijb:iije,iku) = (py(iijb:iije,iku) - py(iijb:iije,iku-ikl)) / pdzz(iijb:iije,iku)
464!$mnh_end_expand_array(JIJ=IIJB:IIJE)
465!
466!-------------------------------------------------------------------------------
467!
468END SUBROUTINE gz_m_w_mf
469
470END MODULE mode_shuman_mf
subroutine mzf_mf(d, pa, pmzf)
subroutine dzm_mf(d, pa, pdzm)
subroutine mzm_mf(d, pa, pmzm)
subroutine dzf_mf(d, pa, pdzf)
subroutine gz_m_w_mf(d, py, pdzz, pgz_m_w)