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

Last change on this file since 3948 was 3913, checked in by jbclement, 2 months ago

Mars PCM:
Partial reversion of r3847: removal of the incompatibility test requires 'microphys'?. Therefore, in "updatereffrad_mod.F", without microphysics, we use a typical value for 'tau' (0.2) to assess the number of cloud condensation nuclei in the same way than done before r744. Comments and unused variables are cleaned.
JBC

File size: 10.9 KB
Line 
1                module 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! T. Navarro, June 2012
13! CO2 clouds added 09/16 by J. Audouard
14
15! For instance, if R^3 is lower than r3icemin, then R is set to ricemin.
16! So, ricemin should be the cubic root of r3icemin, but not necessarily ...
17
18real, parameter :: r3icemin = 1.e-30   ! ie ricemin  = 0.0001 microns
19real, parameter :: ricemin  = 1.e-10
20real, parameter :: r3icemax = 125.e-12 ! ie ricemax  = 500 microns
21real, parameter :: ricemax  = 500.e-6
22
23double precision, parameter :: r3iceco2min = 1.e-30
24double precision, parameter :: riceco2min  = 1.e-10
25double precision, parameter :: r3iceco2max = 125.e-12
26double precision, parameter :: riceco2max  = 500.e-6
27
28real, parameter :: qice_threshold  = 1.e-15 ! 1.e-10
29real, parameter :: qice_co2_threshold  = 1.e-30 ! 1.e-10
30
31real, parameter :: nccn_threshold  =  1.
32real, parameter :: qccn_threshold  =  1.e-20
33
34real, parameter :: r3ccnmin = 1.e-21    ! ie rccnmin = 0.1 microns
35real, parameter :: rccnmin  = 0.1e-6
36real, parameter :: rccnCO2min  = 1e-9
37
38real, parameter :: r3ccnmax = 125.e-12  ! ie rccnmax  = 500 microns
39real, parameter :: rccnmax  = 500.e-6
40
41real, parameter :: ndust_threshold  = 1.
42real, parameter :: qdust_threshold  = 1.e-20
43
44real, parameter :: r3dustmin = 1.e-24  ! ie rdustmin = 0.01 microns
45real, parameter :: rdustmin  = 1.e-8
46
47real, parameter :: r3dustmax = 125.e-12 ! ie rdustmax  = 500 microns
48real, parameter :: rdustmax  = 500.e-6 
49
50real, parameter :: rdust0 = 0.8e-6
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!============================================================================
97subroutine updaterice_microco2(qice, qccn, nccn, qccn_h2o, nccn_h2o, temperature, coeff, rice, rhocloudco2)
98use tracer_mod, only: rho_dust, rho_ice
99use comcstfi_h, only: pi
100use density_co2_ice_mod, only: density_co2_ice
101
102implicit none
103!CO2 clouds parameter update by CL and JA 09/16
104
105DOUBLE PRECISION, intent(in)  :: qice,qccn,nccn, qccn_h2o, nccn_h2o
106real, intent(in)  :: coeff         ! this coeff is tauscaling if microphy = T (possibly ccn_factor^-1 otherwise)
107real, intent(in)  :: temperature ! temperature effective for density co2_ice computation
108real, intent(out) :: rhocloudco2 ! rhocloud is needed for sedimentation and is also a good diagnostic variable
109double precision, intent(out) :: rice
110real nccn_true,qccn_true, qccn_h2o_true, nccn_h2o_true ! nombre et masse de CCN
111double precision :: rho_ice_co2T ! density co2_ice Temperature-dependent
112
113nccn_true = max(nccn * coeff, 1.e-30)
114qccn_true = max(qccn * coeff, 1.e-30)
115
116nccn_h2o_true = max(nccn_h2o, 1.e-30)
117qccn_h2o_true = max(qccn_h2o, 1.e-30)
118
119call density_co2_ice(dble(temperature), rho_ice_co2T)
120
121rhocloudco2 = (qice * rho_ice_co2T + qccn_true*rho_dust + qccn_h2o_true*rho_ice) / (qice + qccn_true + qccn_h2o_true)
122
123rhocloudco2 = min(max(rhocloudco2,rho_ice_co2T), rho_dust)
124
125rice = (qice + qccn_true + qccn_h2o_true) * 0.75 / pi / rhocloudco2 / (nccn_true + nccn_h2o_true)
126
127rhocloudco2 = (qice * rho_ice_co2T + qccn_true*rho_dust + qccn_h2o_true*rho_ice) / (qice + qccn_true + qccn_h2o_true)
128
129if (rice <= r3iceco2min) then !r3icemin radius power 3 ?
130  rice = riceco2min
131else if (rice >= r3iceco2max) then !r3icemin radius power 3 ?
132  rice = riceco2max
133else
134  rice = rice**(1./3.) ! here rice is always positive
135endif
136
137
138end subroutine updaterice_microco2
139
140
141
142!============================================================================
143!============================================================================
144!============================================================================
145! Update ice radius from a typical profile if microphys == false
146subroutine updaterice_typ(qice,tau,pzlay,rice)
147
148use tracer_mod, only: rho_ice
149USE comcstfi_h, only: pi
150
151implicit none
152
153real, intent(in)  :: qice
154real, intent(in)  :: tau   ! tau for dust
155real, intent(in)  :: pzlay ! altitude at the middle of the layers
156real, intent(out) :: rice
157real :: rccn, nccn ! radius  and number of ice crystals
158
159!   Typical CCN profile following Montmessin et al. 2004
160!   (N0=2e6 m-3 has been converted into N0=1.3e8 kg-1 using a typical atmospheric density,
161!   otherwise the equation for rice is not homogeneous...)
162     nccn = 1.3e+8*max(tau,0.001)/0.1*exp(-pzlay/10000.)
163!   The previously used profile was not correct:
164!   Nccn=( epaisseur/masse ) * 2.e+6/0.1*max(tau,0.001)*exp(-pzlay/10000.)
165
166if (nccn .le. 1) then
167
168  rice = ricemin
169
170else
171
172! Typical dust radius profile:
173  rccn = max(rdust0*exp(-pzlay/18000.),1.e-9)
174  rice = qice * 0.75 / pi / rho_ice / nccn + rccn*rccn*rccn
175
176  if (rice .le. r3icemin) then
177    rice = ricemin
178  else if (rice .ge. r3icemax) then
179    rice = ricemax
180  else
181    rice = rice**(1./3.) ! here rice is always positive
182  endif
183
184endif
185
186end subroutine updaterice_typ
187!============================================================================
188!============================================================================
189!============================================================================
190
191
192
193
194
195
196!============================================================================
197!============================================================================
198!============================================================================
199! This subroutine computes the geometric mean radius(or number median radius)
200! For a lognormal distribution :
201! geometric mean radius = mass mean radius x exp(-1.5 sigma0^2)
202! To be used with doubleq == true. otherwise, rdust is constant !!!
203subroutine updaterdust(qdust,ndust,rdust,tauscaling)
204use tracer_mod, only: r3n_q
205USE comcstfi_h
206implicit none
207
208real, intent(in) :: qdust,ndust ! needed if doubleq
209real, intent(in), optional :: tauscaling ! useful for realistic thresholds
210real, intent(out) :: rdust
211real coeff
212
213if (present(tauscaling)) then
214  coeff = tauscaling ! thresholds on realistic values
215else
216  coeff = 1. ! thresholds on virtual values
217endif
218
219if ((ndust .le. ndust_threshold/coeff) .or. (qdust .le. qdust_threshold/coeff)) then
220
221   rdust = rdustmin
222
223else
224
225   rdust  = r3n_q * qdust / ndust
226
227   if (rdust .le. r3dustmin) then
228       rdust = rdustmin
229   else if (rdust .ge. r3dustmax) then
230       rdust = rdustmax
231   else
232      rdust = rdust**(1./3.)
233   endif
234
235endif
236     
237
238end subroutine updaterdust
239!============================================================================
240!============================================================================
241!============================================================================
242
243
244
245
246
247
248!============================================================================
249!============================================================================
250!============================================================================
251! This subroutine computes the mass mean radius,
252! used for heterogenous nucleation on CCNs in microphysics.
253! For a lognormal distribution :
254! geometric mean radius = mass mean radius x exp(-1.5 sigma0^2)
255subroutine updaterccn(qccn,nccn,rccn,tauscaling)
256use tracer_mod, only: rho_dust
257USE comcstfi_h
258implicit none
259
260real, intent(in) :: qccn,nccn ! needed if doubleq
261real, intent(in), optional :: tauscaling ! useful for realistic thresholds
262
263real, intent(out) :: rccn
264
265real coeff
266
267
268if (present(tauscaling)) then
269  coeff = tauscaling ! threshold on realistic values
270else
271  coeff = 1. ! threshold on virtual values
272endif
273
274if ((nccn .le. nccn_threshold/coeff) .or. (qccn .le. qccn_threshold/coeff)) then
275
276   rccn = rccnmin
277
278else
279
280   rccn  =  qccn * 0.75 / pi / rho_dust / nccn
281
282   if (rccn .le. r3ccnmin) then
283       rccn = rccnmin
284   else if (rccn .ge. r3ccnmax) then
285       rccn = rccnmax
286   else
287       rccn = rccn**(1./3.)
288   endif
289
290endif
291     
292end subroutine updaterccn
293!============================================================================
294!============================================================================
295!============================================================================
296
297
298
299
300
301!============================================================================
302!============================================================================
303!============================================================================
304! This subroutine computes the mass mean radius,
305! used for heterogenous nucleation on CCNs in microphysics of CO2.
306! For a lognormal distribution :
307! geometric mean radius = mass mean radius x exp(-1.5 sigma0^2)
308subroutine updaterccnCO2(qccn,nccn,rccn,tauscaling)
309use tracer_mod, only: rho_dust
310USE comcstfi_h
311implicit none
312
313real, intent(in) :: qccn,nccn ! needed if doubleq
314real, intent(in), optional :: tauscaling ! useful for realistic thresholds
315
316real, intent(out) :: rccn
317
318real coeff
319
320
321if (present(tauscaling)) then
322  coeff = tauscaling ! threshold on realistic values
323else
324  coeff = 1. ! threshold on virtual values
325endif
326
327if ((nccn .le. nccn_threshold/coeff) .or. (qccn .le. qccn_threshold/coeff)) then
328
329   rccn = rccnCO2min
330
331else
332
333   rccn  =  qccn * 0.75 / pi / rho_dust / nccn
334   rccn = rccn**(1./3.)
335
336endif
337
338rccn=min(5.E-4,rccn)
339     
340end subroutine updaterccnCO2
341!============================================================================
342!============================================================================
343!============================================================================
344
345
346
347end module updaterad
348
Note: See TracBrowser for help on using the repository browser.