PHYEX 0.9.5
PHYsique EXternalisée
Loading...
Searching...
No Matches
modd_nebn.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! ######spl
6 MODULE modd_neb_n
7
8!$ACDC methods
9
10! #############################
11!> @file
12!!**** *MODD_NEB_n* - Declaration of nebulosity constants
13!!
14!! PURPOSE
15!! -------
16!! The purpose of this declarative module is to declare some
17!! constants for nebulosity calculation
18!
19!!
20!! IMPLICIT ARGUMENTS
21!! ------------------
22!! None
23!!
24!! REFERENCE
25!! ---------
26!!
27!!
28!! AUTHOR
29!! ------
30!! S. Riette (Meteo France)
31!!
32!! MODIFICATIONS
33!! -------------
34!! Original 24 Aug 2011
35!-------------------------------------------------------------------------------
36!
37!* 0. DECLARATIONS
38! ------------
39!
41IMPLICIT NONE
42!
44 REAL :: xtminmix !< minimum temperature of mixed phase
45 REAL :: xtmaxmix !< maximum temperature of mixed phase
46 LOGICAL :: lhgt_qs !< Switch for height dependent VQSIGSAT
47 CHARACTER(LEN=1) :: cfrac_ice_adjust !< ice fraction for adjustments
48 CHARACTER(LEN=1) :: cfrac_ice_shallow_mf !< ice fraction for shallow_mf
49 REAL :: vsigqsat !< coeff applied to qsat variance contribution
50 CHARACTER(LEN=80) :: ccondens !< subrgrid condensation PDF
51 CHARACTER(LEN=4) :: clambda3 !< lambda3 choice for subgrid cloud scheme
52 LOGICAL :: lstatnw !< updated full statistical cloud scheme
53 LOGICAL :: ltauconv !< new convection time scale
54 LOGICAL :: lvarresdep !< extra variance term (VSIGQSAT) is made grid size dependent
55 LOGICAL :: lsigmas !< Switch for using Sigma_s from turbulence scheme
56 LOGICAL :: lsubg_cond !< Switch for subgrid condensation
57 LOGICAL :: lcondborn !< Switch to limit condensation
58END TYPE neb_t
59
60TYPE(neb_t), DIMENSION(JPMODELMAX), SAVE, TARGET :: neb_model
61TYPE(neb_t), POINTER, SAVE :: nebn => null()
62
63REAL, POINTER :: xtminmix=>null(), &
64 xtmaxmix=>null()
65LOGICAL, POINTER :: lhgt_qs=>null()
66CHARACTER(LEN=1), POINTER :: cfrac_ice_adjust => null()
67CHARACTER(LEN=1), POINTER :: cfrac_ice_shallow_mf => null()
68REAL, POINTER :: vsigqsat=>null()
69CHARACTER(LEN=80),POINTER :: ccondens=>null()
70CHARACTER(LEN=4),POINTER :: clambda3=>null()
71LOGICAL, POINTER :: lstatnw=>null()
72LOGICAL, POINTER :: ltauconv=>null()
73LOGICAL, POINTER :: lvarresdep=>null()
74LOGICAL, POINTER :: lsigmas=>null()
75LOGICAL, POINTER :: lsubg_cond=>null()
76LOGICAL, POINTER :: lcondborn=>null()
77!
80!
81!-------------------------------------------------------------------------------
82!
83CONTAINS
84SUBROUTINE neb_goto_model(KFROM, KTO)
85!! This subroutine associate all the pointers to the right component of
86!! the right strucuture. A value can be accessed through the structure NEBN
87!! or through the strucuture NEB_MODEL(KTO) or directly through these pointers.
88IMPLICIT NONE
89INTEGER, INTENT(IN) :: KFROM, KTO
90!
91IF(.NOT. ASSOCIATED(nebn, neb_model(kto))) THEN
92 !
93 nebn => neb_model(kto)
94 !
95 xtminmix => nebn%XTMINMIX
96 xtmaxmix => nebn%XTMAXMIX
97 lhgt_qs => nebn%LHGT_QS
98 cfrac_ice_adjust => nebn%CFRAC_ICE_ADJUST
99 cfrac_ice_shallow_mf => nebn%CFRAC_ICE_SHALLOW_MF
100 vsigqsat => nebn%VSIGQSAT
101 ccondens => nebn%CCONDENS
102 clambda3 => nebn%CLAMBDA3
103 lstatnw => nebn%LSTATNW
104 ltauconv => nebn%LTAUCONV
105 lvarresdep => nebn%LVARRESDEP
106 lsigmas => nebn%LSIGMAS
107 lsubg_cond => nebn%LSUBG_COND
108 lcondborn => nebn%LCONDBORN
109 !
110ENDIF
111END SUBROUTINE neb_goto_model
112!
113SUBROUTINE nebn_init(HPROGRAM, TFILENAM, LDNEEDNAM, KLUOUT, &
114 &LDDEFAULTVAL, LDREADNAM, LDCHECK, KPRINT)
115!!*** *NEBN_INIT* - Code needed to initialize the MODD_NEB_n module
116!!
117!!* PURPOSE
118!! -------
119!! Sets the default values, reads the namelist, performs the checks and prints
120!!
121!!* METHOD
122!! ------
123!! 0. Declarations
124!! 1. Declaration of arguments
125!! 2. Declaration of local variables
126!! 1. Default values
127!! 2. Namelist
128!! 3. Checks
129!! 4. Prints
130!!
131!! AUTHOR
132!! ------
133!! S. Riette
134!!
135!! MODIFICATIONS
136!! -------------
137!! Original Mar 2023
138!-------------------------------------------------------------------------------
139!
140!* 0. DECLARATIONS
141! ---------------
142!
145USE modd_io, ONLY: tfiledata
146!
147IMPLICIT NONE
148!
149!* 0.1. Declaration of arguments
150! ------------------------
151!
152CHARACTER(LEN=6), INTENT(IN) :: HPROGRAM !< Name of the calling program
153TYPE(tfiledata), INTENT(IN) :: TFILENAM !< Namelist file
154LOGICAL, INTENT(IN) :: LDNEEDNAM !< True to abort if namelist is absent
155INTEGER, INTENT(IN) :: KLUOUT !< Logical unit for outputs
156LOGICAL, OPTIONAL, INTENT(IN) :: LDDEFAULTVAL !< Must we initialize variables with default values (defaults to .TRUE.)
157LOGICAL, OPTIONAL, INTENT(IN) :: LDREADNAM !< Must we read the namelist (defaults to .TRUE.)
158LOGICAL, OPTIONAL, INTENT(IN) :: LDCHECK !< Must we perform some checks on values (defaults to .TRUE.)
159INTEGER, OPTIONAL, INTENT(IN) :: KPRINT !< Print level (defaults to 0): 0 for no print, 1 to safely print namelist,
160 !! 2 to print informative messages
161!
162!* 0.2 Declaration of local variables
163! ------------------------------
164!
165LOGICAL :: LLDEFAULTVAL, LLREADNAM, LLCHECK, LLFOUND
166INTEGER :: IPRINT
167
168lldefaultval=.true.
169llreadnam=.true.
170llcheck=.true.
171iprint=0
172IF(PRESENT(lddefaultval)) lldefaultval=lddefaultval
173IF(PRESENT(ldreadnam )) llreadnam =ldreadnam
174IF(PRESENT(ldcheck )) llcheck =ldcheck
175IF(PRESENT(kprint )) iprint =kprint
176!
177!* 1. DEFAULT VALUES
178! -----------------
179!
180IF(lldefaultval) THEN
181 !NOTES ON GENERAL DEFAULTS AND MODEL-SPECIFIC DEFAULTS :
182 !- General default values *MUST* remain unchanged.
183 !- To change the default value for a given application,
184 ! an "IF(HPROGRAM=='...')" condition must be used.
185
186 !Freezing between 0 and -20. Other possibilities are 0/-40 or -5/-25
187 xtmaxmix = 273.16
188 xtminmix = 253.16
189 lhgt_qs = .false.
192 vsigqsat = 0.02
193 ccondens='CB02'
194 clambda3='CB'
195 lsubg_cond=.false.
196 lcondborn=.false.
197 lsigmas =.true.
198 lstatnw=.false.
199 ltauconv=.false.
200 lvarresdep=.false.
201
202 IF(hprogram=='AROME') THEN
205 vsigqsat=0.
206 lsigmas=.false.
207 ELSEIF(hprogram=='MESONH') THEN
208 lsubg_cond=.true.
209 ELSEIF(hprogram=='LMDZ') THEN
210 lsubg_cond=.true.
211 ENDIF
212ENDIF
213!
214!* 2. NAMELIST
215! -----------
216!
217IF(llreadnam) THEN
218 CALL posnam_phy(tfilenam, 'NAM_NEBN', ldneednam, llfound)
219 IF(llfound) READ(unit=tfilenam%NLU, nml=nam_nebn)
220ENDIF
221!
222!* 3. CHECKS
223! ---------
224!
225IF(llcheck) THEN
226 CALL check_nam_val_char(kluout, 'CFRAC_ICE_ADJUST', cfrac_ice_adjust, 'T', 'O', 'N', 'S')
227 CALL check_nam_val_char(kluout, 'CFRAC_ICE_SHALLOW_MF', cfrac_ice_shallow_mf, 'T', 'O', 'N', 'S')
228 CALL check_nam_val_char(kluout, 'CCONDENS', ccondens, 'CB02', 'GAUS')
229 CALL check_nam_val_char(kluout, 'CLAMBDA3', clambda3, 'CB', 'NONE')
230ENDIF
231!
232!* 3. PRINTS
233! ---------
234!
235IF(iprint>=1) THEN
236 WRITE(unit=kluout,nml=nam_nebn)
237ENDIF
238!
239END SUBROUTINE nebn_init
240!
241END MODULE modd_neb_n
logical, pointer lsubg_cond
Definition modd_nebn.F90:75
logical, pointer lsigmas
Definition modd_nebn.F90:74
subroutine neb_goto_model(kfrom, kto)
Definition modd_nebn.F90:85
logical, pointer lvarresdep
Definition modd_nebn.F90:73
character(len=4), pointer clambda3
Definition modd_nebn.F90:70
character(len=1), pointer cfrac_ice_shallow_mf
Definition modd_nebn.F90:67
logical, pointer ltauconv
Definition modd_nebn.F90:72
real, pointer xtminmix
Definition modd_nebn.F90:63
real, pointer vsigqsat
Definition modd_nebn.F90:68
character(len=80), pointer ccondens
Definition modd_nebn.F90:69
logical, pointer lcondborn
Definition modd_nebn.F90:76
logical, pointer lhgt_qs
Definition modd_nebn.F90:65
type(neb_t), dimension(jpmodelmax), target, save neb_model
Definition modd_nebn.F90:60
subroutine nebn_init(hprogram, tfilenam, ldneednam, kluout, lddefaultval, ldreadnam, ldcheck, kprint)
real, pointer xtmaxmix
Definition modd_nebn.F90:63
character(len=1), pointer cfrac_ice_adjust
Definition modd_nebn.F90:66
type(neb_t), pointer, save nebn
Definition modd_nebn.F90:61
logical, pointer lstatnw
Definition modd_nebn.F90:71
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)