44 integer,
private,
parameter :: QA_MP = 6
57 'Ratio of Water Vapor mass to total mass (Specific humidity)', &
58 'Ratio of Cloud Water mass to total mass ', &
59 'Ratio of Rain Water mass to total mass ', &
60 'Ratio of Cloud Ice mass ratio to total mass ', &
61 'Ratio of Snow miass ratio to total mass ', &
62 'Ratio of Graupel mass ratio to total mass '/)
75 private :: mp_tomita08
81 integer,
private,
parameter :: i_qv = 1
82 integer,
private,
parameter :: i_qc = 2
83 integer,
private,
parameter :: i_qr = 3
84 integer,
private,
parameter :: i_qi = 4
85 integer,
private,
parameter :: i_qs = 5
86 integer,
private,
parameter :: i_qg = 6
88 integer,
private,
parameter :: i_hyd_qc = 1
89 integer,
private,
parameter :: i_hyd_qr = 2
90 integer,
private,
parameter :: i_hyd_qi = 3
91 integer,
private,
parameter :: i_hyd_qs = 4
92 integer,
private,
parameter :: i_hyd_qg = 5
94 logical,
private :: do_couple_aerosol = .false.
95 logical,
private :: do_explicit_icegen = .false.
97 logical,
private :: fixed_re = .false.
98 logical,
private :: const_rec = .true.
99 logical,
private :: nofall_qr = .false.
100 logical,
private :: nofall_qi = .false.
101 logical,
private :: nofall_qs = .false.
102 logical,
private :: nofall_qg = .false.
105 real(
rp),
private,
parameter :: dens00 = 1.28_rp
108 real(
rp),
private :: n0r_def = 8.e+6_rp
109 real(
rp),
private :: n0s_def = 3.e+6_rp
110 real(
rp),
private :: n0g_def = 4.e+6_rp
113 real(
rp),
private :: dens_s = 100.0_rp
114 real(
rp),
private :: dens_g = 400.0_rp
117 real(
rp),
private :: drag_g = 0.6_rp
118 real(
rp),
private :: re_qc = 8.e-6_rp
119 real(
rp),
private :: re_qi = 40.e-6_rp
120 real(
rp),
private :: cr = 130.0_rp
121 real(
rp),
private :: cs = 4.84_rp
125 real(
rp),
private :: ar, as, ag
126 real(
rp),
private :: br, bs, bg
127 real(
rp),
private :: cg
128 real(
rp),
private :: dr, ds, dg
132 real(
rp),
private :: gam, gam_2, gam_3
134 real(
rp),
private :: gam_1br, gam_2br, gam_3br
135 real(
rp),
private :: gam_3dr
136 real(
rp),
private :: gam_6dr
137 real(
rp),
private :: gam_1brdr
138 real(
rp),
private :: gam_5dr_h
140 real(
rp),
private :: gam_1bs, gam_2bs, gam_3bs
141 real(
rp),
private :: gam_3ds
142 real(
rp),
private :: gam_1bsds
143 real(
rp),
private :: gam_5ds_h
145 real(
rp),
private :: gam_1bg, gam_3dg
146 real(
rp),
private :: gam_1bgdg
147 real(
rp),
private :: gam_5dg_h
151 real(
rp),
parameter :: bergeron_a1_tab(32) = (/ &
152 0.0001e-7_rp, 0.7939e-7_rp, 0.7841e-6_rp, 0.3369e-5_rp, 0.4336e-5_rp, &
153 0.5285e-5_rp, 0.3728e-5_rp, 0.1852e-5_rp, 0.2991e-6_rp, 0.4248e-6_rp, &
154 0.7434e-6_rp, 0.1812e-5_rp, 0.4394e-5_rp, 0.9145e-5_rp, 0.1725e-4_rp, &
155 0.3348e-4_rp, 0.1725e-4_rp, 0.9175e-5_rp, 0.4412e-5_rp, 0.2252e-5_rp, &
156 0.9115e-6_rp, 0.4876e-6_rp, 0.3473e-6_rp, 0.4758e-6_rp, 0.6306e-6_rp, &
157 0.8573e-6_rp, 0.7868e-6_rp, 0.7192e-6_rp, 0.6513e-6_rp, 0.5956e-6_rp, &
158 0.5333e-6_rp, 0.4834e-6_rp /)
159 real(
rp),
parameter :: bergeron_a2_tab(32) = (/ &
160 0.0100_rp, 0.4006_rp, 0.4831_rp, 0.5320_rp, 0.5307_rp, &
161 0.5319_rp, 0.5249_rp, 0.4888_rp, 0.3849_rp, 0.4047_rp, &
162 0.4318_rp, 0.4771_rp, 0.5183_rp, 0.5463_rp, 0.5651_rp, &
163 0.5813_rp, 0.5655_rp, 0.5478_rp, 0.5203_rp, 0.4906_rp, &
164 0.4447_rp, 0.4126_rp, 0.3960_rp, 0.4149_rp, 0.4320_rp, &
165 0.4506_rp, 0.4483_rp, 0.4460_rp, 0.4433_rp, 0.4413_rp, &
166 0.4382_rp, 0.4361_rp /)
167 real(
rp),
private :: temcc, fact
168 integer,
private :: itemc
171 logical,
private :: enable_kk2000 = .false.
175 logical,
private :: enable_rs2014 = .false.
176 real(
rp),
private,
parameter :: ln10 = log(10.0_rp)
177 real(
rp),
private,
parameter :: coef_a01 = 5.065339_rp
178 real(
rp),
private,
parameter :: coef_a02 = -0.062659_rp
179 real(
rp),
private,
parameter :: coef_a03 = -3.032362_rp
180 real(
rp),
private,
parameter :: coef_a04 = 0.029469_rp
181 real(
rp),
private,
parameter :: coef_a05 = -0.000285_rp
182 real(
rp),
private,
parameter :: coef_a06 = 0.31255_rp
183 real(
rp),
private,
parameter :: coef_a07 = 0.000204_rp
184 real(
rp),
private,
parameter :: coef_a08 = 0.003199_rp
185 real(
rp),
private,
parameter :: coef_a09 = 0.0_rp
186 real(
rp),
private,
parameter :: coef_a10 = -0.015952_rp
188 real(
rp),
private,
parameter :: coef_b01 = 0.476221_rp
189 real(
rp),
private,
parameter :: coef_b02 = -0.015896_rp
190 real(
rp),
private,
parameter :: coef_b03 = 0.165977_rp
191 real(
rp),
private,
parameter :: coef_b04 = 0.007468_rp
192 real(
rp),
private,
parameter :: coef_b05 = -0.000141_rp
193 real(
rp),
private,
parameter :: coef_b06 = 0.060366_rp
194 real(
rp),
private,
parameter :: coef_b07 = 0.000079_rp
195 real(
rp),
private,
parameter :: coef_b08 = 0.000594_rp
196 real(
rp),
private,
parameter :: coef_b09 = 0.0_rp
197 real(
rp),
private,
parameter :: coef_b10 = -0.003577_rp
201 logical,
private :: enable_wdxz2014 = .false.
205 logical,
private :: enable_hzdfhi2007 = .false.
206 character(len=12),
private :: cloud_type =
"synoptic"
207 real(
rp),
private :: coef_a0
208 real(
rp),
private :: coef_a1
209 real(
rp),
private :: coef_b0
210 real(
rp),
private :: coef_b1
214 logical,
private :: enable_trawlbg2017 = .false.
217 real(
rp),
private :: eiw = 1.0_rp
218 real(
rp),
private :: erw = 1.0_rp
219 real(
rp),
private :: esw = 1.0_rp
220 real(
rp),
private :: egw = 1.0_rp
221 real(
rp),
private :: eri = 1.0_rp
222 real(
rp),
private :: esi = 1.0_rp
223 real(
rp),
private :: egi = 0.1_rp
224 real(
rp),
private :: esr = 1.0_rp
225 real(
rp),
private :: egr = 1.0_rp
226 real(
rp),
private :: egs = 1.0_rp
227 real(
rp),
private :: gamma_sacr = 25.e-3_rp
228 real(
rp),
private :: gamma_gacs = 90.e-3_rp
229 real(
rp),
private :: mi = 4.19e-13_rp
232 real(
rp),
private,
parameter :: nc_lnd = 2000.0_rp
233 real(
rp),
private,
parameter :: nc_ocn = 50.0_rp
234 real(
rp),
private,
allocatable :: nc_def(:,:)
237 real(
rp),
private :: beta_saut = 6.e-3_rp
238 real(
rp),
private :: gamma_saut = 60.e-3_rp
239 real(
rp),
private :: beta_gaut = 0.0_rp
240 real(
rp),
private :: gamma_gaut = 90.e-3_rp
241 real(
rp),
private :: qicrt_saut = 0.0_rp
242 real(
rp),
private :: qscrt_gaut = 6.e-4_rp
245 real(
rp),
private,
parameter :: da0 = 2.428e-2_rp
246 real(
rp),
private,
parameter :: dda_dt = 7.47e-5_rp
247 real(
rp),
private,
parameter :: dw0 = 2.222e-5_rp
248 real(
rp),
private,
parameter :: ddw_dt = 1.37e-7_rp
249 real(
rp),
private,
parameter :: mu0 = 1.718e-5_rp
250 real(
rp),
private,
parameter :: dmu_dt = 5.28e-8_rp
252 real(
rp),
private,
parameter :: f1r = 0.78_rp
253 real(
rp),
private,
parameter :: f2r = 0.27_rp
254 real(
rp),
private,
parameter :: f1s = 0.65_rp
255 real(
rp),
private,
parameter :: f2s = 0.39_rp
256 real(
rp),
private,
parameter :: f1g = 0.78_rp
257 real(
rp),
private,
parameter :: f2g = 0.27_rp
260 real(
rp),
private,
parameter :: a_frz = 0.66_rp
261 real(
rp),
private,
parameter :: b_frz = 100.0_rp
264 real(
rp),
private,
parameter :: mi40 = 2.46e-10_rp
265 real(
rp),
private,
parameter :: mi50 = 4.80e-10_rp
266 real(
rp),
private,
parameter :: vti50 = 1.0_rp
267 real(
rp),
private,
parameter :: ri50 = 5.e-5_rp
270 logical,
private :: only_liquid = .false.
271 real(
rp),
private :: sw_expice = 0.0_rp
272 real(
rp),
private,
parameter :: nc_ihtr = 300.0_rp
273 real(
rp),
private,
parameter :: di_max = 500.e-6_rp
274 real(
rp),
private,
parameter :: di_a = 11.9_rp
277 real(
rp),
private :: ecoal_gi
278 real(
rp),
private :: ecoal_gs
279 real(
rp),
private :: flg_ecoali = 0.0_rp
280 real(
rp),
private :: flg_ecoals = 0.0_rp
282 integer,
private,
parameter :: w_nmax = 49
283 integer,
private,
parameter :: i_dqv_dt = 1
284 integer,
private,
parameter :: i_dqc_dt = 2
285 integer,
private,
parameter :: i_dqr_dt = 3
286 integer,
private,
parameter :: i_dqi_dt = 4
287 integer,
private,
parameter :: i_dqs_dt = 5
288 integer,
private,
parameter :: i_dqg_dt = 6
289 integer,
private,
parameter :: i_delta1 = 7
290 integer,
private,
parameter :: i_delta2 = 8
291 integer,
private,
parameter :: i_spsati = 9
292 integer,
private,
parameter :: i_iceflg = 10
293 integer,
private,
parameter :: i_rlmdr = 11
294 integer,
private,
parameter :: i_rlmds = 12
295 integer,
private,
parameter :: i_rlmdg = 13
296 integer,
private,
parameter :: i_piacr = 14
297 integer,
private,
parameter :: i_psacr = 15
298 integer,
private,
parameter :: i_praci = 16
299 integer,
private,
parameter :: i_pigen = 17
300 integer,
private,
parameter :: i_pidep = 18
301 integer,
private,
parameter :: i_psdep = 19
302 integer,
private,
parameter :: i_pgdep = 20
303 integer,
private,
parameter :: i_praut = 21
304 integer,
private,
parameter :: i_pracw = 22
305 integer,
private,
parameter :: i_pihom = 23
306 integer,
private,
parameter :: i_pihtr = 24
307 integer,
private,
parameter :: i_psacw = 25
308 integer,
private,
parameter :: i_psfw = 26
309 integer,
private,
parameter :: i_pgacw = 27
310 integer,
private,
parameter :: i_prevp = 28
311 integer,
private,
parameter :: i_piacr_s = 29
312 integer,
private,
parameter :: i_psacr_s = 30
313 integer,
private,
parameter :: i_piacr_g = 31
314 integer,
private,
parameter :: i_psacr_g = 32
315 integer,
private,
parameter :: i_pgacr = 33
316 integer,
private,
parameter :: i_pgfrz = 34
317 integer,
private,
parameter :: i_pisub = 35
318 integer,
private,
parameter :: i_pimlt = 36
319 integer,
private,
parameter :: i_psaut = 37
320 integer,
private,
parameter :: i_praci_s = 38
321 integer,
private,
parameter :: i_psaci = 39
322 integer,
private,
parameter :: i_psfi = 40
323 integer,
private,
parameter :: i_praci_g = 41
324 integer,
private,
parameter :: i_pgaci = 42
325 integer,
private,
parameter :: i_pssub = 43
326 integer,
private,
parameter :: i_psmlt = 44
327 integer,
private,
parameter :: i_pgaut = 45
328 integer,
private,
parameter :: i_pracs = 46
329 integer,
private,
parameter :: i_pgacs = 47
330 integer,
private,
parameter :: i_pgsub = 48
331 integer,
private,
parameter :: i_pgmlt = 49
333 character(len=H_SHORT),
private :: w_name(w_nmax)
335 data w_name /
'dqv_dt ', &
385 real(
rp),
private,
allocatable :: w3d(:,:,:,:)
386 integer,
private :: hist_id(w_nmax)
387 integer,
private :: hist_pcsat, hist_pisat
397 KA, KS, KE, IA, IS, IE, JA, JS, JE, &
412 integer,
intent(in) :: ka, ks, ke
413 integer,
intent(in) :: ia, is, ie
414 integer,
intent(in) :: ja, js, je
416 logical,
intent(in),
optional :: flg_lt
418 real(
rp) :: autoconv_nc = nc_ocn
420 namelist / param_atmos_phy_mp_tomita08 / &
422 do_explicit_icegen, &
429 enable_trawlbg2017, &
468 real(
rp),
parameter :: max_term_vel = 10.0_rp
477 log_info(
"ATMOS_PHY_MP_tomita08_setup",*)
'Setup'
478 log_info(
"ATMOS_PHY_MP_tomita08_setup",*)
'Tomita (2008) 1-moment bulk 6 category'
480 allocate( w3d(ka,ia,ja,w_nmax) )
481 w3d(:,:,:,:) = 0.0_rp
483 allocate( nc_def(ia,ja) )
490 read(
io_fid_conf,nml=param_atmos_phy_mp_tomita08,iostat=ierr)
492 log_info(
"ATMOS_PHY_MP_tomita08_setup",*)
'Not found namelist. Default used.'
493 elseif( ierr > 0 )
then
494 log_error(
"ATMOS_PHY_MP_tomita08_setup",*)
'Not appropriate names in namelist PARAM_ATMOS_PHY_MP_TOMITA08. Check!'
497 log_nml(param_atmos_phy_mp_tomita08)
500 log_info(
"ATMOS_PHY_MP_tomita08_setup",*)
'density of the snow [kg/m3] : ', dens_s
501 log_info(
"ATMOS_PHY_MP_tomita08_setup",*)
'density of the graupel [kg/m3] : ', dens_g
502 log_info(
"ATMOS_PHY_MP_tomita08_setup",*)
'Nc for auto-conversion [num/m3]: ', autoconv_nc
503 log_info(
"ATMOS_PHY_MP_tomita08_setup",*)
'Use k-k scheme? : ', enable_kk2000
504 log_info(
"ATMOS_PHY_MP_tomita08_setup",*)
'Use Roh scheme? : ', enable_rs2014
505 log_info(
"ATMOS_PHY_MP_tomita08_setup",*)
'Use WDXZ scheme? : ', enable_wdxz2014
506 log_info(
"ATMOS_PHY_MP_tomita08_setup",*)
'Use HZDFHI scheme? : ', enable_hzdfhi2007
507 log_info(
"ATMOS_PHY_MP_tomita08_setup",*)
'Use TRAWLBG scheme? : ', enable_trawlbg2017
509 log_info(
"ATMOS_PHY_MP_tomita08_setup",*)
'Use effective radius of ice for snow and graupel,'
510 log_info(
"ATMOS_PHY_MP_tomita08_setup",*)
' and set rain transparent? : ', fixed_re
511 log_info(
"ATMOS_PHY_MP_tomita08_setup",*)
'Density of the ice is used for the calculation of '
512 log_info(
"ATMOS_PHY_MP_tomita08_setup",*)
' optically effective volume of snow and graupel.'
513 log_info(
"ATMOS_PHY_MP_tomita08_setup",*)
'Surpress sedimentation of rain? : ', nofall_qr
514 log_info(
"ATMOS_PHY_MP_tomita08_setup",*)
'Surpress sedimentation of ice? : ', nofall_qi
515 log_info(
"ATMOS_PHY_MP_tomita08_setup",*)
'Surpress sedimentation of snow? : ', nofall_qs
516 log_info(
"ATMOS_PHY_MP_tomita08_setup",*)
'Surpress sedimentation of graupel? : ', nofall_qg
517 log_info(
"ATMOS_PHY_MP_tomita08_setup",*)
'Enable explicit ice generation? : ', do_explicit_icegen
522 nc_def(i,j) = autoconv_nc
527 ar = pi * dens_w / 6.0_rp
528 as = pi * dens_s / 6.0_rp
529 ag = pi * dens_g / 6.0_rp
535 cg = sqrt( ( 4.0_rp * dens_g * grav ) / ( 3.0_rp * dens00 * drag_g ) )
541 if ( enable_rs2014 )
then
542 do_explicit_icegen = .true.
552 if ( enable_hzdfhi2007 )
then
553 select case( cloud_type )
559 case (
"crystal_face")
563 coef_b1 = -0.0024539_rp
565 log_error(
"ATMOS_PHY_MP_tomita08_setup",*)
'cloud_type is invalid: ', trim(cloud_type)
570 if ( do_explicit_icegen )
then
574 only_liquid = .false.
587 gam_1brdr =
sf_gamma( 1.0_rp + br + dr )
588 gam_5dr_h =
sf_gamma( 0.5_rp * (5.0_rp+dr) )
594 gam_1bsds =
sf_gamma( 1.0_rp + bs + ds )
595 gam_5ds_h =
sf_gamma( 0.5_rp * (5.0_rp+ds) )
599 gam_1bgdg =
sf_gamma( 1.0_rp + bg + dg)
600 gam_5dg_h =
sf_gamma( 0.5_rp * (5.0_rp+dg) )
604 call file_history_reg( w_name(ip),
'individual tendency term in tomita08',
'kg/kg/s', &
607 call file_history_reg(
'Pcsat',
'QC production term by satulation adjustment',
'kg/kg/s', hist_pcsat )
608 call file_history_reg(
'Pisat',
'QI production term by satulation adjustment',
'kg/kg/s', hist_pisat )
611 if(
present(flg_lt) )
then
617 if( enable_rs2014 )
then
618 write(*,*)
'xxx ROH and Satoh (2014) scheme is not supported for Lightning'
622 if( ecoal_gi == 0.0_rp )
then
628 if( ecoal_gs == 0.0_rp )
then
675 real(
rp),
intent(in),
optional :: in_drag_g
676 real(
rp),
intent(in),
optional :: in_re_qc
677 real(
rp),
intent(in),
optional :: in_re_qi
678 real(
rp),
intent(in),
optional :: in_cr
679 real(
rp),
intent(in),
optional :: in_cs
682 if(
present(in_drag_g) ) drag_g = in_drag_g
683 if(
present(in_re_qc ) ) re_qc = in_re_qc
684 if(
present(in_re_qi ) ) re_qi = in_re_qi
685 if(
present(in_cr ) ) cr = in_cr
686 if(
present(in_cs ) ) cs = in_cs
688 if(
present(in_drag_g) )
then
689 cg = sqrt( ( 4.0_rp * dens_g * grav ) / ( 3.0_rp * dens00 * drag_g ) )
705 real(
rp),
intent(out),
optional :: out_drag_g
706 real(
rp),
intent(out),
optional :: out_re_qc
707 real(
rp),
intent(out),
optional :: out_re_qi
708 real(
rp),
intent(out),
optional :: out_cr
709 real(
rp),
intent(out),
optional :: out_cs
712 if(
present(out_drag_g) ) out_drag_g = drag_g
713 if(
present(out_re_qc ) ) out_re_qc = re_qc
714 if(
present(out_re_qi ) ) out_re_qi = re_qi
715 if(
present(out_cr ) ) out_cr = cr
716 if(
present(out_cs ) ) out_cs = cs
726 KA, KS, KE, IA, IS, IE, JA, JS, JE, &
730 TEMP, QTRC, CPtot, CVtot, &
732 flg_lt, d0_crg, v0_crg, &
734 QSPLT_in, Sarea, QTRC_crg )
739 file_history_query, &
742 mp_saturation_adjustment => atmos_phy_mp_saturation_adjustment
744 integer,
intent(in) :: ka, ks, ke
745 integer,
intent(in) :: ia, is, ie
746 integer,
intent(in) :: ja, js, je
748 real(
rp),
intent(in) :: dens (ka,ia,ja)
749 real(
rp),
intent(in) :: pres (ka,ia,ja)
750 real(
rp),
intent(in) :: ccn (ka,ia,ja)
751 real(
dp),
intent(in) :: dt
753 real(
rp),
intent(inout) :: temp(ka,ia,ja)
754 real(
rp),
intent(inout) :: qtrc(ka,ia,ja,qa_mp)
755 real(
rp),
intent(inout) :: cptot(ka,ia,ja)
756 real(
rp),
intent(inout) :: cvtot(ka,ia,ja)
758 real(
rp),
intent(out) :: rhoe_t (ka,ia,ja)
759 real(
rp),
intent(out) :: evaporate(ka,ia,ja)
762 logical,
intent(in),
optional :: flg_lt
763 real(
rp),
intent(in),
optional :: d0_crg, v0_crg
764 real(
rp),
intent(in),
optional :: dqcrg(ka,ia,ja)
765 real(
rp),
intent(in),
optional :: beta_crg(ka,ia,ja)
766 real(
rp),
intent(out),
optional :: sarea(ka,ia,ja,qa_mp-1)
767 real(
rp),
intent(out),
optional :: qsplt_in(ka,ia,ja,3)
768 real(
rp),
intent(inout),
optional :: qtrc_crg(ka,ia,ja,qa_mp-1)
770 real(
rp) :: rhoe_d_sat(ka,ia,ja)
772 real(
rp) :: qc_t_sat(ka,ia,ja)
773 real(
rp) :: qi_t_sat(ka,ia,ja)
779 log_progress(*)
'atmosphere / physics / microphysics / Tomita08'
790 ka, ks, ke, ia, is, ie, ja, js, je, &
791 dens(:,:,:), pres(:,:,:), ccn(:,:,:), &
793 temp(:,:,:), qtrc(:,:,:,:), &
794 cptot(:,:,:), cvtot(:,:,:), &
796 flg_lt, d0_crg, v0_crg, &
797 dqcrg(:,:,:), beta_crg(:,:,:), &
808 qc_t_sat(k,i,j) = qtrc(k,i,j,i_qc)
809 qi_t_sat(k,i,j) = qtrc(k,i,j,i_qi)
815 call mp_saturation_adjustment( &
816 ka, ks, ke, ia, is, ie, ja, js, je, &
821 qtrc(:,:,:,i_qc), qtrc(:,:,:,i_qi), &
822 cptot(:,:,:), cvtot(:,:,:), &
830 rhoe_t(k,i,j) = rhoe_t(k,i,j) + rhoe_d_sat(k,i,j) / dt
841 qc_t_sat(k,i,j) = ( qtrc(k,i,j,i_qc) - qc_t_sat(k,i,j) ) / dt
842 evaporate(k,i,j) = max( -qc_t_sat(k,i,j), 0.0_rp ) &
843 * dens(k,i,j) / (4.0_rp/3.0_rp*pi*dwatr*re_qc**3)
850 call file_history_query( hist_pcsat, hist_flag )
851 if ( hist_flag )
then
852 call file_history_put( hist_pcsat, qc_t_sat(:,:,:) )
856 call file_history_query( hist_pisat, hist_flag )
857 if ( hist_flag )
then
863 qi_t_sat(k,i,j) = ( qtrc(k,i,j,i_qi) - qi_t_sat(k,i,j) ) / dt
868 call file_history_put( hist_pisat, qi_t_sat(:,:,:) )
881 subroutine mp_tomita08( &
882 KA, KS, KE, IA, IS, IE, JA, JS, JE, &
909 file_history_query, &
923 saturation_dens2qsat_liq => atmos_saturation_dens2qsat_liq, &
924 saturation_dens2qsat_ice => atmos_saturation_dens2qsat_ice
926 integer,
intent(in) :: ka, ks, ke
927 integer,
intent(in) :: ia, is, ie
928 integer,
intent(in) :: ja, js, je
930 real(
rp),
intent(in) :: dens(ka,ia,ja)
931 real(
rp),
intent(in) :: pres(ka,ia,ja)
932 real(
rp),
intent(in) :: ccn (ka,ia,ja)
933 real(
dp),
intent(in) :: dt
935 real(
rp),
intent(inout) :: temp (ka,ia,ja)
936 real(
rp),
intent(inout) :: qtrc (ka,ia,ja,qa_mp)
937 real(
rp),
intent(inout) :: cptot0(ka,ia,ja)
938 real(
rp),
intent(inout) :: cvtot0(ka,ia,ja)
940 real(
rp),
intent(out) :: rhoe_t(ka,ia,ja)
942 logical,
intent(in),
optional :: flg_lt
943 real(
rp),
intent(in),
optional :: d0_crg, v0_crg
944 real(
rp),
intent(in),
optional :: dqcrg(ka,ia,ja)
945 real(
rp),
intent(in),
optional :: beta_crg(ka,ia,ja)
946 real(
rp),
intent(out),
optional :: qsplt_in(ka,ia,ja,3)
947 real(
rp),
intent(out),
optional :: sarea(ka,ia,ja,qa_mp-1)
948 real(
rp),
intent(inout),
optional :: qtrc_crg0(ka,ia,ja,qa_mp-1)
950 real(
rp) :: cvtot(ks:ke)
951 real(
rp) :: qv(ks:ke), qc(ks:ke), qr(ks:ke), qi(ks:ke), qs(ks:ke), qg(ks:ke)
952 real(
rp) :: qv_t(ks:ke), qc_t(ks:ke), qr_t(ks:ke), qi_t(ks:ke), qs_t(ks:ke), qg_t(ks:ke)
953 real(
rp) :: e_t, cp_t, cv_t
955 real(
rp) :: qsatl(ka)
956 real(
rp) :: qsati(ka)
958 real(
rp) :: sliq(ks:ke)
959 real(
rp) :: sice(ks:ke)
961 real(
rp) :: rho_fact(ks:ke)
962 real(
rp) :: temc(ks:ke)
964 real(
rp) :: n0r(ks:ke), n0s(ks:ke), n0g(ks:ke)
966 real(
rp) :: rlmdr(ks:ke), rlmdr_2(ks:ke), rlmdr_3(ks:ke)
967 real(
rp) :: rlmds, rlmds_2, rlmds_3
968 real(
rp) :: rlmdg(ks:ke), rlmdg_2(ks:ke), rlmdg_3(ks:ke)
969 real(
rp) :: rlmdr_1br(ks:ke), rlmdr_2br(ks:ke), rlmdr_3br(ks:ke)
970 real(
rp) :: rlmds_1bs, rlmds_2bs, rlmds_3bs
971 real(
rp) :: rlmdr_dr(ks:ke), rlmdr_3dr(ks:ke), rlmdr_5dr(ks:ke)
972 real(
rp) :: rlmds_ds, rlmds_3ds, rlmds_5ds
973 real(
rp) :: rlmdg_dg(ks:ke), rlmdg_3dg(ks:ke), rlmdg_5dg(ks:ke)
974 real(
rp) :: rlmdr_7(ks:ke)
975 real(
rp) :: rlmdr_6dr(ks:ke)
978 real(
rp) :: tems, xs2
979 real(
rp) :: moms_0(ks:ke), moms_1(ks:ke), moms_2(ks:ke)
980 real(
rp) :: moms_0bs(ks:ke), moms_1bs(ks:ke), moms_2bs(ks:ke)
981 real(
rp) :: moms_2ds(ks:ke), moms_5ds_h(ks:ke), rmoms_vt(ks:ke)
982 real(
rp) :: coef_at(4), coef_bt(4)
983 real(
rp) :: loga_, b_, nm
985 real(
rp) :: vti(ks:ke), vtr(ks:ke), vts(ks:ke), vtg(ks:ke)
986 real(
rp) :: esi_mod, egs_mod(ka)
988 real(
rp) :: nc(ks:ke)
989 real(
rp) :: pracw_orig, pracw_kk
990 real(
rp) :: praut_berry, praut_kk
992 real(
rp) :: betai, betas
995 real(
rp) :: nu(ks:ke)
996 real(
rp) :: glv(ks:ke), giv(ks:ke), gil(ks:ke)
997 real(
rp) :: ventr, vents, ventg
998 real(
rp) :: net, fac, fack(ka), fac_sw
999 real(
rp) :: zerosw, tmp
1002 real(
rp) :: sw_bergeron(ks:ke)
1009 real(
rp) :: sw, rhoqi, xni, xmi, di, nig, qig
1011 logical :: hist_sw(w_nmax), hist_flag
1012 real(
rp) :: w(ks:ke,w_nmax)
1014 integer :: k, i, j, ip
1017 integer,
parameter :: i_qgaci = 1
1018 integer,
parameter :: i_qgacs = 2
1019 real(
rp) :: qcrg_c(ks:ke), qcrg_r(ks:ke)
1020 real(
rp) :: qcrg_i(ks:ke), qcrg_s(ks:ke), qcrg_g(ks:ke)
1021 real(
rp) :: w_q(ks:ke,w_nmax)
1022 real(
rp) :: w_qcrg(ks:ke,2)
1023 real(
rp) :: rdens_r, rdens_i, rdens_s, rdens_g
1024 real(
rp) :: dcrg(ks:ke), beta1_crg(ks:ke), re_qs(ks:ke)
1025 real(
rp) :: re(ka,ia,ja,
n_hyd)
1027 real(
rp) :: facq_qc, facq_qr, facq_qi, facq_qs, facq_qg
1029 integer :: pp, qq, iq
1030 real(
rp) :: qc_crg_t(ks:ke), qr_crg_t(ks:ke), qi_crg_t(ks:ke), qs_crg_t(ks:ke), qg_crg_t(ks:ke)
1031 real(
rp) :: rlambda(i_qc:i_qg)
1041 rdens_i = 1.0_rp / dice
1042 rdens_g = 1.0_rp / dens_g
1043 rdens_r = 1.0_rp / dwatr
1044 rdens_s = 1.0_rp / dens_s
1045 if (
present(flg_lt) )
then
1060 qsplt_in(:,:,:,:) = 0.0_rp
1065 ka, ks, ke, ia, is, ie, ja, js, je, &
1080 call file_history_query( hist_id(ip), hist_sw(ip) )
1081 hist_flag = hist_flag .or. hist_sw(ip)
1129 if ( do_couple_aerosol )
then
1131 nc(k) = max( ccn(k,i,j)*1.e-6_rp, nc_def(i,j) )
1140 call saturation_dens2qsat_liq( ka, ks, ke, &
1141 temp(:,i,j), dens(:,i,j), &
1144 call saturation_dens2qsat_ice( ka, ks, ke, &
1145 temp(:,i,j), dens(:,i,j), &
1150 qv(k) = max( qtrc(k,i,j,i_qv), 0.0_rp )
1153 qc(k) = max( qtrc(k,i,j,i_qc), 0.0_rp )
1156 qr(k) = max( qtrc(k,i,j,i_qr), 0.0_rp )
1159 qi(k) = max( qtrc(k,i,j,i_qi), 0.0_rp )
1162 qs(k) = max( qtrc(k,i,j,i_qs), 0.0_rp )
1165 qg(k) = max( qtrc(k,i,j,i_qg), 0.0_rp )
1168 if ( flg_lt_l )
then
1171 qcrg_c(k) = qtrc_crg0(k,i,j,i_qc-1)
1174 qcrg_r(k) = qtrc_crg0(k,i,j,i_qr-1)
1177 qcrg_i(k) = qtrc_crg0(k,i,j,i_qi-1)
1180 qcrg_s(k) = qtrc_crg0(k,i,j,i_qs-1)
1183 qcrg_g(k) = qtrc_crg0(k,i,j,i_qg-1)
1186 re_qs(k) = re(k,i,j,
i_hs) * 1.0e-2_rp
1189 beta1_crg(k) = beta_crg(k,i,j)
1190 dcrg(k) = - dqcrg(k,i,j)
1196 sliq(k) = qv(k) / max( qsatl(k), eps )
1197 sice(k) = qv(k) / max( qsati(k), eps )
1199 rho_fact(k) = sqrt( dens00 / dens(k,i,j) )
1200 temc(k) = temp(k,i,j) - tem00
1204 w(k,i_delta1) = ( 0.5_rp + sign(0.5_rp, qr(k) - 1.e-4_rp ) )
1206 w(k,i_delta2) = ( 0.5_rp + sign(0.5_rp, 1.e-4_rp - qr(k) ) ) &
1207 * ( 0.5_rp + sign(0.5_rp, 1.e-4_rp - qs(k) ) )
1209 w(k,i_spsati) = 0.5_rp + sign(0.5_rp, sice(k) - 1.0_rp )
1211 w(k,i_iceflg) = 0.5_rp - sign( 0.5_rp, temc(k) )
1215 w(k,i_dqv_dt) = qv(k) / dt
1216 w(k,i_dqc_dt) = qc(k) / dt
1217 w(k,i_dqr_dt) = qr(k) / dt
1218 w(k,i_dqi_dt) = qi(k) / dt
1219 w(k,i_dqs_dt) = qs(k) / dt
1220 w(k,i_dqg_dt) = qg(k) / dt
1224 sw_bergeron(k) = ( 0.5_rp + sign(0.5_rp, temc(k) + 30.0_rp ) ) &
1225 * ( 0.5_rp + sign(0.5_rp, 0.0_rp - temc(k) ) ) &
1226 * ( 1.0_rp - sw_expice )
1230 if ( enable_wdxz2014 )
then
1232 n0r(k) = 1.16e+5_rp * exp( log( max( dens(k,i,j)*qr(k)*1000.0_rp, 1.e-2_rp ) )*0.477_rp )
1233 n0s(k) = 4.58e+9_rp * exp( log( max( dens(k,i,j)*qs(k)*1000.0_rp, 1.e-2_rp ) )*0.788_rp )
1234 n0g(k) = 9.74e+8_rp * exp( log( max( dens(k,i,j)*qg(k)*1000.0_rp, 1.e-2_rp ) )*0.816_rp )
1246 zerosw = 0.5_rp - sign(0.5_rp, qr(k) - 1.e-12_rp )
1247 rlmdr(k) = sqrt(sqrt( dens(k,i,j) * qr(k) / ( ar * n0r(k) * gam_1br ) + zerosw )) * ( 1.0_rp-zerosw )
1249 rlmdr_dr(k) = sqrt( rlmdr(k) )
1250 rlmdr_2(k) = rlmdr(k)**2
1251 rlmdr_3(k) = rlmdr(k)**3
1252 rlmdr_7(k) = rlmdr(k)**7
1253 rlmdr_1br(k) = rlmdr(k)**4
1254 rlmdr_2br(k) = rlmdr(k)**5
1255 rlmdr_3br(k) = rlmdr(k)**6
1256 rlmdr_3dr(k) = rlmdr(k)**3 * rlmdr_dr(k)
1257 rlmdr_5dr(k) = rlmdr(k)**5 * rlmdr_dr(k)
1258 rlmdr_6dr(k) = rlmdr(k)**6 * rlmdr_dr(k)
1260 w(k,i_rlmdr) = rlmdr(k)
1264 if ( enable_rs2014 )
then
1269 zerosw = 0.5_rp - sign(0.5_rp, dens(k,i,j) * qs(k) - 1.e-12_rp )
1271 xs2 = dens(k,i,j) * qs(k) / as
1272 tems = min( -0.1_rp, temc(k) )
1273 coef_at(1) = coef_a01 + tems * ( coef_a02 + tems * ( coef_a05 + tems * coef_a09 ) )
1274 coef_at(2) = coef_a03 + tems * ( coef_a04 + tems * coef_a07 )
1275 coef_at(3) = coef_a06 + tems * coef_a08
1276 coef_at(4) = coef_a10
1277 coef_bt(1) = coef_b01 + tems * ( coef_b02 + tems * ( coef_b05 + tems * coef_b09 ) )
1278 coef_bt(2) = coef_b03 + tems * ( coef_b04 + tems * coef_b07 )
1279 coef_bt(3) = coef_b06 + tems * coef_b08
1280 coef_bt(4) = coef_b10
1284 moms_0(k) = exp(ln10*loga_) * exp(log(xs2+zerosw)*b_) * ( 1.0_rp-zerosw )
1287 loga_ = coef_at(1) + nm * ( coef_at(2) + nm * ( coef_at(3) + nm * coef_at(4) ) )
1288 b_ = coef_bt(1) + nm * ( coef_bt(2) + nm * ( coef_bt(3) + nm * coef_bt(4) ) )
1289 moms_1(k) = exp(ln10*loga_) * exp(log(xs2+zerosw)*b_) * ( 1.0_rp-zerosw )
1294 loga_ = coef_at(1) + nm * ( coef_at(2) + nm * ( coef_at(3) + nm * coef_at(4) ) )
1295 b_ = coef_bt(1) + nm * ( coef_bt(2) + nm * ( coef_bt(3) + nm * coef_bt(4) ) )
1296 moms_0bs(k) = exp(ln10*loga_) * exp(log(xs2+zerosw)*b_) * ( 1.0_rp-zerosw )
1299 loga_ = coef_at(1) + nm * ( coef_at(2) + nm * ( coef_at(3) + nm * coef_at(4) ) )
1300 b_ = coef_bt(1) + nm * ( coef_bt(2) + nm * ( coef_bt(3) + nm * coef_bt(4) ) )
1301 moms_1bs(k) = exp(ln10*loga_) * exp(log(xs2+zerosw)*b_) * ( 1.0_rp-zerosw )
1304 loga_ = coef_at(1) + nm * ( coef_at(2) + nm * ( coef_at(3) + nm * coef_at(4) ) )
1305 b_ = coef_bt(1) + nm * ( coef_bt(2) + nm * ( coef_bt(3) + nm * coef_bt(4) ) )
1306 moms_2bs(k) = exp(ln10*loga_) * exp(log(xs2+zerosw)*b_) * ( 1.0_rp-zerosw )
1309 loga_ = coef_at(1) + nm * ( coef_at(2) + nm * ( coef_at(3) + nm * coef_at(4) ) )
1310 b_ = coef_bt(1) + nm * ( coef_bt(2) + nm * ( coef_bt(3) + nm * coef_bt(4) ) )
1311 moms_2ds(k) = exp(ln10*loga_) * exp(log(xs2+zerosw)*b_) * ( 1.0_rp-zerosw )
1314 loga_ = coef_at(1) + nm * ( coef_at(2) + nm * ( coef_at(3) + nm * coef_at(4) ) )
1315 b_ = coef_bt(1) + nm * ( coef_bt(2) + nm * ( coef_bt(3) + nm * coef_bt(4) ) )
1316 moms_5ds_h(k) = exp(ln10*loga_) * exp(log(xs2+zerosw)*b_) * ( 1.0_rp-zerosw )
1319 loga_ = coef_at(1) + nm * ( coef_at(2) + nm * ( coef_at(3) + nm * coef_at(4) ) )
1320 b_ = coef_bt(1) + nm * ( coef_bt(2) + nm * ( coef_bt(3) + nm * coef_bt(4) ) )
1321 rmoms_vt(k) = exp(ln10*loga_) * exp(log(xs2+zerosw)*b_) * ( 1.0_rp-zerosw ) / ( moms_0bs(k) + zerosw )
1323 w(k,i_rlmds) = undef
1327 zerosw = 0.5_rp - sign(0.5_rp, dens(k,i,j) * qs(k) - 1.e-12_rp )
1329 rlmds = sqrt(sqrt( dens(k,i,j) * qs(k) / ( as * n0s(k) * gam_1bs ) + zerosw )) * ( 1.0_rp-zerosw )
1330 rlmds_ds = sqrt( sqrt(rlmds) )
1332 rlmds_3 = rlmds_2 * rlmds
1333 rlmds_1bs = rlmds_2 * rlmds_2
1334 rlmds_2bs = rlmds_3 * rlmds_2
1335 rlmds_3bs = rlmds_3 * rlmds_3
1336 rlmds_3ds = rlmds_3 * rlmds_ds
1337 rlmds_5ds = rlmds_2 * rlmds_3ds
1339 moms_0(k) = n0s(k) * gam * rlmds
1340 moms_1(k) = n0s(k) * gam_2 * rlmds_2
1341 moms_2(k) = n0s(k) * gam_3 * rlmds_3
1342 moms_0bs(k) = n0s(k) * gam_1bs * rlmds_1bs
1343 moms_1bs(k) = n0s(k) * gam_2bs * rlmds_2bs
1344 moms_2bs(k) = n0s(k) * gam_3bs * rlmds_3bs
1345 moms_2ds(k) = n0s(k) * gam_3ds * rlmds_3ds
1346 moms_5ds_h(k) = n0s(k) * gam_5ds_h * sqrt(rlmds_5ds)
1347 rmoms_vt(k) = gam_1bsds / gam_1bs * rlmds_ds
1349 w(k,i_rlmds) = rlmds
1355 zerosw = 0.5_rp - sign(0.5_rp, qg(k) - 1.e-12_rp )
1356 rlmdg(k) = sqrt(sqrt( dens(k,i,j) * qg(k) / ( ag * n0g(k) * gam_1bg ) + zerosw )) * ( 1.0_rp-zerosw )
1358 rlmdg_dg(k) = sqrt( rlmdg(k) )
1359 rlmdg_2(k) = rlmdg(k)**2
1360 rlmdg_3(k) = rlmdg(k) * rlmdg_2(k)
1361 rlmdg_3dg(k) = rlmdg_3(k) * rlmdg_dg(k)
1362 rlmdg_5dg(k) = rlmdg_2(k) * rlmdg_3dg(k)
1364 w(k,i_rlmdg) = rlmdg(k)
1368 if ( enable_hzdfhi2007 )
then
1370 zerosw = 0.5_rp - sign(0.5_rp, qi(k) - 1.e-8_rp )
1371 vti(k) = min( 0.0_rp, &
1372 - ( coef_a0 + coef_a1 * temc(k) ) &
1373 * exp( log( dens(k,i,j)*qi(k)*1000.0_rp+zerosw ) * ( coef_b0 + coef_b1 * temc(k) ) ) &
1374 * 1e-2_rp * ( 1.0_rp-zerosw ) )
1378 zerosw = 0.5_rp - sign(0.5_rp, qi(k) - 1.e-8_rp )
1379 vti(k) = -3.29_rp * exp( log( dens(k,i,j)*qi(k)+zerosw )*0.16_rp ) * ( 1.0_rp-zerosw )
1384 vtr(k) = -cr * rho_fact(k) * gam_1brdr / gam_1br * rlmdr_dr(k)
1385 vts(k) = -cs * rho_fact(k) * rmoms_vt(k)
1386 vtg(k) = -cg * rho_fact(k) * gam_1bgdg / gam_1bg * rlmdg_dg(k)
1393 nig = max( exp(-0.1_rp*temc(k)), 1.0_rp ) * 1000.0_rp
1394 qig = 4.92e-11_rp * exp(log(nig)*1.33_rp) / dens(k,i,j)
1395 w(k,i_pigen) = max( min( qig-qi(k), qv(k)-qsati(k) ), 0.0_rp ) / dt
1402 if ( enable_kk2000 )
then
1404 zerosw = 0.5_rp - sign(0.5_rp, qc(k)*qr(k) - 1.e-12_rp )
1405 pracw_kk = 67.0_rp * exp( log( qc(k)*qr(k)+zerosw )*1.15_rp ) * ( 1.0_rp-zerosw )
1406 w(k,i_pracw) = pracw_kk
1410 pracw_orig = qc(k) * 0.25_rp * pi * erw * n0r(k) * cr * gam_3dr * rlmdr_3dr(k) * rho_fact(k)
1411 w(k,i_pracw) = pracw_orig
1417 w(k,i_psacw) = qc(k) * 0.25_rp * pi * esw * cs * moms_2ds(k) * rho_fact(k)
1419 w(k,i_pgacw) = qc(k) * 0.25_rp * pi * egw * n0g(k) * cg * gam_3dg * rlmdg_3dg(k) * rho_fact(k)
1423 esi_mod = min( esi, esi * exp( gamma_sacr * temc(k) ) )
1425 w(k,i_praci) = qi(k) * 0.25_rp * pi * eri * n0r(k) * cr * gam_3dr * rlmdr_3dr(k) * rho_fact(k)
1427 w(k,i_psaci) = qi(k) * 0.25_rp * pi * esi_mod * cs * moms_2ds(k) * rho_fact(k)
1429 w(k,i_pgaci) = qi(k) * 0.25_rp * pi * egi * n0g(k) * cg * gam_3dg * rlmdg_3dg(k) * rho_fact(k)
1431 w(k,i_piacr) = qi(k) * ar / mi * 0.25_rp * pi * eri * n0r(k) * cr * gam_6dr * rlmdr_6dr(k) * rho_fact(k)
1436 w(k,i_psacr) = ar * 0.25_rp * pi / dens(k,i,j) * esr * n0r(k) * abs(vtr(k)-vts(k)) &
1437 * ( gam_1br * rlmdr_1br(k) * moms_2(k) &
1438 + 2.0_rp * gam_2br * rlmdr_2br(k) * moms_1(k) &
1439 + gam_3br * rlmdr_3br(k) * moms_0(k) )
1444 w(k,i_pgacr) = ar * 0.25_rp * pi / dens(k,i,j) * egr * n0g(k) * n0r(k) * abs(vtg(k)-vtr(k)) &
1445 * ( gam_1br * rlmdr_1br(k) * gam_3 * rlmdg_3(k) &
1446 + 2.0_rp * gam_2br * rlmdr_2br(k) * gam_2 * rlmdg_2(k) &
1447 + gam_3br * rlmdr_3br(k) * gam * rlmdg(k) )
1452 w(k,i_pracs) = as * 0.25_rp * pi / dens(k,i,j) * esr * n0r(k) * abs(vtr(k)-vts(k)) &
1453 * ( moms_0bs(k) * gam_3 * rlmdr_3(k) &
1454 + 2.0_rp * moms_1bs(k) * gam_2 * rlmdr_2(k) &
1455 + moms_2bs(k) * gam * rlmdr(k) )
1460 egs_mod(k) = min( egs, egs * exp( gamma_gacs * temc(k) ) )
1461 w(k,i_pgacs) = as * 0.25_rp * pi / dens(k,i,j) * egs_mod(k) * n0g(k) * abs(vtg(k)-vts(k)) &
1462 * ( moms_0bs(k) * gam_3 * rlmdg_3(k) &
1463 + 2.0_rp * moms_1bs(k) * gam_2 * rlmdg_2(k) &
1464 + moms_2bs(k) * gam * rlmdg(k) )
1472 if ( enable_kk2000 )
then
1474 zerosw = 0.5_rp - sign(0.5_rp, qc(k) - 1.e-12_rp )
1475 praut_kk = 1350.0_rp &
1476 * exp( log( qc(k)+zerosw )*2.47_rp + log( nc(k) )*(-1.79_rp) ) &
1478 w(k,i_praut) = praut_kk
1482 rhoqc = dens(k,i,j) * qc(k) * 1000.0_rp
1483 dc = 0.146_rp - 5.964e-2_rp * log( nc(k) / 2000.0_rp )
1484 praut_berry = 1.67e-5_rp * rhoqc * rhoqc / ( ( 5.0_rp + 3.66e-2_rp * nc(k) / ( dc * rhoqc + eps ) ) * dens(k,i,j) )
1485 w(k,i_praut) = praut_berry
1491 betai = min( beta_saut, beta_saut * exp( gamma_saut * temc(k) ) )
1492 w(k,i_psaut) = max( betai*(qi(k)-qicrt_saut), 0.0_rp )
1494 betas = min( beta_gaut, beta_gaut * exp( gamma_gaut * temc(k) ) )
1495 w(k,i_pgaut) = max( betas*(qs(k)-qscrt_gaut), 0.0_rp )
1502 da = ( da0 + dda_dt * temc(k) )
1503 kd = ( dw0 + ddw_dt * temc(k) ) * pre00 / pres(k,i,j)
1504 nu(k) = ( mu0 + dmu_dt * temc(k) ) / dens(k,i,j)
1506 glv(k) = 1.0_rp / ( lhv0/(da*temp(k,i,j)) * ( lhv0/(rvap*temp(k,i,j)) - 1.0_rp ) + 1.0_rp/(kd*dens(k,i,j)*qsatl(k)) )
1507 giv(k) = 1.0_rp / ( lhs0/(da*temp(k,i,j)) * ( lhs0/(rvap*temp(k,i,j)) - 1.0_rp ) + 1.0_rp/(kd*dens(k,i,j)*qsati(k)) )
1508 gil(k) = ( da * temc(k) ) / lhf0
1513 ventr = f1r * gam_2 * rlmdr_2(k) + f2r * sqrt( cr * rho_fact(k) / nu(k) * rlmdr_5dr(k) ) * gam_5dr_h
1514 w(k,i_prevp) = 2.0_rp * pi / dens(k,i,j) * n0r(k) * ( 1.0_rp-min(sliq(k),1.0_rp) ) * glv(k) * ventr
1519 rhoqi = max(dens(k,i,j)*qi(k), eps)
1520 xni = min( max( 5.38e+7_rp * exp( log(rhoqi)*0.75_rp ), 1.e+3_rp ), 1.e+6_rp )
1522 di = min( di_a * sqrt(xmi), di_max )
1523 tmp = 4.0_rp * di * xni / dens(k,i,j) * ( sice(k)-1.0_rp ) * giv(k)
1524 w(k,i_pidep) = ( w(k,i_spsati) ) * ( tmp)
1525 w(k,i_pisub) = ( 1.0_rp-w(k,i_spsati) ) * (-tmp)
1528 sw = ( 0.5_rp - sign(0.5_rp, temc(k) + 40.0_rp ) )
1529 w(k,i_pihom) = sw * qc(k) / dt
1532 sw = ( 0.5_rp + sign(0.5_rp, temc(k) + 40.0_rp ) ) &
1533 * ( 0.5_rp - sign(0.5_rp, temc(k) ) )
1534 w(k,i_pihtr) = sw * ( dens(k,i,j) / dwatr * qc(k)**2 / ( nc_ihtr * 1.e+6_rp ) ) &
1535 * b_frz * ( exp(-a_frz*temc(k)) - 1.0_rp )
1538 sw = ( 0.5_rp + sign(0.5_rp, temc(k) ) )
1539 w(k,i_pimlt) = sw * qi(k) / dt
1544 vents = f1s * moms_1(k) + f2s * sqrt( cs * rho_fact(k) / nu(k) ) * moms_5ds_h(k)
1545 tmp = 2.0_rp * pi / dens(k,i,j) * ( sice(k)-1.0_rp ) * giv(k) * vents
1546 w(k,i_psdep) = ( w(k,i_spsati) ) * ( tmp)
1547 w(k,i_pssub) = ( 1.0_rp-w(k,i_spsati) ) * (-tmp)
1549 w(k,i_psmlt) = 2.0_rp * pi / dens(k,i,j) * gil(k) * vents &
1550 + cl * temc(k) / lhf0 * ( w(k,i_psacw) + w(k,i_psacr) )
1551 w(k,i_psmlt) = max( w(k,i_psmlt), 0.0_rp )
1556 ventg = f1g * gam_2 * rlmdg_2(k) + f2g * sqrt( cg * rho_fact(k) / nu(k) * rlmdg_5dg(k) ) * gam_5dg_h
1557 tmp = 2.0_rp * pi / dens(k,i,j) * n0g(k) * ( sice(k)-1.0_rp ) * giv(k) * ventg
1558 w(k,i_pgdep) = ( w(k,i_spsati) ) * ( tmp)
1559 w(k,i_pgsub) = ( 1.0_rp-w(k,i_spsati) ) * (-tmp)
1561 w(k,i_pgmlt) = 2.0_rp * pi / dens(k,i,j) * n0g(k) * gil(k) * ventg &
1562 + cl * temc(k) / lhf0 * ( w(k,i_pgacw) + w(k,i_pgacr) )
1563 w(k,i_pgmlt) = max( w(k,i_pgmlt), 0.0_rp )
1568 tmp = ( exp(-a_frz*temc(k)) - 1.0_rp ) * rlmdr_7(k)
1569 w(k,i_pgfrz) = 2.0_rp * pi / dens(k,i,j) * n0r(k) * 60.0_rp * b_frz * ar * tmp
1574 temcc = min( max( temc(k), -30.99_rp ), 0.0_rp )
1575 itemc = int( -temcc ) + 1
1576 fact = - ( temcc + real(itemc-1,kind=8) )
1577 a1 = ( 1.0_rp-fact ) * bergeron_a1_tab(itemc ) &
1578 + ( fact ) * bergeron_a1_tab(itemc+1)
1579 a2 = ( 1.0_rp-fact ) * bergeron_a2_tab(itemc ) &
1580 + ( fact ) * bergeron_a2_tab(itemc+1)
1582 a1 = a1 * exp( log(1.e-3_rp)*ma2 )
1583 dt1 = ( exp( log(mi50)*ma2 ) &
1584 - exp( log(mi40)*ma2 ) ) / ( a1 * ma2 )
1585 ni50 = qi(k) * dt / ( mi50 * dt1 )
1586 w(k,i_psfw ) = ni50 * ( a1 * exp( log(mi50)*a2 ) &
1587 + pi * eiw * dens(k,i,j) * qc(k) * ri50*ri50 * vti50 )
1588 w(k,i_psfi ) = qi(k) / dt1
1593 w(k,i_pigen) = min( w(k,i_pigen), w(k,i_dqv_dt) ) * ( w(k,i_iceflg) ) * sw_expice
1594 w(k,i_pidep) = min( w(k,i_pidep), w(k,i_dqv_dt) ) * ( w(k,i_iceflg) ) * sw_expice
1595 w(k,i_psdep) = min( w(k,i_psdep), w(k,i_dqv_dt) ) * ( w(k,i_iceflg) )
1596 w(k,i_pgdep) = min( w(k,i_pgdep), w(k,i_dqv_dt) ) * ( w(k,i_iceflg) )
1598 w(k,i_pracw) = w(k,i_pracw) &
1599 + w(k,i_psacw) * ( 1.0_rp-w(k,i_iceflg) ) &
1600 + w(k,i_pgacw) * ( 1.0_rp-w(k,i_iceflg) )
1604 w(k,i_praut) = min( w(k,i_praut), w(k,i_dqc_dt) )
1605 w(k,i_pracw) = min( w(k,i_pracw), w(k,i_dqc_dt) )
1606 w(k,i_pihom) = min( w(k,i_pihom), w(k,i_dqc_dt) ) * ( w(k,i_iceflg) ) * sw_expice
1607 w(k,i_pihtr) = min( w(k,i_pihtr), w(k,i_dqc_dt) ) * ( w(k,i_iceflg) ) * sw_expice
1608 w(k,i_psacw) = min( w(k,i_psacw), w(k,i_dqc_dt) ) * ( w(k,i_iceflg) )
1609 w(k,i_psfw ) = min( w(k,i_psfw ), w(k,i_dqc_dt) ) * ( w(k,i_iceflg) ) * sw_bergeron(k)
1610 w(k,i_pgacw) = min( w(k,i_pgacw), w(k,i_dqc_dt) ) * ( w(k,i_iceflg) )
1614 w(k,i_prevp) = min( w(k,i_prevp), w(k,i_dqr_dt) )
1615 w(k,i_piacr) = min( w(k,i_piacr), w(k,i_dqr_dt) ) * ( w(k,i_iceflg) )
1616 w(k,i_psacr) = min( w(k,i_psacr), w(k,i_dqr_dt) ) * ( w(k,i_iceflg) )
1617 w(k,i_pgacr) = min( w(k,i_pgacr), w(k,i_dqr_dt) ) * ( w(k,i_iceflg) )
1618 w(k,i_pgfrz) = min( w(k,i_pgfrz), w(k,i_dqr_dt) ) * ( w(k,i_iceflg) )
1622 w(k,i_pisub) = min( w(k,i_pisub), w(k,i_dqi_dt) ) * ( w(k,i_iceflg) ) * sw_expice
1623 w(k,i_pimlt) = min( w(k,i_pimlt), w(k,i_dqi_dt) ) * ( 1.0_rp-w(k,i_iceflg) ) * sw_expice
1624 w(k,i_psaut) = min( w(k,i_psaut), w(k,i_dqi_dt) ) * ( w(k,i_iceflg) )
1625 w(k,i_praci) = min( w(k,i_praci), w(k,i_dqi_dt) ) * ( w(k,i_iceflg) )
1626 w(k,i_psaci) = min( w(k,i_psaci), w(k,i_dqi_dt) ) * ( w(k,i_iceflg) )
1627 w(k,i_psfi ) = min( w(k,i_psfi ), w(k,i_dqi_dt) ) * ( w(k,i_iceflg) ) * sw_bergeron(k)
1628 w(k,i_pgaci) = min( w(k,i_pgaci), w(k,i_dqi_dt) ) * ( w(k,i_iceflg) )
1632 w(k,i_pssub) = min( w(k,i_pssub), w(k,i_dqs_dt) ) * ( w(k,i_iceflg) )
1633 w(k,i_psmlt) = min( w(k,i_psmlt), w(k,i_dqs_dt) ) * ( 1.0_rp-w(k,i_iceflg) )
1634 w(k,i_pgaut) = min( w(k,i_pgaut), w(k,i_dqs_dt) ) * ( w(k,i_iceflg) )
1635 w(k,i_pracs) = min( w(k,i_pracs), w(k,i_dqs_dt) ) * ( w(k,i_iceflg) )
1636 w(k,i_pgacs) = min( w(k,i_pgacs), w(k,i_dqs_dt) )
1638 w(k,i_pgsub) = min( w(k,i_pgsub), w(k,i_dqg_dt) ) * ( w(k,i_iceflg) )
1639 w(k,i_pgmlt) = min( w(k,i_pgmlt), w(k,i_dqg_dt) ) * ( 1.0_rp-w(k,i_iceflg) )
1643 w(k,i_piacr_s) = ( 1.0_rp - w(k,i_delta1) ) * w(k,i_piacr)
1644 w(k,i_piacr_g) = ( w(k,i_delta1) ) * w(k,i_piacr)
1645 w(k,i_praci_s) = ( 1.0_rp - w(k,i_delta1) ) * w(k,i_praci)
1646 w(k,i_praci_g) = ( w(k,i_delta1) ) * w(k,i_praci)
1647 w(k,i_psacr_s) = ( w(k,i_delta2) ) * w(k,i_psacr)
1648 w(k,i_psacr_g) = ( 1.0_rp - w(k,i_delta2) ) * w(k,i_psacr)
1649 w(k,i_pracs ) = ( 1.0_rp - w(k,i_delta2) ) * w(k,i_pracs)
1664 fac_sw = 0.5_rp + sign( 0.5_rp, net+eps )
1666 + ( 1.0_rp - fac_sw ) * min( -w(k,i_dqc_dt)/(net-fac_sw), 1.0_rp )
1668 w(k,i_pimlt ) = w(k,i_pimlt ) * fac
1669 w(k,i_praut ) = w(k,i_praut ) * fac
1670 w(k,i_pracw ) = w(k,i_pracw ) * fac
1671 w(k,i_pihom ) = w(k,i_pihom ) * fac
1672 w(k,i_pihtr ) = w(k,i_pihtr ) * fac
1673 w(k,i_psacw ) = w(k,i_psacw ) * fac
1674 w(k,i_psfw ) = w(k,i_psfw ) * fac
1675 w(k,i_pgacw ) = w(k,i_pgacw ) * fac
1694 fac_sw = 0.5_rp + sign( 0.5_rp, net+eps )
1696 + ( 1.0_rp - fac_sw ) * min( -w(k,i_dqi_dt)/(net-fac_sw), 1.0_rp )
1698 w(k,i_pigen ) = w(k,i_pigen ) * fac
1699 w(k,i_pidep ) = w(k,i_pidep ) * fac
1700 w(k,i_pihom ) = w(k,i_pihom ) * fac
1701 w(k,i_pihtr ) = w(k,i_pihtr ) * fac
1702 w(k,i_pisub ) = w(k,i_pisub ) * fac
1703 w(k,i_pimlt ) = w(k,i_pimlt ) * fac
1704 w(k,i_psaut ) = w(k,i_psaut ) * fac
1705 w(k,i_praci_s) = w(k,i_praci_s) * fac
1706 w(k,i_psaci ) = w(k,i_psaci ) * fac
1707 w(k,i_psfi ) = w(k,i_psfi ) * fac
1708 w(k,i_praci_g) = w(k,i_praci_g) * fac
1709 w(k,i_pgaci ) = w(k,i_pgaci ) * fac
1727 fac_sw = 0.5_rp + sign( 0.5_rp, net+eps )
1729 + ( 1.0_rp - fac_sw ) * min( -w(k,i_dqr_dt)/(net-fac_sw), 1.0_rp )
1731 w(k,i_praut ) = w(k,i_praut ) * fac
1732 w(k,i_pracw ) = w(k,i_pracw ) * fac
1733 w(k,i_psmlt ) = w(k,i_psmlt ) * fac
1734 w(k,i_pgmlt ) = w(k,i_pgmlt ) * fac
1735 w(k,i_prevp ) = w(k,i_prevp ) * fac
1736 w(k,i_piacr_s) = w(k,i_piacr_s) * fac
1737 w(k,i_psacr_s) = w(k,i_psacr_s) * fac
1738 w(k,i_piacr_g) = w(k,i_piacr_g) * fac
1739 w(k,i_psacr_g) = w(k,i_psacr_g) * fac
1740 w(k,i_pgacr ) = w(k,i_pgacr ) * fac
1741 w(k,i_pgfrz ) = w(k,i_pgfrz ) * fac
1756 fac_sw = 0.5_rp + sign( 0.5_rp, net+eps )
1758 + ( 1.0_rp - fac_sw ) * min( -w(k,i_dqv_dt)/(net-fac_sw), 1.0_rp )
1760 w(k,i_prevp ) = w(k,i_prevp ) * fac
1761 w(k,i_pisub ) = w(k,i_pisub ) * fac
1762 w(k,i_pssub ) = w(k,i_pssub ) * fac
1763 w(k,i_pgsub ) = w(k,i_pgsub ) * fac
1764 w(k,i_pigen ) = w(k,i_pigen ) * fac
1765 w(k,i_pidep ) = w(k,i_pidep ) * fac
1766 w(k,i_psdep ) = w(k,i_psdep ) * fac
1767 w(k,i_pgdep ) = w(k,i_pgdep ) * fac
1788 fac_sw = 0.5_rp + sign( 0.5_rp, net+eps )
1789 fack(k) = ( fac_sw ) &
1790 + ( 1.0_rp - fac_sw ) * min( -w(k,i_dqs_dt)/(net-fac_sw), 1.0_rp )
1793 w(k,i_psdep ) = w(k,i_psdep ) * fack(k)
1794 w(k,i_psacw ) = w(k,i_psacw ) * fack(k)
1795 w(k,i_psfw ) = w(k,i_psfw ) * fack(k)
1796 w(k,i_piacr_s) = w(k,i_piacr_s) * fack(k)
1797 w(k,i_psacr_s) = w(k,i_psacr_s) * fack(k)
1798 w(k,i_psaut ) = w(k,i_psaut ) * fack(k)
1799 w(k,i_praci_s) = w(k,i_praci_s) * fack(k)
1800 w(k,i_psaci ) = w(k,i_psaci ) * fack(k)
1801 w(k,i_psfi ) = w(k,i_psfi ) * fack(k)
1802 w(k,i_pssub ) = w(k,i_pssub ) * fack(k)
1803 w(k,i_psmlt ) = w(k,i_psmlt ) * fack(k)
1804 w(k,i_pgaut ) = w(k,i_pgaut ) * fack(k)
1805 w(k,i_pracs ) = w(k,i_pracs ) * fack(k)
1806 w(k,i_pgacs ) = w(k,i_pgacs ) * fack(k)
1826 fac_sw = 0.5_rp + sign( 0.5_rp, net+eps )
1827 fack(k) = ( fac_sw ) &
1828 + ( 1.0_rp - fac_sw ) * min( -w(k,i_dqg_dt)/(net-fac_sw), 1.0_rp )
1831 w(k,i_pgdep ) = w(k,i_pgdep ) * fack(k)
1832 w(k,i_pgacw ) = w(k,i_pgacw ) * fack(k)
1833 w(k,i_piacr_g) = w(k,i_piacr_g) * fack(k)
1834 w(k,i_psacr_g) = w(k,i_psacr_g) * fack(k)
1835 w(k,i_pgacr ) = w(k,i_pgacr ) * fack(k)
1836 w(k,i_pgfrz ) = w(k,i_pgfrz ) * fack(k)
1837 w(k,i_praci_g) = w(k,i_praci_g) * fack(k)
1838 w(k,i_pgaci ) = w(k,i_pgaci ) * fack(k)
1839 w(k,i_pgaut ) = w(k,i_pgaut ) * fack(k)
1840 w(k,i_pracs ) = w(k,i_pracs ) * fack(k)
1841 w(k,i_pgacs ) = w(k,i_pgacs ) * fack(k)
1842 w(k,i_pgsub ) = w(k,i_pgsub ) * fack(k)
1843 w(k,i_pgmlt ) = w(k,i_pgmlt ) * fack(k)
1847 qc_t(k) = + w(k,i_pimlt ) &
1855 qc_t(k) = max( qc_t(k), -w(k,i_dqc_dt) )
1859 qr_t(k) = + w(k,i_praut ) &
1871 qr_t(k) = max( qr_t(k), -w(k,i_dqr_dt) )
1875 qi_t(k) = + w(k,i_pigen ) &
1887 qi_t(k) = max( qi_t(k), -w(k,i_dqi_dt) )
1891 qs_t(k) = + w(k,i_psdep ) &
1905 qs_t(k) = max( qs_t(k), -w(k,i_dqs_dt) )
1909 qg_t(k) = + w(k,i_pgdep ) &
1922 qg_t(k) = max( qg_t(k), -w(k,i_dqg_dt) )
1925 if ( flg_lt_l )
then
1928 qcrg_c(k) = qtrc_crg0(k,i,j,i_qc-1)
1929 qcrg_r(k) = qtrc_crg0(k,i,j,i_qr-1)
1930 qcrg_i(k) = qtrc_crg0(k,i,j,i_qi-1)
1931 qcrg_s(k) = qtrc_crg0(k,i,j,i_qs-1)
1932 qcrg_g(k) = qtrc_crg0(k,i,j,i_qg-1)
1933 re_qs(k) = re(k,i,j,
i_hs) * 1.0e-2_rp
1934 beta1_crg(k) = beta_crg(k,i,j)
1935 dcrg(k) = - dqcrg(k,i,j)
1940 alpha = 5.0_rp * ( 2.0_rp * re_qi / d0_crg )**2 * ( -vtg(k) ) / v0_crg
1941 alpha = min( alpha, 10.0_rp )
1942 w_qcrg(k,i_qgaci) = dens(k,i,j) * qi(k) * 1.5_rp &
1943 * cg * gam_3dg * rlmdg_3dg(k) * rho_fact(k) * rdens_i &
1944 * sign( min( abs(dcrg(k)*alpha),20.0_rp ),dcrg(k)*alpha ) * beta1_crg(k) &
1945 * n0g(k) / ( 2.0_rp * re_qi )**3 &
1946 * ( ( 1.0_rp - flg_ecoali ) * ( 1.0_rp-egi ) &
1947 + ( flg_ecoali ) * egi * ( 1.0_rp-ecoal_gi ) / ecoal_gi )
1948 qsplt_in(k,i,j,1) = qsplt_in(k,i,j,1) - w_qcrg(k,i_qgaci)
1949 qsplt_in(k,i,j,2) = qsplt_in(k,i,j,2) + w_qcrg(k,i_qgaci)
1956 alpha = 5.0_rp * ( 2.0_rp * re_qs(k) / d0_crg )**2 * ( -vtg(k) ) / v0_crg
1957 alpha = min( alpha, 10.0_rp )
1958 w_qcrg(k,i_qgacs) = 0.25_rp * pi / dens(k,i,j) &
1959 * n0g(k) * n0s(k) * abs(vtg(k)-vts(k)) * beta1_crg(k) &
1960 * sign( min( abs(dcrg(k)*alpha),50.0_rp ),dcrg(k)*alpha ) &
1961 * ( gam_3 * gam * w(k,i_rlmds)**3 * rlmdg(k) &
1962 + gam_2 * gam_2 * w(k,i_rlmds)**2 * rlmdg_2(k) &
1963 + gam * gam_3 * w(k,i_rlmds) * rlmdg_3(k) ) &
1964 * ( ( 1.0_rp - flg_ecoals ) * ( 1.0_rp-egs_mod(k) ) &
1965 + ( flg_ecoals ) * egs_mod(k) * ( 1.0_rp-ecoal_gs ) / ecoal_gs )
1966 qsplt_in(k,i,j,1) = qsplt_in(k,i,j,1) - w_qcrg(k,i_qgacs)
1967 qsplt_in(k,i,j,3) = qsplt_in(k,i,j,3) + w_qcrg(k,i_qgacs)
1971 facq_qc = 0.5_rp + sign( 0.5_rp, qc(k) - eps )
1972 facq_qi = 0.5_rp + sign( 0.5_rp, qi(k) - eps )
1973 w_q(k,i_pimlt) = qcrg_i(k) * w(k,i_pimlt) / ( qi(k) + eps*eps ) * facq_qi
1974 w_q(k,i_praut) = qcrg_c(k) * w(k,i_praut) / ( qc(k) + eps*eps ) * facq_qc
1975 w_q(k,i_pracw) = qcrg_c(k) * w(k,i_pracw) / ( qc(k) + eps*eps ) * facq_qc
1976 w_q(k,i_pihom) = qcrg_c(k) * w(k,i_pihom) / ( qc(k) + eps*eps ) * facq_qc
1977 w_q(k,i_pihtr) = qcrg_c(k) * w(k,i_pihtr) / ( qc(k) + eps*eps ) * facq_qc
1978 w_q(k,i_psacw) = qcrg_c(k) * w(k,i_psacw) / ( qc(k) + eps*eps ) * facq_qc
1979 w_q(k,i_psfw ) = qcrg_c(k) * w(k,i_psfw ) / ( qc(k) + eps*eps ) * facq_qc
1980 w_q(k,i_pgacw) = qcrg_c(k) * w(k,i_pgacw) / ( qc(k) + eps*eps ) * facq_qc
1984 facq_qc = 0.5_rp + sign( 0.5_rp, qc(k) - eps )
1985 facq_qi = 0.5_rp + sign( 0.5_rp, qi(k) - eps )
1986 w_q(k,i_pigen ) = 0.0_rp
1987 w_q(k,i_pidep ) = 0.0_rp
1988 w_q(k,i_pihom ) = qcrg_c(k) * w(k,i_pihom ) / ( qc(k) + eps*eps ) * facq_qc
1989 w_q(k,i_pihtr ) = qcrg_c(k) * w(k,i_pihtr ) / ( qc(k) + eps*eps ) * facq_qc
1990 w_q(k,i_pisub ) = qcrg_i(k) * w(k,i_pisub ) / ( qi(k) + eps*eps ) * facq_qi
1991 w_q(k,i_pimlt ) = qcrg_i(k) * w(k,i_pimlt ) / ( qi(k) + eps*eps ) * facq_qi
1992 w_q(k,i_psaut ) = qcrg_i(k) * w(k,i_psaut ) / ( qi(k) + eps*eps ) * facq_qi
1993 w_q(k,i_praci_s) = qcrg_i(k) * w(k,i_praci_s) / ( qi(k) + eps*eps ) * facq_qi
1994 w_q(k,i_psaci ) = qcrg_i(k) * w(k,i_psaci ) / ( qi(k) + eps*eps ) * facq_qi
1995 w_q(k,i_psfi ) = qcrg_i(k) * w(k,i_psfi ) / ( qi(k) + eps*eps ) * facq_qi
1996 w_q(k,i_praci_g) = qcrg_i(k) * w(k,i_praci_g) / ( qi(k) + eps*eps ) * facq_qi
1997 w_q(k,i_pgaci ) = qcrg_i(k) * w(k,i_pgaci ) / ( qi(k) + eps*eps ) * facq_qi
2001 facq_qc = 0.5_rp + sign( 0.5_rp, qc(k) - eps )
2002 facq_qr = 0.5_rp + sign( 0.5_rp, qr(k) - eps )
2003 facq_qs = 0.5_rp + sign( 0.5_rp, qs(k) - eps )
2004 facq_qg = 0.5_rp + sign( 0.5_rp, qg(k) - eps )
2005 w_q(k,i_praut ) = qcrg_c(k) * w(k,i_praut ) / ( qc(k) + eps*eps ) * facq_qc
2006 w_q(k,i_pracw ) = qcrg_c(k) * w(k,i_pracw ) / ( qc(k) + eps*eps ) * facq_qc
2007 w_q(k,i_psmlt ) = qcrg_s(k) * w(k,i_psmlt ) / ( qs(k) + eps*eps ) * facq_qs
2008 w_q(k,i_pgmlt ) = qcrg_g(k) * w(k,i_pgmlt ) / ( qg(k) + eps*eps ) * facq_qg
2009 w_q(k,i_prevp ) = qcrg_r(k) * w(k,i_prevp ) / ( qr(k) + eps*eps ) * facq_qr
2010 w_q(k,i_piacr_s) = qcrg_r(k) * w(k,i_piacr_s) / ( qr(k) + eps*eps ) * facq_qr
2011 w_q(k,i_psacr_s) = qcrg_r(k) * w(k,i_psacr_s) / ( qr(k) + eps*eps ) * facq_qr
2012 w_q(k,i_piacr_g) = qcrg_r(k) * w(k,i_piacr_g) / ( qr(k) + eps*eps ) * facq_qr
2013 w_q(k,i_psacr_g) = qcrg_r(k) * w(k,i_psacr_g) / ( qr(k) + eps*eps ) * facq_qr
2014 w_q(k,i_pgacr ) = qcrg_r(k) * w(k,i_pgacr ) / ( qr(k) + eps*eps ) * facq_qr
2015 w_q(k,i_pgfrz ) = qcrg_r(k) * w(k,i_pgfrz ) / ( qr(k) + eps*eps ) * facq_qr
2019 facq_qc = 0.5_rp + sign( 0.5_rp, qc(k) - eps )
2020 facq_qr = 0.5_rp + sign( 0.5_rp, qr(k) - eps )
2021 facq_qi = 0.5_rp + sign( 0.5_rp, qi(k) - eps )
2022 facq_qs = 0.5_rp + sign( 0.5_rp, qs(k) - eps )
2023 facq_qg = 0.5_rp + sign( 0.5_rp, qg(k) - eps )
2024 w_q(k,i_psdep ) = 0.0_rp
2025 w_q(k,i_psacw ) = qcrg_c(k) * w(k,i_psacw ) / ( qc(k) + eps*eps ) * facq_qc
2026 w_q(k,i_psfw ) = qcrg_c(k) * w(k,i_psfw ) / ( qc(k) + eps*eps ) * facq_qc
2027 w_q(k,i_piacr_s) = qcrg_r(k) * w(k,i_piacr_s) / ( qr(k) + eps*eps ) * facq_qr
2028 w_q(k,i_psacr_s) = qcrg_r(k) * w(k,i_psacr_s) / ( qr(k) + eps*eps ) * facq_qr
2029 w_q(k,i_psaut ) = qcrg_i(k) * w(k,i_psaut ) / ( qi(k) + eps*eps ) * facq_qi
2030 w_q(k,i_praci_s) = qcrg_i(k) * w(k,i_praci_s) / ( qi(k) + eps*eps ) * facq_qi
2031 w_q(k,i_psaci ) = qcrg_i(k) * w(k,i_psaci ) / ( qi(k) + eps*eps ) * facq_qi
2032 w_q(k,i_psfi ) = qcrg_i(k) * w(k,i_psfi ) / ( qi(k) + eps*eps ) * facq_qi
2033 w_q(k,i_pssub ) = qcrg_s(k) * w(k,i_pssub ) / ( qs(k) + eps*eps ) * facq_qs
2034 w_q(k,i_psmlt ) = qcrg_s(k) * w(k,i_psmlt ) / ( qs(k) + eps*eps ) * facq_qs
2035 w_q(k,i_pgaut ) = qcrg_s(k) * w(k,i_pgaut ) / ( qs(k) + eps*eps ) * facq_qs
2036 w_q(k,i_pracs ) = qcrg_s(k) * w(k,i_pracs ) / ( qs(k) + eps*eps ) * facq_qs
2037 w_q(k,i_pgacs ) = qcrg_s(k) * w(k,i_pgacs ) / ( qs(k) + eps*eps ) * facq_qs
2041 facq_qc = 0.5_rp + sign( 0.5_rp, qc(k) - eps )
2042 facq_qr = 0.5_rp + sign( 0.5_rp, qr(k) - eps )
2043 facq_qi = 0.5_rp + sign( 0.5_rp, qi(k) - eps )
2044 facq_qs = 0.5_rp + sign( 0.5_rp, qs(k) - eps )
2045 facq_qg = 0.5_rp + sign( 0.5_rp, qg(k) - eps )
2046 w_q(k,i_pgdep ) = 0.0_rp
2047 w_q(k,i_pgacw ) = qcrg_c(k) * w(k,i_pgacw ) / ( qc(k) + eps*eps ) * facq_qc
2048 w_q(k,i_piacr_g) = qcrg_r(k) * w(k,i_piacr_g) / ( qr(k) + eps*eps ) * facq_qr
2049 w_q(k,i_psacr_g) = qcrg_r(k) * w(k,i_psacr_g) / ( qr(k) + eps*eps ) * facq_qr
2050 w_q(k,i_pgacr ) = qcrg_r(k) * w(k,i_pgacr ) / ( qr(k) + eps*eps ) * facq_qr
2051 w_q(k,i_pgfrz ) = qcrg_r(k) * w(k,i_pgfrz ) / ( qr(k) + eps*eps ) * facq_qr
2052 w_q(k,i_praci_g) = qcrg_i(k) * w(k,i_praci_g) / ( qi(k) + eps*eps ) * facq_qi
2053 w_q(k,i_pgaci ) = qcrg_i(k) * w(k,i_pgaci ) / ( qi(k) + eps*eps ) * facq_qi
2054 w_q(k,i_pgaut ) = qcrg_s(k) * w(k,i_pgaut ) / ( qs(k) + eps*eps ) * facq_qs
2055 w_q(k,i_pracs ) = qcrg_s(k) * w(k,i_pracs ) / ( qs(k) + eps*eps ) * facq_qs
2056 w_q(k,i_pgacs ) = qcrg_s(k) * w(k,i_pgacs ) / ( qs(k) + eps*eps ) * facq_qs
2057 w_q(k,i_pgsub ) = qcrg_g(k) * w(k,i_pgsub ) / ( qg(k) + eps*eps ) * facq_qg
2058 w_q(k,i_pgmlt ) = qcrg_g(k) * w(k,i_pgmlt ) / ( qg(k) + eps*eps ) * facq_qg
2062 qc_crg_t(k) = + w_q(k,i_pimlt ) &
2073 qr_crg_t(k) = + w_q(k,i_praut ) &
2078 - w_q(k,i_piacr_s) &
2079 - w_q(k,i_psacr_s) &
2080 - w_q(k,i_piacr_g) &
2081 - w_q(k,i_psacr_g) &
2087 qi_crg_t(k) = + w_q(k,i_pigen ) &
2094 - w_q(k,i_praci_s) &
2097 - w_q(k,i_praci_g) &
2099 + w_qcrg(k,i_qgaci )
2103 qs_crg_t(k) = + w_q(k,i_psdep ) &
2106 + w_q(k,i_piacr_s) &
2107 + w_q(k,i_psacr_s) &
2109 + w_q(k,i_praci_s) &
2117 + w_qcrg(k,i_qgacs )
2121 qg_crg_t(k) = + w_q(k,i_pgdep ) &
2123 + w_q(k,i_piacr_g) &
2124 + w_q(k,i_psacr_g) &
2127 + w_q(k,i_praci_g) &
2134 - w_qcrg(k,i_qgaci) &
2140 qv_t(k) = - ( qc_t(k) + qr_t(k) + qi_t(k) + qs_t(k) + qg_t(k) )
2144 qtrc(k,i,j,i_qv) = qtrc(k,i,j,i_qv) + qv_t(k) * dt
2147 qtrc(k,i,j,i_qc) = qtrc(k,i,j,i_qc) + qc_t(k) * dt
2150 qtrc(k,i,j,i_qr) = qtrc(k,i,j,i_qr) + qr_t(k) * dt
2153 qtrc(k,i,j,i_qi) = qtrc(k,i,j,i_qi) + qi_t(k) * dt
2156 qtrc(k,i,j,i_qs) = qtrc(k,i,j,i_qs) + qs_t(k) * dt
2159 qtrc(k,i,j,i_qg) = qtrc(k,i,j,i_qg) + qg_t(k) * dt
2163 +
cv_water * ( qc_t(k) + qr_t(k) ) &
2164 +
cv_ice * ( qi_t(k) + qs_t(k) + qg_t(k) )
2165 cvtot(k) = cvtot0(k,i,j) + cv_t * dt
2169 e_t = -
lhv * qv_t(k) +
lhf * ( qi_t(k) + qs_t(k) + qg_t(k) )
2170 rhoe_t(k,i,j) = dens(k,i,j) * e_t
2171 temp(k,i,j) = ( temp(k,i,j) * cvtot0(k,i,j) + e_t * dt ) / cvtot(k)
2175 cvtot0(k,i,j) = cvtot(k)
2180 +
cp_water * ( qc_t(k) + qr_t(k) ) &
2181 +
cp_ice * ( qi_t(k) + qs_t(k) + qg_t(k) )
2182 cptot0(k,i,j) = cptot0(k,i,j) + cp_t * dt
2187 qtrc_crg0(k,i,j,i_qc-1) = qtrc_crg0(k,i,j,i_qc-1) + qc_crg_t(k) * dt
2188 qtrc_crg0(k,i,j,i_qr-1) = qtrc_crg0(k,i,j,i_qr-1) + qr_crg_t(k) * dt
2189 qtrc_crg0(k,i,j,i_qi-1) = qtrc_crg0(k,i,j,i_qi-1) + qi_crg_t(k) * dt
2190 qtrc_crg0(k,i,j,i_qs-1) = qtrc_crg0(k,i,j,i_qs-1) + qs_crg_t(k) * dt
2191 qtrc_crg0(k,i,j,i_qg-1) = qtrc_crg0(k,i,j,i_qg-1) + qg_crg_t(k) * dt
2197 rlambda(i_qr) = sqrt(sqrt( dens(k,i,j) * max( qtrc(k,i,j,i_qr),0.0_rp ) / ( ar * n0r(k) * gam_1br ) ))
2198 rlambda(i_qs) = sqrt(sqrt( dens(k,i,j) * max( qtrc(k,i,j,i_qs),0.0_rp ) / ( as * n0s(k) * gam_1bs ) ))
2199 rlambda(i_qg) = sqrt(sqrt( dens(k,i,j) * max( qtrc(k,i,j,i_qg),0.0_rp ) / ( ag * n0g(k) * gam_1bg ) ))
2200 sarea(k,i,j,i_qc-1) = 6.0_rp / ( re_qc*2.0_rp * dwatr ) &
2201 * max( qtrc(k,i,j,i_qc),0.0_rp ) * dens(k,i,j)
2202 sarea(k,i,j,i_qi-1) = 6.0_rp / ( re_qi*2.0_rp * dice ) &
2203 * max( qtrc(k,i,j,i_qi),0.0_rp ) * dens(k,i,j)
2204 sarea(k,i,j,i_qr-1) = pi * n0r(k) * gam_3 * rlambda(i_qr)**3
2205 sarea(k,i,j,i_qs-1) = pi * n0s(k) * gam_3 * rlambda(i_qs)**3
2206 sarea(k,i,j,i_qg-1) = pi * n0g(k) * gam_3 * rlambda(i_qg)**3
2211 qsplt_in(k,i,j,iq) = qsplt_in(k,i,j,iq) * dens(k,i,j)
2216 if ( hist_flag )
then
2219 if ( hist_sw(ip) )
then
2221 w3d(k,i,j,ip) = w(k,ip)
2232 if ( hist_sw(ip) )
call file_history_put( hist_id(ip), w3d(:,:,:,ip) )
2248 end subroutine mp_tomita08
2261 integer,
intent(in),
value :: ka, ks, ke
2263 real(
rp),
intent(in) :: dens(ka)
2264 real(
rp),
intent(in) :: temp(ka)
2265 real(
rp),
intent(in) :: rhoq(ka,qa_mp-1)
2267 real(
rp),
intent(out) :: vterm(ka,qa_mp-1)
2275 real(
rp) :: rho_fact_tv
2276 #define temc_tv(k) temc_tv
2277 #define qr_tv(k) qr_tv
2278 #define qi_tv(k) qi_tv
2279 #define qs_tv(k) qs_tv
2280 #define qg_tv(k) qg_tv
2281 #define rho_fact_tv(k) rho_fact_tv
2283 real(
rp) :: temc_tv(ka)
2284 real(
rp) :: qr_tv(ka)
2285 real(
rp) :: qi_tv(ka)
2286 real(
rp) :: qs_tv(ka)
2287 real(
rp) :: qg_tv(ka)
2288 real(
rp) :: rho_fact_tv(ka)
2295 #define N0r_tv(k) N0r_tv
2296 #define N0s_tv(k) N0s_tv
2297 #define N0g_tv(k) N0g_tv
2299 real(
rp) :: n0r_tv(ka)
2300 real(
rp) :: n0s_tv(ka)
2301 real(
rp) :: n0g_tv(ka)
2303 real(
rp) :: rlmdr, rlmds, rlmdg
2304 real(
rp) :: rlmdr_dr, rlmds_ds, rlmdg_dg
2307 real(
rp) :: tems, xs2
2308 real(
rp) :: moms_0bs
2310 real(
rp) :: rmoms_vt_tv
2311 #define RMOMs_Vt_tv(k) RMOMs_Vt_tv
2313 real(
rp) :: rmoms_vt_tv(ka)
2315 real(
rp) :: coef_at(4), coef_bt(4)
2316 real(
rp) :: loga_, b_, nm
2325 temc_tv(k) = temp(k) - tem00
2326 qr_tv(k) = rhoq(k,i_hyd_qr) / dens(k)
2327 qi_tv(k) = rhoq(k,i_hyd_qi) / dens(k)
2328 qs_tv(k) = rhoq(k,i_hyd_qs) / dens(k)
2329 qg_tv(k) = rhoq(k,i_hyd_qg) / dens(k)
2331 rho_fact_tv(k) = sqrt( dens00 / dens(k) )
2336 if ( enable_wdxz2014 )
then
2342 n0r_tv(k) = 1.16e+5_rp * exp( log( max( dens(k)*qr_tv(k)*1000.0_rp, 1.e-2_rp ) )*0.477_rp )
2343 n0s_tv(k) = 4.58e+9_rp * exp( log( max( dens(k)*qs_tv(k)*1000.0_rp, 1.e-2_rp ) )*0.788_rp )
2344 n0g_tv(k) = 9.74e+8_rp * exp( log( max( dens(k)*qg_tv(k)*1000.0_rp, 1.e-2_rp ) )*0.816_rp )
2362 if ( enable_hzdfhi2007 )
then
2366 zerosw = 0.5_rp - sign(0.5_rp, qi_tv(k) - 1.e-8_rp )
2367 vterm(k,i_hyd_qi) = min( 0.0_rp, &
2368 - ( coef_a0 + coef_a1 * temc_tv(k) ) &
2369 * exp( log( dens(k)*qi_tv(k)*1000.0_rp+zerosw ) * ( coef_b0 + coef_b1 * temc_tv(k) ) ) &
2370 * 1e-2_rp * ( 1.0_rp-zerosw ) )
2378 zerosw = 0.5_rp - sign(0.5_rp, qi_tv(k) - 1.e-8_rp )
2379 vterm(k,i_hyd_qi) = -3.29_rp * exp( log( dens(k)*qi_tv(k)+zerosw )*0.16_rp ) * ( 1.0_rp-zerosw )
2390 zerosw = 0.5_rp - sign(0.5_rp, qr_tv(k) - 1.e-12_rp )
2391 rlmdr = sqrt(sqrt( dens(k) * qr_tv(k) / ( ar * n0r_tv(k) * gam_1br ) + zerosw )) * ( 1.0_rp-zerosw )
2392 rlmdr_dr = sqrt( rlmdr )
2393 vterm(k,i_hyd_qr) = -cr * rho_fact_tv(k) * gam_1brdr / gam_1br * rlmdr_dr
2399 if ( enable_rs2014 )
then
2405 zerosw = 0.5_rp - sign(0.5_rp, dens(k) * qs_tv(k) - 1.e-12_rp )
2406 xs2 = dens(k) * qs_tv(k) / as
2408 tems = min( -0.1_rp, temc_tv(k) )
2409 coef_at(1) = coef_a01 + tems * ( coef_a02 + tems * ( coef_a05 + tems * coef_a09 ) )
2410 coef_at(2) = coef_a03 + tems * ( coef_a04 + tems * coef_a07 )
2411 coef_at(3) = coef_a06 + tems * coef_a08
2412 coef_at(4) = coef_a10
2413 coef_bt(1) = coef_b01 + tems * ( coef_b02 + tems * ( coef_b05 + tems * coef_b09 ) )
2414 coef_bt(2) = coef_b03 + tems * ( coef_b04 + tems * coef_b07 )
2415 coef_bt(3) = coef_b06 + tems * coef_b08
2416 coef_bt(4) = coef_b10
2419 loga_ = coef_at(1) + nm * ( coef_at(2) + nm * ( coef_at(3) + nm * coef_at(4) ) )
2420 b_ = coef_bt(1) + nm * ( coef_bt(2) + nm * ( coef_bt(3) + nm * coef_bt(4) ) )
2421 moms_0bs = exp( ln10 * loga_ + log(xs2+zerosw) * b_ ) * ( 1.0_rp-zerosw )
2424 loga_ = coef_at(1) + nm * ( coef_at(2) + nm * ( coef_at(3) + nm * coef_at(4) ) )
2425 b_ = coef_bt(1) + nm * ( coef_bt(2) + nm * ( coef_bt(3) + nm * coef_bt(4) ) )
2426 rmoms_vt_tv(k) = exp( ln10 * loga_ + log(xs2+zerosw) * b_ ) * ( 1.0_rp-zerosw ) / ( moms_0bs + zerosw )
2435 zerosw = 0.5_rp - sign(0.5_rp, qs_tv(k) - 1.e-12_rp )
2436 rlmds = sqrt(sqrt( dens(k) * qs_tv(k) / ( as * n0s_tv(k) * gam_1bs ) + zerosw )) * ( 1.0_rp-zerosw )
2437 rlmds_ds = sqrt( sqrt(rlmds) )
2438 rmoms_vt_tv(k) = gam_1bsds / gam_1bs * rlmds_ds
2447 vterm(k,i_hyd_qs) = -cs * rho_fact_tv(k) * rmoms_vt_tv(k)
2454 zerosw = 0.5_rp - sign(0.5_rp, qg_tv(k) - 1.e-12_rp )
2455 rlmdg = sqrt(sqrt( dens(k) * qg_tv(k) / ( ag * n0g_tv(k) * gam_1bg ) + zerosw )) * ( 1.0_rp-zerosw )
2456 rlmdg_dg = sqrt( rlmdg )
2457 vterm(k,i_hyd_qg) = -cg * rho_fact_tv(k) * gam_1bgdg / gam_1bg * rlmdg_dg
2465 vterm(k,i_hyd_qc) = 0.0_rp
2470 if ( nofall_qr )
then
2475 vterm(k,i_hyd_qr) = 0.0_rp
2481 if ( nofall_qi )
then
2486 vterm(k,i_hyd_qi) = 0.0_rp
2492 if ( nofall_qs )
then
2497 vterm(k,i_hyd_qs) = 0.0_rp
2503 if ( nofall_qg )
then
2508 vterm(k,i_hyd_qg) = 0.0_rp
2524 KA, KS, KE, IA, IS, IE, JA, JS, JE, &
2529 integer,
intent(in) :: ka, ks, ke
2530 integer,
intent(in) :: ia, is, ie
2531 integer,
intent(in) :: ja, js, je
2533 real(
rp),
intent(in) :: qtrc(ka,ia,ja,qa_mp-1)
2534 real(
rp),
intent(in) :: mask_criterion
2536 real(
rp),
intent(out) :: cldfrac(ka,ia,ja)
2548 qhydro = qtrc(k,i,j,i_hyd_qc) + qtrc(k,i,j,i_hyd_qr) &
2549 + qtrc(k,i,j,i_hyd_qi) + qtrc(k,i,j,i_hyd_qs) + qtrc(k,i,j,i_hyd_qg)
2550 cldfrac(k,i,j) = 0.5_rp + sign(0.5_rp,qhydro-mask_criterion)
2562 KA, KS, KE, IA, IS, IE, JA, JS, JE, &
2563 DENS0, TEMP0, QTRC0, &
2578 integer,
intent(in) :: ka, ks, ke
2579 integer,
intent(in) :: ia, is, ie
2580 integer,
intent(in) :: ja, js, je
2582 real(
rp),
intent(in) :: dens0(ka,ia,ja)
2583 real(
rp),
intent(in) :: temp0(ka,ia,ja)
2584 real(
rp),
intent(in) :: qtrc0(ka,ia,ja,qa_mp-1)
2586 real(
rp),
intent(out) :: re (ka,ia,ja,
n_hyd)
2587 real(
rp) :: dens(ka)
2588 real(
rp) :: temc(ka)
2589 real(
rp) :: qr(ka), qs(ka), qg(ka)
2591 real(
rp) :: n0r(ka), n0s(ka), n0g(ka)
2592 real(
rp) :: rlmdr, rlmds, rlmdg
2594 real(
rp),
parameter :: m2cm = 100.0_rp
2597 real(
rp) :: tems, xs2
2598 real(
rp) :: coef_at(4), coef_bt(4)
2599 real(
rp) :: loga_, b_, nm
2601 real(
rp) :: zerosw, sw
2602 integer :: k, i, j, ih
2607 if ( enable_trawlbg2017 )
then
2614 sw = 0.5_rp + sign(0.5_rp, temp0(k,i,j) - 192.0_rp)
2615 re(k,i,j,
i_hi) = ( ( 40.0_rp + 0.53_rp * ( temp0(k,i,j) - 192.0_rp ) ) * sw &
2616 + ( 12.0_rp + 28.0_rp * exp( 0.65_rp * ( temp0(k,i,j) - 192.0_rp ) ) ) * ( 1.0_rp-sw ) &
2617 ) * 1.0e-6_rp * m2cm
2628 re(k,i,j,
i_hi) = re_qi * m2cm
2640 re(k,i,j,ih) = 0.0_rp
2647 if ( const_rec .or. fixed_re )
then
2654 re(k,i,j,
i_hc) = re_qc * m2cm
2668 if ( do_couple_aerosol )
then
2671 nc(k) = nc_def(i,j) * 1.e+6_rp
2675 nc(k) = nc_def(i,j) * 1.e+6_rp
2680 re(k,i,j,
i_hc) = 1.1_rp &
2681 * ( dens0(k,i,j) * qtrc0(k,i,j,i_hyd_qc) / nc(k) / ( 4.0_rp / 3.0_rp * pi * dens_w ) )**(1.0_rp/3.0_rp)
2682 re(k,i,j,
i_hc) = min( 1.e-3_rp, max( 1.e-6_rp, re(k,i,j,
i_hc) ) ) * m2cm
2690 if ( fixed_re )
then
2697 re(k,i,j,
i_hr) = 10000.e-6_rp * m2cm
2708 re(k,i,j,
i_hs) = re_qi * m2cm
2719 re(k,i,j,
i_hg) = re_qi * m2cm
2727 #ifndef __GFORTRAN__
2747 dens(k) = dens0(k,i,j)
2748 temc(k) = temp0(k,i,j) - tem00
2749 qr(k) = qtrc0(k,i,j,i_hyd_qr)
2750 qs(k) = qtrc0(k,i,j,i_hyd_qs)
2751 qg(k) = qtrc0(k,i,j,i_hyd_qg)
2755 if ( enable_wdxz2014 )
then
2758 n0r(k) = 1.16e+5_rp * exp( log( max( dens(k)*qr(k)*1000.0_rp, 1.e-2_rp ) )*0.477_rp )
2759 n0s(k) = 4.58e+9_rp * exp( log( max( dens(k)*qs(k)*1000.0_rp, 1.e-2_rp ) )*0.788_rp )
2760 n0g(k) = 9.74e+8_rp * exp( log( max( dens(k)*qg(k)*1000.0_rp, 1.e-2_rp ) )*0.816_rp )
2772 zerosw = 0.5_rp - sign(0.5_rp, qr(k) - 1.e-12_rp )
2773 rlmdr = sqrt(sqrt( dens(k) * qr(k) / ( ar * n0r(k) * gam_1br ) + zerosw )) * ( 1.0_rp-zerosw )
2775 re(k,i,j,
i_hr) = 1.5_rp * rlmdr * m2cm
2778 if ( enable_rs2014 )
then
2781 zerosw = 0.5_rp - sign(0.5_rp, qs(k) - 1.e-12_rp )
2784 zerosw = 0.5_rp - sign(0.5_rp, dens(k) * qs(k) - 1.e-12_rp )
2785 xs2 = dens(k) * qs(k) / as
2787 tems = min( -0.1_rp, temc(k) )
2788 coef_at(1) = coef_a01 + tems * ( coef_a02 + tems * ( coef_a05 + tems * coef_a09 ) )
2789 coef_at(2) = coef_a03 + tems * ( coef_a04 + tems * coef_a07 )
2790 coef_at(3) = coef_a06 + tems * coef_a08
2791 coef_at(4) = coef_a10
2792 coef_bt(1) = coef_b01 + tems * ( coef_b02 + tems * ( coef_b05 + tems * coef_b09 ) )
2793 coef_bt(2) = coef_b03 + tems * ( coef_b04 + tems * coef_b07 )
2794 coef_bt(3) = coef_b06 + tems * coef_b08
2795 coef_bt(4) = coef_b10
2798 loga_ = coef_at(1) + nm * ( coef_at(2) + nm * ( coef_at(3) + nm * coef_at(4) ) )
2799 b_ = coef_bt(1) + nm * ( coef_bt(2) + nm * ( coef_bt(3) + nm * coef_bt(4) ) )
2801 re(k,i,j,
i_hs) = 0.5_rp * exp( ln10 * loga_ + log(xs2+zerosw) * b_ ) * ( 1.0_rp-zerosw ) / ( xs2+zerosw ) * m2cm
2805 zerosw = 0.5_rp - sign(0.5_rp, qs(k) - 1.e-12_rp )
2806 rlmds = sqrt(sqrt( dens(k) * qs(k) / ( as * n0s(k) * gam_1bs ) + zerosw )) * ( 1.0_rp-zerosw )
2807 re(k,i,j,
i_hs) = 1.5_rp * rlmds * m2cm
2813 zerosw = 0.5_rp - sign(0.5_rp, qg(k) - 1.e-12_rp )
2814 rlmdg = sqrt(sqrt( dens(k) * qg(k) / ( ag * n0g(k) * gam_1bg ) + zerosw )) * ( 1.0_rp-zerosw )
2815 re(k,i,j,
i_hg) = 1.5_rp * rlmdg * m2cm
2833 KA, KS, KE, IA, IS, IE, JA, JS, JE, &
2844 integer,
intent(in) :: ka, ks, ke
2845 integer,
intent(in) :: ia, is, ie
2846 integer,
intent(in) :: ja, js, je
2848 real(
rp),
intent(in) :: qtrc(ka,ia,ja,qa_mp-1)
2850 real(
rp),
intent(out) :: qe(ka,ia,ja,
n_hyd)
2852 integer :: k, i, j, ih
2863 qe(k,i,j,
i_hc) = qtrc(k,i,j,i_hyd_qc)
2875 qe(k,i,j,
i_hr) = qtrc(k,i,j,i_hyd_qr)
2887 qe(k,i,j,
i_hi) = qtrc(k,i,j,i_hyd_qi)
2899 qe(k,i,j,
i_hs) = qtrc(k,i,j,i_hyd_qs)
2911 qe(k,i,j,
i_hg) = qtrc(k,i,j,i_hyd_qg)
2924 qe(k,i,j,ih) = 0.0_rp
2941 KA, KS, KE, IA, IS, IE, JA, JS, JE, &
2954 integer,
intent(in) :: ka, ks, ke
2955 integer,
intent(in) :: ia, is, ie
2956 integer,
intent(in) :: ja, js, je
2957 real(
rp),
intent(in) :: qe (ka,ia,ja,
n_hyd)
2958 real(
rp),
intent(out) :: qtrc(ka,ia,ja,qa_mp-1)
2971 qtrc(k,i,j,i_hyd_qc) = qe(k,i,j,
i_hc)
2983 qtrc(k,i,j,i_hyd_qr) = qe(k,i,j,
i_hr)
2995 qtrc(k,i,j,i_hyd_qi) = qe(k,i,j,
i_hi)
3007 qtrc(k,i,j,i_hyd_qs) = qe(k,i,j,
i_hs)
3019 qtrc(k,i,j,i_hyd_qg) = qe(k,i,j,
i_hg) + qe(k,i,j,
i_hh)