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 | |
---|
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 | |
---|
20 | real, parameter :: r3icemin = 1.e-30 ! ie ricemin = 0.0001 microns |
---|
21 | real, parameter :: ricemin = 1.e-10 |
---|
22 | |
---|
23 | real, parameter :: r3icemax = 125.e-12 ! ie ricemax = 500 microns |
---|
24 | real, parameter :: ricemax = 500.e-6 |
---|
25 | |
---|
26 | |
---|
27 | real, parameter :: nccn_threshold = 1. |
---|
28 | real, parameter :: qccn_threshold = 1.e-20 |
---|
29 | |
---|
30 | real, parameter :: r3ccnmin = 1.e-21 ! ie rccnmin = 0.1 microns |
---|
31 | real, parameter :: rccnmin = 0.1e-6 |
---|
32 | |
---|
33 | real, parameter :: r3ccnmax = 125.e-12 ! ie rccnmax = 500 microns |
---|
34 | real, parameter :: rccnmax = 500.e-6 |
---|
35 | |
---|
36 | |
---|
37 | |
---|
38 | real, parameter :: ndust_threshold = 1. |
---|
39 | real, parameter :: qdust_threshold = 1.e-20 |
---|
40 | |
---|
41 | real, parameter :: r3dustmin = 1.e-24 ! ie rdustmin = 0.1 microns |
---|
42 | real, parameter :: rdustmin = 0.01e-6 |
---|
43 | |
---|
44 | real, parameter :: r3dustmax = 125.e-12 ! ie rdustmax = 500 microns |
---|
45 | real, parameter :: rdustmax = 500.e-6 |
---|
46 | |
---|
47 | |
---|
48 | real, parameter :: rdust0 = 0.8e-6 |
---|
49 | |
---|
50 | |
---|
51 | |
---|
52 | |
---|
53 | contains |
---|
54 | |
---|
55 | |
---|
56 | !============================================================================ |
---|
57 | !============================================================================ |
---|
58 | !============================================================================ |
---|
59 | ! Update ice radius if microphys == true |
---|
60 | subroutine updaterice_micro(qice,qccn,nccn,coeff,rice,rhocloud) |
---|
61 | use tracer_mod, only: rho_dust, rho_ice |
---|
62 | USE comcstfi_h |
---|
63 | implicit none |
---|
64 | |
---|
65 | real, intent(in) :: qice,qccn,nccn |
---|
66 | real, intent(in) :: coeff ! this coeff is tauscaling if microphy = T (possibly ccn_factor^-1 otherwise) |
---|
67 | real, intent(out) :: rice,rhocloud ! rhocloud is needed for sedimentation and is also a good diagnostic variable |
---|
68 | real nccn_true,qccn_true ! radius of the ice crystal core to the power of 3 |
---|
69 | |
---|
70 | |
---|
71 | nccn_true = max(nccn * coeff, 1.e-30) |
---|
72 | qccn_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 | |
---|
79 | rhocloud = (qice*rho_ice + qccn_true*rho_dust) / (qice + qccn_true) |
---|
80 | rhocloud = min(max(rhocloud,rho_ice),rho_dust) |
---|
81 | |
---|
82 | rice = (qice + qccn_true) * 0.75 / pi / rhocloud / nccn_true |
---|
83 | |
---|
84 | if (rice .le. r3icemin) then |
---|
85 | rice = ricemin |
---|
86 | else if (rice .ge. r3icemax) then |
---|
87 | rice = ricemax |
---|
88 | else |
---|
89 | rice = rice**(1./3.) ! here rice is always positive |
---|
90 | endif |
---|
91 | |
---|
92 | |
---|
93 | end 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 |
---|
106 | subroutine updaterice_typ(qice,tau,pzlay,rice) |
---|
107 | use tracer_mod, only: rho_ice |
---|
108 | USE comcstfi_h |
---|
109 | implicit none |
---|
110 | |
---|
111 | real, intent(in) :: qice |
---|
112 | real, intent(in) :: tau ! tau for dust |
---|
113 | real, intent(in) :: pzlay ! altitude at the middle of the layers |
---|
114 | real, intent(out) :: rice |
---|
115 | real 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 | |
---|
123 | if (nccn .le. 1) then |
---|
124 | |
---|
125 | rice = ricemin |
---|
126 | |
---|
127 | else |
---|
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 | |
---|
141 | endif |
---|
142 | |
---|
143 | end 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 !!! |
---|
160 | subroutine updaterdust(qdust,ndust,rdust,tauscaling) |
---|
161 | use tracer_mod, only: r3n_q |
---|
162 | USE comcstfi_h |
---|
163 | implicit none |
---|
164 | |
---|
165 | real, intent(in) :: qdust,ndust ! needed if doubleq |
---|
166 | real, intent(in), optional :: tauscaling ! useful for realistic thresholds |
---|
167 | real, intent(out) :: rdust |
---|
168 | real coeff |
---|
169 | |
---|
170 | if (present(tauscaling)) then |
---|
171 | coeff = tauscaling ! thresholds on realistic values |
---|
172 | else |
---|
173 | coeff = 1. ! thresholds on virtual values |
---|
174 | endif |
---|
175 | |
---|
176 | if ((ndust .le. ndust_threshold/coeff) .or. (qdust .le. qdust_threshold/coeff)) then |
---|
177 | |
---|
178 | rdust = rdustmin |
---|
179 | |
---|
180 | else |
---|
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 | |
---|
192 | endif |
---|
193 | |
---|
194 | |
---|
195 | end 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) |
---|
212 | subroutine updaterccn(qccn,nccn,rccn,tauscaling) |
---|
213 | use tracer_mod, only: rho_dust |
---|
214 | USE comcstfi_h |
---|
215 | implicit none |
---|
216 | |
---|
217 | real, intent(in) :: qccn,nccn ! needed if doubleq |
---|
218 | real, intent(in), optional :: tauscaling ! useful for realistic thresholds |
---|
219 | |
---|
220 | real, intent(out) :: rccn |
---|
221 | |
---|
222 | real coeff |
---|
223 | |
---|
224 | |
---|
225 | if (present(tauscaling)) then |
---|
226 | coeff = tauscaling ! threshold on realistic values |
---|
227 | else |
---|
228 | coeff = 1. ! threshold on virtual values |
---|
229 | endif |
---|
230 | |
---|
231 | if ((nccn .le. nccn_threshold/coeff) .or. (qccn .le. qccn_threshold/coeff)) then |
---|
232 | |
---|
233 | rccn = rccnmin |
---|
234 | |
---|
235 | else |
---|
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 | |
---|
247 | endif |
---|
248 | |
---|
249 | end subroutine updaterccn |
---|
250 | !============================================================================ |
---|
251 | !============================================================================ |
---|
252 | !============================================================================ |
---|
253 | |
---|
254 | |
---|
255 | |
---|
256 | end module updaterad |
---|
257 | |
---|