source: trunk/LMDZ.MARS/libf/phymars/updaterad.F90 @ 1307

Last change on this file since 1307 was 1307, checked in by tnavarro, 10 years ago

Changed two microphysics thresholds for timesteps used in Mesoscale and LES

File size: 7.5 KB
Line 
1module updaterad
2
3
4
5! This module intents to group together all ice and dust radius computations done in the GCM,
6! so that it stays coherent through the code and make (numerous) radius bugs easier to debug.
7! All different thresholds values are defined below.
8
9! Radius computation do not always occur on the whole grid (cf. improvedcloud).
10! So, subroutines are designed for scalar values instead of tables
11
12
13! T. Navarro, June 2012
14
15
16
17! For instance, if R^3 is lower than r3icemin, then R is set to ricemin.
18! So, ricemin should be the cubic root of r3icemin, but not necessarily ...
19
20real, parameter :: r3icemin = 1.e-30   ! ie ricemin  = 0.0001 microns
21real, parameter :: ricemin  = 1.e-10
22
23real, parameter :: r3icemax = 125.e-12 ! ie ricemax  = 500 microns
24real, parameter :: ricemax  = 500.e-6
25
26
27real, parameter :: nccn_threshold  =  1.
28real, parameter :: qccn_threshold  =  1.e-20
29
30real, parameter :: r3ccnmin = 1.e-21    ! ie rccnmin = 0.1 microns
31real, parameter :: rccnmin  = 0.1e-6
32
33real, parameter :: r3ccnmax = 125.e-12  ! ie rccnmax  = 500 microns
34real, parameter :: rccnmax  = 500.e-6 
35
36
37
38real, parameter :: ndust_threshold  = 1.
39real, parameter :: qdust_threshold  = 1.e-20
40
41real, parameter :: r3dustmin = 1.e-24  ! ie rdustmin = 0.1 microns
42real, parameter :: rdustmin  = 0.01e-6
43
44real, parameter :: r3dustmax = 125.e-12 ! ie rdustmax  = 500 microns
45real, parameter :: rdustmax  = 500.e-6 
46
47
48real, parameter :: rdust0 = 0.8e-6
49
50
51     
52
53contains
54
55
56!============================================================================
57!============================================================================
58!============================================================================
59! Update ice radius if microphys == true
60subroutine updaterice_micro(qice,qccn,nccn,coeff,rice,rhocloud)
61use tracer_mod, only: rho_dust, rho_ice
62USE comcstfi_h
63implicit none
64
65real, intent(in)  :: qice,qccn,nccn
66real, intent(in)  :: coeff         ! this coeff is tauscaling if microphy = T (possibly ccn_factor^-1 otherwise)
67real, intent(out) :: rice,rhocloud ! rhocloud is needed for sedimentation and is also a good diagnostic variable
68real nccn_true,qccn_true ! radius of the ice crystal core to the power of 3
69
70   
71nccn_true = max(nccn * coeff, 1.e-30)
72qccn_true = max(qccn * coeff, 1.e-30)
73
74
75!! Nota: It is very dangerous to apply a threshold on qccn or nccn to force rice to be ricemin.
76!! Indeed, one can obtain ricemin for small but non negligible qice values, and therefore hugely opaque clouds.
77 
78
79rhocloud = (qice*rho_ice + qccn_true*rho_dust) / (qice + qccn_true)
80rhocloud = min(max(rhocloud,rho_ice),rho_dust)
81
82rice = (qice + qccn_true) * 0.75 / pi / rhocloud / nccn_true
83 
84if (rice .le. r3icemin) then
85  rice = ricemin
86else if (rice .ge. r3icemax) then
87  rice = ricemax
88else
89  rice = rice**(1./3.) ! here rice is always positive
90endif
91
92
93end subroutine updaterice_micro
94!============================================================================
95!============================================================================
96!============================================================================
97
98
99
100
101
102!============================================================================
103!============================================================================
104!============================================================================
105! Update ice radius from a typical profile if microphys == false
106subroutine updaterice_typ(qice,tau,pzlay,rice)
107use tracer_mod, only: rho_ice
108USE comcstfi_h
109implicit none
110
111real, intent(in)  :: qice
112real, intent(in)  :: tau   ! tau for dust
113real, intent(in)  :: pzlay ! altitude at the middle of the layers
114real, intent(out) :: rice
115real rccn,nccn ! radius  and number of ice crystals
116
117!   Typical CCN profile following Montmessin et al. 2004
118!   (N0=2e6 m-3 has been converted into N0=1.3e8 kg-1, otherwise the equation for rice is not homogeneous...)
119     nccn  = 1.3e+8*max(tau,0.001)/0.1*exp(-pzlay/10000.)
120!   The previously used profile was not correct:
121!   Nccn=( epaisseur/masse ) * 2.e+6/0.1*max(tau,0.001)*exp(-pzlay/10000.)
122     
123if (nccn .le. 1) then
124
125  rice = ricemin
126
127else
128
129! Typical dust radius profile:
130  rccn = max(rdust0*exp(-pzlay/18000.),1.e-9)
131  rice  = qice * 0.75 / pi / rho_ice / nccn + rccn*rccn*rccn
132       
133  if (rice .le. r3icemin) then
134    rice = ricemin
135  else if (rice .ge. r3icemax) then
136    rice = ricemax
137  else
138    rice = rice**(1./3.) ! here rice is always positive
139  endif
140
141endif
142 
143end subroutine updaterice_typ
144!============================================================================
145!============================================================================
146!============================================================================
147
148
149
150
151
152
153!============================================================================
154!============================================================================
155!============================================================================
156! This subroutine computes the geometric mean radius(or number median radius)
157! For a lognormal distribution :
158! geometric mean radius = mass mean radius x exp(-1.5 sigma0^2)
159! To be used with doubleq == true. otherwise, rdust is constant !!!
160subroutine updaterdust(qdust,ndust,rdust,tauscaling)
161use tracer_mod, only: r3n_q
162USE comcstfi_h
163implicit none
164
165real, intent(in) :: qdust,ndust ! needed if doubleq
166real, intent(in), optional :: tauscaling ! useful for realistic thresholds
167real, intent(out) :: rdust
168real coeff
169
170if (present(tauscaling)) then
171  coeff = tauscaling ! thresholds on realistic values
172else
173  coeff = 1. ! thresholds on virtual values
174endif
175
176if ((ndust .le. ndust_threshold/coeff) .or. (qdust .le. qdust_threshold/coeff)) then
177
178   rdust = rdustmin
179
180else
181
182   rdust  = r3n_q * qdust / ndust
183
184   if (rdust .le. r3dustmin) then
185       rdust = rdustmin
186   else if (rdust .ge. r3dustmax) then
187       rdust = rdustmax
188   else
189      rdust = rdust**(1./3.)
190   endif
191
192endif
193     
194
195end subroutine updaterdust
196!============================================================================
197!============================================================================
198!============================================================================
199
200
201
202
203
204
205!============================================================================
206!============================================================================
207!============================================================================
208! This subroutine computes the mass mean radius,
209! used for heterogenous nucleation on CCNs in microphysics.
210! For a lognormal distribution :
211! geometric mean radius = mass mean radius x exp(-1.5 sigma0^2)
212subroutine updaterccn(qccn,nccn,rccn,tauscaling)
213use tracer_mod, only: rho_dust
214USE comcstfi_h
215implicit none
216
217real, intent(in) :: qccn,nccn ! needed if doubleq
218real, intent(in), optional :: tauscaling ! useful for realistic thresholds
219
220real, intent(out) :: rccn
221
222real coeff
223
224
225if (present(tauscaling)) then
226  coeff = tauscaling ! threshold on realistic values
227else
228  coeff = 1. ! threshold on virtual values
229endif
230
231if ((nccn .le. nccn_threshold/coeff) .or. (qccn .le. qccn_threshold/coeff)) then
232
233   rccn = rccnmin
234
235else
236
237   rccn  =  qccn * 0.75 / pi / rho_dust / nccn
238
239   if (rccn .le. r3ccnmin) then
240       rccn = rccnmin
241   else if (rccn .ge. r3ccnmax) then
242       rccn = rccnmax
243   else
244       rccn = rccn**(1./3.)
245   endif
246
247endif
248     
249end subroutine updaterccn
250!============================================================================
251!============================================================================
252!============================================================================
253
254
255
256end module updaterad
257
Note: See TracBrowser for help on using the repository browser.