PHYEX 0.9.5
PHYsique EXternalisée
Loading...
Searching...
No Matches
modd_param_mfshalln.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!-----------------------------------------------------------------
6!-----------------------------------------------------------------
7! #############################
9
10!$ACDC methods
11
12! #############################
13!> @file
14!! *MODD_PARAM_MFSHALL_n* - Declaration of Mass flux scheme free parameters
15!!
16!! PURPOSE
17!! -------
18!! The purpose of this declarative module is to declare the
19!! variables that may be set by namelist for the mass flux scheme
20!!
21!! IMPLICIT ARGUMENTS
22!! ------------------
23!! None
24!!
25!! REFERENCE
26!! ---------
27!!
28!!
29!! AUTHOR
30!! ------
31!! S. Malardel, J. Pergaud (Meteo France)
32!!
33!! MODIFICATIONS
34!! -------------
35!! Original 01/02/07
36!! 10/16 R.Honnert Update with AROME
37!! 01/2019 R.Honnert add parameters for the reduction of mass-flux surface closure with resolution
38!! Jan 2025 A. Marcel: Wet mixing according to Lapp and Randall 2001
39!! Jan 2025 A. Marcel: TKE mixing
40!! A. Marcel Jan 2025: bi-Gaussian PDF and associated subgrid precipitation
41!! S. Riette Jan 2025: LPZ_EXP_LOG switch
42!! A. Marcel Jan 2025: KIC computed following Rooy and Siebesma (2008)
43!! A. Marcel Jan 2025: minimum dry detrainment computed with LUP in updraft
44!! A. Marcel Jan 2025: w_up equation update (XBRIO and XAADVEC)
45!! A. Marcel Jan 2025: relaxation of the small fraction assumption
46!-------------------------------------------------------------------------------
47!
48!* 0. DECLARATIONS
49! ------------
50!
52IMPLICIT NONE
53
55
56REAL :: ximpl_mf !< degre of implicitness
57
58CHARACTER (LEN=4) :: cmf_updraft !< Type of Mass Flux Scheme
59 !! 'NONE' if no parameterization
60CHARACTER (LEN=4) :: cmf_cloud !< Type of cloud scheme associated
61CHARACTER (LEN=4) :: cwet_mixing !< Type of env mixing for buoyancy sorting scheme
62 !! PKFB for the original Pergaud code, LR01 for Lappen and Randall 2001
63CHARACTER (LEN=4) :: ckic_compute !< Method to compute KIC: KFB (PMMC09 original method, like in KFB)
64 !! RS08 (to use the Rooy and Siebesma (2008) formulation)
65CHARACTER (LEN=4) :: cdetr_dry_lup!< 'SURF' to use LUP at surface (PMMC09), UPDR to compute LUP in updraft
66
67LOGICAL :: lmixuv !< True if mixing of momentum
68LOGICAL :: lmixtke !< True if mixing of TKE
69LOGICAL :: lmf_flx !< logical switch for the storage of the mass flux fluxes
70REAL :: xalp_pert !< coefficient for the perturbation of
71 !! theta_l and r_t at the first level of the updraft
72REAL :: xabuo !< coefficient of the buoyancy term in the w_up equation
73REAL :: xbentr !< coefficient of the entrainment term in the w_up equation
74REAL :: xbdetr !< coefficient of the detrainment term in the w_up equation
75REAL :: xcmf !< coefficient for the mass flux at the first level of the updraft (closure)
76REAL :: xentr_mf !< entrainment constant (m/Pa) = 0.2 (m)
77REAL :: xcrad_mf !< cloud radius in cloudy part
78REAL :: xentr_dry !< coefficient for entrainment in dry part
79REAL :: xdetr_dry !< coefficient for detrainment in dry part
80REAL :: xdetr_lup !< coefficient for detrainment in dry part
81REAL :: xkcf_mf !< coefficient for cloud fraction
82REAL :: xkrc_mf !< coefficient for convective rc
83REAL :: xtausigmf
84REAL :: xpres_uv !< coefficient for pressure term in wind mixing
85REAL :: xalpha_mf !< coefficient for cloudy fraction
86REAL :: xsigma_mf !< coefficient for updraft sigma computation in the bigaussian scheme
87REAL :: xsigma_env !< coefficient for the environment sigma contribution in the bigaussian scheme
88REAL :: xfrac_up_max!< maximum Updraft fraction
89!
90REAL :: xa1 !< Parameter for Rio et al (2010) formulation for entrainment and detrainment (RHCJ10)
91REAL :: xb !!
92REAL :: xc !!
93REAL :: xbeta1 !!
94!
95REAL :: xr !< Parameter for closure assumption of Hourdin et al (2002): aspect ratio of updraft
96!
97LOGICAL :: lgz !< Grey Zone Surface Closure
98REAL :: xgz !< Tuning of the surface initialisation for Grey Zone
99!
100LOGICAL :: lthetas_mf !< .TRUE. to use ThetaS1 instead of ThetaL
101REAL :: xlambda_mf !< Thermodynamic parameter: Lambda to compute ThetaS1 from ThetaL
102LOGICAL :: lverlimup !< .TRUE. to use correction on vertical limitation of updraft (issue #38 PHYEX)
103LOGICAL :: lpz_exp_log !< .TRUE. to exp/log during dP/dZ conversion
104REAL :: xbrio !< coefficient to slow down wup equa like Rio 2010
105REAL :: xaadvec !< coeff for advective pressure perturbation like Jia he 2022
106LOGICAL :: lrelax_alpha_mf !< .TRUE. to relax the small fraction assumption
107
108END TYPE param_mfshall_t
109
110TYPE(param_mfshall_t), DIMENSION(JPMODELMAX), TARGET, SAVE :: param_mfshall_model
111TYPE(param_mfshall_t), POINTER, SAVE :: param_mfshalln => null()
112
113REAL , POINTER :: ximpl_mf=>null()
114CHARACTER (LEN=4), POINTER :: cmf_updraft=>null()
115CHARACTER (LEN=4), POINTER :: cmf_cloud=>null()
116CHARACTER (LEN=4), POINTER :: cwet_mixing=>null()
117CHARACTER (LEN=4), POINTER :: ckic_compute=>null()
118CHARACTER (LEN=4), POINTER :: cdetr_dry_lup=>null()
119LOGICAL , POINTER :: lmixuv=>null()
120LOGICAL , POINTER :: lmixtke=>null()
121LOGICAL , POINTER :: lmf_flx=>null()
122!
123REAL, POINTER :: xalp_pert=>null()
124REAL, POINTER :: xabuo=>null()
125REAL, POINTER :: xbentr=>null()
126REAL, POINTER :: xbdetr=>null()
127REAL, POINTER :: xcmf=>null()
128REAL, POINTER :: xentr_mf=>null()
129REAL, POINTER :: xcrad_mf=>null()
130REAL, POINTER :: xentr_dry=>null()
131REAL, POINTER :: xdetr_dry=>null()
132REAL, POINTER :: xdetr_lup=>null()
133REAL, POINTER :: xkcf_mf=>null()
134REAL, POINTER :: xkrc_mf=>null()
135REAL, POINTER :: xtausigmf=>null()
136REAL, POINTER :: xpres_uv=>null()
137REAL, POINTER :: xalpha_mf=>null()
138REAL, POINTER :: xsigma_mf=>null()
139REAL, POINTER :: xsigma_env=>null()
140REAL, POINTER :: xfrac_up_max=>null()
141REAL, POINTER :: xa1=>null()
142REAL, POINTER :: xb=>null()
143REAL, POINTER :: xc=>null()
144REAL, POINTER :: xbeta1=>null()
145REAL, POINTER :: xr=>null()
146LOGICAL, POINTER :: lthetas_mf=>null()
147REAL, POINTER :: xlambda_mf=>null()
148LOGICAL, POINTER :: lgz=>null()
149REAL, POINTER :: xgz=>null()
150LOGICAL, POINTER :: lverlimup=>null()
151LOGICAL, POINTER :: lpz_exp_log=>null()
152REAL, POINTER :: xbrio=>null()
153REAL, POINTER :: xaadvec=>null()
154LOGICAL, POINTER :: lrelax_alpha_mf=>null()
155!
156NAMELIST/nam_param_mfshalln/ximpl_mf,cmf_updraft,cmf_cloud,cwet_mixing,lmixuv,lmixtke,lmf_flx,&
163!
164!-------------------------------------------------------------------------------
165!
166CONTAINS
167
168SUBROUTINE param_mfshall_goto_model(KFROM, KTO)
169!! This subroutine associate all the pointers to the right component of
170!! the right strucuture. A value can be accessed through the structure PARAM_MFSHALLN
171!! or through the strucuture PARAM_MFSHALL_MODEL(KTO) or directly through these pointers.
172INTEGER, INTENT(IN) :: KFROM, KTO
173!
174IF(.NOT. ASSOCIATED(param_mfshalln, param_mfshall_model(kto))) THEN
175!
177!
178! Save current state for allocated arrays
179!
180! Current model is set to model KTO
181ximpl_mf=>param_mfshall_model(kto)%XIMPL_MF
182cmf_updraft=>param_mfshall_model(kto)%CMF_UPDRAFT
183cmf_cloud=>param_mfshall_model(kto)%CMF_CLOUD
184cwet_mixing=>param_mfshall_model(kto)%CWET_MIXING
185ckic_compute=>param_mfshall_model(kto)%CKIC_COMPUTE
186cdetr_dry_lup=>param_mfshall_model(kto)%CDETR_DRY_LUP
187lmixuv=>param_mfshall_model(kto)%LMIXUV
188lmixtke=>param_mfshall_model(kto)%LMIXTKE
189lmf_flx=>param_mfshall_model(kto)%LMF_FLX
190!
191xalp_pert=>param_mfshall_model(kto)%XALP_PERT
192xabuo=>param_mfshall_model(kto)%XABUO
193xbentr=>param_mfshall_model(kto)%XBENTR
194xbdetr=>param_mfshall_model(kto)%XBDETR
195xcmf=>param_mfshall_model(kto)%XCMF
196xentr_mf=>param_mfshall_model(kto)%XENTR_MF
197xcrad_mf=>param_mfshall_model(kto)%XCRAD_MF
198xentr_dry=>param_mfshall_model(kto)%XENTR_DRY
199xdetr_dry=>param_mfshall_model(kto)%XDETR_DRY
200xdetr_lup=>param_mfshall_model(kto)%XDETR_LUP
201xkcf_mf=>param_mfshall_model(kto)%XKCF_MF
202xkrc_mf=>param_mfshall_model(kto)%XKRC_MF
203xtausigmf=>param_mfshall_model(kto)%XTAUSIGMF
204xpres_uv=>param_mfshall_model(kto)%XPRES_UV
205xalpha_mf=>param_mfshall_model(kto)%XALPHA_MF
206xsigma_mf=>param_mfshall_model(kto)%XSIGMA_MF
207xsigma_env=>param_mfshall_model(kto)%XSIGMA_ENV
208xfrac_up_max=>param_mfshall_model(kto)%XFRAC_UP_MAX
209xa1=>param_mfshall_model(kto)%XA1
210xb=>param_mfshall_model(kto)%XB
211xc=>param_mfshall_model(kto)%XC
212xbeta1=>param_mfshall_model(kto)%XBETA1
213xr=>param_mfshall_model(kto)%XR
214lthetas_mf=>param_mfshall_model(kto)%LTHETAS_MF
215xlambda_mf=>param_mfshall_model(kto)%XLAMBDA_MF
216lgz=>param_mfshall_model(kto)%LGZ
217xgz=>param_mfshall_model(kto)%XGZ
218lverlimup=>param_mfshall_model(kto)%LVERLIMUP
219lpz_exp_log=>param_mfshall_model(kto)%LPZ_EXP_LOG
220xbrio=>param_mfshall_model(kto)%XBRIO
221xaadvec=>param_mfshall_model(kto)%XAADVEC
222lrelax_alpha_mf=>param_mfshall_model(kto)%LRELAX_ALPHA_MF
223!
224ENDIF
225!
226END SUBROUTINE param_mfshall_goto_model
227
228SUBROUTINE param_mfshalln_init(HPROGRAM, TFILENAM, LDNEEDNAM, KLUOUT, &
229 &LDDEFAULTVAL, LDREADNAM, LDCHECK, KPRINT)
230!!*** *PARAM_MFSHALLN* - Code needed to initialize the MODD_PARAM_MFSHALL_n module
231!!
232!!* PURPOSE
233!! -------
234!! Sets the default values, reads the namelist, performs the checks and prints
235!!
236!!* METHOD
237!! ------
238!! 0. Declarations
239!! 1. Declaration of arguments
240!! 2. Declaration of local variables
241!! 1. Default values
242!! 2. Namelist
243!! 3. Checks
244!! 4. Prints
245!!
246!! AUTHOR
247!! ------
248!! S. Riette
249!!
250!! MODIFICATIONS
251!! -------------
252!! Original Feb 2023
253!-------------------------------------------------------------------------------
254!
255!* 0. DECLARATIONS
256! ---------------
257!
261USE mode_msg, ONLY: print_msg
262!
263IMPLICIT NONE
264!
265!* 0.1. Declaration of arguments
266! ------------------------
267!
268CHARACTER(LEN=6), INTENT(IN) :: HPROGRAM !< Name of the calling program
269TYPE(tfiledata), INTENT(IN) :: TFILENAM !< Namelist file
270LOGICAL, INTENT(IN) :: LDNEEDNAM !< True to abort if namelist is absent
271INTEGER, INTENT(IN) :: KLUOUT !< Logical unit for outputs
272LOGICAL, OPTIONAL, INTENT(IN) :: LDDEFAULTVAL !< Must we initialize variables with default values (defaults to .TRUE.)
273LOGICAL, OPTIONAL, INTENT(IN) :: LDREADNAM !< Must we read the namelist (defaults to .TRUE.)
274LOGICAL, OPTIONAL, INTENT(IN) :: LDCHECK !< Must we perform some checks on values (defaults to .TRUE.)
275INTEGER, OPTIONAL, INTENT(IN) :: KPRINT !< Print level (defaults to 0): 0 for no print, 1 to safely print namelist,
276 !! 2 to print informative messages
277!
278!* 0.2 Declaration of local variables
279! ------------------------------
280!
281LOGICAL :: LLDEFAULTVAL, LLREADNAM, LLCHECK, LLFOUND
282INTEGER :: IPRINT
283
284lldefaultval=.true.
285llreadnam=.true.
286llcheck=.true.
287iprint=0
288IF(PRESENT(lddefaultval)) lldefaultval=lddefaultval
289IF(PRESENT(ldreadnam )) llreadnam =ldreadnam
290IF(PRESENT(ldcheck )) llcheck =ldcheck
291IF(PRESENT(kprint )) iprint =kprint
292!
293!* 1. DEFAULT VALUES
294! -----------------
295!
296IF(lldefaultval) THEN
297 !NOTES ON GENERAL DEFAULTS AND MODEL-SPECIFIC DEFAULTS :
298 !- General default values *MUST* remain unchanged.
299 !- To change the default value for a given application,
300 ! an "IF(HPROGRAM=='...')" condition must be used.
301
302 ximpl_mf=1.
303 cmf_updraft='EDKF'
304 cmf_cloud='DIRE'
305 cwet_mixing='PKFB'
306 ckic_compute='KFB'
307 cdetr_dry_lup='SURF'
308 lmixuv=.true.
309 lmixtke=.false.
310 lmf_flx=.false.
311 xalp_pert=0.3
312 xabuo=1.
313 xbentr=1.
314 xbdetr=0.
315 xcmf=0.065
316 xentr_mf=0.035
317 xcrad_mf=50.
318 xentr_dry=0.55
319 xdetr_dry=10.
320 xdetr_lup=1.
321 xkcf_mf=2.75
322 xkrc_mf=1.
323 xtausigmf=600.
324 xpres_uv=0.5
325 xalpha_mf=2.
326 xsigma_mf=20.
327 xsigma_env=0.
328 xfrac_up_max=0.33
329 xa1=2./3.
330 xb=0.002
331 xc=0.012
332 xbeta1=0.9
333 xr=2.
334 lthetas_mf=.false.
335 xlambda_mf=0.
336 lgz=.false.
337 xgz=1.83 ! between 1.83 and 1.33
338 lverlimup=.false.
339 lpz_exp_log=.false.
340 xbrio=0.
341 xaadvec=0.
342 lrelax_alpha_mf=.false.
343 IF(hprogram=='MESONH') lverlimup=.true.
344ENDIF
345!
346!* 2. NAMELIST
347! -----------
348!
349IF(llreadnam) THEN
350 CALL posnam_phy(tfilenam, 'NAM_PARAM_MFSHALLN', ldneednam, llfound)
351 IF(llfound) READ(unit=tfilenam%NLU, nml=nam_param_mfshalln)
352ENDIF
353!
354!* 3. CHECKS
355! ---------
356!
357IF(llcheck) THEN
358 CALL check_nam_val_char(kluout, 'CMF_CLOUD', cmf_cloud, 'NONE', 'STAT', 'DIRE', 'BIGA')
359 CALL check_nam_val_char(kluout, 'CWET_MIXING', cwet_mixing, 'PKFB', 'LR01')
360 CALL check_nam_val_char(kluout, 'CKIC_COMPUTE', ckic_compute, 'KFB', 'RS08')
361 CALL check_nam_val_char(kluout, 'CDETR_DRY_LUP', cdetr_dry_lup, 'SURF', 'UPDR')
362 IF(hprogram=='AROME') THEN
363 CALL check_nam_val_char(kluout, 'CMF_UPDRAFT', cmf_updraft, 'NONE', 'EDKF', 'RHCJ', 'RAHA', 'DUAL')
364 ELSE
365 CALL check_nam_val_char(kluout, 'CMF_UPDRAFT', cmf_updraft, 'NONE', 'EDKF', 'RHCJ', 'RAHA')
366 ENDIF
367 !
368 IF(lmixtke .AND. cmf_updraft == 'DUAL')THEN
369 CALL print_msg(nverb_fatal, 'GEN', 'PARAM_MFSHALLN_INIT', &
370 &"LMIXTKE not implemented when CMF_UPDRAFT is 'DUAL'")
371 ENDIF
372ENDIF
373!
374!* 3. PRINTS
375! ---------
376!
377IF(iprint>=1) THEN
378 WRITE(unit=kluout,nml=nam_param_mfshalln)
379ENDIF
380!
381END SUBROUTINE param_mfshalln_init
382!
383END MODULE modd_param_mfshall_n
integer, parameter nverb_fatal
Definition modd_io.F90:6
character(len=4), pointer cwet_mixing
subroutine param_mfshalln_init(hprogram, tfilenam, ldneednam, kluout, lddefaultval, ldreadnam, ldcheck, kprint)
character(len=4), pointer cmf_cloud
type(param_mfshall_t), pointer, save param_mfshalln
character(len=4), pointer cdetr_dry_lup
type(param_mfshall_t), dimension(jpmodelmax), target, save param_mfshall_model
character(len=4), pointer ckic_compute
subroutine param_mfshall_goto_model(kfrom, kto)
character(len=4), pointer cmf_updraft
logical, pointer lrelax_alpha_mf
integer, parameter jpmodelmax
subroutine check_nam_val_char(kluout, hname, hvar, hvalue1, hvalue2, hvalue3, hvalue4, hvalue5, hvalue6, hvalue7, hvalue8, hvalue9, hvalue10, hvalue11, hvalue12)
subroutine, public posnam_phy(tfilenam, cdnaml, ldneednam, ldfound)