41 integer,
private,
parameter :: QA_MP = 6
54 'Ratio of Water Vapor mass to total mass (Specific humidity)', &
55 'Ratio of Cloud Water mass to total mass ', &
56 'Ratio of Rain Water mass to total mass ', &
57 'Ratio of Cloud Ice mass ratio to total mass ', &
58 'Ratio of Snow miass ratio to total mass ', &
59 'Ratio of Graupel mass ratio to total mass '/)
72 private :: mp_tomita08
73 private :: mp_tomita08_bergeronparam
79 integer,
private,
parameter :: i_qv = 1
80 integer,
private,
parameter :: i_qc = 2
81 integer,
private,
parameter :: i_qr = 3
82 integer,
private,
parameter :: i_qi = 4
83 integer,
private,
parameter :: i_qs = 5
84 integer,
private,
parameter :: i_qg = 6
86 integer,
private,
parameter :: i_hyd_qc = 1
87 integer,
private,
parameter :: i_hyd_qr = 2
88 integer,
private,
parameter :: i_hyd_qi = 3
89 integer,
private,
parameter :: i_hyd_qs = 4
90 integer,
private,
parameter :: i_hyd_qg = 5
92 logical,
private :: do_couple_aerosol
93 logical,
private :: do_explicit_icegen
95 logical,
private :: fixed_re = .false.
96 logical,
private :: const_rec = .true.
97 logical,
private :: nofall_qr = .false.
98 logical,
private :: nofall_qi = .false.
99 logical,
private :: nofall_qs = .false.
100 logical,
private :: nofall_qg = .false.
102 real(
rp),
private,
parameter :: dens00 = 1.28_rp
105 real(
rp),
private :: n0r_def = 8.e+6_rp
106 real(
rp),
private :: n0s_def = 3.e+6_rp
107 real(
rp),
private :: n0g_def = 4.e+6_rp
109 real(
rp),
private :: dens_s = 100.0_rp
110 real(
rp),
private :: dens_g = 400.0_rp
113 real(
rp),
private :: drag_g = 0.6_rp
114 real(
rp),
private :: re_qc = 8.e-6_rp
115 real(
rp),
private :: re_qi = 40.e-6_rp
116 real(
rp),
private :: cr = 130.0_rp
117 real(
rp),
private :: cs = 4.84_rp
120 real(
rp),
private :: ar, as, ag
121 real(
rp),
private :: br, bs, bg
122 real(
rp),
private :: cg
123 real(
rp),
private :: dr, ds, dg
126 real(
rp),
private :: gam, gam_2, gam_3
128 real(
rp),
private :: gam_1br, gam_2br, gam_3br
129 real(
rp),
private :: gam_3dr
130 real(
rp),
private :: gam_6dr
131 real(
rp),
private :: gam_1brdr
132 real(
rp),
private :: gam_5dr_h
134 real(
rp),
private :: gam_1bs, gam_2bs, gam_3bs
135 real(
rp),
private :: gam_3ds
136 real(
rp),
private :: gam_1bsds
137 real(
rp),
private :: gam_5ds_h
139 real(
rp),
private :: gam_1bg, gam_3dg
140 real(
rp),
private :: gam_1bgdg
141 real(
rp),
private :: gam_5dg_h
144 logical,
private :: enable_kk2000 = .false.
148 logical,
private :: enable_rs2014 = .false.
149 real(
rp),
private :: ln10
150 real(
rp),
private,
parameter :: coef_a01 = 5.065339_rp
151 real(
rp),
private,
parameter :: coef_a02 = -0.062659_rp
152 real(
rp),
private,
parameter :: coef_a03 = -3.032362_rp
153 real(
rp),
private,
parameter :: coef_a04 = 0.029469_rp
154 real(
rp),
private,
parameter :: coef_a05 = -0.000285_rp
155 real(
rp),
private,
parameter :: coef_a06 = 0.31255_rp
156 real(
rp),
private,
parameter :: coef_a07 = 0.000204_rp
157 real(
rp),
private,
parameter :: coef_a08 = 0.003199_rp
158 real(
rp),
private,
parameter :: coef_a09 = 0.0_rp
159 real(
rp),
private,
parameter :: coef_a10 = -0.015952_rp
161 real(
rp),
private,
parameter :: coef_b01 = 0.476221_rp
162 real(
rp),
private,
parameter :: coef_b02 = -0.015896_rp
163 real(
rp),
private,
parameter :: coef_b03 = 0.165977_rp
164 real(
rp),
private,
parameter :: coef_b04 = 0.007468_rp
165 real(
rp),
private,
parameter :: coef_b05 = -0.000141_rp
166 real(
rp),
private,
parameter :: coef_b06 = 0.060366_rp
167 real(
rp),
private,
parameter :: coef_b07 = 0.000079_rp
168 real(
rp),
private,
parameter :: coef_b08 = 0.000594_rp
169 real(
rp),
private,
parameter :: coef_b09 = 0.0_rp
170 real(
rp),
private,
parameter :: coef_b10 = -0.003577_rp
173 logical,
private :: enable_wdxz2014 = .false.
176 real(
rp),
private :: eiw = 1.0_rp
177 real(
rp),
private :: erw = 1.0_rp
178 real(
rp),
private :: esw = 1.0_rp
179 real(
rp),
private :: egw = 1.0_rp
180 real(
rp),
private :: eri = 1.0_rp
181 real(
rp),
private :: esi = 1.0_rp
182 real(
rp),
private :: egi = 0.1_rp
183 real(
rp),
private :: esr = 1.0_rp
184 real(
rp),
private :: egr = 1.0_rp
185 real(
rp),
private :: egs = 1.0_rp
186 real(
rp),
private :: gamma_sacr = 25.e-3_rp
187 real(
rp),
private :: gamma_gacs = 90.e-3_rp
188 real(
rp),
private :: mi = 4.19e-13_rp
191 real(
rp),
private,
parameter :: nc_lnd = 2000.0_rp
192 real(
rp),
private,
parameter :: nc_ocn = 50.0_rp
193 real(
rp),
private,
allocatable :: nc_def(:,:)
195 real(
rp),
private :: beta_saut = 6.e-3_rp
196 real(
rp),
private :: gamma_saut = 60.e-3_rp
197 real(
rp),
private :: beta_gaut = 0.0_rp
198 real(
rp),
private :: gamma_gaut = 90.e-3_rp
199 real(
rp),
private :: qicrt_saut = 0.0_rp
200 real(
rp),
private :: qscrt_gaut = 6.e-4_rp
203 real(
rp),
private,
parameter :: da0 = 2.428e-2_rp
204 real(
rp),
private,
parameter :: dda_dt = 7.47e-5_rp
205 real(
rp),
private,
parameter :: dw0 = 2.222e-5_rp
206 real(
rp),
private,
parameter :: ddw_dt = 1.37e-7_rp
207 real(
rp),
private,
parameter :: mu0 = 1.718e-5_rp
208 real(
rp),
private,
parameter :: dmu_dt = 5.28e-8_rp
210 real(
rp),
private,
parameter :: f1r = 0.78_rp
211 real(
rp),
private,
parameter :: f2r = 0.27_rp
212 real(
rp),
private,
parameter :: f1s = 0.65_rp
213 real(
rp),
private,
parameter :: f2s = 0.39_rp
214 real(
rp),
private,
parameter :: f1g = 0.78_rp
215 real(
rp),
private,
parameter :: f2g = 0.27_rp
218 real(
rp),
private,
parameter :: a_frz = 0.66_rp
219 real(
rp),
private,
parameter :: b_frz = 100.0_rp
222 real(
rp),
private,
parameter :: mi40 = 2.46e-10_rp
223 real(
rp),
private,
parameter :: mi50 = 4.80e-10_rp
224 real(
rp),
private,
parameter :: vti50 = 1.0_rp
225 real(
rp),
private,
parameter :: ri50 = 5.e-5_rp
228 logical,
private :: only_liquid = .false.
229 real(
rp),
private :: sw_expice = 0.0_rp
230 real(
rp),
private,
parameter :: nc_ihtr = 300.0_rp
231 real(
rp),
private,
parameter :: di_max = 500.e-6_rp
232 real(
rp),
private,
parameter :: di_a = 11.9_rp
235 real(
rp),
private :: ecoal_gi = 0.0_rp
236 real(
rp),
private :: ecoal_gs = 0.0_rp
237 real(
rp),
private :: flg_ecoali = 0.0_rp
238 real(
rp),
private :: flg_ecoals = 0.0_rp
240 integer,
private,
parameter :: w_nmax = 49
241 integer,
private,
parameter :: i_dqv_dt = 1
242 integer,
private,
parameter :: i_dqc_dt = 2
243 integer,
private,
parameter :: i_dqr_dt = 3
244 integer,
private,
parameter :: i_dqi_dt = 4
245 integer,
private,
parameter :: i_dqs_dt = 5
246 integer,
private,
parameter :: i_dqg_dt = 6
247 integer,
private,
parameter :: i_delta1 = 7
248 integer,
private,
parameter :: i_delta2 = 8
249 integer,
private,
parameter :: i_spsati = 9
250 integer,
private,
parameter :: i_iceflg = 10
251 integer,
private,
parameter :: i_rlmdr = 11
252 integer,
private,
parameter :: i_rlmds = 12
253 integer,
private,
parameter :: i_rlmdg = 13
254 integer,
private,
parameter :: i_piacr = 14
255 integer,
private,
parameter :: i_psacr = 15
256 integer,
private,
parameter :: i_praci = 16
257 integer,
private,
parameter :: i_pigen = 17
258 integer,
private,
parameter :: i_pidep = 18
259 integer,
private,
parameter :: i_psdep = 19
260 integer,
private,
parameter :: i_pgdep = 20
261 integer,
private,
parameter :: i_praut = 21
262 integer,
private,
parameter :: i_pracw = 22
263 integer,
private,
parameter :: i_pihom = 23
264 integer,
private,
parameter :: i_pihtr = 24
265 integer,
private,
parameter :: i_psacw = 25
266 integer,
private,
parameter :: i_psfw = 26
267 integer,
private,
parameter :: i_pgacw = 27
268 integer,
private,
parameter :: i_prevp = 28
269 integer,
private,
parameter :: i_piacr_s = 29
270 integer,
private,
parameter :: i_psacr_s = 30
271 integer,
private,
parameter :: i_piacr_g = 31
272 integer,
private,
parameter :: i_psacr_g = 32
273 integer,
private,
parameter :: i_pgacr = 33
274 integer,
private,
parameter :: i_pgfrz = 34
275 integer,
private,
parameter :: i_pisub = 35
276 integer,
private,
parameter :: i_pimlt = 36
277 integer,
private,
parameter :: i_psaut = 37
278 integer,
private,
parameter :: i_praci_s = 38
279 integer,
private,
parameter :: i_psaci = 39
280 integer,
private,
parameter :: i_psfi = 40
281 integer,
private,
parameter :: i_praci_g = 41
282 integer,
private,
parameter :: i_pgaci = 42
283 integer,
private,
parameter :: i_pssub = 43
284 integer,
private,
parameter :: i_psmlt = 44
285 integer,
private,
parameter :: i_pgaut = 45
286 integer,
private,
parameter :: i_pracs = 46
287 integer,
private,
parameter :: i_pgacs = 47
288 integer,
private,
parameter :: i_pgsub = 48
289 integer,
private,
parameter :: i_pgmlt = 49
291 character(len=H_SHORT),
private :: w_name(w_nmax)
293 data w_name /
'dqv_dt ', &
343 real(
rp),
private,
allocatable :: w3d(:,:,:,:)
344 integer,
private :: hist_id(w_nmax)
353 KA, KS, KE, IA, IS, IE, JA, JS, JE, &
368 integer,
intent(in) :: ka, ks, ke
369 integer,
intent(in) :: ia, is, ie
370 integer,
intent(in) :: ja, js, je
372 logical,
intent(in),
optional :: flg_lt
374 real(
rp) :: autoconv_nc = nc_ocn
376 namelist / param_atmos_phy_mp_tomita08 / &
378 do_explicit_icegen, &
421 real(
rp),
parameter :: max_term_vel = 10.0_rp
430 log_info(
"ATMOS_PHY_MP_tomita08_setup",*)
'Setup'
431 log_info(
"ATMOS_PHY_MP_tomita08_setup",*)
'Tomita (2008) 1-moment bulk 6 category'
433 allocate( w3d(ka,ia,ja,w_nmax) )
434 w3d(:,:,:,:) = 0.0_rp
436 allocate( nc_def(ia,ja) )
441 read(
io_fid_conf,nml=param_atmos_phy_mp_tomita08,iostat=ierr)
443 log_info(
"ATMOS_PHY_MP_tomita08_setup",*)
'Not found namelist. Default used.'
444 elseif( ierr > 0 )
then
445 log_error(
"ATMOS_PHY_MP_tomita08_setup",*)
'Not appropriate names in namelist PARAM_ATMOS_PHY_MP_TOMITA08. Check!'
448 log_nml(param_atmos_phy_mp_tomita08)
451 log_info(
"ATMOS_PHY_MP_tomita08_setup",*)
'density of the snow [kg/m3] : ', dens_s
452 log_info(
"ATMOS_PHY_MP_tomita08_setup",*)
'density of the graupel [kg/m3] : ', dens_g
453 log_info(
"ATMOS_PHY_MP_tomita08_setup",*)
'Nc for auto-conversion [num/m3]: ', autoconv_nc
454 log_info(
"ATMOS_PHY_MP_tomita08_setup",*)
'Use k-k scheme? : ', enable_kk2000
455 log_info(
"ATMOS_PHY_MP_tomita08_setup",*)
'Use Roh scheme? : ', enable_rs2014
456 log_info(
"ATMOS_PHY_MP_tomita08_setup",*)
'Use WDXZ scheme? : ', enable_wdxz2014
458 log_info(
"ATMOS_PHY_MP_tomita08_setup",*)
'Use effective radius of ice for snow and graupel,'
459 log_info(
"ATMOS_PHY_MP_tomita08_setup",*)
' and set rain transparent? : ', fixed_re
460 log_info(
"ATMOS_PHY_MP_tomita08_setup",*)
'Density of the ice is used for the calculation of '
461 log_info(
"ATMOS_PHY_MP_tomita08_setup",*)
' optically effective volume of snow and graupel.'
462 log_info(
"ATMOS_PHY_MP_tomita08_setup",*)
'Surpress sedimentation of rain? : ', nofall_qr
463 log_info(
"ATMOS_PHY_MP_tomita08_setup",*)
'Surpress sedimentation of ice? : ', nofall_qi
464 log_info(
"ATMOS_PHY_MP_tomita08_setup",*)
'Surpress sedimentation of snow? : ', nofall_qs
465 log_info(
"ATMOS_PHY_MP_tomita08_setup",*)
'Surpress sedimentation of graupel? : ', nofall_qg
466 log_info(
"ATMOS_PHY_MP_tomita08_setup",*)
'Enable explicit ice generation? : ', do_explicit_icegen
471 nc_def(i,j) = autoconv_nc
476 ar = pi * dens_w / 6.0_rp
477 as = pi * dens_s / 6.0_rp
478 ag = pi * dens_g / 6.0_rp
484 cg = sqrt( ( 4.0_rp * dens_g * grav ) / ( 3.0_rp * dens00 * drag_g ) )
490 if ( enable_rs2014 )
then
491 do_explicit_icegen = .true.
501 if ( do_explicit_icegen )
then
505 only_liquid = .false.
518 gam_1brdr =
sf_gamma( 1.0_rp + br + dr )
519 gam_5dr_h =
sf_gamma( 0.5_rp * (5.0_rp+dr) )
525 gam_1bsds =
sf_gamma( 1.0_rp + bs + ds )
526 gam_5ds_h =
sf_gamma( 0.5_rp * (5.0_rp+ds) )
530 gam_1bgdg =
sf_gamma( 1.0_rp + bg + dg)
531 gam_5dg_h =
sf_gamma( 0.5_rp * (5.0_rp+dg) )
537 call file_history_reg( w_name(ip),
'individual tendency term in tomita08',
'kg/kg/s', &
542 if(
present(flg_lt) )
then
548 if( enable_rs2014 )
then
549 write(*,*)
'xxx ROH and Satoh (2014) scheme is not supported for Lightning'
553 if( ecoal_gi == 0.0_rp )
then
559 if( ecoal_gs == 0.0_rp )
then
579 KA, KS, KE, IA, IS, IE, JA, JS, JE, &
583 TEMP, QTRC, CPtot, CVtot, &
585 flg_lt, d0_crg, v0_crg, &
587 QSPLT_in, Sarea, QTRC_crg )
594 mp_saturation_adjustment => atmos_phy_mp_saturation_adjustment
596 integer,
intent(in) :: ka, ks, ke
597 integer,
intent(in) :: ia, is, ie
598 integer,
intent(in) :: ja, js, je
600 real(
rp),
intent(in) :: dens (ka,ia,ja)
601 real(
rp),
intent(in) :: pres (ka,ia,ja)
602 real(
rp),
intent(in) :: ccn (ka,ia,ja)
603 real(
dp),
intent(in) :: dt
605 real(
rp),
intent(inout) :: temp(ka,ia,ja)
606 real(
rp),
intent(inout) :: qtrc(ka,ia,ja,qa_mp)
607 real(
rp),
intent(inout) :: cptot(ka,ia,ja)
608 real(
rp),
intent(inout) :: cvtot(ka,ia,ja)
610 real(
rp),
intent(out) :: rhoe_t (ka,ia,ja)
611 real(
rp),
intent(out) :: evaporate(ka,ia,ja)
614 logical,
intent(in),
optional :: flg_lt
615 real(
rp),
intent(in),
optional :: d0_crg, v0_crg
616 real(
rp),
intent(in),
optional :: dqcrg(ka,ia,ja)
617 real(
rp),
intent(in),
optional :: beta_crg(ka,ia,ja)
618 real(
rp),
intent(out),
optional :: sarea(ka,ia,ja,qa_mp-1)
619 real(
rp),
intent(out),
optional :: qsplt_in(ka,ia,ja,3)
620 real(
rp),
intent(inout),
optional :: qtrc_crg(ka,ia,ja,qa_mp-1)
622 real(
rp) :: rhoe_d_sat(ka,ia,ja)
624 real(
rp) :: qc_t_sat(ka,ia,ja)
625 real(
rp) :: qi_t_sat(ka,ia,ja)
630 log_progress(*)
'atmosphere / physics / microphysics / Tomita08'
634 ka, ks, ke, ia, is, ie, ja, js, je, &
635 dens(:,:,:), pres(:,:,:), ccn(:,:,:), &
637 temp(:,:,:), qtrc(:,:,:,:), &
638 cptot(:,:,:), cvtot(:,:,:), &
640 flg_lt, d0_crg, v0_crg, &
641 dqcrg(:,:,:), beta_crg(:,:,:), &
650 qc_t_sat(k,i,j) = qtrc(k,i,j,i_qc)
651 qi_t_sat(k,i,j) = qtrc(k,i,j,i_qi)
656 call mp_saturation_adjustment( &
657 ka, ks, ke, ia, is, ie, ja, js, je, &
662 qtrc(:,:,:,i_qc), qtrc(:,:,:,i_qi), &
663 cptot(:,:,:), cvtot(:,:,:), &
669 rhoe_t(k,i,j) = rhoe_t(k,i,j) + rhoe_d_sat(k,i,j) / dt
676 qc_t_sat(k,i,j) = ( qtrc(k,i,j,i_qc) - qc_t_sat(k,i,j) ) / dt
683 qi_t_sat(k,i,j) = ( qtrc(k,i,j,i_qi) - qi_t_sat(k,i,j) ) / dt
688 call file_history_in( qc_t_sat(:,:,:),
'Pcsat',
'QC production term by satadjust',
'kg/kg/s' )
689 call file_history_in( qi_t_sat(:,:,:),
'Pisat',
'QI production term by satadjust',
'kg/kg/s' )
694 evaporate(k,i,j) = max( -qc_t_sat(k,i,j), 0.0_rp ) &
695 * dens(k,i,j) / (4.0_rp/3.0_rp*pi*dwatr*re_qc**3)
707 subroutine mp_tomita08( &
708 KA, KS, KE, IA, IS, IE, JA, JS, JE, &
735 file_history_query, &
749 saturation_dens2qsat_liq => atmos_saturation_dens2qsat_liq, &
750 saturation_dens2qsat_ice => atmos_saturation_dens2qsat_ice
752 integer,
intent(in) :: ka, ks, ke
753 integer,
intent(in) :: ia, is, ie
754 integer,
intent(in) :: ja, js, je
756 real(
rp),
intent(in) :: dens0(ka,ia,ja)
757 real(
rp),
intent(in) :: pres0(ka,ia,ja)
758 real(
rp),
intent(in) :: ccn (ka,ia,ja)
759 real(
dp),
intent(in) :: dt
761 real(
rp),
intent(inout) :: temp0 (ka,ia,ja)
762 real(
rp),
intent(inout) :: qtrc0 (ka,ia,ja,qa_mp)
763 real(
rp),
intent(inout) :: cptot0(ka,ia,ja)
764 real(
rp),
intent(inout) :: cvtot0(ka,ia,ja)
766 real(
rp),
intent(out) :: rhoe_t(ka,ia,ja)
768 logical,
intent(in),
optional :: flg_lt
769 real(
rp),
intent(in),
optional :: d0_crg, v0_crg
770 real(
rp),
intent(in),
optional :: dqcrg(ka,ia,ja)
771 real(
rp),
intent(in),
optional :: beta_crg(ka,ia,ja)
772 real(
rp),
intent(out),
optional :: qsplt_in(ka,ia,ja,3)
773 real(
rp),
intent(out),
optional :: sarea(ka,ia,ja,qa_mp-1)
774 real(
rp),
intent(inout),
optional :: qtrc_crg0(ka,ia,ja,qa_mp-1)
778 real(
rp) :: cptot, cvtot(ka)
779 real(
rp) :: qv(ka), qc(ka), qr(ka), qi(ka), qs(ka), qg(ka)
780 real(
rp) :: qv_t(ka), qc_t(ka), qr_t(ka), qi_t(ka), qs_t(ka), qg_t(ka)
781 real(
rp) :: e_t, cp_t, cv_t
783 real(
rp) :: qsatl(ka)
784 real(
rp) :: qsati(ka)
789 real(
rp) :: rdens(ka)
790 real(
rp) :: rho_fact(ka)
793 real(
rp) :: n0r(ka), n0s(ka), n0g(ka)
795 real(
rp) :: rlmdr(ka), rlmdr_2(ka), rlmdr_3(ka)
796 real(
rp) :: rlmds, rlmds_2, rlmds_3
797 real(
rp) :: rlmdg(ka), rlmdg_2(ka), rlmdg_3(ka)
798 real(
rp) :: rlmdr_1br(ka), rlmdr_2br(ka), rlmdr_3br(ka)
799 real(
rp) :: rlmds_1bs, rlmds_2bs, rlmds_3bs
800 real(
rp) :: rlmdr_dr(ka), rlmdr_3dr(ka), rlmdr_5dr(ka)
801 real(
rp) :: rlmds_ds, rlmds_3ds, rlmds_5ds
802 real(
rp) :: rlmdg_dg(ka), rlmdg_3dg(ka), rlmdg_5dg(ka)
803 real(
rp) :: rlmdr_7(ka)
804 real(
rp) :: rlmdr_6dr(ka)
807 real(
rp) :: tems, xs2
808 real(
rp) :: moms_0(ka), moms_1(ka), moms_2(ka)
809 real(
rp) :: moms_0bs(ka), moms_1bs(ka), moms_2bs(ka)
810 real(
rp) :: moms_2ds(ka), moms_5ds_h(ka), rmoms_vt(ka)
811 real(
rp) :: coef_at(4), coef_bt(4)
812 real(
rp) :: loga_, b_, nm
814 real(
rp) :: vti(ka), vtr(ka), vts(ka), vtg(ka)
815 real(
rp) :: esi_mod, egs_mod
818 real(
rp) :: pracw_orig, pracw_kk
819 real(
rp) :: praut_berry, praut_kk
821 real(
rp) :: betai, betas
825 real(
rp) :: glv(ka), giv(ka), gil(ka)
826 real(
rp) :: ventr, vents, ventg
827 real(
rp) :: net, fac, fac_sw
828 real(
rp) :: zerosw, tmp
831 real(
rp) :: sw_bergeron(ka)
832 real(
rp) :: a1(ka), a2(ka)
838 real(
rp) :: sw, rhoqi, xni, xmi, di, nig, qig
840 logical :: hist_sw(w_nmax), hist_flag
841 real(
rp) :: w(ka,w_nmax)
843 integer :: k, i, j, ip
846 integer,
parameter :: i_qgaci = 1
847 integer,
parameter :: i_qgacs = 2
848 real(
rp) :: qcrg_c(ka), qcrg_r(ka)
849 real(
rp) :: qcrg_i(ka), qcrg_s(ka), qcrg_g(ka)
850 real(
rp) :: w_q(ka,w_nmax)
851 real(
rp) :: w_qcrg(ka,2)
852 real(
rp) :: rdens_r, rdens_i, rdens_s, rdens_g
853 real(
rp) :: dcrg(ka), beta1_crg(ka), re_qs(ka)
856 real(
rp) :: facq(i_qc:i_qg)
858 integer :: grid(2), pp, qq, iq
859 real(
rp) :: qc_crg_t(ka), qr_crg_t(ka), qi_crg_t(ka), qs_crg_t(ka), qg_crg_t(ka)
860 real(
rp) :: rlambda(i_qc:i_qg)
865 rdens_i = 1.0_rp / dice
866 rdens_g = 1.0_rp / dens_g
867 rdens_r = 1.0_rp / dwatr
868 rdens_s = 1.0_rp / dens_s
869 if (
present(flg_lt) )
then
875 qsplt_in(:,:,:,:) = 0.0_rp
877 ka, ks, ke, ia, is, ie, ja, js, je, &
878 dens0, temp0, qtrc0, &
884 call file_history_query( hist_id(ip), hist_sw(ip) )
885 hist_flag = hist_flag .or. hist_sw(ip)
921 if ( do_couple_aerosol )
then
923 nc(k) = max( ccn(k,i,j)*1.e-6_rp, nc_def(i,j) )
933 dens(k) = dens0(k,i,j)
936 temp(k) = temp0(k,i,j)
939 call saturation_dens2qsat_liq( ka, ks, ke, &
943 call saturation_dens2qsat_ice( ka, ks, ke, &
949 qv(k) = max( qtrc0(k,i,j,i_qv), 0.0_rp )
952 qc(k) = max( qtrc0(k,i,j,i_qc), 0.0_rp )
955 qr(k) = max( qtrc0(k,i,j,i_qr), 0.0_rp )
958 qi(k) = max( qtrc0(k,i,j,i_qi), 0.0_rp )
961 qs(k) = max( qtrc0(k,i,j,i_qs), 0.0_rp )
964 qg(k) = max( qtrc0(k,i,j,i_qg), 0.0_rp )
970 qcrg_c(k) = qtrc_crg0(k,i,j,i_qc-1)
973 qcrg_r(k) = qtrc_crg0(k,i,j,i_qr-1)
976 qcrg_i(k) = qtrc_crg0(k,i,j,i_qi-1)
979 qcrg_s(k) = qtrc_crg0(k,i,j,i_qs-1)
982 qcrg_g(k) = qtrc_crg0(k,i,j,i_qg-1)
985 re_qs(k) = re(k,i,j,
i_hs) * 1.0e-2_rp
988 beta1_crg(k) = beta_crg(k,i,j)
989 dcrg(k) = - dqcrg(k,i,j)
995 sliq(k) = qv(k) / max( qsatl(k), eps )
996 sice(k) = qv(k) / max( qsati(k), eps )
998 rdens(k) = 1.0_rp / dens(k)
999 rho_fact(k) = sqrt( dens00 * rdens(k) )
1000 temc(k) = temp(k) - tem00
1004 w(k,i_delta1) = ( 0.5_rp + sign(0.5_rp, qr(k) - 1.e-4_rp ) )
1006 w(k,i_delta2) = ( 0.5_rp + sign(0.5_rp, 1.e-4_rp - qr(k) ) ) &
1007 * ( 0.5_rp + sign(0.5_rp, 1.e-4_rp - qs(k) ) )
1009 w(k,i_spsati) = 0.5_rp + sign(0.5_rp, sice(k) - 1.0_rp )
1011 w(k,i_iceflg) = 0.5_rp - sign( 0.5_rp, temc(k) )
1015 w(k,i_dqv_dt) = qv(k) / dt
1016 w(k,i_dqc_dt) = qc(k) / dt
1017 w(k,i_dqr_dt) = qr(k) / dt
1018 w(k,i_dqi_dt) = qi(k) / dt
1019 w(k,i_dqs_dt) = qs(k) / dt
1020 w(k,i_dqg_dt) = qg(k) / dt
1024 sw_bergeron(k) = ( 0.5_rp + sign(0.5_rp, temc(k) + 30.0_rp ) ) &
1025 * ( 0.5_rp + sign(0.5_rp, 0.0_rp - temc(k) ) ) &
1026 * ( 1.0_rp - sw_expice )
1030 if ( enable_wdxz2014 )
then
1032 n0r(k) = 1.16e+5_rp * exp( log( max( dens(k)*qr(k)*1000.0_rp, 1.e-2_rp ) )*0.477_rp )
1033 n0s(k) = 4.58e+9_rp * exp( log( max( dens(k)*qs(k)*1000.0_rp, 1.e-2_rp ) )*0.788_rp )
1034 n0g(k) = 9.74e+8_rp * exp( log( max( dens(k)*qg(k)*1000.0_rp, 1.e-2_rp ) )*0.816_rp )
1046 zerosw = 0.5_rp - sign(0.5_rp, qr(k) - 1.e-12_rp )
1047 rlmdr(k) = sqrt(sqrt( dens(k) * qr(k) / ( ar * n0r(k) * gam_1br ) + zerosw )) * ( 1.0_rp-zerosw )
1049 rlmdr_dr(k) = sqrt( rlmdr(k) )
1050 rlmdr_2(k) = rlmdr(k)**2
1051 rlmdr_3(k) = rlmdr(k)**3
1052 rlmdr_7(k) = rlmdr(k)**7
1053 rlmdr_1br(k) = rlmdr(k)**4
1054 rlmdr_2br(k) = rlmdr(k)**5
1055 rlmdr_3br(k) = rlmdr(k)**6
1056 rlmdr_3dr(k) = rlmdr(k)**3 * rlmdr_dr(k)
1057 rlmdr_5dr(k) = rlmdr(k)**5 * rlmdr_dr(k)
1058 rlmdr_6dr(k) = rlmdr(k)**6 * rlmdr_dr(k)
1060 w(k,i_rlmdr) = rlmdr(k)
1064 if ( enable_rs2014 )
then
1068 zerosw = 0.5_rp - sign(0.5_rp, dens(k) * qs(k) - 1.e-12_rp )
1070 xs2 = dens(k) * qs(k) / as
1071 tems = min( -0.1_rp, temc(k) )
1072 coef_at(1) = coef_a01 + tems * ( coef_a02 + tems * ( coef_a05 + tems * coef_a09 ) )
1073 coef_at(2) = coef_a03 + tems * ( coef_a04 + tems * coef_a07 )
1074 coef_at(3) = coef_a06 + tems * coef_a08
1075 coef_at(4) = coef_a10
1076 coef_bt(1) = coef_b01 + tems * ( coef_b02 + tems * ( coef_b05 + tems * coef_b09 ) )
1077 coef_bt(2) = coef_b03 + tems * ( coef_b04 + tems * coef_b07 )
1078 coef_bt(3) = coef_b06 + tems * coef_b08
1079 coef_bt(4) = coef_b10
1083 moms_0(k) = exp(ln10*loga_) * exp(log(xs2+zerosw)*b_) * ( 1.0_rp-zerosw )
1086 loga_ = coef_at(1) + nm * ( coef_at(2) + nm * ( coef_at(3) + nm * coef_at(4) ) )
1087 b_ = coef_bt(1) + nm * ( coef_bt(2) + nm * ( coef_bt(3) + nm * coef_bt(4) ) )
1088 moms_1(k) = exp(ln10*loga_) * exp(log(xs2+zerosw)*b_) * ( 1.0_rp-zerosw )
1093 loga_ = coef_at(1) + nm * ( coef_at(2) + nm * ( coef_at(3) + nm * coef_at(4) ) )
1094 b_ = coef_bt(1) + nm * ( coef_bt(2) + nm * ( coef_bt(3) + nm * coef_bt(4) ) )
1095 moms_0bs(k) = exp(ln10*loga_) * exp(log(xs2+zerosw)*b_) * ( 1.0_rp-zerosw )
1098 loga_ = coef_at(1) + nm * ( coef_at(2) + nm * ( coef_at(3) + nm * coef_at(4) ) )
1099 b_ = coef_bt(1) + nm * ( coef_bt(2) + nm * ( coef_bt(3) + nm * coef_bt(4) ) )
1100 moms_1bs(k) = exp(ln10*loga_) * exp(log(xs2+zerosw)*b_) * ( 1.0_rp-zerosw )
1103 loga_ = coef_at(1) + nm * ( coef_at(2) + nm * ( coef_at(3) + nm * coef_at(4) ) )
1104 b_ = coef_bt(1) + nm * ( coef_bt(2) + nm * ( coef_bt(3) + nm * coef_bt(4) ) )
1105 moms_2bs(k) = exp(ln10*loga_) * exp(log(xs2+zerosw)*b_) * ( 1.0_rp-zerosw )
1108 loga_ = coef_at(1) + nm * ( coef_at(2) + nm * ( coef_at(3) + nm * coef_at(4) ) )
1109 b_ = coef_bt(1) + nm * ( coef_bt(2) + nm * ( coef_bt(3) + nm * coef_bt(4) ) )
1110 moms_2ds(k) = exp(ln10*loga_) * exp(log(xs2+zerosw)*b_) * ( 1.0_rp-zerosw )
1113 loga_ = coef_at(1) + nm * ( coef_at(2) + nm * ( coef_at(3) + nm * coef_at(4) ) )
1114 b_ = coef_bt(1) + nm * ( coef_bt(2) + nm * ( coef_bt(3) + nm * coef_bt(4) ) )
1115 moms_5ds_h(k) = exp(ln10*loga_) * exp(log(xs2+zerosw)*b_) * ( 1.0_rp-zerosw )
1118 loga_ = coef_at(1) + nm * ( coef_at(2) + nm * ( coef_at(3) + nm * coef_at(4) ) )
1119 b_ = coef_bt(1) + nm * ( coef_bt(2) + nm * ( coef_bt(3) + nm * coef_bt(4) ) )
1120 rmoms_vt(k) = exp(ln10*loga_) * exp(log(xs2+zerosw)*b_) * ( 1.0_rp-zerosw ) / ( moms_0bs(k) + zerosw )
1122 w(k,i_rlmds) = undef
1126 zerosw = 0.5_rp - sign(0.5_rp, dens(k) * qs(k) - 1.e-12_rp )
1128 rlmds = sqrt(sqrt( dens(k) * qs(k) / ( as * n0s(k) * gam_1bs ) + zerosw )) * ( 1.0_rp-zerosw )
1129 rlmds_ds = sqrt( sqrt(rlmds) )
1131 rlmds_3 = rlmds_2 * rlmds
1132 rlmds_1bs = rlmds_2 * rlmds_2
1133 rlmds_2bs = rlmds_3 * rlmds_2
1134 rlmds_3bs = rlmds_3 * rlmds_3
1135 rlmds_3ds = rlmds_3 * rlmds_ds
1136 rlmds_5ds = rlmds_2 * rlmds_3ds
1138 moms_0(k) = n0s(k) * gam * rlmds
1139 moms_1(k) = n0s(k) * gam_2 * rlmds_2
1140 moms_2(k) = n0s(k) * gam_3 * rlmds_3
1141 moms_0bs(k) = n0s(k) * gam_1bs * rlmds_1bs
1142 moms_1bs(k) = n0s(k) * gam_2bs * rlmds_2bs
1143 moms_2bs(k) = n0s(k) * gam_3bs * rlmds_3bs
1144 moms_2ds(k) = n0s(k) * gam_3ds * rlmds_3ds
1145 moms_5ds_h(k) = n0s(k) * gam_5ds_h * sqrt(rlmds_5ds)
1146 rmoms_vt(k) = gam_1bsds / gam_1bs * rlmds_ds
1148 w(k,i_rlmds) = rlmds
1154 zerosw = 0.5_rp - sign(0.5_rp, qg(k) - 1.e-12_rp )
1155 rlmdg(k) = sqrt(sqrt( dens(k) * qg(k) / ( ag * n0g(k) * gam_1bg ) + zerosw )) * ( 1.0_rp-zerosw )
1157 rlmdg_dg(k) = sqrt( rlmdg(k) )
1158 rlmdg_2(k) = rlmdg(k)**2
1159 rlmdg_3(k) = rlmdg(k) * rlmdg_2(k)
1160 rlmdg_3dg(k) = rlmdg_3(k) * rlmdg_dg(k)
1161 rlmdg_5dg(k) = rlmdg_2(k) * rlmdg_3dg(k)
1163 w(k,i_rlmdg) = rlmdg(k)
1168 zerosw = 0.5_rp - sign(0.5_rp, qi(k) - 1.e-8_rp )
1169 vti(k) = -3.29_rp * exp( log( dens(k)*qi(k)+zerosw )*0.16_rp ) * ( 1.0_rp-zerosw )
1170 vtr(k) = -cr * rho_fact(k) * gam_1brdr / gam_1br * rlmdr_dr(k)
1171 vts(k) = -cs * rho_fact(k) * rmoms_vt(k)
1172 vtg(k) = -cg * rho_fact(k) * gam_1bgdg / gam_1bg * rlmdg_dg(k)
1178 nig = max( exp(-0.1_rp*temc(k)), 1.0_rp ) * 1000.0_rp
1179 qig = 4.92e-11_rp * exp(log(nig)*1.33_rp) * rdens(k)
1181 w(k,i_pigen) = max( min( qig-qi(k), qv(k)-qsati(k) ), 0.0_rp ) / dt
1187 if ( enable_kk2000 )
then
1189 zerosw = 0.5_rp - sign(0.5_rp, qc(k)*qr(k) - 1.e-12_rp )
1190 pracw_kk = 67.0_rp * exp( log( qc(k)*qr(k)+zerosw )*1.15_rp ) * ( 1.0_rp-zerosw )
1191 w(k,i_pracw) = pracw_kk
1195 pracw_orig = qc(k) * 0.25_rp * pi * erw * n0r(k) * cr * gam_3dr * rlmdr_3dr(k) * rho_fact(k)
1196 w(k,i_pracw) = pracw_orig
1203 w(k,i_psacw) = qc(k) * 0.25_rp * pi * esw * cs * moms_2ds(k) * rho_fact(k)
1205 w(k,i_pgacw) = qc(k) * 0.25_rp * pi * egw * n0g(k) * cg * gam_3dg * rlmdg_3dg(k) * rho_fact(k)
1209 esi_mod = min( esi, esi * exp( gamma_sacr * temc(k) ) )
1211 w(k,i_praci) = qi(k) * 0.25_rp * pi * eri * n0r(k) * cr * gam_3dr * rlmdr_3dr(k) * rho_fact(k)
1213 w(k,i_psaci) = qi(k) * 0.25_rp * pi * esi_mod * cs * moms_2ds(k) * rho_fact(k)
1215 w(k,i_pgaci) = qi(k) * 0.25_rp * pi * egi * n0g(k) * cg * gam_3dg * rlmdg_3dg(k) * rho_fact(k)
1217 w(k,i_piacr) = qi(k) * ar / mi * 0.25_rp * pi * eri * n0r(k) * cr * gam_6dr * rlmdr_6dr(k) * rho_fact(k)
1220 if ( flg_lt_l )
then
1223 alpha = 5.0_rp * ( 2.0_rp * re_qi / d0_crg )**2 * ( -vtg(k) ) / v0_crg
1224 alpha = min( alpha, 10.0_rp )
1225 w_qcrg(k,i_qgaci) = dens(k) * qi(k) * 1.5_rp &
1226 * cg * gam_3dg * rlmdg_3dg(k) * rho_fact(k) * rdens_i &
1227 * sign( min( abs(dcrg(k)*alpha),20.0_rp ),dcrg(k)*alpha ) * beta1_crg(k) &
1228 * n0g(k) / ( 2.0_rp * re_qi )**3 &
1229 * ( ( 1.0_rp - flg_ecoali ) * ( 1.0_rp-egi ) &
1230 + ( flg_ecoali ) * egi * ( 1.0_rp-ecoal_gi ) / ecoal_gi )
1231 qsplt_in(k,i,j,1) = qsplt_in(k,i,j,1) - w_qcrg(k,i_qgaci)
1232 qsplt_in(k,i,j,2) = qsplt_in(k,i,j,2) + w_qcrg(k,i_qgaci)
1238 w(k,i_psacr) = ar * 0.25_rp * pi * rdens(k) * esr * n0r(k) * abs(vtr(k)-vts(k)) &
1239 * ( gam_1br * rlmdr_1br(k) * moms_2(k) &
1240 + 2.0_rp * gam_2br * rlmdr_2br(k) * moms_1(k) &
1241 + gam_3br * rlmdr_3br(k) * moms_0(k) )
1244 w(k,i_pgacr) = ar * 0.25_rp * pi * rdens(k) * egr * n0g(k) * n0r(k) * abs(vtg(k)-vtr(k)) &
1245 * ( gam_1br * rlmdr_1br(k) * gam_3 * rlmdg_3(k) &
1246 + 2.0_rp * gam_2br * rlmdr_2br(k) * gam_2 * rlmdg_2(k) &
1247 + gam_3br * rlmdr_3br(k) * gam * rlmdg(k) )
1250 w(k,i_pracs) = as * 0.25_rp * pi * rdens(k) * esr * n0r(k) * abs(vtr(k)-vts(k)) &
1251 * ( moms_0bs(k) * gam_3 * rlmdr_3(k) &
1252 + 2.0_rp * moms_1bs(k) * gam_2 * rlmdr_2(k) &
1253 + moms_2bs(k) * gam * rlmdr(k) )
1256 egs_mod = min( egs, egs * exp( gamma_gacs * temc(k) ) )
1257 w(k,i_pgacs) = as * 0.25_rp * pi * rdens(k) * egs_mod * n0g(k) * abs(vtg(k)-vts(k)) &
1258 * ( moms_0bs(k) * gam_3 * rlmdg_3(k) &
1259 + 2.0_rp * moms_1bs(k) * gam_2 * rlmdg_2(k) &
1260 + moms_2bs(k) * gam * rlmdg(k) )
1262 if ( flg_lt_l )
then
1265 alpha = 5.0_rp * ( 2.0_rp * re_qs(k) / d0_crg )**2 * ( -vtg(k) ) / v0_crg
1266 alpha = min( alpha, 10.0_rp )
1267 w_qcrg(k,i_qgacs) = 0.25_rp * pi * rdens(k) &
1268 * n0g(k) * n0s(k) * abs(vtg(k)-vts(k)) * beta1_crg(k) &
1269 * sign( min( abs(dcrg(k)*alpha),50.0_rp ),dcrg(k)*alpha ) &
1270 * ( gam_3 * gam * w(k,i_rlmds)**3 * rlmdg(k) &
1271 + gam_2 * gam_2 * w(k,i_rlmds)**2 * rlmdg_2(k) &
1272 + gam * gam_3 * w(k,i_rlmds) * rlmdg_3(k) ) &
1273 * ( ( 1.0_rp - flg_ecoals ) * ( 1.0_rp-egs_mod ) &
1274 + ( flg_ecoals ) * egs_mod * ( 1.0_rp-ecoal_gs ) / ecoal_gs )
1275 qsplt_in(k,i,j,1) = qsplt_in(k,i,j,1) - w_qcrg(k,i_qgacs)
1276 qsplt_in(k,i,j,3) = qsplt_in(k,i,j,3) + w_qcrg(k,i_qgacs)
1283 if ( enable_kk2000 )
then
1285 zerosw = 0.5_rp - sign(0.5_rp, qc(k) - 1.e-12_rp )
1286 praut_kk = 1350.0_rp &
1287 * exp( log( qc(k)+zerosw )*2.47_rp ) * ( 1.0_rp-zerosw ) &
1288 * exp( log( nc(k) )*(-1.79_rp) )
1289 w(k,i_praut) = praut_kk
1293 rhoqc = dens(k) * qc(k) * 1000.0_rp
1294 dc = 0.146_rp - 5.964e-2_rp * log( nc(k) / 2000.0_rp )
1295 praut_berry = rdens(k) * 1.67e-5_rp * rhoqc * rhoqc / ( 5.0_rp + 3.66e-2_rp * nc(k) / ( dc * rhoqc + eps ) )
1296 w(k,i_praut) = praut_berry
1302 betai = min( beta_saut, beta_saut * exp( gamma_saut * temc(k) ) )
1303 w(k,i_psaut) = max( betai*(qi(k)-qicrt_saut), 0.0_rp )
1305 betas = min( beta_gaut, beta_gaut * exp( gamma_gaut * temc(k) ) )
1306 w(k,i_pgaut) = max( betas*(qs(k)-qscrt_gaut), 0.0_rp )
1311 da = ( da0 + dda_dt * temc(k) )
1312 kd = ( dw0 + ddw_dt * temc(k) ) * pre00 / pres0(k,i,j)
1313 nu(k) = ( mu0 + dmu_dt * temc(k) ) * rdens(k)
1315 glv(k) = 1.0_rp / ( lhv0/(da*temp(k)) * ( lhv0/(rvap*temp(k)) - 1.0_rp ) + 1.0_rp/(kd*dens(k)*qsatl(k)) )
1316 giv(k) = 1.0_rp / ( lhs0/(da*temp(k)) * ( lhs0/(rvap*temp(k)) - 1.0_rp ) + 1.0_rp/(kd*dens(k)*qsati(k)) )
1317 gil(k) = ( da * temc(k) ) / lhf0
1322 ventr = f1r * gam_2 * rlmdr_2(k) + f2r * sqrt( cr * rho_fact(k) / nu(k) * rlmdr_5dr(k) ) * gam_5dr_h
1323 w(k,i_prevp) = 2.0_rp * pi * rdens(k) * n0r(k) * ( 1.0_rp-min(sliq(k),1.0_rp) ) * glv(k) * ventr
1328 rhoqi = max(dens(k)*qi(k), eps)
1329 xni = min( max( 5.38e+7_rp * exp( log(rhoqi)*0.75_rp ), 1.e+3_rp ), 1.e+6_rp )
1331 di = min( di_a * sqrt(xmi), di_max )
1332 tmp = 4.0_rp * di * xni * rdens(k) * ( sice(k)-1.0_rp ) * giv(k)
1333 w(k,i_pidep) = ( w(k,i_spsati) ) * ( tmp)
1334 w(k,i_pisub) = ( 1.0_rp-w(k,i_spsati) ) * (-tmp)
1339 sw = ( 0.5_rp - sign(0.5_rp, temc(k) + 40.0_rp ) )
1340 w(k,i_pihom) = sw * qc(k) / dt
1345 sw = ( 0.5_rp + sign(0.5_rp, temc(k) + 40.0_rp ) ) &
1346 * ( 0.5_rp - sign(0.5_rp, temc(k) ) )
1347 w(k,i_pihtr) = sw * ( dens(k) / dwatr * qc(k)**2 / ( nc_ihtr * 1.e+6_rp ) ) &
1348 * b_frz * ( exp(-a_frz*temc(k)) - 1.0_rp )
1353 sw = ( 0.5_rp + sign(0.5_rp, temc(k) ) )
1354 w(k,i_pimlt) = sw * qi(k) / dt
1359 vents = f1s * moms_1(k) + f2s * sqrt( cs * rho_fact(k) / nu(k) ) * moms_5ds_h(k)
1360 tmp = 2.0_rp * pi * rdens(k) * ( sice(k)-1.0_rp ) * giv(k) * vents
1361 w(k,i_psdep) = ( w(k,i_spsati) ) * ( tmp)
1362 w(k,i_pssub) = ( 1.0_rp-w(k,i_spsati) ) * (-tmp)
1364 w(k,i_psmlt) = 2.0_rp * pi * rdens(k) * gil(k) * vents &
1365 + cl * temc(k) / lhf0 * ( w(k,i_psacw) + w(k,i_psacr) )
1366 w(k,i_psmlt) = max( w(k,i_psmlt), 0.0_rp )
1371 ventg = f1g * gam_2 * rlmdg_2(k) + f2g * sqrt( cg * rho_fact(k) / nu(k) * rlmdg_5dg(k) ) * gam_5dg_h
1372 tmp = 2.0_rp * pi * rdens(k) * n0g(k) * ( sice(k)-1.0_rp ) * giv(k) * ventg
1373 w(k,i_pgdep) = ( w(k,i_spsati) ) * ( tmp)
1374 w(k,i_pgsub) = ( 1.0_rp-w(k,i_spsati) ) * (-tmp)
1376 w(k,i_pgmlt) = 2.0_rp * pi * rdens(k) * n0g(k) * gil(k) * ventg &
1377 + cl * temc(k) / lhf0 * ( w(k,i_pgacw) + w(k,i_pgacr) )
1378 w(k,i_pgmlt) = max( w(k,i_pgmlt), 0.0_rp )
1383 tmp = ( exp(-a_frz*temc(k)) - 1.0_rp ) * rlmdr_7(k)
1384 w(k,i_pgfrz) = 2.0_rp * pi * rdens(k) * n0r(k) * 60.0_rp * b_frz * ar * tmp
1388 call mp_tomita08_bergeronparam( ka, ks, ke, &
1390 a1(:), a2(:), ma2(:) )
1392 dt1 = ( exp( log(mi50)*ma2(k) ) &
1393 - exp( log(mi40)*ma2(k) ) ) / ( a1(k) * ma2(k) )
1394 ni50 = qi(k) * dt / ( mi50 * dt1 )
1395 w(k,i_psfw ) = ni50 * ( a1(k) * exp( log(mi50)*a2(k) ) &
1396 + pi * eiw * dens(k) * qc(k) * ri50*ri50 * vti50 )
1397 w(k,i_psfi ) = qi(k) / dt1
1402 w(k,i_pigen) = min( w(k,i_pigen), w(k,i_dqv_dt) ) * ( w(k,i_iceflg) ) * sw_expice
1403 w(k,i_pidep) = min( w(k,i_pidep), w(k,i_dqv_dt) ) * ( w(k,i_iceflg) ) * sw_expice
1404 w(k,i_psdep) = min( w(k,i_psdep), w(k,i_dqv_dt) ) * ( w(k,i_iceflg) )
1405 w(k,i_pgdep) = min( w(k,i_pgdep), w(k,i_dqv_dt) ) * ( w(k,i_iceflg) )
1409 w(k,i_pracw) = w(k,i_pracw) &
1410 + w(k,i_psacw) * ( 1.0_rp-w(k,i_iceflg) ) &
1411 + w(k,i_pgacw) * ( 1.0_rp-w(k,i_iceflg) )
1415 w(k,i_praut) = min( w(k,i_praut), w(k,i_dqc_dt) )
1416 w(k,i_pracw) = min( w(k,i_pracw), w(k,i_dqc_dt) )
1417 w(k,i_pihom) = min( w(k,i_pihom), w(k,i_dqc_dt) ) * ( w(k,i_iceflg) ) * sw_expice
1418 w(k,i_pihtr) = min( w(k,i_pihtr), w(k,i_dqc_dt) ) * ( w(k,i_iceflg) ) * sw_expice
1419 w(k,i_psacw) = min( w(k,i_psacw), w(k,i_dqc_dt) ) * ( w(k,i_iceflg) )
1420 w(k,i_psfw ) = min( w(k,i_psfw ), w(k,i_dqc_dt) ) * ( w(k,i_iceflg) ) * sw_bergeron(k)
1421 w(k,i_pgacw) = min( w(k,i_pgacw), w(k,i_dqc_dt) ) * ( w(k,i_iceflg) )
1425 w(k,i_prevp) = min( w(k,i_prevp), w(k,i_dqr_dt) )
1426 w(k,i_piacr) = min( w(k,i_piacr), w(k,i_dqr_dt) ) * ( w(k,i_iceflg) )
1427 w(k,i_psacr) = min( w(k,i_psacr), w(k,i_dqr_dt) ) * ( w(k,i_iceflg) )
1428 w(k,i_pgacr) = min( w(k,i_pgacr), w(k,i_dqr_dt) ) * ( w(k,i_iceflg) )
1429 w(k,i_pgfrz) = min( w(k,i_pgfrz), w(k,i_dqr_dt) ) * ( w(k,i_iceflg) )
1433 w(k,i_pisub) = min( w(k,i_pisub), w(k,i_dqi_dt) ) * ( w(k,i_iceflg) ) * sw_expice
1434 w(k,i_pimlt) = min( w(k,i_pimlt), w(k,i_dqi_dt) ) * ( 1.0_rp-w(k,i_iceflg) ) * sw_expice
1435 w(k,i_psaut) = min( w(k,i_psaut), w(k,i_dqi_dt) ) * ( w(k,i_iceflg) )
1436 w(k,i_praci) = min( w(k,i_praci), w(k,i_dqi_dt) ) * ( w(k,i_iceflg) )
1437 w(k,i_psaci) = min( w(k,i_psaci), w(k,i_dqi_dt) ) * ( w(k,i_iceflg) )
1438 w(k,i_psfi ) = min( w(k,i_psfi ), w(k,i_dqi_dt) ) * ( w(k,i_iceflg) ) * sw_bergeron(k)
1439 w(k,i_pgaci) = min( w(k,i_pgaci), w(k,i_dqi_dt) ) * ( w(k,i_iceflg) )
1443 w(k,i_pssub) = min( w(k,i_pssub), w(k,i_dqs_dt) ) * ( w(k,i_iceflg) )
1444 w(k,i_psmlt) = min( w(k,i_psmlt), w(k,i_dqs_dt) ) * ( 1.0_rp-w(k,i_iceflg) )
1445 w(k,i_pgaut) = min( w(k,i_pgaut), w(k,i_dqs_dt) ) * ( w(k,i_iceflg) )
1446 w(k,i_pracs) = min( w(k,i_pracs), w(k,i_dqs_dt) ) * ( w(k,i_iceflg) )
1447 w(k,i_pgacs) = min( w(k,i_pgacs), w(k,i_dqs_dt) )
1451 w(k,i_pgsub) = min( w(k,i_pgsub), w(k,i_dqg_dt) ) * ( w(k,i_iceflg) )
1452 w(k,i_pgmlt) = min( w(k,i_pgmlt), w(k,i_dqg_dt) ) * ( 1.0_rp-w(k,i_iceflg) )
1456 w(k,i_piacr_s) = ( 1.0_rp - w(k,i_delta1) ) * w(k,i_piacr)
1457 w(k,i_piacr_g) = ( w(k,i_delta1) ) * w(k,i_piacr)
1458 w(k,i_praci_s) = ( 1.0_rp - w(k,i_delta1) ) * w(k,i_praci)
1459 w(k,i_praci_g) = ( w(k,i_delta1) ) * w(k,i_praci)
1460 w(k,i_psacr_s) = ( w(k,i_delta2) ) * w(k,i_psacr)
1461 w(k,i_psacr_g) = ( 1.0_rp - w(k,i_delta2) ) * w(k,i_psacr)
1462 w(k,i_pracs ) = ( 1.0_rp - w(k,i_delta2) ) * w(k,i_pracs)
1477 fac_sw = 0.5_rp + sign( 0.5_rp, net+eps )
1479 + ( 1.0_rp - fac_sw ) * min( -w(k,i_dqc_dt)/(net-fac_sw), 1.0_rp )
1481 w(k,i_pimlt ) = w(k,i_pimlt ) * fac
1482 w(k,i_praut ) = w(k,i_praut ) * fac
1483 w(k,i_pracw ) = w(k,i_pracw ) * fac
1484 w(k,i_pihom ) = w(k,i_pihom ) * fac
1485 w(k,i_pihtr ) = w(k,i_pihtr ) * fac
1486 w(k,i_psacw ) = w(k,i_psacw ) * fac
1487 w(k,i_psfw ) = w(k,i_psfw ) * fac
1488 w(k,i_pgacw ) = w(k,i_pgacw ) * fac
1491 if ( flg_lt_l )
then
1493 facq(i_qc) = 0.5_rp + sign( 0.5_rp, qc(k) - eps )
1494 facq(i_qi) = 0.5_rp + sign( 0.5_rp, qi(k) - eps )
1495 w_q(k,i_pimlt) = qcrg_i(k) * w(k,i_pimlt) / ( qi(k) + eps*eps ) * facq(i_qi)
1496 w_q(k,i_praut) = qcrg_c(k) * w(k,i_praut) / ( qc(k) + eps*eps ) * facq(i_qc)
1497 w_q(k,i_pracw) = qcrg_c(k) * w(k,i_pracw) / ( qc(k) + eps*eps ) * facq(i_qc)
1498 w_q(k,i_pihom) = qcrg_c(k) * w(k,i_pihom) / ( qc(k) + eps*eps ) * facq(i_qc)
1499 w_q(k,i_pihtr) = qcrg_c(k) * w(k,i_pihtr) / ( qc(k) + eps*eps ) * facq(i_qc)
1500 w_q(k,i_psacw) = qcrg_c(k) * w(k,i_psacw) / ( qc(k) + eps*eps ) * facq(i_qc)
1501 w_q(k,i_psfw ) = qcrg_c(k) * w(k,i_psfw ) / ( qc(k) + eps*eps ) * facq(i_qc)
1502 w_q(k,i_pgacw) = qcrg_c(k) * w(k,i_pgacw) / ( qc(k) + eps*eps ) * facq(i_qc)
1522 fac_sw = 0.5_rp + sign( 0.5_rp, net+eps )
1524 + ( 1.0_rp - fac_sw ) * min( -w(k,i_dqi_dt)/(net-fac_sw), 1.0_rp )
1526 w(k,i_pigen ) = w(k,i_pigen ) * fac
1527 w(k,i_pidep ) = w(k,i_pidep ) * fac
1528 w(k,i_pihom ) = w(k,i_pihom ) * fac
1529 w(k,i_pihtr ) = w(k,i_pihtr ) * fac
1530 w(k,i_pisub ) = w(k,i_pisub ) * fac
1531 w(k,i_pimlt ) = w(k,i_pimlt ) * fac
1532 w(k,i_psaut ) = w(k,i_psaut ) * fac
1533 w(k,i_praci_s) = w(k,i_praci_s) * fac
1534 w(k,i_psaci ) = w(k,i_psaci ) * fac
1535 w(k,i_psfi ) = w(k,i_psfi ) * fac
1536 w(k,i_praci_g) = w(k,i_praci_g) * fac
1537 w(k,i_pgaci ) = w(k,i_pgaci ) * fac
1540 if ( flg_lt_l )
then
1542 facq(i_qc) = 0.5_rp + sign( 0.5_rp, qc(k) - eps )
1543 facq(i_qi) = 0.5_rp + sign( 0.5_rp, qi(k) - eps )
1544 w_q(k,i_pigen ) = 0.0_rp
1545 w_q(k,i_pidep ) = 0.0_rp
1546 w_q(k,i_pihom ) = qcrg_c(k) * w(k,i_pihom ) / ( qc(k) + eps*eps ) * facq(i_qc)
1547 w_q(k,i_pihtr ) = qcrg_c(k) * w(k,i_pihtr ) / ( qc(k) + eps*eps ) * facq(i_qc)
1548 w_q(k,i_pisub ) = qcrg_i(k) * w(k,i_pisub ) / ( qi(k) + eps*eps ) * facq(i_qi)
1549 w_q(k,i_pimlt ) = qcrg_i(k) * w(k,i_pimlt ) / ( qi(k) + eps*eps ) * facq(i_qi)
1550 w_q(k,i_psaut ) = qcrg_i(k) * w(k,i_psaut ) / ( qi(k) + eps*eps ) * facq(i_qi)
1551 w_q(k,i_praci_s) = qcrg_i(k) * w(k,i_praci_s) / ( qi(k) + eps*eps ) * facq(i_qi)
1552 w_q(k,i_psaci ) = qcrg_i(k) * w(k,i_psaci ) / ( qi(k) + eps*eps ) * facq(i_qi)
1553 w_q(k,i_psfi ) = qcrg_i(k) * w(k,i_psfi ) / ( qi(k) + eps*eps ) * facq(i_qi)
1554 w_q(k,i_praci_g) = qcrg_i(k) * w(k,i_praci_g) / ( qi(k) + eps*eps ) * facq(i_qi)
1555 w_q(k,i_pgaci ) = qcrg_i(k) * w(k,i_pgaci ) / ( qi(k) + eps*eps ) * facq(i_qi)
1574 fac_sw = 0.5_rp + sign( 0.5_rp, net+eps )
1576 + ( 1.0_rp - fac_sw ) * min( -w(k,i_dqr_dt)/(net-fac_sw), 1.0_rp )
1578 w(k,i_praut ) = w(k,i_praut ) * fac
1579 w(k,i_pracw ) = w(k,i_pracw ) * fac
1580 w(k,i_psmlt ) = w(k,i_psmlt ) * fac
1581 w(k,i_pgmlt ) = w(k,i_pgmlt ) * fac
1582 w(k,i_prevp ) = w(k,i_prevp ) * fac
1583 w(k,i_piacr_s) = w(k,i_piacr_s) * fac
1584 w(k,i_psacr_s) = w(k,i_psacr_s) * fac
1585 w(k,i_piacr_g) = w(k,i_piacr_g) * fac
1586 w(k,i_psacr_g) = w(k,i_psacr_g) * fac
1587 w(k,i_pgacr ) = w(k,i_pgacr ) * fac
1588 w(k,i_pgfrz ) = w(k,i_pgfrz ) * fac
1591 if ( flg_lt_l )
then
1593 facq(i_qc) = 0.5_rp + sign( 0.5_rp, qc(k) - eps )
1594 facq(i_qr) = 0.5_rp + sign( 0.5_rp, qr(k) - eps )
1595 facq(i_qs) = 0.5_rp + sign( 0.5_rp, qs(k) - eps )
1596 facq(i_qg) = 0.5_rp + sign( 0.5_rp, qg(k) - eps )
1598 w_q(k,i_praut ) = qcrg_c(k) * w(k,i_praut ) / ( qc(k) + eps*eps ) * facq(i_qc)
1599 w_q(k,i_pracw ) = qcrg_c(k) * w(k,i_pracw ) / ( qc(k) + eps*eps ) * facq(i_qc)
1600 w_q(k,i_psmlt ) = qcrg_s(k) * w(k,i_psmlt ) / ( qs(k) + eps*eps ) * facq(i_qs)
1601 w_q(k,i_pgmlt ) = qcrg_g(k) * w(k,i_pgmlt ) / ( qg(k) + eps*eps ) * facq(i_qg)
1602 w_q(k,i_prevp ) = qcrg_r(k) * w(k,i_prevp ) / ( qr(k) + eps*eps ) * facq(i_qr)
1603 w_q(k,i_piacr_s) = qcrg_r(k) * w(k,i_piacr_s) / ( qr(k) + eps*eps ) * facq(i_qr)
1604 w_q(k,i_psacr_s) = qcrg_r(k) * w(k,i_psacr_s) / ( qr(k) + eps*eps ) * facq(i_qr)
1605 w_q(k,i_piacr_g) = qcrg_r(k) * w(k,i_piacr_g) / ( qr(k) + eps*eps ) * facq(i_qr)
1606 w_q(k,i_psacr_g) = qcrg_r(k) * w(k,i_psacr_g) / ( qr(k) + eps*eps ) * facq(i_qr)
1607 w_q(k,i_pgacr ) = qcrg_r(k) * w(k,i_pgacr ) / ( qr(k) + eps*eps ) * facq(i_qr)
1608 w_q(k,i_pgfrz ) = qcrg_r(k) * w(k,i_pgfrz ) / ( qr(k) + eps*eps ) * facq(i_qr)
1624 fac_sw = 0.5_rp + sign( 0.5_rp, net+eps )
1626 + ( 1.0_rp - fac_sw ) * min( -w(k,i_dqv_dt)/(net-fac_sw), 1.0_rp )
1628 w(k,i_prevp ) = w(k,i_prevp ) * fac
1629 w(k,i_pisub ) = w(k,i_pisub ) * fac
1630 w(k,i_pssub ) = w(k,i_pssub ) * fac
1631 w(k,i_pgsub ) = w(k,i_pgsub ) * fac
1632 w(k,i_pigen ) = w(k,i_pigen ) * fac
1633 w(k,i_pidep ) = w(k,i_pidep ) * fac
1634 w(k,i_psdep ) = w(k,i_psdep ) * fac
1635 w(k,i_pgdep ) = w(k,i_pgdep ) * fac
1656 fac_sw = 0.5_rp + sign( 0.5_rp, net+eps )
1658 + ( 1.0_rp - fac_sw ) * min( -w(k,i_dqs_dt)/(net-fac_sw), 1.0_rp )
1660 w(k,i_psdep ) = w(k,i_psdep ) * fac
1661 w(k,i_psacw ) = w(k,i_psacw ) * fac
1662 w(k,i_psfw ) = w(k,i_psfw ) * fac
1663 w(k,i_piacr_s) = w(k,i_piacr_s) * fac
1664 w(k,i_psacr_s) = w(k,i_psacr_s) * fac
1665 w(k,i_psaut ) = w(k,i_psaut ) * fac
1666 w(k,i_praci_s) = w(k,i_praci_s) * fac
1667 w(k,i_psaci ) = w(k,i_psaci ) * fac
1668 w(k,i_psfi ) = w(k,i_psfi ) * fac
1669 w(k,i_pssub ) = w(k,i_pssub ) * fac
1670 w(k,i_psmlt ) = w(k,i_psmlt ) * fac
1671 w(k,i_pgaut ) = w(k,i_pgaut ) * fac
1672 w(k,i_pracs ) = w(k,i_pracs ) * fac
1673 w(k,i_pgacs ) = w(k,i_pgacs ) * fac
1676 if ( flg_lt_l )
then
1678 facq(i_qc) = 0.5_rp + sign( 0.5_rp, qc(k) - eps )
1679 facq(i_qr) = 0.5_rp + sign( 0.5_rp, qr(k) - eps )
1680 facq(i_qi) = 0.5_rp + sign( 0.5_rp, qi(k) - eps )
1681 facq(i_qs) = 0.5_rp + sign( 0.5_rp, qs(k) - eps )
1682 facq(i_qg) = 0.5_rp + sign( 0.5_rp, qg(k) - eps )
1684 w_q(k,i_psdep ) = 0.0_rp
1685 w_q(k,i_psacw ) = qcrg_c(k) * w(k,i_psacw ) / ( qc(k) + eps*eps ) * facq(i_qc)
1686 w_q(k,i_psfw ) = qcrg_c(k) * w(k,i_psfw ) / ( qc(k) + eps*eps ) * facq(i_qc)
1687 w_q(k,i_piacr_s) = qcrg_r(k) * w(k,i_piacr_s) / ( qr(k) + eps*eps ) * facq(i_qr)
1688 w_q(k,i_psacr_s) = qcrg_r(k) * w(k,i_psacr_s) / ( qr(k) + eps*eps ) * facq(i_qr)
1689 w_q(k,i_psaut ) = qcrg_i(k) * w(k,i_psaut ) / ( qi(k) + eps*eps ) * facq(i_qi)
1690 w_q(k,i_praci_s) = qcrg_i(k) * w(k,i_praci_s) / ( qi(k) + eps*eps ) * facq(i_qi)
1691 w_q(k,i_psaci ) = qcrg_i(k) * w(k,i_psaci ) / ( qi(k) + eps*eps ) * facq(i_qi)
1692 w_q(k,i_psfi ) = qcrg_i(k) * w(k,i_psfi ) / ( qi(k) + eps*eps ) * facq(i_qi)
1693 w_q(k,i_pssub ) = qcrg_s(k) * w(k,i_pssub ) / ( qs(k) + eps*eps ) * facq(i_qs)
1694 w_q(k,i_psmlt ) = qcrg_s(k) * w(k,i_psmlt ) / ( qs(k) + eps*eps ) * facq(i_qs)
1695 w_q(k,i_pgaut ) = qcrg_s(k) * w(k,i_pgaut ) / ( qs(k) + eps*eps ) * facq(i_qs)
1696 w_q(k,i_pracs ) = qcrg_s(k) * w(k,i_pracs ) / ( qs(k) + eps*eps ) * facq(i_qs)
1697 w_q(k,i_pgacs ) = qcrg_s(k) * w(k,i_pgacs ) / ( qs(k) + eps*eps ) * facq(i_qs)
1718 fac_sw = 0.5_rp + sign( 0.5_rp, net+eps )
1720 + ( 1.0_rp - fac_sw ) * min( -w(k,i_dqg_dt)/(net-fac_sw), 1.0_rp )
1722 w(k,i_pgdep ) = w(k,i_pgdep ) * fac
1723 w(k,i_pgacw ) = w(k,i_pgacw ) * fac
1724 w(k,i_piacr_g) = w(k,i_piacr_g) * fac
1725 w(k,i_psacr_g) = w(k,i_psacr_g) * fac
1726 w(k,i_pgacr ) = w(k,i_pgacr ) * fac
1727 w(k,i_pgfrz ) = w(k,i_pgfrz ) * fac
1728 w(k,i_praci_g) = w(k,i_praci_g) * fac
1729 w(k,i_pgaci ) = w(k,i_pgaci ) * fac
1730 w(k,i_pgaut ) = w(k,i_pgaut ) * fac
1731 w(k,i_pracs ) = w(k,i_pracs ) * fac
1732 w(k,i_pgacs ) = w(k,i_pgacs ) * fac
1733 w(k,i_pgsub ) = w(k,i_pgsub ) * fac
1734 w(k,i_pgmlt ) = w(k,i_pgmlt ) * fac
1737 if ( flg_lt_l )
then
1739 facq(i_qc) = 0.5_rp + sign( 0.5_rp, qc(k) - eps )
1740 facq(i_qr) = 0.5_rp + sign( 0.5_rp, qr(k) - eps )
1741 facq(i_qi) = 0.5_rp + sign( 0.5_rp, qi(k) - eps )
1742 facq(i_qs) = 0.5_rp + sign( 0.5_rp, qs(k) - eps )
1743 facq(i_qg) = 0.5_rp + sign( 0.5_rp, qg(k) - eps )
1744 w_q(k,i_pgdep ) = 0.0_rp
1745 w_q(k,i_pgacw ) = qcrg_c(k) * w(k,i_pgacw ) / ( qc(k) + eps*eps ) * facq(i_qc)
1746 w_q(k,i_piacr_g) = qcrg_r(k) * w(k,i_piacr_g) / ( qr(k) + eps*eps ) * facq(i_qr)
1747 w_q(k,i_psacr_g) = qcrg_r(k) * w(k,i_psacr_g) / ( qr(k) + eps*eps ) * facq(i_qr)
1748 w_q(k,i_pgacr ) = qcrg_r(k) * w(k,i_pgacr ) / ( qr(k) + eps*eps ) * facq(i_qr)
1749 w_q(k,i_pgfrz ) = qcrg_r(k) * w(k,i_pgfrz ) / ( qr(k) + eps*eps ) * facq(i_qr)
1750 w_q(k,i_praci_g) = qcrg_i(k) * w(k,i_praci_g) / ( qi(k) + eps*eps ) * facq(i_qi)
1751 w_q(k,i_pgaci ) = qcrg_i(k) * w(k,i_pgaci ) / ( qi(k) + eps*eps ) * facq(i_qi)
1752 w_q(k,i_pgaut ) = qcrg_s(k) * w(k,i_pgaut ) / ( qs(k) + eps*eps ) * facq(i_qs)
1753 w_q(k,i_pracs ) = qcrg_s(k) * w(k,i_pracs ) / ( qs(k) + eps*eps ) * facq(i_qs)
1754 w_q(k,i_pgacs ) = qcrg_s(k) * w(k,i_pgacs ) / ( qs(k) + eps*eps ) * facq(i_qs)
1755 w_q(k,i_pgsub ) = qcrg_g(k) * w(k,i_pgsub ) / ( qg(k) + eps*eps ) * facq(i_qg)
1756 w_q(k,i_pgmlt ) = qcrg_g(k) * w(k,i_pgmlt ) / ( qg(k) + eps*eps ) * facq(i_qg)
1761 qc_t(k) = + w(k,i_pimlt ) &
1769 qc_t(k) = max( qc_t(k), -w(k,i_dqc_dt) )
1772 if ( flg_lt_l )
then
1774 qc_crg_t(k) = + w_q(k,i_pimlt ) &
1786 qr_t(k) = + w(k,i_praut ) &
1798 qr_t(k) = max( qr_t(k), -w(k,i_dqr_dt) )
1801 if ( flg_lt_l )
then
1803 qr_crg_t(k) = + w_q(k,i_praut ) &
1808 - w_q(k,i_piacr_s) &
1809 - w_q(k,i_psacr_s) &
1810 - w_q(k,i_piacr_g) &
1811 - w_q(k,i_psacr_g) &
1818 qi_t(k) = + w(k,i_pigen ) &
1830 qi_t(k) = max( qi_t(k), -w(k,i_dqi_dt) )
1833 if ( flg_lt_l )
then
1835 qi_crg_t(k) = + w_q(k,i_pigen ) &
1842 - w_q(k,i_praci_s) &
1845 - w_q(k,i_praci_g) &
1847 + w_qcrg(k,i_qgaci )
1852 qs_t(k) = + w(k,i_psdep ) &
1866 qs_t(k) = max( qs_t(k), -w(k,i_dqs_dt) )
1869 if ( flg_lt_l )
then
1871 qs_crg_t(k) = + w_q(k,i_psdep ) &
1874 + w_q(k,i_piacr_s) &
1875 + w_q(k,i_psacr_s) &
1877 + w_q(k,i_praci_s) &
1885 + w_qcrg(k,i_qgacs )
1890 qg_t(k) = + w(k,i_pgdep ) &
1903 qg_t(k) = max( qg_t(k), -w(k,i_dqg_dt) )
1906 if ( flg_lt_l )
then
1908 qg_crg_t(k) = + w_q(k,i_pgdep ) &
1910 + w_q(k,i_piacr_g) &
1911 + w_q(k,i_psacr_g) &
1914 + w_q(k,i_praci_g) &
1921 - w_qcrg(k,i_qgaci) &
1927 qv_t(k) = - ( qc_t(k) + qr_t(k) + qi_t(k) + qs_t(k) + qg_t(k) )
1931 qtrc0(k,i,j,i_qv) = qtrc0(k,i,j,i_qv) + qv_t(k) * dt
1934 qtrc0(k,i,j,i_qc) = qtrc0(k,i,j,i_qc) + qc_t(k) * dt
1937 qtrc0(k,i,j,i_qr) = qtrc0(k,i,j,i_qr) + qr_t(k) * dt
1940 qtrc0(k,i,j,i_qi) = qtrc0(k,i,j,i_qi) + qi_t(k) * dt
1943 qtrc0(k,i,j,i_qs) = qtrc0(k,i,j,i_qs) + qs_t(k) * dt
1946 qtrc0(k,i,j,i_qg) = qtrc0(k,i,j,i_qg) + qg_t(k) * dt
1950 +
cv_water * ( qc_t(k) + qr_t(k) ) &
1951 +
cv_ice * ( qi_t(k) + qs_t(k) + qg_t(k) )
1952 cvtot(k) = cvtot0(k,i,j) + cv_t * dt
1956 e_t = -
lhv * qv_t(k) +
lhf * ( qi_t(k) + qs_t(k) + qg_t(k) )
1957 rhoe_t(k,i,j) = dens(k) * e_t
1958 temp0(k,i,j) = ( temp(k) * cvtot0(k,i,j) + e_t * dt ) / cvtot(k)
1962 cvtot0(k,i,j) = cvtot(k)
1967 +
cp_water * ( qc_t(k) + qr_t(k) ) &
1968 +
cp_ice * ( qi_t(k) + qs_t(k) + qg_t(k) )
1969 cptot = cptot0(k,i,j) + cp_t * dt
1970 cptot0(k,i,j) = cptot
1975 qtrc_crg0(k,i,j,i_qc-1) = qtrc_crg0(k,i,j,i_qc-1) + qc_crg_t(k) * dt
1978 qtrc_crg0(k,i,j,i_qr-1) = qtrc_crg0(k,i,j,i_qr-1) + qr_crg_t(k) * dt
1981 qtrc_crg0(k,i,j,i_qi-1) = qtrc_crg0(k,i,j,i_qi-1) + qi_crg_t(k) * dt
1984 qtrc_crg0(k,i,j,i_qs-1) = qtrc_crg0(k,i,j,i_qs-1) + qs_crg_t(k) * dt
1987 qtrc_crg0(k,i,j,i_qg-1) = qtrc_crg0(k,i,j,i_qg-1) + qg_crg_t(k) * dt
1991 rlambda(i_qr) = sqrt(sqrt( dens0(k,i,j) * max( qtrc0(k,i,j,i_qr),0.0_rp ) / ( ar * n0r(k) * gam_1br ) ))
1992 rlambda(i_qs) = sqrt(sqrt( dens0(k,i,j) * max( qtrc0(k,i,j,i_qs),0.0_rp ) / ( as * n0s(k) * gam_1bs ) ))
1993 rlambda(i_qg) = sqrt(sqrt( dens0(k,i,j) * max( qtrc0(k,i,j,i_qg),0.0_rp ) / ( ag * n0g(k) * gam_1bg ) ))
1994 sarea(k,i,j,i_qc-1) = 6.0_rp / ( re_qc*2.0_rp * dwatr ) &
1995 * max( qtrc0(k,i,j,i_qc),0.0_rp ) * dens0(k,i,j)
1996 sarea(k,i,j,i_qi-1) = 6.0_rp / ( re_qi*2.0_rp * dice ) &
1997 * max( qtrc0(k,i,j,i_qi),0.0_rp ) * dens0(k,i,j)
1998 sarea(k,i,j,i_qr-1) = pi * n0r(k) * gam_3 * rlambda(i_qr)**3
1999 sarea(k,i,j,i_qs-1) = pi * n0s(k) * gam_3 * rlambda(i_qs)**3
2000 sarea(k,i,j,i_qg-1) = pi * n0g(k) * gam_3 * rlambda(i_qg)**3
2003 qsplt_in(k,i,j,:) = qsplt_in(k,i,j,:) * dens0(k,i,j)
2007 if ( hist_flag )
then
2009 if ( hist_sw(ip) )
then
2011 w3d(k,i,j,ip) = w(k,ip)
2021 if ( hist_sw(ip) )
call file_history_put( hist_id(ip), w3d(:,:,:,ip) )
2027 end subroutine mp_tomita08
2034 DENS0, TEMP0, RHOQ0, &
2039 integer,
intent(in) :: ka, ks, ke
2041 real(
rp),
intent(in) :: dens0(ka)
2042 real(
rp),
intent(in) :: temp0(ka)
2043 real(
rp),
intent(in) :: rhoq0(ka,qa_mp-1)
2045 real(
rp),
intent(out) :: vterm(ka,qa_mp-1)
2047 real(
rp) :: dens(ka)
2048 real(
rp) :: temc(ka)
2049 real(
rp) :: qr(ka), qi(ka), qs(ka), qg(ka)
2051 real(
rp) :: rho_fact(ka)
2053 real(
rp) :: n0r(ka), n0s(ka), n0g(ka)
2054 real(
rp) :: rlmdr, rlmds, rlmdg
2055 real(
rp) :: rlmdr_dr, rlmds_ds, rlmdg_dg
2058 real(
rp) :: tems, xs2
2059 real(
rp) :: moms_0bs, rmoms_vt(ka)
2060 real(
rp) :: coef_at(4), coef_bt(4)
2061 real(
rp) :: loga_, b_, nm
2070 temc(k) = temp0(k) - tem00
2071 qr(k) = rhoq0(k,i_hyd_qr) / dens(k)
2072 qi(k) = rhoq0(k,i_hyd_qi) / dens(k)
2073 qs(k) = rhoq0(k,i_hyd_qs) / dens(k)
2074 qg(k) = rhoq0(k,i_hyd_qg) / dens(k)
2076 rho_fact(k) = sqrt( dens00 / dens(k) )
2079 if ( enable_wdxz2014 )
then
2083 n0r(k) = 1.16e+5_rp * exp( log( max( dens(k)*qr(k)*1000.0_rp, 1.e-2_rp ) )*0.477_rp )
2084 n0s(k) = 4.58e+9_rp * exp( log( max( dens(k)*qs(k)*1000.0_rp, 1.e-2_rp ) )*0.788_rp )
2085 n0g(k) = 9.74e+8_rp * exp( log( max( dens(k)*qg(k)*1000.0_rp, 1.e-2_rp ) )*0.816_rp )
2099 zerosw = 0.5_rp - sign(0.5_rp, qi(k) - 1.e-8_rp )
2100 vterm(k,i_hyd_qi) = -3.29_rp * exp( log( dens(k)*qi(k)+zerosw )*0.16_rp ) * ( 1.0_rp-zerosw )
2106 zerosw = 0.5_rp - sign(0.5_rp, qr(k) - 1.e-12_rp )
2107 rlmdr = sqrt(sqrt( dens(k) * qr(k) / ( ar * n0r(k) * gam_1br ) + zerosw )) * ( 1.0_rp-zerosw )
2108 rlmdr_dr = sqrt( rlmdr )
2109 vterm(k,i_hyd_qr) = -cr * rho_fact(k) * gam_1brdr / gam_1br * rlmdr_dr
2113 if ( enable_rs2014 )
then
2117 zerosw = 0.5_rp - sign(0.5_rp, dens(k) * qs(k) - 1.e-12_rp )
2118 xs2 = dens(k) * qs(k) / as
2120 tems = min( -0.1_rp, temc(k) )
2121 coef_at(1) = coef_a01 + tems * ( coef_a02 + tems * ( coef_a05 + tems * coef_a09 ) )
2122 coef_at(2) = coef_a03 + tems * ( coef_a04 + tems * coef_a07 )
2123 coef_at(3) = coef_a06 + tems * coef_a08
2124 coef_at(4) = coef_a10
2125 coef_bt(1) = coef_b01 + tems * ( coef_b02 + tems * ( coef_b05 + tems * coef_b09 ) )
2126 coef_bt(2) = coef_b03 + tems * ( coef_b04 + tems * coef_b07 )
2127 coef_bt(3) = coef_b06 + tems * coef_b08
2128 coef_bt(4) = coef_b10
2131 loga_ = coef_at(1) + nm * ( coef_at(2) + nm * ( coef_at(3) + nm * coef_at(4) ) )
2132 b_ = coef_bt(1) + nm * ( coef_bt(2) + nm * ( coef_bt(3) + nm * coef_bt(4) ) )
2133 moms_0bs = exp(ln10*loga_) * exp(log(xs2+zerosw)*b_) * ( 1.0_rp-zerosw )
2136 loga_ = coef_at(1) + nm * ( coef_at(2) + nm * ( coef_at(3) + nm * coef_at(4) ) )
2137 b_ = coef_bt(1) + nm * ( coef_bt(2) + nm * ( coef_bt(3) + nm * coef_bt(4) ) )
2138 rmoms_vt(k) = exp(ln10*loga_) * exp(log(xs2+zerosw)*b_) * ( 1.0_rp-zerosw ) / ( moms_0bs + zerosw )
2143 zerosw = 0.5_rp - sign(0.5_rp, qs(k) - 1.e-12_rp )
2144 rlmds = sqrt(sqrt( dens(k) * qs(k) / ( as * n0s(k) * gam_1bs ) + zerosw )) * ( 1.0_rp-zerosw )
2145 rlmds_ds = sqrt( sqrt(rlmds) )
2146 rmoms_vt(k) = gam_1bsds / gam_1bs * rlmds_ds
2151 vterm(k,i_hyd_qs) = -cs * rho_fact(k) * rmoms_vt(k)
2157 zerosw = 0.5_rp - sign(0.5_rp, qg(k) - 1.e-12_rp )
2158 rlmdg = sqrt(sqrt( dens(k) * qg(k) / ( ag * n0g(k) * gam_1bg ) + zerosw )) * ( 1.0_rp-zerosw )
2159 rlmdg_dg = sqrt( rlmdg )
2160 vterm(k,i_hyd_qg) = -cg * rho_fact(k) * gam_1bgdg / gam_1bg * rlmdg_dg
2166 vterm(k,i_hyd_qc) = 0.0_rp
2169 if ( nofall_qr )
then
2172 vterm(k,i_hyd_qr) = 0.0_rp
2176 if ( nofall_qi )
then
2179 vterm(k,i_hyd_qi) = 0.0_rp
2183 if ( nofall_qs )
then
2186 vterm(k,i_hyd_qs) = 0.0_rp
2190 if ( nofall_qg )
then
2193 vterm(k,i_hyd_qg) = 0.0_rp
2197 vterm( 1:ks-1,:) = 0.0_rp
2198 vterm(ke+1:ka ,:) = 0.0_rp
2206 KA, KS, KE, IA, IS, IE, JA, JS, JE, &
2211 integer,
intent(in) :: ka, ks, ke
2212 integer,
intent(in) :: ia, is, ie
2213 integer,
intent(in) :: ja, js, je
2215 real(
rp),
intent(in) :: qtrc(ka,ia,ja,qa_mp-1)
2216 real(
rp),
intent(in) :: mask_criterion
2218 real(
rp),
intent(out) :: cldfrac(ka,ia,ja)
2229 qhydro = qtrc(k,i,j,i_hyd_qc) + qtrc(k,i,j,i_hyd_qr) &
2230 + qtrc(k,i,j,i_hyd_qi) + qtrc(k,i,j,i_hyd_qs) + qtrc(k,i,j,i_hyd_qg)
2231 cldfrac(k,i,j) = 0.5_rp + sign(0.5_rp,qhydro-mask_criterion)
2242 KA, KS, KE, IA, IS, IE, JA, JS, JE, &
2243 DENS0, TEMP0, QTRC0, &
2258 integer,
intent(in) :: ka, ks, ke
2259 integer,
intent(in) :: ia, is, ie
2260 integer,
intent(in) :: ja, js, je
2262 real(
rp),
intent(in) :: dens0(ka,ia,ja)
2263 real(
rp),
intent(in) :: temp0(ka,ia,ja)
2264 real(
rp),
intent(in) :: qtrc0(ka,ia,ja,qa_mp-1)
2266 real(
rp),
intent(out) :: re (ka,ia,ja,
n_hyd)
2267 real(
rp) :: dens(ka)
2268 real(
rp) :: temc(ka)
2269 real(
rp) :: qr(ka), qs(ka), qg(ka)
2271 real(
rp) :: n0r(ka), n0s(ka), n0g(ka)
2272 real(
rp) :: rlmdr, rlmds, rlmdg
2274 real(
rp),
parameter :: um2cm = 100.0_rp
2277 real(
rp) :: tems, xs2
2278 real(
rp) :: coef_at(4), coef_bt(4)
2279 real(
rp) :: loga_, b_, nm
2282 integer :: k, i, j, ih
2289 re(k,i,j,
i_hi) = re_qi * um2cm
2298 re(k,i,j,ih) = 0.0_rp
2304 if ( const_rec .or. fixed_re )
then
2310 re(k,i,j,
i_hc) = re_qc * um2cm
2321 if ( do_couple_aerosol )
then
2324 nc(k) = nc_def(i,j) * 1.e+6_rp
2328 nc(k) = nc_def(i,j) * 1.e+6_rp
2333 re(k,i,j,
i_hc) = 1.1_rp &
2334 * ( 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)
2335 re(k,i,j,
i_hc) = min( 1.e-3_rp, max( 1.e-6_rp, re(k,i,j,
i_hc) ) ) * um2cm
2342 if ( fixed_re )
then
2348 re(k,i,j,
i_hr) = 10000.e-6_rp * um2cm
2356 re(k,i,j,
i_hs) = re_qi * um2cm
2364 re(k,i,j,
i_hg) = re_qi * um2cm
2371 #ifndef __GFORTRAN__
2389 dens(k) = dens0(k,i,j)
2390 temc(k) = temp0(k,i,j) - tem00
2391 qr(k) = qtrc0(k,i,j,i_hyd_qr)
2392 qs(k) = qtrc0(k,i,j,i_hyd_qs)
2393 qg(k) = qtrc0(k,i,j,i_hyd_qg)
2397 if ( enable_wdxz2014 )
then
2400 n0r(k) = 1.16e+5_rp * exp( log( max( dens(k)*qr(k)*1000.0_rp, 1.e-2_rp ) )*0.477_rp )
2401 n0s(k) = 4.58e+9_rp * exp( log( max( dens(k)*qs(k)*1000.0_rp, 1.e-2_rp ) )*0.788_rp )
2402 n0g(k) = 9.74e+8_rp * exp( log( max( dens(k)*qg(k)*1000.0_rp, 1.e-2_rp ) )*0.816_rp )
2414 zerosw = 0.5_rp - sign(0.5_rp, qr(k) - 1.e-12_rp )
2415 rlmdr = sqrt(sqrt( dens(k) * qr(k) / ( ar * n0r(k) * gam_1br ) + zerosw )) * ( 1.0_rp-zerosw )
2417 re(k,i,j,
i_hr) = 1.5_rp * rlmdr * um2cm
2420 if ( enable_rs2014 )
then
2422 zerosw = 0.5_rp - sign(0.5_rp, qs(k) - 1.e-12_rp )
2425 zerosw = 0.5_rp - sign(0.5_rp, dens(k) * qs(k) - 1.e-12_rp )
2426 xs2 = dens(k) * qs(k) / as
2428 tems = min( -0.1_rp, temc(k) )
2429 coef_at(1) = coef_a01 + tems * ( coef_a02 + tems * ( coef_a05 + tems * coef_a09 ) )
2430 coef_at(2) = coef_a03 + tems * ( coef_a04 + tems * coef_a07 )
2431 coef_at(3) = coef_a06 + tems * coef_a08
2432 coef_at(4) = coef_a10
2433 coef_bt(1) = coef_b01 + tems * ( coef_b02 + tems * ( coef_b05 + tems * coef_b09 ) )
2434 coef_bt(2) = coef_b03 + tems * ( coef_b04 + tems * coef_b07 )
2435 coef_bt(3) = coef_b06 + tems * coef_b08
2436 coef_bt(4) = coef_b10
2439 loga_ = coef_at(1) + nm * ( coef_at(2) + nm * ( coef_at(3) + nm * coef_at(4) ) )
2440 b_ = coef_bt(1) + nm * ( coef_bt(2) + nm * ( coef_bt(3) + nm * coef_bt(4) ) )
2442 re(k,i,j,
i_hs) = 0.5_rp * exp(ln10*loga_) * exp(log(xs2+zerosw)*b_) * ( 1.0_rp-zerosw ) / ( xs2+zerosw ) * um2cm
2446 zerosw = 0.5_rp - sign(0.5_rp, qs(k) - 1.e-12_rp )
2447 rlmds = sqrt(sqrt( dens(k) * qs(k) / ( as * n0s(k) * gam_1bs ) + zerosw )) * ( 1.0_rp-zerosw )
2448 re(k,i,j,
i_hs) = 1.5_rp * rlmds * um2cm
2454 zerosw = 0.5_rp - sign(0.5_rp, qg(k) - 1.e-12_rp )
2455 rlmdg = sqrt(sqrt( dens(k) * qg(k) / ( ag * n0g(k) * gam_1bg ) + zerosw )) * ( 1.0_rp-zerosw )
2456 re(k,i,j,
i_hg) = 1.5_rp * rlmdg * um2cm
2470 subroutine mp_tomita08_bergeronparam( &
2477 integer,
intent(in) :: ka, ks, ke
2479 real(
rp),
intent(in) :: temp(ka)
2480 real(
rp),
intent(out) :: a1(ka)
2481 real(
rp),
intent(out) :: a2(ka)
2482 real(
rp),
intent(out) :: ma2(ka)
2484 real(
rp),
parameter :: a1_tab(32) = (/ &
2485 0.0001e-7_rp, 0.7939e-7_rp, 0.7841e-6_rp, 0.3369e-5_rp, 0.4336e-5_rp, &
2486 0.5285e-5_rp, 0.3728e-5_rp, 0.1852e-5_rp, 0.2991e-6_rp, 0.4248e-6_rp, &
2487 0.7434e-6_rp, 0.1812e-5_rp, 0.4394e-5_rp, 0.9145e-5_rp, 0.1725e-4_rp, &
2488 0.3348e-4_rp, 0.1725e-4_rp, 0.9175e-5_rp, 0.4412e-5_rp, 0.2252e-5_rp, &
2489 0.9115e-6_rp, 0.4876e-6_rp, 0.3473e-6_rp, 0.4758e-6_rp, 0.6306e-6_rp, &
2490 0.8573e-6_rp, 0.7868e-6_rp, 0.7192e-6_rp, 0.6513e-6_rp, 0.5956e-6_rp, &
2491 0.5333e-6_rp, 0.4834e-6_rp /)
2492 real(
rp),
parameter :: a2_tab(32) = (/ &
2493 0.0100_rp, 0.4006_rp, 0.4831_rp, 0.5320_rp, 0.5307_rp, &
2494 0.5319_rp, 0.5249_rp, 0.4888_rp, 0.3849_rp, 0.4047_rp, &
2495 0.4318_rp, 0.4771_rp, 0.5183_rp, 0.5463_rp, 0.5651_rp, &
2496 0.5813_rp, 0.5655_rp, 0.5478_rp, 0.5203_rp, 0.4906_rp, &
2497 0.4447_rp, 0.4126_rp, 0.3960_rp, 0.4149_rp, 0.4320_rp, &
2498 0.4506_rp, 0.4483_rp, 0.4460_rp, 0.4433_rp, 0.4413_rp, &
2499 0.4382_rp, 0.4361_rp /)
2509 temc = min( max( temp(k)-tem00, -30.99_rp ), 0.0_rp )
2510 itemc = int( -temc ) + 1
2511 fact = - ( temc + real(itemc-1,kind=8) )
2513 a1(k) = ( 1.0_rp-fact ) * a1_tab(itemc ) &
2514 + ( fact ) * a1_tab(itemc+1)
2516 a2(k) = ( 1.0_rp-fact ) * a2_tab(itemc ) &
2517 + ( fact ) * a2_tab(itemc+1)
2519 ma2(k) = 1.0_rp - a2(k)
2521 a1(k) = a1(k) * exp( log(1.e-3_rp)*ma2(k) )
2526 end subroutine mp_tomita08_bergeronparam
2531 KA, KS, KE, IA, IS, IE, JA, JS, JE, &
2542 integer,
intent(in) :: ka, ks, ke
2543 integer,
intent(in) :: ia, is, ie
2544 integer,
intent(in) :: ja, js, je
2546 real(
rp),
intent(in) :: qtrc(ka,ia,ja,qa_mp-1)
2548 real(
rp),
intent(out) :: qe(ka,ia,ja,
n_hyd)
2550 integer :: k, i, j, ih
2558 qe(k,i,j,
i_hc) = qtrc(k,i,j,i_hyd_qc)
2567 qe(k,i,j,
i_hr) = qtrc(k,i,j,i_hyd_qr)
2576 qe(k,i,j,
i_hi) = qtrc(k,i,j,i_hyd_qi)
2585 qe(k,i,j,
i_hs) = qtrc(k,i,j,i_hyd_qs)
2594 qe(k,i,j,
i_hg) = qtrc(k,i,j,i_hyd_qg)
2604 qe(k,i,j,ih) = 0.0_rp
2616 KA, KS, KE, IA, IS, IE, JA, JS, JE, &
2629 integer,
intent(in) :: ka, ks, ke
2630 integer,
intent(in) :: ia, is, ie
2631 integer,
intent(in) :: ja, js, je
2632 real(
rp),
intent(in) :: qe (ka,ia,ja,
n_hyd)
2633 real(
rp),
intent(out) :: qtrc(ka,ia,ja,qa_mp-1)
2643 qtrc(k,i,j,i_hyd_qc) = qe(k,i,j,
i_hc)
2652 qtrc(k,i,j,i_hyd_qr) = qe(k,i,j,
i_hr)
2661 qtrc(k,i,j,i_hyd_qi) = qe(k,i,j,
i_hi)
2670 qtrc(k,i,j,i_hyd_qs) = qe(k,i,j,
i_hs)
2679 qtrc(k,i,j,i_hyd_qg) = qe(k,i,j,
i_hg) + qe(k,i,j,
i_hh)