CCPP SciDoc v7.0.0  v7.0.0
Common Community Physics Package Developed at DTC
 
Loading...
Searching...
No Matches
module_mp_tempo.F90
1! 3D TEMPO Driver for MPAS
2!=================================================================================================================
4
5 use mpas_kind_types, only: wp => rkind, sp => r4kind, dp => r8kind
7 use module_mp_tempo_utils, only : create_bins, table_efrw, table_efsw, table_dropevap, &
8 calc_refl10cm, calc_effectrad, hail_size_diagnostics
9 use module_mp_tempo_main, only : mp_tempo_main
10 use module_mp_tempo_ml, only : predict_number_sub
11 use mpas_atmphys_utilities, only : physics_message, physics_error_fatal
12 use mpas_io_units, only : mpas_new_unit, mpas_release_unit
13 use mp_radar
14
15 implicit none
16
17contains
18 !=================================================================================================================
19 ! This subroutine handles initialzation of the microphysics scheme including building of lookup tables,
20 ! allocating arrays for the microphysics scheme, and defining gamma function variables.
21
22 ! Input:
23 ! l_mp_tables = .false. to build lookup tables. If l_mp_tables = .true., lookup tables are built.
24
25 ! AAJ No support yet for hail_aware in microphysics driver
26 subroutine tempo_init(l_mp_tables, hail_aware_flag, aerosol_aware_flag)
27
28 ! Input arguments:
29 logical, intent(in) :: l_mp_tables
30 logical, intent(in), optional :: aerosol_aware_flag, hail_aware_flag
31
32 integer, parameter :: open_OK = 0
33 integer, parameter :: num_records = 5
34 integer :: qr_acr_qg_filesize, qr_acr_qg_check, qr_acr_qg_dim1size, qr_acr_qg_dim9size
35 logical :: qr_acr_qg_exists, qr_acr_qg_hailaware_exists
36 integer :: i, j, k, l, m, n
37 integer :: istat
38 logical :: micro_init
39 integer :: mp_unit
40 character(len=132) :: message
41
42 ! Initialize physical constants
43 call mp_tempo_params_init()
44
45 if (present(hail_aware_flag)) then
46 configs%hail_aware = hail_aware_flag
47 else
48 call physics_message('--- tempo_init() called without hail_aware_flag... setting value to .false.')
49 configs%hail_aware = .false.
50 endif
51
52 ! If lookup tables are already built
53 if (l_mp_tables) then
54 ! configs%hail_aware = hail_aware_flag
55 write(message, '(L1)') configs%hail_aware
56 call physics_message('--- tempo_init() called with hail_aware_flag = ' // trim(message))
57
58 if (present(aerosol_aware_flag)) then
59 configs%aerosol_aware = aerosol_aware_flag
60 write(message, '(L1)') configs%aerosol_aware
61 call physics_message('--- tempo_init() called with aerosol_aware_flag = ' // trim(message))
62 endif
63 endif
64
65 if (configs%hail_aware) then
66 dimnrhg = nrhg
67 else
68 av_g(idx_bg1) = av_g_old
69 bv_g(idx_bg1) = bv_g_old
70 dimnrhg = nrhg1
71 endif
72
73 micro_init = .false.
74
75 !=================================================================================================================
76 ! Check the qr_acr_qg lookup table to make sure it is compatible with runtime options
77
78 ! If lookup tables are already built
79 ! if (l_mp_tables) then
80
81 ! inquire(file='MP_TEMPO_QRacrQG_DATA.DBL', exist=qr_acr_qg_exists)
82 ! if (qr_acr_qg_exists) then ! Check again that file exists
83
84 ! ! Add check on qr_ac_qg filesize to determine if table includes hail-awareness (dimNRHG=9)
85 ! qr_acr_qg_check = dp * num_records * (dimNRHG * ntb_g1 * ntb_g * ntb_r1 * ntb_r + 1)
86 ! qr_acr_qg_dim1size = dp * num_records * (NRHG1 * ntb_g1 * ntb_g * ntb_r1 * ntb_r + 1)
87 ! qr_acr_qg_dim9size = dp * num_records * (NRHG * ntb_g1 * ntb_g * ntb_r1 * ntb_r + 1)
88
89 ! inquire(file='MP_TEMPO_QRacrQG_DATA.DBL', size=qr_acr_qg_filesize)
90
91 ! if (qr_acr_qg_filesize == qr_acr_qg_dim1size) then
92 ! using_hail_aware_table = .false.
93 ! call physics_message('--- tempo_init() ' // &
94 ! 'Lookup table for qr_acr_qg is not hail aware.')
95 ! dimNRHG = NRHG1
96 ! if (hail_aware_flag) then
97 ! call physics_error_fatal('--- tempo_init() Cannot use hail-aware microphysics ' // &
98 ! 'with non hail-aware qr_acr_qg lookup table. ' // &
99 ! 'Please rebuild table with parameter build_hail_aware_table set to true.')
100 ! endif
101 ! elseif (qr_acr_qg_filesize == qr_acr_qg_dim9size) then
102 ! using_hail_aware_table = .true.
103 ! call physics_message('--- tempo_init() ' // &
104 ! 'Lookup table for qr_acr_qg is hail aware.')
105 ! dimNRHG = NRHG
106 ! else
107 ! using_hail_aware_table = .false.
108 ! if (hail_aware_flag) using_hail_aware_table = .true.
109 ! call physics_message('--- tempo_init() ' // &
110 ! 'Could not determine if lookup table for qr_acr_qg is hail aware based on file size.')
111 ! endif
112 ! endif
113 ! endif
114
115 !=================================================================================================================
116 ! Allocate space for lookup tables (J. Michalakes 2009Jun08).
117 if (.not. allocated(tcg_racg)) then
118 allocate(tcg_racg(ntb_g1,ntb_g,dimnrhg,ntb_r1,ntb_r))
119 micro_init = .true.
120 endif
121
122 ! Rain-graupel (including array above tcg_racg)
123 if (.not. allocated(tmr_racg)) allocate(tmr_racg(ntb_g1,ntb_g,dimnrhg,ntb_r1,ntb_r))
124 if (.not. allocated(tcr_gacr)) allocate(tcr_gacr(ntb_g1,ntb_g,dimnrhg,ntb_r1,ntb_r))
125 if (.not. allocated(tnr_racg)) allocate(tnr_racg(ntb_g1,ntb_g,dimnrhg,ntb_r1,ntb_r))
126 if (.not. allocated(tnr_gacr)) allocate(tnr_gacr(ntb_g1,ntb_g,dimnrhg,ntb_r1,ntb_r))
127
128 ! Rain-snow
129 if (.not. allocated(tcs_racs1)) allocate(tcs_racs1(ntb_s,ntb_t,ntb_r1,ntb_r))
130 if (.not. allocated(tmr_racs1)) allocate(tmr_racs1(ntb_s,ntb_t,ntb_r1,ntb_r))
131 if (.not. allocated(tcs_racs2)) allocate(tcs_racs2(ntb_s,ntb_t,ntb_r1,ntb_r))
132 if (.not. allocated(tmr_racs2)) allocate(tmr_racs2(ntb_s,ntb_t,ntb_r1,ntb_r))
133 if (.not. allocated(tcr_sacr1)) allocate(tcr_sacr1(ntb_s,ntb_t,ntb_r1,ntb_r))
134 if (.not. allocated(tms_sacr1)) allocate(tms_sacr1(ntb_s,ntb_t,ntb_r1,ntb_r))
135 if (.not. allocated(tcr_sacr2)) allocate(tcr_sacr2(ntb_s,ntb_t,ntb_r1,ntb_r))
136 if (.not. allocated(tms_sacr2)) allocate(tms_sacr2(ntb_s,ntb_t,ntb_r1,ntb_r))
137 if (.not. allocated(tnr_racs1)) allocate(tnr_racs1(ntb_s,ntb_t,ntb_r1,ntb_r))
138 if (.not. allocated(tnr_racs2)) allocate(tnr_racs2(ntb_s,ntb_t,ntb_r1,ntb_r))
139 if (.not. allocated(tnr_sacr1)) allocate(tnr_sacr1(ntb_s,ntb_t,ntb_r1,ntb_r))
140 if (.not. allocated(tnr_sacr2)) allocate(tnr_sacr2(ntb_s,ntb_t,ntb_r1,ntb_r))
141
142 ! Cloud water freezing
143 if (.not. allocated(tpi_qcfz)) allocate(tpi_qcfz(ntb_c,nbc,ntb_t1,ntb_in))
144 if (.not. allocated(tni_qcfz)) allocate(tni_qcfz(ntb_c,nbc,ntb_t1,ntb_in))
145
146 ! Rain freezing
147 if (.not. allocated(tpi_qrfz)) allocate(tpi_qrfz(ntb_r,ntb_r1,ntb_t1,ntb_in))
148 if (.not. allocated(tpg_qrfz)) allocate(tpg_qrfz(ntb_r,ntb_r1,ntb_t1,ntb_in))
149 if (.not. allocated(tni_qrfz)) allocate(tni_qrfz(ntb_r,ntb_r1,ntb_t1,ntb_in))
150 if (.not. allocated(tnr_qrfz)) allocate(tnr_qrfz(ntb_r,ntb_r1,ntb_t1,ntb_in))
151
152 ! Ice growth and conversion to snow
153 if (.not. allocated(tps_iaus)) allocate(tps_iaus(ntb_i,ntb_i1))
154 if (.not. allocated(tni_iaus)) allocate(tni_iaus(ntb_i,ntb_i1))
155 if (.not. allocated(tpi_ide)) allocate(tpi_ide(ntb_i,ntb_i1))
156
157 ! Collision efficiencies
158 if (.not. allocated(t_efrw)) allocate(t_efrw(nbr,nbc))
159 if (.not. allocated(t_efsw)) allocate(t_efsw(nbs,nbc))
160
161 ! Cloud water
162 if (.not. allocated(tnr_rev)) allocate(tnr_rev(nbr,ntb_r1,ntb_r))
163 if (.not. allocated(tpc_wev)) allocate(tpc_wev(nbc,ntb_c,nbc))
164 if (.not. allocated(tnc_wev)) allocate(tnc_wev(nbc,ntb_c,nbc))
165
166 ! CCN
167 if (.not. allocated(tnccn_act)) allocate(tnccn_act(ntb_arc,ntb_arw,ntb_art,ntb_arr,ntb_ark))
168
169 !=================================================================================================================
170 if (micro_init) then
171
172 ! Schmidt number to one-third used numerous times.
173 sc3 = sc**(1./3.)
174
175 ! Compute minimum ice diameter from mass and minimum snow/graupel mass from diameter
176 d0i = (xm0i/am_i)**(1.0/bm_i)
177 xm0s = am_s * d0s**bm_s
178 xm0g = am_g(nrhg) * d0g**bm_g
179
180 ! These constants various exponents and gamma() assoc with cloud, rain, snow, and graupel.
181 do n = 1, 15
182 cce(1,n) = n + 1.
183 cce(2,n) = bm_r + n + 1.
184 cce(3,n) = bm_r + n + 4.
185 cce(4,n) = n + bv_c + 1.
186 cce(5,n) = bm_r + n + bv_c + 1.
187 ccg(1,n) = gamma(cce(1,n))
188 ccg(2,n) = gamma(cce(2,n))
189 ccg(3,n) = gamma(cce(3,n))
190 ccg(4,n) = gamma(cce(4,n))
191 ccg(5,n) = gamma(cce(5,n))
192 ocg1(n) = 1.0 / ccg(1,n)
193 ocg2(n) = 1.0 / ccg(2,n)
194 enddo
195
196 cie(1) = mu_i + 1.
197 cie(2) = bm_i + mu_i + 1.
198 cie(3) = bm_i + mu_i + bv_i + 1.
199 cie(4) = mu_i + bv_i + 1.
200 cie(5) = mu_i + 2.
201 cie(6) = bm_i*0.5 + mu_i + bv_i + 1.
202 cie(7) = bm_i*0.5 + mu_i + 1.
203 cig(1) = gamma(cie(1))
204 cig(2) = gamma(cie(2))
205 cig(3) = gamma(cie(3))
206 cig(4) = gamma(cie(4))
207 cig(5) = gamma(cie(5))
208 cig(6) = gamma(cie(6))
209 cig(7) = gamma(cie(7))
210 oig1 = 1.0 / cig(1)
211 oig2 = 1.0 / cig(2)
212 obmi = 1.0 / bm_i
213
214 cre(1) = bm_r + 1.
215 cre(2) = mu_r + 1.
216 cre(3) = bm_r + mu_r + 1.
217 cre(4) = bm_r*2. + mu_r + 1.
218 cre(5) = mu_r + bv_r + 1.
219 cre(6) = bm_r + mu_r + bv_r + 1.
220 cre(7) = bm_r*0.5 + mu_r + bv_r + 1.
221 cre(8) = bm_r + mu_r + bv_r + 3.
222 cre(9) = mu_r + bv_r + 3.
223 cre(10) = mu_r + 2.
224 cre(11) = 0.5*(bv_r + 5. + 2.*mu_r)
225 cre(12) = bm_r*0.5 + mu_r + 1.
226 cre(13) = bm_r*2. + mu_r + bv_r + 1.
227
228 do n = 1, 13
229 crg(n) = gamma(cre(n))
230 enddo
231
232 obmr = 1.0 / bm_r
233 ore1 = 1.0 / cre(1)
234 org1 = 1.0 / crg(1)
235 org2 = 1.0 / crg(2)
236 org3 = 1.0 / crg(3)
237
238 cse(1) = bm_s + 1.
239 cse(2) = bm_s + 2.
240 cse(3) = bm_s*2.
241 cse(4) = bm_s + bv_s + 1.
242 cse(5) = bm_s*2. + bv_s + 1.
243 cse(6) = bm_s*2. + 1.
244 cse(7) = bm_s + mu_s + 1.
245 cse(8) = bm_s + mu_s + 2.
246 cse(9) = bm_s + mu_s + 3.
247 cse(10) = bm_s + mu_s + bv_s + 1.
248 cse(11) = bm_s*2. + mu_s + bv_s + 1.
249 cse(12) = bm_s*2. + mu_s + 1.
250 cse(13) = bv_s + 2.
251 cse(14) = bm_s + bv_s
252 cse(15) = mu_s + 1.
253 cse(16) = 1.0 + (1.0 + bv_s)/2.
254 cse(17) = bm_s + bv_s + 2.
255
256 do n = 1, 17
257 csg(n) = gamma(cse(n))
258 enddo
259
260 oams = 1.0 / am_s
261 obms = 1.0 / bm_s
262 ocms = oams**obms
263
264 cge(1,:) = bm_g + 1.
265 cge(2,:) = mu_g + 1.
266 cge(3,:) = bm_g + mu_g + 1.
267 cge(4,:) = bm_g*2. + mu_g + 1.
268 cge(10,:) = mu_g + 2.
269 cge(12,:) = bm_g*0.5 + mu_g + 1.
270
271 do m = 1, nrhg
272 cge(5,m) = bm_g*2. + mu_g + bv_g(m) + 1.
273 cge(6,m) = bm_g + mu_g + bv_g(m) + 1.
274 cge(7,m) = bm_g*0.5 + mu_g + bv_g(m) + 1.
275 cge(8,m) = mu_g + bv_g(m) + 1. ! not used
276 cge(9,m) = mu_g + bv_g(m) + 3.
277 cge(11,m) = 0.5*(bv_g(m) + 5. + 2.*mu_g)
278 enddo
279
280 do m = 1, nrhg
281 do n = 1, 12
282 cgg(n,m) = gamma(cge(n,m))
283 enddo
284 enddo
285
286 oamg = 1.0 / am_g
287 obmg = 1.0 / bm_g
288
289 do m = 1, nrhg
290 oamg(m) = 1.0 / am_g(m)
291 ocmg(m) = oamg(m)**obmg
292 enddo
293
294 oge1 = 1.0 / cge(1,1)
295 ogg1 = 1.0 / cgg(1,1)
296 ogg2 = 1.0 / cgg(2,1)
297 ogg3 = 1.0 / cgg(3,1)
298
299 !=================================================================================================================
300 ! Simplify various rate eqns the best we can now.
301
302 ! Rain collecting cloud water and cloud ice
303 t1_qr_qc = pi * 0.25 * av_r * crg(9)
304 t1_qr_qi = pi * 0.25 * av_r * crg(9)
305 t2_qr_qi = pi * 0.25 * am_r*av_r * crg(8)
306
307 ! Graupel collecting cloud water
308 ! t1_qg_qc = PI*.25*av_g * cgg(9)
309
310 ! Snow collecting cloud water
311 t1_qs_qc = pi * 0.25 * av_s
312
313 ! Snow collecting cloud ice
314 t1_qs_qi = pi * 0.25 * av_s
315
316 ! Evaporation of rain; ignore depositional growth of rain.
317 t1_qr_ev = 0.78 * crg(10)
318 t2_qr_ev = 0.308 * sc3 * sqrt(av_r) * crg(11)
319
320 ! Sublimation/depositional growth of snow
321 t1_qs_sd = 0.86
322 t2_qs_sd = 0.28 * sc3 * sqrt(av_s)
323
324 ! Melting of snow
325 t1_qs_me = pi * 4. *c_sqrd * olfus * 0.86
326 t2_qs_me = pi * 4. *c_sqrd * olfus * 0.28 * sc3 * sqrt(av_s)
327
328 ! Sublimation/depositional growth of graupel
329 t1_qg_sd = 0.86 * cgg(10,1)
330 ! t2_qg_sd = 0.28*Sc3*SQRT(av_g) * cgg(11)
331
332 ! Melting of graupel
333 t1_qg_me = pi * 4. * c_cube * olfus * 0.86 * cgg(10,1)
334 ! t2_qg_me = PI*4.*C_cube*olfus * 0.28*Sc3*SQRT(av_g) * cgg(11)
335
336
337 ! Constants for helping find lookup table indexes.
338 nic2 = nint(log10(r_c(1)))
339 nii2 = nint(log10(r_i(1)))
340 nii3 = nint(log10(nt_i(1)))
341 nir2 = nint(log10(r_r(1)))
342 nir3 = nint(log10(n0r_exp(1)))
343 nis2 = nint(log10(r_s(1)))
344 nig2 = nint(log10(r_g(1)))
345 nig3 = nint(log10(n0g_exp(1)))
346 niin2 = nint(log10(nt_in(1)))
347
348 ! Create bins of cloud water (from minimum diameter to 100 microns).
349 dc(1) = d0c*1.0_dp
350 dtc(1) = d0c*1.0_dp
351 do n = 2, nbc
352 dc(n) = dc(n-1) + 1.0e-6_dp
353 dtc(n) = (dc(n) - dc(n-1))
354 enddo
355
356 ! Create bins of cloud ice (from min diameter up to 2x min snow size).
357 call create_bins(numbins=nbi, lowbin=d0i*1.0_dp, highbin=d0s*2.0_dp, &
358 bins=di, deltabins=dti)
359
360 ! Create bins of rain (from min diameter up to 5 mm).
361 call create_bins(numbins=nbr, lowbin=d0r*1.0_dp, highbin=0.005_dp, &
362 bins=dr, deltabins=dtr)
363
364 ! Create bins of snow (from min diameter up to 2 cm).
365 call create_bins(numbins=nbs, lowbin=d0s*1.0_dp, highbin=0.02_dp, &
366 bins=ds, deltabins=dts)
367
368 ! Create bins of graupel (from min diameter up to 5 cm).
369 call create_bins(numbins=nbg, lowbin=d0g*1.0_dp, highbin=0.05_dp, &
370 bins=dg, deltabins=dtg)
371
372 ! Create bins of cloud droplet number concentration (1 to 3000 per cc).
373 call create_bins(numbins=nbc, lowbin=1.0_dp, highbin=3000.0_dp, &
374 bins=t_nc)
375 t_nc = t_nc * 1.0e6_dp
376 nic1 = log(t_nc(nbc)/t_nc(1))
377
378 !=================================================================================================================
379 ! Create lookup tables for most costly calculations.
380
381 do m = 1, ntb_r
382 do k = 1, ntb_r1
383 do n = 1, dimnrhg
384 do j = 1, ntb_g
385 do i = 1, ntb_g1
386 tcg_racg(i,j,n,k,m) = 0.0_dp
387 tmr_racg(i,j,n,k,m) = 0.0_dp
388 tcr_gacr(i,j,n,k,m) = 0.0_dp
389 tnr_racg(i,j,n,k,m) = 0.0_dp
390 tnr_gacr(i,j,n,k,m) = 0.0_dp
391 enddo
392 enddo
393 enddo
394 enddo
395 enddo
396
397 do m = 1, ntb_r
398 do k = 1, ntb_r1
399 do j = 1, ntb_t
400 do i = 1, ntb_s
401 tcs_racs1(i,j,k,m) = 0.0_dp
402 tmr_racs1(i,j,k,m) = 0.0_dp
403 tcs_racs2(i,j,k,m) = 0.0_dp
404 tmr_racs2(i,j,k,m) = 0.0_dp
405 tcr_sacr1(i,j,k,m) = 0.0_dp
406 tms_sacr1(i,j,k,m) = 0.0_dp
407 tcr_sacr2(i,j,k,m) = 0.0_dp
408 tms_sacr2(i,j,k,m) = 0.0_dp
409 tnr_racs1(i,j,k,m) = 0.0_dp
410 tnr_racs2(i,j,k,m) = 0.0_dp
411 tnr_sacr1(i,j,k,m) = 0.0_dp
412 tnr_sacr2(i,j,k,m) = 0.0_dp
413 enddo
414 enddo
415 enddo
416 enddo
417
418 do m = 1, ntb_in
419 do k = 1, ntb_t1
420 do j = 1, ntb_r1
421 do i = 1, ntb_r
422 tpi_qrfz(i,j,k,m) = 0.0_dp
423 tni_qrfz(i,j,k,m) = 0.0_dp
424 tpg_qrfz(i,j,k,m) = 0.0_dp
425 tnr_qrfz(i,j,k,m) = 0.0_dp
426 enddo
427 enddo
428 do j = 1, nbc
429 do i = 1, ntb_c
430 tpi_qcfz(i,j,k,m) = 0.0_dp
431 tni_qcfz(i,j,k,m) = 0.0_dp
432 enddo
433 enddo
434 enddo
435 enddo
436
437 do j = 1, ntb_i1
438 do i = 1, ntb_i
439 tps_iaus(i,j) = 0.0_dp
440 tni_iaus(i,j) = 0.0_dp
441 tpi_ide(i,j) = 0.0_dp
442 enddo
443 enddo
444
445 do j = 1, nbc
446 do i = 1, nbr
447 t_efrw(i,j) = 0.0
448 enddo
449 do i = 1, nbs
450 t_efsw(i,j) = 0.0
451 enddo
452 enddo
453
454 do k = 1, ntb_r
455 do j = 1, ntb_r1
456 do i = 1, nbr
457 tnr_rev(i,j,k) = 0.0_dp
458 enddo
459 enddo
460 enddo
461
462 do k = 1, nbc
463 do j = 1, ntb_c
464 do i = 1, nbc
465 tpc_wev(i,j,k) = 0.0_dp
466 tnc_wev(i,j,k) = 0.0_dp
467 enddo
468 enddo
469 enddo
470
471 do m = 1, ntb_ark
472 do l = 1, ntb_arr
473 do k = 1, ntb_art
474 do j = 1, ntb_arw
475 do i = 1, ntb_arc
476 tnccn_act(i,j,k,l,m) = 1.0
477 enddo
478 enddo
479 enddo
480 enddo
481 enddo
482
483 !=================================================================================================================
484 ! Check that the look-up tables are available.
485 if (.not. l_mp_tables) return
486
487 ! Collision efficiency between rain/snow and cloud water.
488 call table_efrw ! => fills t_Efrw
489 call table_efsw ! => fills t_Efsw
490
491 ! Drop evaporation
492 call table_dropevap ! => fills tpc_wev and tnc_wev
493
494 ! Read a static file containing CCN activation of aerosols. The data were created from a parcel model
495 ! by Feingold & Heymsfield with further changes by Eidhammer and Kriedenweis.
496 call mpas_new_unit(mp_unit, unformatted = .true.)
497
498 ! open(unit=mp_unit,file='CCN_ACTIVATE.BIN',form='unformatted',status='old',action='read',iostat=istat)
499 ! if (istat /= open_OK) then
500 ! call physics_error_fatal('--- tempo_init() failure opening CCN_ACTIVATE.BIN')
501 ! endif
502 ! read(mp_unit) tnccn_act
503 ! close(unit=mp_unit)
504
505 ! Rain collecting graupel & graupel collecting rain.
506 if (configs%hail_aware) then
507 using_hail_aware_table = .true.
508 open(unit=mp_unit,file='MP_TEMPO_HAILAWARE_QRacrQG_DATA.DBL',form='unformatted',status='old',action='read', &
509 iostat=istat)
510 if (istat /= open_ok) then
511 call physics_error_fatal('--- tempo_init() failure opening MP_TEMPO_HAILAWARE_QRacrQG.DBL')
512 endif
513 read(mp_unit) tcg_racg
514 read(mp_unit) tmr_racg
515 read(mp_unit) tcr_gacr
516 read(mp_unit) tnr_racg
517 read(mp_unit) tnr_gacr
518 close(unit=mp_unit)
519 else
520 inquire(file='MP_TEMPO_HAILAWARE_QRacrQG_DATA.DBL', exist=qr_acr_qg_hailaware_exists)
521 inquire(file='MP_TEMPO_QRacrQG_DATA.DBL', exist=qr_acr_qg_exists)
522
523 if (qr_acr_qg_hailaware_exists) then
524 using_hail_aware_table = .true.
525 open(unit=mp_unit,file='MP_TEMPO_HAILAWARE_QRacrQG_DATA.DBL',form='unformatted',status='old', &
526 action='read',iostat=istat)
527 if (istat /= open_ok) then
528 call physics_error_fatal('--- tempo_init() failure opening MP_TEMPO_HAILAWARE_QRacrQG.DBL')
529 endif
530 elseif (qr_acr_qg_exists) then
531 using_hail_aware_table = .false.
532 open(unit=mp_unit,file='MP_TEMPO_QRacrQG_DATA.DBL',form='unformatted',status='old', &
533 action='read',iostat=istat)
534 if (istat /= open_ok) then
535 call physics_error_fatal('--- tempo_init() failure opening MP_TEMPO_QRacrQG.DBL')
536 endif
537 else
538 call physics_error_fatal('--- tempo_init() could not find file to read QRacrQG data.')
539 endif
540 read(mp_unit) tcg_racg
541 read(mp_unit) tmr_racg
542 read(mp_unit) tcr_gacr
543 read(mp_unit) tnr_racg
544 read(mp_unit) tnr_gacr
545 close(unit=mp_unit)
546 endif
547
548 ! Rain collecting snow & snow collecting rain.
549 open(unit=mp_unit,file='MP_TEMPO_QRacrQS_DATA.DBL',form='unformatted',status='old',action='read', &
550 iostat=istat)
551 if (istat /= open_ok) then
552 call physics_error_fatal('--- tempo_init() failure opening MP_TEMPO_QRacrQS.DBL')
553 endif
554 read(mp_unit) tcs_racs1
555 read(mp_unit) tmr_racs1
556 read(mp_unit) tcs_racs2
557 read(mp_unit) tmr_racs2
558 read(mp_unit) tcr_sacr1
559 read(mp_unit) tms_sacr1
560 read(mp_unit) tcr_sacr2
561 read(mp_unit) tms_sacr2
562 read(mp_unit) tnr_racs1
563 read(mp_unit) tnr_racs2
564 read(mp_unit) tnr_sacr1
565 read(mp_unit) tnr_sacr2
566 close(unit=mp_unit)
567
568 ! Cloud water and rain freezing (Bigg, 1953).
569 open(unit=mp_unit,file='MP_TEMPO_freezeH2O_DATA.DBL',form='unformatted',status='old',action='read', &
570 iostat=istat)
571 if (istat /= open_ok) then
572 call physics_error_fatal('--- tempo_init() failure opening MP_TEMPO_freezeH2O.DBL')
573 endif
574 read(mp_unit) tpi_qrfz
575 read(mp_unit) tni_qrfz
576 read(mp_unit) tpg_qrfz
577 read(mp_unit) tnr_qrfz
578 read(mp_unit) tpi_qcfz
579 read(mp_unit) tni_qcfz
580 close(unit=mp_unit)
581
582 ! Conversion of some ice mass into snow category.
583 open(unit=mp_unit,file='MP_TEMPO_QIautQS_DATA.DBL',form='unformatted',status='old',action='read', &
584 iostat=istat)
585 if (istat /= open_ok) then
586 call physics_error_fatal('--- tempo_init() failure opening MP_TEMPO_QIautQS.DBL')
587 endif
588 read(mp_unit) tpi_ide
589 read(mp_unit) tps_iaus
590 read(mp_unit) tni_iaus
591 close(unit=mp_unit)
592 call mpas_release_unit(mp_unit)
593
594 ! Initialize various constants for computing radar reflectivity.
595 xam_r = am_r
596 xbm_r = bm_r
597 xmu_r = mu_r
598 xam_s = am_s
599 xbm_s = bm_s
600 xmu_s = mu_s
601 xam_g = am_g(idx_bg1)
602 xbm_g = bm_g
603 xmu_g = mu_g
604 call radar_init
605
606 endif ! micro_init
607
608 end subroutine tempo_init
609
610 !=================================================================================================================
611 ! This is a wrapper routine designed to transfer values from 3D to 1D.
612 ! Required microphysics variables are qv, qc, qr, nr, qi, ni, qs, qg
613 ! Optional microphysics variables are aerosol aware (nc, nwfa, nifa, nwfa2d, nifa2d), and hail aware (ng, qg)
614
615 subroutine tempo_3d_to_1d_driver(qv, qc, qr, qi, qs, qg, qb, ni, nr, nc, ng, &
616 nwfa, nifa, nwfa2d, nifa2d, th, pii, p, w, dz, dt_in, itimestep, &
617 rainnc, rainncv, snownc, snowncv, graupelnc, graupelncv, sr, frainnc, &
618 refl_10cm, diagflag, do_radar_ref, re_cloud, re_ice, re_snow, qcbl, cldfrac, &
619 has_reqc, has_reqi, has_reqs, ntc, muc, rainprod, evapprod, &
620 max_hail_diameter_column, max_hail_diameter_sfc, &
621 ids, ide, jds, jde, kds, kde, ims, ime, jms, jme, kms, kme, its, ite, jts, jte, kts, kte)
622
623 ! Subroutine (3D) arguments
624 integer, intent(in) :: ids,ide, jds,jde, kds,kde, ims,ime, jms,jme, kms,kme, its,ite, jts,jte, kts,kte
625 real, dimension(ims:ime, kms:kme, jms:jme), intent(inout) :: qv, qc, qr, qi, qs, qg, ni, nr, th
626 real, dimension(ims:ime, kms:kme, jms:jme), intent(inout) :: re_cloud, re_ice, re_snow
627 integer, intent(in) :: has_reqc, has_reqi, has_reqs
628 real, dimension(ims:ime, kms:kme, jms:jme), intent(in) :: pii, p, w, dz
629 real, dimension(ims:ime, jms:jme), intent(inout) :: rainnc, rainncv, sr
630 real, optional, dimension(ims:ime,jms:jme), intent(inout) :: frainnc, max_hail_diameter_column, max_hail_diameter_sfc
631 real, dimension(ims:ime, kms:kme, jms:jme), intent(inout) :: rainprod, evapprod
632 real, dimension(ims:ime, jms:jme), intent(in), optional :: ntc, muc
633 real, dimension(ims:ime, kms:kme, jms:jme), intent(inout), optional :: nc, nwfa, nifa, qb, ng
634 real, dimension(ims:ime, jms:jme), intent(in), optional :: nwfa2d, nifa2d
635 real, dimension(ims:ime, kms:kme, jms:jme), intent(inout), optional :: refl_10cm
636 real, dimension(ims:ime, kms:kme, jms:jme), intent(in), optional :: qcbl, cldfrac
637 real, dimension(ims:ime, jms:jme), intent(inout), optional :: snownc, snowncv, graupelnc, graupelncv
638 real, intent(in) :: dt_in
639 integer, intent(in) :: itimestep
640
641 ! Local (1d) variables
642 real, dimension(kts:kte) :: qv1d, qc1d, qi1d, qr1d, qs1d, qg1d, qb1d, ni1d, nr1d, nc1d, ng1d, &
643 nwfa1d, nifa1d, t1d, p1d, w1d, dz1d, rho, dbz, qcbl1d, cldfrac1d, qg_max_diam1d
644 real, dimension(kts:kte) :: re_qc1d, re_qi1d, re_qs1d
645 real, dimension(kts:kte):: rainprod1d, evapprod1d
646 double precision, dimension(kts:kte) :: ncbl1d
647 real, dimension(its:ite, jts:jte) :: pcp_ra, pcp_sn, pcp_gr, pcp_ic, frain
648 real :: dt, pptrain, pptsnow, pptgraul, pptice
649 real :: qc_max, qr_max, qs_max, qi_max, qg_max, ni_max, nr_max
650 real :: nwfa1
651 real :: ygra1, zans1
652 real :: graupel_vol
653 real :: tmprc, tmpnc, xDc
654 integer :: nu_c
655 logical, dimension(kts:kte) :: sgs_clouds
656 double precision :: lamg, lam_exp, lamr, n0_min, n0_exp, lamc
657 integer :: i, j, k
658 integer :: imax_qc, imax_qr, imax_qi, imax_qs, imax_qg, imax_ni, imax_nr
659 integer :: jmax_qc, jmax_qr, jmax_qi, jmax_qs, jmax_qg, jmax_ni, jmax_nr
660 integer :: kmax_qc, kmax_qr, kmax_qi, kmax_qs, kmax_qg, kmax_ni, kmax_nr
661 integer :: i_start, j_start, i_end, j_end
662 logical, optional, intent(in) :: diagflag
663 integer, optional, intent(in) :: do_radar_ref
664 character(len=132) :: message
665
666 !=================================================================================================================
667 i_start = its
668 j_start = jts
669 i_end = min(ite, ide-1)
670 j_end = min(jte, jde-1)
671 dt = dt_in
672
673 qc_max = 0.0
674 qr_max = 0.0
675 qs_max = 0.0
676 qi_max = 0.0
677 qg_max = 0.0
678 ni_max = 0.0
679 nr_max = 0.0
680 imax_qc = 0
681 imax_qr = 0
682 imax_qi = 0
683 imax_qs = 0
684 imax_qg = 0
685 imax_ni = 0
686 imax_nr = 0
687 jmax_qc = 0
688 jmax_qr = 0
689 jmax_qi = 0
690 jmax_qs = 0
691 jmax_qg = 0
692 jmax_ni = 0
693 jmax_nr = 0
694 kmax_qc = 0
695 kmax_qr = 0
696 kmax_qi = 0
697 kmax_qs = 0
698 kmax_qg = 0
699 kmax_ni = 0
700 kmax_nr = 0
701
702 !=================================================================================================================
703 j_loop: do j = j_start, j_end
704 i_loop: do i = i_start, i_end
705 pptrain = 0.0
706 pptsnow = 0.0
707 pptgraul = 0.0
708 pptice = 0.0
709 rainncv(i,j) = 0.0
710 if (present(snowncv)) then
711 snowncv(i,j) = 0.0
712 endif
713 if (present(graupelncv)) then
714 graupelncv(i,j) = 0.0
715 endif
716 sr(i,j) = 0.0
717
718 ! ntc and muc are defined in mpas submodule based on landmask
719 if (present(ntc)) then
720 nt_c = ntc(i,j)
721 mu_c = muc(i,j)
722 else
723 nt_c = nt_c_o
724 mu_c = 4
725 endif
726
727 !=================================================================================================================
728 ! Begin k loop
729 do k = kts, kte
730 t1d(k) = th(i,k,j) * pii(i,k,j)
731 p1d(k) = p(i,k,j)
732 w1d(k) = w(i,k,j)
733 dz1d(k) = dz(i,k,j)
734 qv1d(k) = qv(i,k,j)
735 qc1d(k) = qc(i,k,j)
736 qi1d(k) = qi(i,k,j)
737 qr1d(k) = qr(i,k,j)
738 qs1d(k) = qs(i,k,j)
739 qg1d(k) = qg(i,k,j)
740 ni1d(k) = ni(i,k,j)
741 nr1d(k) = nr(i,k,j)
742 rho(k) = roverrv * p1d(k) / (r * t1d(k) * (qv1d(k)+roverrv))
743
744 sgs_clouds(k) = .false.
745 if (present(qcbl) .and. present(cldfrac)) then
746 qcbl1d(k) = qcbl(i,k,j)
747 cldfrac1d(k) = cldfrac(i,k,j)
748 ncbl1d(k) = 0.
749 endif
750
751 ! nwfa, nifa, and nc are optional aerosol-aware variables
752 if (present(nwfa)) then
753 if (present(nwfa2d)) then
754 if (k == kts) then
755 nwfa(i,k,j) = nwfa(i,k,j) + nwfa2d(i,j) * dt
756 endif
757 endif
758 nwfa(i,k,j) = max(nwfa_default, min(aero_max, nwfa(i,k,j)))
759 nwfa1d(k) = nwfa(i,k,j)
760 else
761 nwfa1d(k) = nwfa_default / rho(k)
762 configs%aerosol_aware = .false.
763 endif
764
765 if (present(nifa)) then
766 nifa1d(k) = nifa(i,k,j)
767 else
768 nifa1d(k) = nifa_default / rho(k)
769 configs%aerosol_aware = .false.
770 endif
771
772 if (present(nc)) then
773 nc1d(k) = nc(i,k,j)
774 else
775 nc1d(k) = nt_c / rho(k)
776 configs%aerosol_aware = .false.
777 endif
778 enddo
779
780 ! ng and qb are optional hail-aware variables
781 if ((present(ng)) .and. (present(qb))) then
782 configs%hail_aware = .true.
783 do k = kts, kte
784 ng1d(k) = ng(i,k,j)
785 qb1d(k) = qb(i,k,j)
786 enddo
787 else
788 do k = kte, kts, -1
789 ! This is the one-moment graupel formulation
790 if (qg1d(k) > r1) then
791 ygra1 = log10(max(1.e-9, qg1d(k)*rho(k)))
792 zans1 = 3.0 + 2.0/7.0*(ygra1+8.0)
793 zans1 = max(2.0, min(zans1, 6.0))
794 n0_exp = 10.0**(zans1)
795 lam_exp = (n0_exp*am_g(idx_bg1)*cgg(1,1) / (rho(k)*qg1d(k)))**oge1
796 lamg = lam_exp * (cgg(3,1)*ogg2*ogg1)**obmg
797 ng1d(k) = cgg(2,1) * ogg3*rho(k) * qg1d(k) * lamg**bm_g / am_g(idx_bg1)
798 ng1d(k) = max(r2, (ng1d(k)/rho(k)))
799 qb1d(k) = qg1d(k) / rho_g(idx_bg1)
800 else
801 ng1d(k) = 0.
802 qb1d(k) = 0.
803 endif
804 enddo
805 endif
806
807 !if (itimestep == 1) then
808 ! call physics_message('--- tempo_3d_to_1d_driver() configuration...')
809 ! write(message, '(L1)') configs%hail_aware
810 ! call physics_message(' hail_aware_flag = ' // trim(message))
811 ! write(message, '(L1)') configs%aerosol_aware
812 ! call physics_message(' aerosol_aware_flag = ' // trim(message))
813 ! call physics_message('calling mp_tempo_main() at itimestep = 1')
814 !endif
815
816 !=================================================================================================================
817 ! Main call to the 1D microphysics
818 call mp_tempo_main(qv1d=qv1d, qc1d=qc1d, qi1d=qi1d, qr1d=qr1d, qs1d=qs1d, qg1d=qg1d, qb1d=qb1d, &
819 ni1d=ni1d, nr1d=nr1d, nc1d=nc1d, ng1d=ng1d, nwfa1d=nwfa1d, nifa1d=nifa1d, t1d=t1d, p1d=p1d, &
820 w1d=w1d, dzq=dz1d, pptrain=pptrain, pptsnow=pptsnow, pptgraul=pptgraul, pptice=pptice, &
821 rainprod=rainprod1d, evapprod=evapprod1d, kts=kts, kte=kte, dt=dt, ii=i, jj=j, configs=configs)
822
823 !=================================================================================================================
824 ! Compute diagnostics and return output to 3D
825 pcp_ra(i,j) = pptrain
826 pcp_sn(i,j) = pptsnow
827 pcp_gr(i,j) = pptgraul
828 pcp_ic(i,j) = pptice
829 rainncv(i,j) = pptrain + pptsnow + pptgraul + pptice
830 rainnc(i,j) = rainnc(i,j) + pptrain + pptsnow + pptgraul + pptice
831 if (present(snowncv) .and. present(snownc)) then
832 snowncv(i,j) = pptsnow + pptice
833 snownc(i,j) = snownc(i,j) + pptsnow + pptice
834 endif
835 if (present(graupelncv) .and. present(graupelnc)) then
836 graupelncv(i,j) = pptgraul
837 graupelnc(i,j) = graupelnc(i,j) + pptgraul
838 endif
839 if (present(frainnc)) then
840 frain(i,j) = 0.
841 if(t1d(1) <= 273.) then
842 frain(i,j) = pcp_ra(i,j)
843 endif
844 frainnc(i,j) = frainnc(i,j) + frain(i,j)
845 endif
846
847 sr(i,j) = (pptsnow + pptgraul + pptice) / (rainncv(i,j) + r1)
848
849 ! ng and qb are optional hail-aware variables
850 if ((present(ng)) .and. (present(qb))) then
851 do k = kts, kte
852 ng(i,k,j) = ng1d(k)
853 qb(i,k,j) = qb1d(k)
854 enddo
855 else
856 do k = kte, kts, -1
857 ! This is the one-moment graupel formulation
858 if (qg1d(k) > r1) then
859 rho(k) = roverrv * p1d(k) / (r * t1d(k) * (qv1d(k)+roverrv))
860 ygra1 = log10(max(1.e-9, qg1d(k)*rho(k)))
861 zans1 = 3.0 + 2.0/7.0*(ygra1+8.0)
862 zans1 = max(2.0, min(zans1, 6.0))
863 n0_exp = 10.0**(zans1)
864 lam_exp = (n0_exp*am_g(idx_bg1)*cgg(1,1) / (rho(k)*qg1d(k)))**oge1
865 lamg = lam_exp * (cgg(3,1)*ogg2*ogg1)**obmg
866 ng1d(k) = cgg(2,1) * ogg3*rho(k) * qg1d(k) * lamg**bm_g / am_g(idx_bg1)
867 ng1d(k) = max(r2, (ng1d(k)/rho(k)))
868 qb1d(k) = qg1d(k) / rho_g(idx_bg1)
869 else
870 ng1d(k) = 0.
871 qb1d(k) = 0.
872 endif
873 enddo
874 endif
875
876 do k = kts, kte
877 if (present(nc)) nc(i,k,j) = nc1d(k)
878 if (present(nwfa)) nwfa(i,k,j) = nwfa1d(k)
879 if (present(nifa)) nifa(i,k,j) = nifa1d(k)
880 qv(i,k,j) = qv1d(k)
881 qc(i,k,j) = qc1d(k)
882 qi(i,k,j) = qi1d(k)
883 qr(i,k,j) = qr1d(k)
884 qs(i,k,j) = qs1d(k)
885 qg(i,k,j) = qg1d(k)
886 ni(i,k,j) = ni1d(k)
887 nr(i,k,j) = nr1d(k)
888 th(i,k,j) = t1d(k) / pii(i,k,j)
889 rainprod(i,k,j) = rainprod1d(k)
890 evapprod(i,k,j) = evapprod1d(k)
891
892 if (present(qcbl) .and. present(cldfrac)) then
893 if ((qc1d(k) <= r1) .and. (qcbl1d(k) > 1.e-9) .and. (cldfrac1d(k) > 0.)) then
894 qc1d(k) = qc1d(k) + qcbl1d(k)/cldfrac1d(k) ! Uses in-cloud PBL mass
895 sgs_clouds(k) = .true.
896 else
897 sgs_clouds(k) = .false.
898 endif
899 else
900 sgs_clouds(k) = .false.
901 endif
902 enddo
903
904 if (any(sgs_clouds)) then
905 ! return array of ncbl1d
906 call predict_number_sub(kts, kte, qc1d, qr1d, qi1d, qs1d, p1d, t1d, w1d, &
907 ncbl1d, predict_nc=.true.)
908 do k = kts, kte
909 if (sgs_clouds(k)) then
910 nc1d(k) = nc1d(k) + real(ncbl1d(k))
911 rho(k) = roverrv * p1d(k) / (r * t1d(k) * (qv1d(k)+roverrv))
912 tmprc = qc1d(k)*rho(k)
913 tmpnc = max(2., min(nc1d(k)*rho(k), nt_c_max))
914 if (tmpnc.gt.10000.e6) then
915 nu_c = 2
916 elseif (tmpnc.lt.100.) then
917 nu_c = 15
918 else
919 nu_c = nint(nu_c_scale/tmpnc) + 2
920 nu_c = max(2, min(nu_c, 15))
921 endif
922 lamc = (tmpnc*am_r*ccg(2,nu_c)*ocg1(nu_c)/tmprc)**obmr
923 xdc = (bm_r + nu_c + 1.) / lamc
924 if (xdc .lt. d0c) then
925 lamc = cce(2,nu_c)/d0c
926 elseif (xdc.gt. d0r*2.) then
927 lamc = cce(2,nu_c)/(d0r*2.)
928 endif
929 tmpnc = min(real(nt_c_max, kind=dp), ccg(1,nu_c)*ocg2(nu_c)*tmprc / am_r*lamc**bm_r)
930 nc1d(k) = tmpnc/rho(k) ! Update nc1d for calc_effectRad
931 endif
932 enddo
933 endif
934 ! if (present(qcbl) .and. present(cldfrac)) then
935 ! if ((qc1d(k) <= R1) .and. (qcbl(i,k,j) > 1.e-9) .and. (cldfrac(i,k,j) > 0.)) then
936 ! qc1d(k) = qc1d(k) + qcbl(i,k,j)/cldfrac(i,k,j) ! Uses in-cloud PBL mass
937 ! ! ML prediction of number concentration (Don't add in qibl for now)
938 ! ! COULD BE DLOW FROM CALLING CALLING SUBROUTINE FOR EACH i,k,j
939 ! ncbl(k) = predict_number(qc1d(k), qr1d(k), qi1d(k), qs1d(k), &
940 ! p1d(k), t1d(k), w1d(k), predict_nc=.true.)
941 ! nc1d(k) = nc1d(k) + ncbl(k)
942 ! rho(k) = RoverRv * p1d(k) / (R * t1d(k) * (qv1d(k)+RoverRv))
943 ! tmprc = qc1d(k)*rho(k)
944 ! tmpnc = max(2., min(nc1d(k)*rho(k), nt_c_max))
945 ! if (tmpnc.gt.10000.e6) then
946 ! nu_c = 2
947 ! elseif (tmpnc.lt.100.) then
948 ! nu_c = 15
949 ! else
950 ! nu_c = nint(nu_c_scale/tmpnc) + 2
951 ! nu_c = max(2, min(nu_c, 15))
952 ! endif
953 ! lamc = (tmpnc*am_r*ccg(2,nu_c)*ocg1(nu_c)/tmprc)**obmr
954 ! xDc = (bm_r + nu_c + 1.) / lamc
955 ! if (xDc .lt. D0c) then
956 ! lamc = cce(2,nu_c)/D0c
957 ! elseif (xDc.gt. D0r*2.) then
958 ! lamc = cce(2,nu_c)/(D0r*2.)
959 ! endif
960 ! tmpnc = min(real(nt_c_max, kind=dp), ccg(1,nu_c)*ocg2(nu_c)*tmprc / am_r*lamc**bm_r)
961 ! nc1d(k) = tmpnc/rho(k) ! Update nc1d for calc_effectRad
962 ! endif
963 ! endif
964!!! K LOOP enddo
965
966 !=================================================================================================================
967 ! Reflectivity
968 call calc_refl10cm (qv1d=qv1d, qc1d=qc1d, qr1d=qr1d, nr1d=nr1d, qs1d=qs1d, qg1d=qg1d, ng1d=ng1d, qb1d=qb1d, &
969 t1d=t1d, p1d=p1d, dbz=dbz, kts=kts, kte=kte, ii=i, jj=j, configs=configs)
970 do k = kts, kte
971 refl_10cm(i,k,j) = max(-35.0_wp, dbz(k))
972 enddo
973
974 if ((present(max_hail_diameter_sfc)) .and. (present(max_hail_diameter_column))) then
975 ! Maximium hail size
976 call hail_size_diagnostics(kts=kts, kte=kte, qg1d=qg1d, ng1d=ng1d, qb1d=qb1d, t1d=t1d, p1d=p1d, qv1d=qv1d, &
977 qg_max_diam1d=qg_max_diam1d, configs=configs)
978
979 max_hail_diameter_sfc(i,j) = max(0.0_wp, qg_max_diam1d(kts))
980 max_hail_diameter_column(i,j) = max(0.0_wp, maxval(qg_max_diam1d))
981 endif
982
983 ! Cloud, ice, and snow effective radius
984 if (has_reqc /= 0 .and. has_reqi /= 0 .and. has_reqs /= 0) then
985 do k = kts, kte
986 re_qc1d(k) = 2.49e-6
987 re_qi1d(k) = 4.99e-6
988 re_qs1d(k) = 9.99e-6
989 enddo
990 call calc_effectrad (t1d=t1d, p1d=p1d, qv1d=qv1d, qc1d=qc1d, nc1d=nc1d, qi1d=qi1d, &
991 ni1d=ni1d, qs1d=qs1d, re_qc1d=re_qc1d, re_qi1d=re_qi1d, re_qs1d=re_qs1d, &
992 kts=kts, kte=kte, configs=configs)
993 do k = kts, kte
994 re_cloud(i,k,j) = max(2.49e-6, min(re_qc1d(k), 50.e-6))
995 re_ice(i,k,j) = max(4.99e-6, min(re_qi1d(k), 125.e-6))
996 re_snow(i,k,j) = max(9.99e-6, min(re_qs1d(k), 999.e-6))
997 enddo
998 endif
999
1000 enddo i_loop
1001 enddo j_loop
1002
1003 end subroutine tempo_3d_to_1d_driver
1004 !=================================================================================================================
1005
1006end module module_mp_tempo