← Back to Documentation Home
CCPP SciDoc v8.0.0  v8.0.0
Common Community Physics Package Developed at DTC
 
Loading...
Searching...
No Matches
module_mp_tempo_utils_v2.F90
1! Utilities for TEMPO Microphysics
2!=================================================================================================================
3module module_mp_tempo_utils_v2
4
5 use machine, only: wp => kind_phys, sp => kind_sngl_prec, dp => kind_dbl_prec
6 use module_mp_tempo_params, only: pi, rho_i, am_r
7
8 implicit none
9
10 public
11contains
12 !=================================================================================================================
13
19 elemental real function make_icenumber (Q_ice, temp)
20
21 !IMPLICIT NONE
22 real, intent(in):: q_ice, temp
23 integer idx_rei
24 real corr, reice, deice
25 double precision lambda
26
27 !+---+-----------------------------------------------------------------+
28 !..Table of lookup values of radiative effective radius of ice crystals
29 !.. as a function of Temperature from -94C to 0C. Taken from WRF RRTMG
30 !.. radiation code where it is attributed to Jon Egill Kristjansson
31 !.. and coauthors.
32 !+---+-----------------------------------------------------------------+
33
34 real, dimension(95), parameter:: retab = (/ &
35 5.92779, 6.26422, 6.61973, 6.99539, 7.39234, &
36 7.81177, 8.25496, 8.72323, 9.21800, 9.74075, 10.2930, &
37 10.8765, 11.4929, 12.1440, 12.8317, 13.5581, 14.2319, &
38 15.0351, 15.8799, 16.7674, 17.6986, 18.6744, 19.6955, &
39 20.7623, 21.8757, 23.0364, 24.2452, 25.5034, 26.8125, &
40 27.7895, 28.6450, 29.4167, 30.1088, 30.7306, 31.2943, &
41 31.8151, 32.3077, 32.7870, 33.2657, 33.7540, 34.2601, &
42 34.7892, 35.3442, 35.9255, 36.5316, 37.1602, 37.8078, &
43 38.4720, 39.1508, 39.8442, 40.5552, 41.2912, 42.0635, &
44 42.8876, 43.7863, 44.7853, 45.9170, 47.2165, 48.7221, &
45 50.4710, 52.4980, 54.8315, 57.4898, 60.4785, 63.7898, &
46 65.5604, 71.2885, 75.4113, 79.7368, 84.2351, 88.8833, &
47 93.6658, 98.5739, 103.603, 108.752, 114.025, 119.424, &
48 124.954, 130.630, 136.457, 142.446, 148.608, 154.956, &
49 161.503, 168.262, 175.248, 182.473, 189.952, 197.699, &
50 205.728, 214.055, 222.694, 231.661, 240.971, 250.639 /)
51
52 if (q_ice == 0) then
54 return
55 end if
56
57 !+---+-----------------------------------------------------------------+
58 !..From the model 3D temperature field, subtract 179K for which
59 !.. index value of retab as a start. Value of corr is for
60 !.. interpolating between neighboring values in the table.
61 !+---+-----------------------------------------------------------------+
62
63 idx_rei = int(temp-179.)
64 idx_rei = min(max(idx_rei,1),94)
65 corr = temp - int(temp)
66 reice = retab(idx_rei)*(1.-corr) + retab(idx_rei+1)*corr
67 deice = 2.*reice * 1.e-6
68
69 !+---+-----------------------------------------------------------------+
70 !..Now we have the final radiative effective size of ice (as function
71 !.. of temperature only). This size represents 3rd moment divided by
72 !.. second moment of the ice size distribution, so we can compute a
73 !.. number concentration from the mean size and mass mixing ratio.
74 !.. The mean (radiative effective) diameter is 3./Slope for an inverse
75 !.. exponential size distribution. So, starting with slope, work
76 !.. backwords to get number concentration.
77 !+---+-----------------------------------------------------------------+
78
79 lambda = 3.0 / deice
80 make_icenumber = q_ice * lambda*lambda*lambda / (pi*rho_i)
81
82 !+---+-----------------------------------------------------------------+
83 !..Example1: Common ice size coming from Thompson scheme is about 30 microns.
84 !.. An example ice mixing ratio could be 0.001 g/kg for a temperature of -50C.
85 !.. Remember to convert both into MKS units. This gives N_ice=357652 per kg.
86 !..Example2: Lower in atmosphere at T=-10C matching ~162 microns in retab,
87 !.. and assuming we have 0.1 g/kg mixing ratio, then N_ice=28122 per kg,
88 !.. which is 28 crystals per liter of air if the air density is 1.0.
89 !+---+-----------------------------------------------------------------+
90
91 return
92 end function make_icenumber
93
94 !=================================================================================================================
95 elemental real function make_dropletnumber (Q_cloud, qnwfa)
96
97 !IMPLICIT NONE
98
99 real, intent(in):: q_cloud, qnwfa
100
101 real, dimension(15), parameter:: g_ratio = (/24,60,120,210,336, &
102 & 504,720,990,1320,1716,2184,2730,3360,4080,4896/)
103 double precision:: lambda, qnc
104 real:: q_nwfa, x1, xdc
105 integer:: nu_c
106
107 if (q_cloud == 0) then
108 make_dropletnumber = 0
109 return
110 end if
111
112 !+---+
113
114 q_nwfa = max(99.e6, min(qnwfa,5.e10))
115 nu_c = max(2, min(nint(2.5e10/q_nwfa), 15))
116
117 x1 = max(1., min(q_nwfa*1.e-9, 10.)) - 1.
118 xdc = (30. - x1*20./9.) * 1.e-6
119
120 lambda = (4.0d0 + nu_c) / xdc
121 qnc = q_cloud / g_ratio(nu_c) * lambda*lambda*lambda / am_r
122 make_dropletnumber = sngl(qnc)
123
124 return
125 end function make_dropletnumber
126
127 !=================================================================================================================
128 elemental real function make_rainnumber (Q_rain, temp)
129
130 IMPLICIT NONE
131
132 real, intent(in):: q_rain, temp
133 double precision:: lambda, n0, qnr
134
135 if (q_rain == 0) then
136 make_rainnumber = 0
137 return
138 end if
139
140 !+---+-----------------------------------------------------------------+
141 !.. Not thrilled with it, but set Y-intercept parameter to Marshal-Palmer value
142 !.. that basically assumes melting snow becomes typical rain. However, for
143 !.. -2C < T < 0C, make linear increase in exponent to attempt to keep
144 !.. supercooled collision-coalescence (warm-rain) similar to drizzle rather
145 !.. than bigger rain drops. While this could also exist at T>0C, it is
146 !.. more difficult to assume it directly from having mass and not number.
147 !+---+-----------------------------------------------------------------+
148
149 n0 = 8.e6
150
151 if (temp .le. 271.15) then
152 n0 = 8.e8
153 elseif (temp .gt. 271.15 .and. temp.lt.273.15) then
154 n0 = 8. * 10**(279.15-temp)
155 endif
156
157 lambda = sqrt(sqrt(n0*am_r*6.0/q_rain))
158 qnr = q_rain / 6.0 * lambda*lambda*lambda / am_r
159 make_rainnumber = sngl(qnr)
160
161 return
162 end function make_rainnumber
163
164end module module_mp_tempo_utils_v2
elemental real function make_icenumber(q_ice, temp)
Table of lookup values of radiative effective radius of ice crystals as a function of Temperature fro...