110 integer,
public,
parameter ::
qa_mp = 11
128 'Ratio of Water Vapor mass to total mass (Specific humidity)', &
129 'Ratio of Cloud Water mass to total mass ', &
130 'Ratio of Rain Water mass to total mass ', &
131 'Ratio of Cloud Ice mass ratio to total mass ', &
132 'Ratio of Snow mass ratio to total mass ', &
133 'Ratio of Graupel mass ratio to total mass ', &
134 'Cloud Water Number Density ', &
135 'Rain Water Number Density ', &
136 'Cloud Ice Number Density ', &
137 'Snow Number Density ', &
138 'Graupel Number Density '/)
156 private :: mp_sn14_init
163 integer,
private,
parameter :: i_qv = 1
164 integer,
private,
parameter :: i_qc = 2
165 integer,
private,
parameter :: i_qr = 3
166 integer,
private,
parameter :: i_qi = 4
167 integer,
private,
parameter :: i_qs = 5
168 integer,
private,
parameter :: i_qg = 6
169 integer,
private,
parameter :: i_nc = 7
170 integer,
private,
parameter :: i_nr = 8
171 integer,
private,
parameter :: i_ni = 9
172 integer,
private,
parameter :: i_ns = 10
173 integer,
private,
parameter :: i_ng = 11
175 integer,
private,
parameter :: hydro_max = 5
177 integer,
private,
parameter :: i_mp_qc = 1
178 integer,
private,
parameter :: i_mp_qr = 2
179 integer,
private,
parameter :: i_mp_qi = 3
180 integer,
private,
parameter :: i_mp_qs = 4
181 integer,
private,
parameter :: i_mp_qg = 5
182 integer,
private,
parameter :: i_mp_nc = 6
183 integer,
private,
parameter :: i_mp_nr = 7
184 integer,
private,
parameter :: i_mp_ni = 8
185 integer,
private,
parameter :: i_mp_ns = 9
186 integer,
private,
parameter :: i_mp_ng = 10
190 integer,
parameter :: i_lcccn = 1
191 integer,
parameter :: i_ncccn = 2
192 integer,
parameter :: i_liccn = 3
193 integer,
parameter :: i_niccn = 4
195 integer,
parameter :: i_lchom = 5
196 integer,
parameter :: i_nchom = 6
197 integer,
parameter :: i_lchet = 7
198 integer,
parameter :: i_nchet = 8
199 integer,
parameter :: i_lrhet = 9
200 integer,
parameter :: i_nrhet = 10
202 integer,
parameter :: i_limlt = 11
203 integer,
parameter :: i_nimlt = 12
204 integer,
parameter :: i_lsmlt = 13
205 integer,
parameter :: i_nsmlt = 14
206 integer,
parameter :: i_lgmlt = 15
207 integer,
parameter :: i_ngmlt = 16
209 integer,
parameter :: i_lrdep = 17
210 integer,
parameter :: i_nrdep = 18
211 integer,
parameter :: i_lidep = 19
212 integer,
parameter :: i_nidep = 20
213 integer,
parameter :: i_lsdep = 21
214 integer,
parameter :: i_nsdep = 22
215 integer,
parameter :: i_lgdep = 23
216 integer,
parameter :: i_ngdep = 24
217 integer,
parameter :: i_lcdep = 25
221 integer,
parameter :: i_lcaut = 26
222 integer,
parameter :: i_ncaut = 27
223 integer,
parameter :: i_nraut = 28
225 integer,
parameter :: i_lcacc = 29
226 integer,
parameter :: i_ncacc = 30
228 integer,
parameter :: i_nrslc = 31
229 integer,
parameter :: i_nrbrk = 32
232 integer,
parameter :: i_licon = 33
233 integer,
parameter :: i_nicon = 34
234 integer,
parameter :: i_lscon = 35
235 integer,
parameter :: i_nscon = 36
237 integer,
parameter :: i_liacm = 37
238 integer,
parameter :: i_niacm = 38
239 integer,
parameter :: i_liarm = 39
240 integer,
parameter :: i_niarm = 40
241 integer,
parameter :: i_lsacm = 41
242 integer,
parameter :: i_nsacm = 42
243 integer,
parameter :: i_lsarm = 43
244 integer,
parameter :: i_nsarm = 44
245 integer,
parameter :: i_lgacm = 45
246 integer,
parameter :: i_ngacm = 46
247 integer,
parameter :: i_lgarm = 47
248 integer,
parameter :: i_ngarm = 48
250 integer,
parameter :: i_lgspl = 49
251 integer,
parameter :: i_lsspl = 50
252 integer,
parameter :: i_nispl = 51
253 integer,
parameter :: i_lihom = 52
254 integer,
parameter :: i_nihom = 53
256 integer,
parameter :: i_ngspl = 54
257 integer,
parameter :: i_nsspl = 55
259 integer,
parameter :: pq_max = 55
264 integer,
parameter :: i_liaclc2li = 1
265 integer,
parameter :: i_niacnc2ni = 2
266 integer,
parameter :: i_lsaclc2ls = 3
267 integer,
parameter :: i_nsacnc2ns = 4
268 integer,
parameter :: i_lgaclc2lg = 5
269 integer,
parameter :: i_ngacnc2ng = 6
270 integer,
parameter :: i_lracli2lg_i = 7
271 integer,
parameter :: i_nracni2ng_i = 8
272 integer,
parameter :: i_lracli2lg_r = 9
273 integer,
parameter :: i_nracni2ng_r = 10
274 integer,
parameter :: i_lracls2lg_s = 11
275 integer,
parameter :: i_nracns2ng_s = 12
276 integer,
parameter :: i_lracls2lg_r = 13
277 integer,
parameter :: i_nracns2ng_r = 14
278 integer,
parameter :: i_lraclg2lg = 15
279 integer,
parameter :: i_nracng2ng = 16
280 integer,
parameter :: i_liacli2ls = 17
281 integer,
parameter :: i_niacni2ns = 18
282 integer,
parameter :: i_liacls2ls = 19
283 integer,
parameter :: i_niacns2ns = 20
284 integer,
parameter :: i_nsacns2ns = 21
285 integer,
parameter :: i_ngacng2ng = 22
286 integer,
parameter :: i_lgacls2lg = 23
287 integer,
parameter :: i_ngacns2ng = 24
288 integer,
parameter :: i_lraclg2lr = 25
289 integer,
parameter :: i_nracng2nr = 26
290 integer,
parameter :: i_liaclg2lg = 27
291 integer,
parameter :: i_niacng2ng = 28
292 integer,
parameter :: i_cgngacns2ng = 29
293 integer,
parameter :: i_cgngacni2ng = 30
295 integer,
parameter :: pac_max = 30
296 integer,
parameter :: pcrg_max = 30
299 integer,
private,
parameter :: w_nmax = pq_max + pac_max
300 character(len=H_SHORT),
private :: w_name(w_nmax)
302 data w_name /
'I_LCccn', &
388 real(
rp),
private,
allocatable :: w3d(:,:,:,:)
389 integer,
private :: hist_id(w_nmax), hist_idx(w_nmax)
390 integer,
private :: hist_max
393 real(
rp),
private,
parameter :: rhow = 1000.0_rp
394 real(
rp),
private,
parameter :: rhof = 100.0_rp
395 real(
rp),
private,
parameter :: rhog = 400.0_rp
399 real(
rp),
private,
parameter :: xc_min = 4.20e-15_rp
400 real(
rp),
private,
parameter :: xr_min = 2.60e-10_rp
401 real(
rp),
private,
parameter :: xi_min = 3.382e-13_rp
402 real(
rp),
private,
parameter :: xs_min = 1.847e-12_rp
403 real(
rp),
private,
parameter :: xg_min = 1.230e-10_rp
405 real(
rp),
private,
parameter :: xc_max = 2.6e-10_rp
406 real(
rp),
private,
parameter :: xr_max = 5.00e-6_rp
407 real(
rp),
private,
parameter :: xi_max = 1.377e-6_rp
408 real(
rp),
private,
parameter :: xs_max = 7.519e-6_rp
409 real(
rp),
private,
parameter :: xg_max = 4.900e-5_rp
411 real(
rp),
private,
parameter :: xmin_filter= xc_min
413 real(
rp),
private,
parameter :: rmin_re= 1.e-6_rp
416 real(
rp),
private,
parameter :: n0r_min= 2.5e+5_rp
417 real(
rp),
private,
parameter :: n0r_max= 2.0e+7_rp
418 real(
rp),
private,
parameter :: lambdar_min= 1.e+3_rp
419 real(
rp),
private,
parameter :: lambdar_max= 1.e+4_rp
421 real(
rp),
private,
parameter :: nc_min = 1.e+4_rp
422 real(
rp),
private,
parameter :: nr_min = 1.0_rp
423 real(
rp),
private,
parameter :: ni_min = 1.0_rp
424 real(
rp),
private,
parameter :: ns_min = 1.e-4_rp
425 real(
rp),
private,
parameter :: ng_min = 1.e-4_rp
427 real(
rp),
private,
parameter :: lc_min = xc_min*nc_min
428 real(
rp),
private,
parameter :: lr_min = xr_min*nr_min
429 real(
rp),
private,
parameter :: li_min = xi_min*ni_min
430 real(
rp),
private,
parameter :: ls_min = xs_min*ns_min
431 real(
rp),
private,
parameter :: lg_min = xg_min*ng_min
433 real(
rp),
private,
parameter :: x_sep = 2.6e-10_rp
435 real(
rp),
private,
parameter :: tem_min=100.0_rp
436 real(
rp),
private,
parameter :: rho_min=1.e-5_rp
437 real(
rp),
private,
parameter :: rhoi = 916.70_rp
439 integer,
private,
save :: ntmax_phase_change = 1
440 integer,
private,
save :: ntmax_collection = 1
443 real(
rp),
private,
parameter :: rho_0 = 1.280_rp
445 real(
rp),
allocatable,
private,
save :: nc_uplim_d(:,:,:)
448 real(
rp),
private,
parameter :: ka0 = 2.428e-2_rp
450 real(
rp),
private,
parameter :: dka_dt = 7.47e-5_rp
455 real(
rp),
private,
parameter :: mua0 = 1.718e-5_rp
457 real(
rp),
private,
parameter :: dmua_dt = 5.28e-8_rp
461 real(
rp),
private,
save :: xc_ccn = 1.e-12_rp
462 real(
rp),
private,
save :: xi_ccn = 1.e-12_rp
466 real(
rp),
private,
save :: cap(hydro_max)
470 real(
rp),
private,
save :: a_m(hydro_max), log_a_m(hydro_max)
471 real(
rp),
private,
save :: b_m(hydro_max)
476 real(
rp),
private,
save :: alpha_v(hydro_max,2), log_alpha_v(hydro_max,2)
477 real(
rp),
private,
save :: beta_v(hydro_max,2), log_beta_v(hydro_max,2)
478 real(
rp),
private,
save :: alpha_vn(hydro_max,2)
479 real(
rp),
private,
save :: beta_vn(hydro_max,2)
480 real(
rp),
private,
save :: gamma_v(hydro_max)
485 real(
rp),
private,
parameter :: pre0_vt = 300.e+2_rp
486 real(
rp),
private,
parameter :: tem0_vt = 233.0_rp
487 real(
rp),
private,
parameter :: a_pre0_vt = -0.1780_rp
488 real(
rp),
private,
parameter :: a_tem0_vt = -0.3940_rp
496 real(
rp),
private,
save :: nu(hydro_max)
497 real(
rp),
private,
save :: mu(hydro_max)
505 real(
rp),
private,
save :: a_area(hydro_max)
506 real(
rp),
private,
save :: b_area(hydro_max)
507 real(
rp),
private,
save :: ax_area(hydro_max)
508 real(
rp),
private,
save :: bx_area(hydro_max)
511 real(
rp),
private,
save :: a_rea(hydro_max)
512 real(
rp),
private,
save :: b_rea(hydro_max)
513 real(
rp),
private,
save :: a_rea2(hydro_max)
514 real(
rp),
private,
save :: b_rea2(hydro_max)
515 real(
rp),
private,
save :: a_rea3(hydro_max)
516 real(
rp),
private,
save :: b_rea3(hydro_max)
518 real(
rp),
private,
save :: a_d2vt(hydro_max)
519 real(
rp),
private,
save :: b_d2vt(hydro_max)
523 real(
rp),
private,
save :: coef_m2(hydro_max)
525 real(
rp),
private,
save :: coef_d6(hydro_max)
527 real(
rp),
private,
save :: coef_d3(hydro_max)
529 real(
rp),
private,
save :: coef_d(hydro_max)
531 real(
rp),
private,
save :: coef_d2v(hydro_max)
533 real(
rp),
private,
save :: coef_md2v(hydro_max)
536 real(
rp),
private,
save :: coef_r2(hydro_max)
537 real(
rp),
private,
save :: coef_r3(hydro_max)
538 real(
rp),
private,
save :: coef_re(hydro_max)
540 real(
rp),
private,
save :: coef_rea2(hydro_max)
541 real(
rp),
private,
save :: coef_rea3(hydro_max)
542 logical,
private,
save :: opt_m96_ice=.true.
543 logical,
private,
save :: opt_m96_column_ice=.false.
548 real(
rp),
private,
save :: coef_vt0(hydro_max,2), log_coef_vt0(hydro_max,2)
549 real(
rp),
private,
save :: coef_vt1(hydro_max,2), log_coef_vt1(hydro_max,2)
550 real(
rp),
private,
save :: coef_deplc
551 real(
rp),
private,
save :: coef_dave_n(hydro_max), log_coef_dave_n(hydro_max)
552 real(
rp),
private,
save :: coef_dave_l(hydro_max), log_coef_dave_l(hydro_max)
558 real(
rp),
private,
save :: d0_ni=261.76e-6_rp, log_d0_ni
559 real(
rp),
private,
save :: d0_li=398.54e-6_rp, log_d0_li
560 real(
rp),
private,
parameter :: d0_ns=270.03e-6_rp, log_d0_ns = log(d0_ns)
561 real(
rp),
private,
parameter :: d0_ls=397.47e-6_rp, log_d0_ls = log(d0_ls)
562 real(
rp),
private,
parameter :: d0_ng=269.08e-6_rp, log_d0_ng = log(d0_ng)
563 real(
rp),
private,
parameter :: d0_lg=376.36e-6_rp, log_d0_lg = log(d0_lg)
567 real(
rp),
private,
parameter :: coef_vtr_ar1=9.65_rp
569 real(
rp),
private,
parameter :: coef_vtr_br1=10.43_rp
570 real(
rp),
private,
parameter :: coef_vtr_cr1=600.0_rp
571 real(
rp),
private,
parameter :: coef_vtr_ar2=4.e+3_rp
572 real(
rp),
private,
parameter :: coef_vtr_br2=12.e+3_rp
573 real(
rp),
private,
parameter :: d_vtr_branch=0.745e-3_rp
575 real(
rp),
private,
parameter :: dr_eq = 1.10e-3_rp
580 real(
rp),
private,
save :: coef_a(hydro_max)
581 real(
rp),
private,
save :: coef_lambda(hydro_max)
585 real(
rp),
private,
save :: ah_vent (hydro_max,2)
586 real(
rp),
private,
save :: bh_vent (hydro_max,2)
587 real(
rp),
private,
save :: ah_vent0 (hydro_max,2)
588 real(
rp),
private,
save :: bh_vent0 (hydro_max,2)
589 real(
rp),
private,
save :: ah_vent1 (hydro_max,2)
590 real(
rp),
private,
save :: bh_vent1 (hydro_max,2)
592 real(
rp),
private,
save :: delta_b0 (hydro_max)
593 real(
rp),
private,
save :: delta_b1 (hydro_max)
594 real(
rp),
private,
save :: delta_ab0(hydro_max,hydro_max)
595 real(
rp),
private,
save :: delta_ab1(hydro_max,hydro_max)
597 real(
rp),
private,
save :: theta_b0 (hydro_max)
598 real(
rp),
private,
save :: theta_b1 (hydro_max)
599 real(
rp),
private,
save :: theta_ab0(hydro_max,hydro_max)
600 real(
rp),
private,
save :: theta_ab1(hydro_max,hydro_max)
602 logical,
private,
save :: opt_debug=.false.
604 logical,
private,
save :: opt_debug_inc=.true.
605 logical,
private,
save :: opt_debug_act=.true.
606 logical,
private,
save :: opt_debug_ree=.true.
607 logical,
private,
save :: opt_debug_bcs=.true.
609 logical,
save,
private :: opt_collection_bin = .false.
611 logical,
private,
save :: mp_doautoconversion = .true.
612 logical,
private,
save :: mp_couple_aerosol = .false.
613 real(
rp),
private,
save :: mp_ssw_lim = 1.e+1_rp
619 real(
rp),
private,
parameter :: c_ccn_ocean= 1.00e+8_rp
620 real(
rp),
private,
parameter :: c_ccn_land = 1.26e+9_rp
621 real(
rp),
private,
save :: c_ccn = 1.00e+8_rp
623 real(
rp),
private,
parameter :: kappa_ocean= 0.462_rp
624 real(
rp),
private,
parameter :: kappa_land = 0.308_rp
625 real(
rp),
private,
save :: kappa = 0.462_rp
626 real(
rp),
private,
save :: c_in = 1.0_rp
628 real(
rp),
private,
save :: nm_m92 = 1.e+3_rp
629 real(
rp),
private,
save :: am_m92 = -0.639_rp
630 real(
rp),
private,
save :: bm_m92 = 12.96_rp
632 real(
rp),
private,
save :: in_max = 1000.e+3_rp
633 real(
rp),
private,
save :: ssi_max= 0.60_rp
634 real(
rp),
private,
save :: ssw_max= 1.1_rp
636 real(
rp),
private,
save :: qke_min = 0.03_rp
637 real(
rp),
private,
save :: tem_ccn_low=233.150_rp
638 real(
rp),
private,
save :: tem_in_low =173.150_rp
639 logical,
private,
save :: nucl_twomey = .false.
640 logical,
private,
save :: inucl_w = .false.
641 logical,
private,
save :: so22_het = .false.
642 logical,
private,
save :: opt_nucleation_ice_hom = .false.
645 real(
rp),
private,
parameter :: rc_cr= 12.e-6_rp
646 real(
rp),
private,
save :: xc_cr
647 real(
rp),
private,
save :: alpha
648 real(
rp),
private,
save :: gm, lgm
653 real(
rp),
private,
save :: dc0 = 15.0e-6_rp
654 real(
rp),
private,
save :: dc1 = 40.0e-6_rp
655 real(
rp),
private,
save :: di0 = 150.0e-6_rp
656 real(
rp),
private,
save :: ds0 = 150.0e-6_rp
657 real(
rp),
private,
save :: dg0 = 150.0e-6_rp
659 real(
rp),
private,
save :: sigma_c=0.00_rp
660 real(
rp),
private,
save :: sigma_r=0.00_rp
661 real(
rp),
private,
save :: sigma_i=0.2_rp
662 real(
rp),
private,
save :: sigma_s=0.2_rp
663 real(
rp),
private,
save :: sigma_g=0.00_rp
665 real(
rp),
private,
save :: e_im = 0.80_rp
666 real(
rp),
private,
save :: e_sm = 0.80_rp
667 real(
rp),
private,
save :: e_gm = 1.00_rp
669 real(
rp),
private,
save :: e_ir=1.0_rp
670 real(
rp),
private,
save :: e_sr=1.0_rp
671 real(
rp),
private,
save :: e_gr=1.0_rp
672 real(
rp),
private,
save :: e_ii=1.0_rp
673 real(
rp),
private,
save :: e_si=1.0_rp
674 real(
rp),
private,
save :: e_gi=1.0_rp
675 real(
rp),
private,
save :: e_ss=1.0_rp
676 real(
rp),
private,
save :: e_gs=1.0_rp
677 real(
rp),
private,
save :: e_gg=1.0_rp
680 integer,
private,
save :: i_iconv2g=1
681 integer,
private,
save :: i_sconv2g=1
683 real(
rp),
private,
save :: rho_g = 900.0_rp
685 real(
rp),
private,
save :: cfill_i = 0.68_rp
686 real(
rp),
private,
save :: cfill_s = 0.01_rp
688 real(
rp),
private,
save :: di_cri = 500.e-6_rp
689 logical,
private,
save :: opt_stick_ks96=.false.
690 logical,
private,
save :: opt_stick_co86=.false.
692 logical,
private,
save :: opt_stick_rhh57=.false.
693 logical,
private,
save :: opt_stick_rhks96=.false.
694 real(
rp),
private,
save :: tem_min_estick=253.0_rp
695 logical,
private,
save :: opt_stick_c12=.false.
697 real(
rp),
private,
save :: fac_cndc = 1.0_rp
698 logical,
private,
save :: opt_fix_taucnd_c=.false.
703 real(
rp),
private,
save :: temc_lim_diff = -80.0_rp
721 integer,
intent(in) :: ka
722 integer,
intent(in) :: ia
723 integer,
intent(in) :: ja
725 namelist / param_atmos_phy_mp_sn14 / &
726 mp_doautoconversion, &
735 log_info(
"ATMOS_PHY_MP_sn14_setup",*)
'Setup'
736 log_info(
"ATMOS_PHY_MP_sn14_setup",*)
'Seiki and Nakajima (2014) 2-moment bulk 6 category'
740 read(
io_fid_conf,nml=param_atmos_phy_mp_sn14,iostat=ierr)
742 log_info(
"ATMOS_PHY_MP_sn14_setup",*)
'Not found namelist. Default used.'
743 elseif( ierr > 0 )
then
744 log_error(
"ATMOS_PHY_MP_sn14_setup",*)
'Not appropriate names in namelist PARAM_ATMOS_PHY_MP_SN14. Check!'
747 log_nml(param_atmos_phy_mp_sn14)
751 allocate(nc_uplim_d(1,ia,ja))
752 nc_uplim_d(:,:,:) = 150.e6_rp
757 call file_history_reg( w_name(ip),
'individual tendency term in SN14',
'kg/kg/s', &
759 if ( hist_id(ip) > 0 )
then
760 hist_max = hist_max + 1
761 hist_idx(ip) = hist_max
764 allocate( w3d(ka,ia,ja,hist_max) )
765 w3d(:,:,:,:) = 0.0_rp
774 deallocate(nc_uplim_d)
784 KA, KS, KE, IA, IS, IE, JA, JS, JE, &
811 integer,
intent(in) :: ka, ks, ke
812 integer,
intent(in) :: ia, is, ie
813 integer,
intent(in) :: ja, js, je
815 real(
rp),
intent(in) :: dens (ka,ia,ja)
816 real(
rp),
intent(in) :: w (ka,ia,ja)
817 real(
rp),
intent(in) :: qtrc (ka,ia,ja,
qa_mp)
818 real(
rp),
intent(in) :: pres(ka,ia,ja)
819 real(
rp),
intent(in) :: temp(ka,ia,ja)
820 real(
rp),
intent(in) :: qdry(ka,ia,ja)
821 real(
rp),
intent(in) :: cptot(ka,ia,ja)
822 real(
rp),
intent(in) :: cvtot(ka,ia,ja)
823 real(
rp),
intent(in) :: ccn (ka,ia,ja)
824 real(
dp),
intent(in) :: dt
825 real(
rp),
intent(in) :: cz( ka,ia,ja)
826 real(
rp),
intent(in) :: fz(0:ka,ia,ja)
828 real(
rp),
intent(out) :: rhoq_t (ka,ia,ja,
qa_mp)
829 real(
rp),
intent(out) :: rhoe_t (ka,ia,ja)
830 real(
rp),
intent(out) :: cptot_t(ka,ia,ja)
831 real(
rp),
intent(out) :: cvtot_t(ka,ia,ja)
832 real(
rp),
intent(out) :: evaporate(ka,ia,ja)
835 logical,
intent(in),
optional :: flg_lt
836 real(
rp),
intent(in),
optional :: d0_crg, v0_crg
837 real(
rp),
intent(in),
optional :: dqcrg(ka,ia,ja)
838 real(
rp),
intent(in),
optional :: beta_crg(ka,ia,ja)
839 real(
rp),
intent(in),
optional :: qtrc_crg(ka,ia,ja,hydro_max)
840 real(
rp),
intent(out),
optional :: qsplt_in(ka,ia,ja,3)
841 real(
rp),
intent(out),
optional :: sarea(ka,ia,ja,hydro_max)
842 real(
rp),
intent(out),
optional :: rhoqcrg_t(ka,ia,ja,hydro_max)
845 log_progress(*)
'atmosphere / physics / microphysics / SN14'
853 ka, ks, ke, ia, is, ie, ja, js, je, &
854 dens(:,:,:), w(:,:,:), qtrc(:,:,:,:), pres(:,:,:), temp(:,:,:), &
855 qdry(:,:,:), cptot(:,:,:), cvtot(:,:,:), ccn(:,:,:), &
856 real(dt,
rp), cz(:,:,:), fz(:,:,:), &
857 rhoq_t(:,:,:,:), rhoe_t(:,:,:), cptot_t(:,:,:), cvtot_t(:,:,:), &
859 flg_lt, d0_crg, v0_crg, dqcrg(:,:,:), beta_crg(:,:,:), &
861 qsplt_in(:,:,:,:), sarea(:,:,:,:), rhoqcrg_t(:,:,:,:) )
875 KA, KS, KE, IA, IS, IE, JA, JS, JE, &
880 integer,
intent(in) :: ka, ks, ke
881 integer,
intent(in) :: ia, is, ie
882 integer,
intent(in) :: ja, js, je
884 real(
rp),
intent(in) :: qtrc (ka,ia,ja,
qa_mp-1)
885 real(
rp),
intent(in) :: mask_criterion
887 real(
rp),
intent(out) :: cldfrac(ka,ia,ja)
890 integer :: k, i, j, iq
899 do iq = i_mp_qc, i_mp_qg
900 qhydro = qhydro + qtrc(k,i,j,iq)
902 cldfrac(k,i,j) = 0.5_rp + sign(0.5_rp,qhydro-mask_criterion)
914 KA, KS, KE, IA, IS, IE, JA, JS, JE, &
915 DENS0, TEMP0, QTRC0, &
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) :: dens0(ka,ia,ja)
931 real(
rp),
intent(in) :: temp0(ka,ia,ja)
932 real(
rp),
intent(in) :: qtrc0(ka,ia,ja,i_qc:i_ng)
934 real(
rp),
intent(out) :: re (ka,ia,ja,
n_hyd)
943 real(
rp) :: dc_ave(ka)
944 real(
rp) :: dr_ave(ka)
948 real(
rp) :: ri2m(ka), ri3m(ka)
949 real(
rp) :: rs2m(ka), rs3m(ka)
950 real(
rp) :: rg2m(ka), rg3m(ka)
952 real(
rp),
parameter :: coef_fuetal1998 = 3.0_rp / (4.0_rp*rhoi)
955 real(
rp),
parameter :: r2m_min=1.e-12_rp
956 real(
rp),
parameter :: um2cm = 100.0_rp
958 real(
rp) :: limitsw, zerosw
970 xc(k) = min( xc_max, max( xc_min, dens0(k,i,j)*qtrc0(k,i,j,i_qc)/(qtrc0(k,i,j,i_nc)+nc_min) ) )
971 xr(k) = min( xr_max, max( xr_min, dens0(k,i,j)*qtrc0(k,i,j,i_qr)/(qtrc0(k,i,j,i_nr)+nr_min) ) )
972 xi(k) = min( xi_max, max( xi_min, dens0(k,i,j)*qtrc0(k,i,j,i_qi)/(qtrc0(k,i,j,i_ni)+ni_min) ) )
973 xs(k) = min( xs_max, max( xs_min, dens0(k,i,j)*qtrc0(k,i,j,i_qs)/(qtrc0(k,i,j,i_ns)+ns_min) ) )
974 xg(k) = min( xg_max, max( xg_min, dens0(k,i,j)*qtrc0(k,i,j,i_qg)/(qtrc0(k,i,j,i_ng)+ng_min) ) )
979 dc_ave(k) = a_m(i_mp_qc) * xc(k)**b_m(i_mp_qc)
980 dr_ave(k) = a_m(i_mp_qr) * xr(k)**b_m(i_mp_qr)
985 rc = 0.5_rp * dc_ave(k)
986 limitsw = 0.5_rp + sign(0.5_rp, rc-rmin_re )
987 re(k,i,j,
i_hc) = coef_re(i_mp_qc) * rc * limitsw * um2cm
992 rr = 0.5_rp * dr_ave(k)
993 limitsw = 0.5_rp + sign(0.5_rp, rr-rmin_re )
994 re(k,i,j,
i_hr) = coef_re(i_mp_qr) * rr * limitsw * um2cm
998 ri2m(k) = pi * coef_rea2(i_mp_qi) * qtrc0(k,i,j,i_ni) * a_rea2(i_mp_qi) * xi(k)**b_rea2(i_mp_qi)
999 rs2m(k) = pi * coef_rea2(i_mp_qs) * qtrc0(k,i,j,i_ns) * a_rea2(i_mp_qs) * xs(k)**b_rea2(i_mp_qs)
1000 rg2m(k) = pi * coef_rea2(i_mp_qg) * qtrc0(k,i,j,i_ng) * a_rea2(i_mp_qg) * xg(k)**b_rea2(i_mp_qg)
1005 ri3m(k) = coef_fuetal1998 * qtrc0(k,i,j,i_ni) * xi(k)
1006 rs3m(k) = coef_fuetal1998 * qtrc0(k,i,j,i_ns) * xs(k)
1007 rg3m(k) = coef_fuetal1998 * qtrc0(k,i,j,i_ng) * xg(k)
1012 zerosw = 0.5_rp - sign(0.5_rp, ri2m(k) - r2m_min )
1013 re(k,i,j,
i_hi) = ri3m(k) / ( ri2m(k) + zerosw ) * ( 1.0_rp - zerosw ) * um2cm
1018 zerosw = 0.5_rp - sign(0.5_rp, rs2m(k) - r2m_min )
1019 re(k,i,j,
i_hs) = rs3m(k) / ( rs2m(k) + zerosw ) * ( 1.0_rp - zerosw ) * um2cm
1024 zerosw = 0.5_rp - sign(0.5_rp, rg2m(k) - r2m_min )
1025 re(k,i,j,
i_hg) = rg3m(k) / ( rg2m(k) + zerosw ) * ( 1.0_rp - zerosw ) * um2cm
1029 re(k,i,j,
i_hh) = 0.0_rp
1043 KA, KS, KE, IA, IS, IE, JA, JS, JE, &
1055 integer,
intent(in) :: ka, ks, ke
1056 integer,
intent(in) :: ia, is, ie
1057 integer,
intent(in) :: ja, js, je
1059 real(
rp),
intent(in) :: qtrc0(ka,ia,ja,
qa_mp-1)
1061 real(
rp),
intent(out) :: qe (ka,ia,ja,
n_hyd)
1071 qe(k,i,j,
i_hc) = qtrc0(k,i,j,i_mp_qc)
1072 qe(k,i,j,
i_hr) = qtrc0(k,i,j,i_mp_qr)
1073 qe(k,i,j,
i_hi) = qtrc0(k,i,j,i_mp_qi)
1074 qe(k,i,j,
i_hs) = qtrc0(k,i,j,i_mp_qs)
1075 qe(k,i,j,
i_hg) = qtrc0(k,i,j,i_mp_qg)
1076 qe(k,i,j,
i_hh) = 0.0_rp
1086 KA, KS, KE, IA, IS, IE, JA, JS, JE, &
1098 integer,
intent(in) :: ka, ks, ke
1099 integer,
intent(in) :: ia, is, ie
1100 integer,
intent(in) :: ja, js, je
1102 real(
rp),
intent(in) :: qtrc0(ka,ia,ja,
qa_mp-1)
1104 real(
rp),
intent(out) :: ne (ka,ia,ja,
n_hyd)
1114 ne(k,i,j,
i_hc) = qtrc0(k,i,j,i_mp_nc)
1115 ne(k,i,j,
i_hr) = qtrc0(k,i,j,i_mp_nr)
1116 ne(k,i,j,
i_hi) = qtrc0(k,i,j,i_mp_ni)
1117 ne(k,i,j,
i_hs) = qtrc0(k,i,j,i_mp_ns)
1118 ne(k,i,j,
i_hg) = qtrc0(k,i,j,i_mp_ng)
1119 ne(k,i,j,
i_hh) = 0.0_rp
1128 KA, KS, KE, IA, IS, IE, JA, JS, JE, &
1144 integer,
intent(in) :: ka, ks, ke
1145 integer,
intent(in) :: ia, is, ie
1146 integer,
intent(in) :: ja, js, je
1148 real(
rp),
intent(in) :: qe(ka,ia,ja,
n_hyd)
1150 real(
rp),
intent(out) :: qtrc(ka,ia,ja,
qa_mp-1)
1152 real(
rp),
intent(in),
optional :: qnum(ka,ia,ja,
n_hyd)
1154 real(
rp),
parameter :: dc = 20.e-6_rp
1155 real(
rp),
parameter :: dr = 200.e-6_rp
1156 real(
rp),
parameter :: di = 80.e-6_rp
1157 real(
rp),
parameter :: ds = 80.e-6_rp
1158 real(
rp),
parameter :: dg = 200.e-6_rp
1159 real(
rp),
parameter :: b = 3.0_rp
1172 qtrc(k,i,j,i_mp_qc) = qe(k,i,j,
i_hc)
1182 qtrc(k,i,j,i_mp_qr) = qe(k,i,j,
i_hr)
1192 qtrc(k,i,j,i_mp_qi) = qe(k,i,j,
i_hi)
1202 qtrc(k,i,j,i_mp_qs) = qe(k,i,j,
i_hs)
1212 qtrc(k,i,j,i_mp_qg) = qe(k,i,j,
i_hg) + qe(k,i,j,
i_hh)
1219 if (
present(qnum) )
then
1226 if ( qnum(k,i,j,
i_hc) .ne. undef )
then
1227 qtrc(k,i,j,i_mp_nc) = qnum(k,i,j,
i_hc)
1229 qtrc(k,i,j,i_mp_nc) = qtrc(k,i,j,i_mp_qc) / ( (piov6*rhow) * dc**b )
1240 if ( qnum(k,i,j,
i_hr) .ne. undef )
then
1241 qtrc(k,i,j,i_mp_nr) = qnum(k,i,j,
i_hr)
1243 qtrc(k,i,j,i_mp_nr) = qtrc(k,i,j,i_mp_qr) / ( (piov6*rhow) * dr**b )
1254 if ( qnum(k,i,j,
i_hi) .ne. undef )
then
1255 qtrc(k,i,j,i_mp_ni) = qnum(k,i,j,
i_hi)
1257 qtrc(k,i,j,i_mp_ni) = qtrc(k,i,j,i_mp_qi) / ( (piov6*rhof) * di**b )
1268 if ( qnum(k,i,j,
i_hs) .ne. undef )
then
1269 qtrc(k,i,j,i_mp_ns) = qnum(k,i,j,
i_hs)
1271 qtrc(k,i,j,i_mp_ns) = qtrc(k,i,j,i_mp_qs) / ( (piov6*rhof) * ds**b )
1282 if ( qnum(k,i,j,
i_hg) .ne. undef )
then
1283 if ( qnum(k,i,j,
i_hh) .ne. undef )
then
1284 qtrc(k,i,j,i_mp_ng) = qnum(k,i,j,
i_hg) + qnum(k,i,j,
i_hh)
1286 qtrc(k,i,j,i_mp_ng) = qnum(k,i,j,
i_hg)
1289 qtrc(k,i,j,i_mp_ng) = qtrc(k,i,j,i_mp_qg) / ( (piov6*rhog) * dg**b )
1302 qtrc(k,i,j,i_mp_nc) = qtrc(k,i,j,i_mp_qc) / ( (piov6*rhow) * dc**b )
1312 qtrc(k,i,j,i_mp_nr) = qtrc(k,i,j,i_mp_qr) / ( (piov6*rhow) * dr**b )
1322 qtrc(k,i,j,i_mp_ni) = qtrc(k,i,j,i_mp_qi) / ( (piov6*rhof) * di**b )
1332 qtrc(k,i,j,i_mp_ns) = qtrc(k,i,j,i_mp_qs) / ( (piov6*rhof) * ds**b )
1342 qtrc(k,i,j,i_mp_ng) = qtrc(k,i,j,i_mp_qg) / ( (piov6*rhog) * dg**b )
1369 integer,
intent(in) :: ka, ks, ke
1371 real(
rp),
intent(in) :: rhoq(ka,i_qc:i_ng)
1372 real(
rp),
intent(in) :: dens(ka)
1373 real(
rp),
intent(in) :: temp(ka)
1374 real(
rp),
intent(in) :: pres(ka)
1376 real(
rp),
intent(out) :: vterm(ka,
qa_mp-1)
1378 real(
rp) :: xq, log_xq
1381 real(
rp) :: rhofac_q(ka), log_rhofac_q
1383 real(
rp) :: rlambdar(ka)
1385 real(
rp) :: dq, log_dq
1392 integer :: k, i, j, iq
1397 rhofac = rho_0 / max( dens(k), rho_min )
1399 log_rhofac_q = log(rhofac) * gamma_v(i_mp_qc)
1400 log_xq = log( max( xc_min, min( xc_max, rhoq(k,i_qc) / ( rhoq(k,i_nc) + nc_min ) ) ) )
1402 vterm(k,i_mp_qc) = - exp( log_rhofac_q + log_coef_vt1(i_mp_qc,1) + log_xq * beta_v(i_mp_qc,1) )
1404 vterm(k,i_mp_nc) = - exp( log_rhofac_q + log_coef_vt0(i_mp_qc,1) + log_xq * beta_vn(i_mp_qc,1) )
1408 mud_r = 3.0_rp * nu(i_mp_qr) + 2.0_rp
1410 rhofac = rho_0 / max( dens(k), rho_min )
1411 rhofac_q(k) = rhofac**gamma_v(i_mp_qr)
1414 xq = max( xr_min, min( xr_max, rhoq(k,i_qr) / ( rhoq(k,i_nr) + nr_min ) ) )
1416 rlambdar(k) = a_m(i_mp_qr) * xq**b_m(i_mp_qr) &
1417 * ( (mud_r+3.0_rp) * (mud_r+2.0_rp) * (mud_r+1.0_rp) )**(-0.333333333_rp)
1421 dq = ( 4.0_rp + mud_r ) * rlambdar(k)
1422 weight = min( 1.0_rp, max( 0.0_rp, 0.5_rp * ( 1.0_rp + tanh( pi * log( dq/d_vtr_branch ) ) ) ) )
1423 velq_s = coef_vtr_ar2 * dq &
1424 * ( 1.0_rp - ( 1.0_rp + coef_vtr_br2*rlambdar(k) )**(-5.0_rp-mud_r) )
1425 velq_l = coef_vtr_ar1 &
1426 - coef_vtr_br1 * ( 1.0_rp + coef_vtr_cr1*rlambdar(k) )**(-4.0_rp-mud_r)
1427 vterm(k,i_mp_qr) = -rhofac_q(k) * ( velq_l * ( weight ) &
1428 + velq_s * ( 1.0_rp - weight ) )
1432 dq = ( 1.0_rp + mud_r ) * rlambdar(k)
1433 weight = min( 1.0_rp, max( 0.0_rp, 0.5_rp * ( 1.0_rp + tanh( pi * log( dq/d_vtr_branch ) ) ) ) )
1434 velq_s = coef_vtr_ar2 * dq &
1435 * ( 1.0_rp - ( 1.0_rp + coef_vtr_br2*rlambdar(k) )**(-2.0_rp-mud_r) )
1436 velq_l = coef_vtr_ar1 &
1437 - coef_vtr_br1 * ( 1.0_rp + coef_vtr_cr1*rlambdar(k) )**(-1.0_rp-mud_r)
1438 vterm(k,i_mp_nr) = -rhofac_q(k) * ( velq_l * ( weight ) &
1439 + velq_s * ( 1.0_rp - weight ) )
1443 rhofac_q(k) = exp( log( pres(k)/pre0_vt ) * a_pre0_vt + log( temp(k)/tem0_vt ) * a_tem0_vt )
1449 log_xq = log( max( xi_min, min( xi_max, rhoq(k,i_qi) / ( rhoq(k,i_ni) + ni_min ) ) ) )
1451 tmp = log_a_m(i_mp_qi) + log_xq * b_m(i_mp_qi)
1452 log_dq = log_coef_dave_l(i_mp_qi) + tmp
1453 weight = min( 1.0_rp, max( 0.0_rp, 0.5_rp * ( 1.0_rp + log_dq - log_d0_li ) ) )
1455 velq_s = exp( log_coef_vt1(i_mp_qi,1) + log_xq * beta_v(i_mp_qi,1) )
1456 velq_l = exp( log_coef_vt1(i_mp_qi,2) + log_xq * beta_v(i_mp_qi,2) )
1457 vterm(k,i_mp_qi) = - rhofac_q(k) * ( velq_l * ( weight ) &
1458 + velq_s * ( 1.0_rp - weight ) )
1460 log_dq = log_coef_dave_n(i_mp_qi) + tmp
1461 weight = min( 1.0_rp, max( 0.0_rp, 0.5_rp * ( 1.0_rp + log_dq - log_d0_ni ) ) )
1463 velq_s = exp( log_coef_vt0(i_mp_qi,1) + log_xq * beta_vn(i_mp_qi,1) )
1464 velq_l = exp( log_coef_vt0(i_mp_qi,2) + log_xq * beta_vn(i_mp_qi,2) )
1465 vterm(k,i_mp_ni) = - rhofac_q(k) * ( velq_l * ( weight ) &
1466 + velq_s * ( 1.0_rp - weight ) )
1472 log_xq = log( max( xs_min, min( xs_max, rhoq(k,i_qs) / ( rhoq(k,i_ns) + ns_min ) ) ) )
1474 tmp = log_a_m(i_mp_qs) + log_xq * b_m(i_mp_qs)
1475 log_dq = log_coef_dave_l(i_mp_qs) + tmp
1476 weight = min( 1.0_rp, max( 0.0_rp, 0.5_rp * ( 1.0_rp + log_dq - log_d0_ls ) ) )
1478 velq_s = exp( log_coef_vt1(i_mp_qs,1) + log_xq * beta_v(i_mp_qs,1) )
1479 velq_l = exp( log_coef_vt1(i_mp_qs,2) + log_xq * beta_v(i_mp_qs,2) )
1480 vterm(k,i_mp_qs) = - rhofac_q(k) * ( velq_l * ( weight ) &
1481 + velq_s * ( 1.0_rp - weight ) )
1483 log_dq = log_coef_dave_n(i_mp_qs) + tmp
1484 weight = min( 1.0_rp, max( 0.0_rp, 0.5_rp * ( 1.0_rp + log_dq - log_d0_ns ) ) )
1486 velq_s = exp( log_coef_vt0(i_mp_qs,1) + log_xq * beta_vn(i_mp_qs,1) )
1487 velq_l = exp( log_coef_vt0(i_mp_qs,2) + log_xq * beta_vn(i_mp_qs,2) )
1488 vterm(k,i_mp_ns) = - rhofac_q(k) * ( velq_l * ( weight ) &
1489 + velq_s * ( 1.0_rp - weight ) )
1495 log_xq = log( max( xg_min, min( xg_max, rhoq(k,i_qg) / ( rhoq(k,i_ng) + ng_min ) ) ) )
1497 tmp = log_a_m(i_mp_qg) + log_xq * b_m(i_mp_qg)
1498 log_dq = log_coef_dave_l(i_mp_qg) + tmp
1499 weight = min( 1.0_rp, max( 0.0_rp, 0.5_rp * ( 1.0_rp + log_dq - log_d0_lg ) ) )
1501 velq_s = exp( log_coef_vt1(i_mp_qg,1) + log_xq * beta_v(i_mp_qg,1) )
1502 velq_l = exp( log_coef_vt1(i_mp_qg,2) + log_xq * beta_v(i_mp_qg,2) )
1503 vterm(k,i_mp_qg) = - rhofac_q(k) * ( velq_l * ( weight ) &
1504 + velq_s * ( 1.0_rp - weight ) )
1506 log_dq = log_coef_dave_n(i_mp_qg) + tmp
1507 weight = min( 1.0_rp, max( 0.0_rp, 0.5_rp * ( 1.0_rp + log_dq - log_d0_ng ) ) )
1509 velq_s = exp( log_coef_vt0(i_mp_qg,1) + log_xq * beta_vn(i_mp_qg,1) )
1510 velq_l = exp( log_coef_vt0(i_mp_qg,2) + log_xq * beta_vn(i_mp_qg,2) )
1511 vterm(k,i_mp_ng) = - rhofac_q(k) * ( velq_l * ( weight ) &
1512 + velq_s * ( 1.0_rp - weight ) )
1517 vterm(ks-1 ,iq) = vterm(ks,iq)
1527 subroutine mp_sn14_init
1534 real(
rp),
parameter :: eps_gamma=1.e-30_rp
1536 real(
rp) :: w1(hydro_max)
1537 real(
rp) :: w2(hydro_max)
1538 real(
rp) :: w3(hydro_max)
1539 real(
rp) :: w4(hydro_max)
1540 real(
rp) :: w5(hydro_max)
1541 real(
rp) :: w6(hydro_max)
1542 real(
rp) :: w7(hydro_max)
1543 real(
rp) :: w8(hydro_max)
1545 character(len=H_SHORT) :: wlabel(hydro_max)
1548 real(
rp) :: ar_ice_fix = 0.7_rp
1549 real(
rp) :: wcap1, wcap2
1551 logical :: flag_vent0(hydro_max), flag_vent1(hydro_max)
1553 integer :: iw, ia, ib
1556 namelist / param_atmos_phy_mp_sn14_init / &
1562 opt_collection_bin, &
1563 ntmax_phase_change, &
1566 namelist / param_atmos_phy_mp_sn14_particles / &
1567 a_m, b_m, alpha_v, beta_v, gamma_v, &
1568 alpha_vn, beta_vn, &
1569 a_area, b_area, cap, &
1571 opt_m96_column_ice, &
1575 namelist / param_atmos_phy_mp_sn14_nucleation / &
1578 nm_m92, am_m92, bm_m92, &
1583 nucl_twomey, inucl_w, &
1584 so22_het, opt_nucleation_ice_hom
1586 namelist / param_atmos_phy_mp_sn14_collection / &
1587 dc0, dc1, di0, ds0, dg0, &
1588 sigma_c, sigma_r, sigma_i, sigma_s, sigma_g, &
1592 e_ir, e_sr, e_gr, e_ii, e_si, e_gi, e_ss, e_gs, e_gg, &
1593 i_iconv2g, i_sconv2g, rho_g, cfill_i, cfill_s, di_cri
1596 namelist / param_atmos_phy_mp_sn14_collection_bin / &
1597 dc0, dc1, di0, ds0, dg0, &
1605 e_ir, e_sr, e_gr, e_ii, e_si, e_gi, e_ss, e_gs, e_gg, &
1606 i_iconv2g, i_sconv2g, rho_g, cfill_i, cfill_s, di_cri
1608 namelist / param_atmos_phy_mp_sn14_condensation / &
1609 opt_fix_taucnd_c, fac_cndc
1615 alpha_v(:,:) = undef8
1616 beta_v(:,:) = undef8
1617 alpha_vn(:,:) = undef8
1618 beta_vn(:,:) = undef8
1636 coef_dave_n(:) = undef8
1637 coef_dave_l(:) = undef8
1638 log_coef_dave_n(:) = undef8
1639 log_coef_dave_l(:) = undef8
1643 coef_d2v(:) = undef8
1644 coef_md2v(:) = undef8
1648 coef_rea2(:) = undef8
1649 coef_rea3(:) = undef8
1652 coef_lambda(:) = undef8
1653 coef_vt0(:,:) = undef8
1654 coef_vt1(:,:) = undef8
1655 log_coef_vt0(:,:) = undef8
1656 log_coef_vt1(:,:) = undef8
1657 delta_b0(:) = undef8
1658 delta_b1(:) = undef8
1659 delta_ab0(:,:) = undef8
1660 delta_ab1(:,:) = undef8
1661 theta_b0(:) = undef8
1662 theta_b1(:) = undef8
1663 theta_ab0(:,:) = undef8
1664 theta_ab1(:,:) = undef8
1666 ah_vent(:,:) = undef8
1667 ah_vent0(:,:) = undef8
1668 ah_vent1(:,:) = undef8
1669 bh_vent(:,:) = undef8
1670 bh_vent0(:,:) = undef8
1671 bh_vent1(:,:) = undef8
1675 read(
io_fid_conf,nml=param_atmos_phy_mp_sn14_init,iostat=ierr)
1678 log_info(
"ATMOS_PHY_MP_sn14_init",*)
'Not found namelist. Default used.'
1679 elseif( ierr > 0 )
then
1680 log_error(
"ATMOS_PHY_MP_sn14_init",*)
'Not appropriate names in namelist PARAM_ATMOS_PHY_MP_SN14_init. Check!'
1683 log_nml(param_atmos_phy_mp_sn14_init)
1689 a_area(i_mp_qc) = pi/4.0_rp
1690 a_area(i_mp_qr) = pi/4.0_rp
1691 a_area(i_mp_qi) = 0.65_rp*1.e-4_rp*100.0_rp**(2.00_rp)
1692 a_area(i_mp_qs) = 0.2285_rp*1.e-4_rp*100.0_rp**(1.88_rp)
1693 a_area(i_mp_qg) = 0.50_rp*1.e-4_rp*100.0_rp**(2.0_rp)
1694 b_area(i_mp_qc) = 2.0_rp
1695 b_area(i_mp_qr) = 2.0_rp
1696 b_area(i_mp_qi) = 2.0_rp
1697 b_area(i_mp_qs) = 1.88_rp
1698 b_area(i_mp_qg) = 2.0_rp
1704 a_m(i_mp_qc) = 0.124_rp
1705 a_m(i_mp_qr) = 0.124_rp
1706 a_m(i_mp_qi) = 0.217_rp
1707 a_m(i_mp_qs) = 8.156_rp
1708 a_m(i_mp_qg) = 0.190_rp
1709 b_m(i_mp_qc) = 1.0_rp/3.0_rp
1710 b_m(i_mp_qr) = 1.0_rp/3.0_rp
1711 b_m(i_mp_qi) = 0.302_rp
1712 b_m(i_mp_qs) = 0.526_rp
1713 b_m(i_mp_qg) = 0.323_rp
1717 alpha_v(i_mp_qc,:)= 3.75e+5_rp
1718 alpha_v(i_mp_qr,:)= 159.0_rp
1719 alpha_v(i_mp_qi,:)= 317.0_rp
1720 alpha_v(i_mp_qs,:)= 27.70_rp
1721 alpha_v(i_mp_qg,:)= 40.0_rp
1722 beta_v(i_mp_qc,:) = 2.0_rp/3.0_rp
1723 beta_v(i_mp_qr,:) = 0.266_rp
1724 beta_v(i_mp_qi,:) = 0.363_rp
1725 beta_v(i_mp_qs,:) = 0.216_rp
1726 beta_v(i_mp_qg,:) = 0.230_rp
1727 gamma_v(i_mp_qc) = 1.0_rp
1729 gamma_v(i_mp_qr) = 1.0_rp/2.0_rp
1730 gamma_v(i_mp_qi) = 1.0_rp/2.0_rp
1731 gamma_v(i_mp_qs) = 1.0_rp/2.0_rp
1732 gamma_v(i_mp_qg) = 1.0_rp/2.0_rp
1740 nu(i_mp_qc) = 1.0_rp
1741 nu(i_mp_qr) = -1.0_rp/3.0_rp
1742 nu(i_mp_qi) = 1.0_rp
1743 nu(i_mp_qs) = 1.0_rp
1744 nu(i_mp_qg) = 1.0_rp
1746 mu(i_mp_qc) = 1.0_rp
1747 mu(i_mp_qr) = 1.0_rp/3.0_rp
1748 mu(i_mp_qi) = 1.0_rp/3.0_rp
1749 mu(i_mp_qs) = 1.0_rp/3.0_rp
1750 mu(i_mp_qg) = 1.0_rp/3.0_rp
1759 cap(i_mp_qc) = 2.0_rp
1760 cap(i_mp_qr) = 2.0_rp
1762 cap(i_mp_qs) = 2.0_rp
1763 cap(i_mp_qg) = 2.0_rp
1765 alpha_vn(:,:) = alpha_v(:,:)
1766 beta_vn(:,:) = beta_v(:,:)
1774 read(
io_fid_conf,nml=param_atmos_phy_mp_sn14_particles,iostat=ierr)
1776 log_info(
"ATMOS_PHY_MP_sn14_init",*)
'Not found namelist. Default used.'
1777 elseif( ierr > 0 )
then
1778 log_error(
"ATMOS_PHY_MP_sn14_init",*)
'Not appropriate names in namelist PARAM_ATMOS_PHY_MP_SN14_particles. Check!'
1781 log_nml(param_atmos_phy_mp_sn14_particles)
1785 if( opt_m96_ice )
then
1789 a_area(i_mp_qi) = 0.120284936_rp
1790 a_area(i_mp_qs) = 0.131488_rp
1791 a_area(i_mp_qg) = 0.5_rp
1792 b_area(i_mp_qi) = 1.850000_rp
1793 b_area(i_mp_qs) = 1.880000_rp
1794 b_area(i_mp_qg) = 2.0_rp
1795 a_m(i_mp_qi) = 1.23655360084766_rp
1796 a_m(i_mp_qs) = a_m(i_mp_qi)
1797 a_m(i_mp_qg) = 0.346111225718402_rp
1798 b_m(i_mp_qi) = 0.408329930583912_rp
1799 b_m(i_mp_qs) = b_m(i_mp_qi)
1800 b_m(i_mp_qg) = 0.357142857142857_rp
1802 if( opt_m96_column_ice )
then
1805 a_area(i_mp_qi)= (0.684_rp*1.e-4_rp)*10.0_rp**(2.0_rp*2.00_rp)
1806 b_area(i_mp_qi)= 2.0_rp
1807 a_m(i_mp_qi) = 0.19834046116844_rp
1808 b_m(i_mp_qi) = 0.343642611683849_rp
1811 wcap1 = sqrt(1.0_rp-ar_ice_fix**2)
1812 wcap2 = log( (1.0_rp+wcap1)/ar_ice_fix )
1813 cap(i_mp_qi) = 2.0_rp*wcap2/wcap1
1822 if( opt_m96_column_ice )
then
1823 alpha_v(i_mp_qi,:) = (/2901.0_rp, 32.20_rp/)
1824 alpha_vn(i_mp_qi,:) = (/9675.2_rp, 64.16_rp/)
1826 alpha_v(i_mp_qi,:) =(/ 5798.60107421875_rp, 167.347076416016_rp/)
1827 alpha_vn(i_mp_qi,:) =(/ 12408.177734375_rp, 421.799865722656_rp/)
1829 alpha_v(i_mp_qs,:) =(/ 15173.3916015625_rp, 305.678619384766_rp/)
1830 alpha_vn(i_mp_qs,:) =(/ 29257.1601562500_rp, 817.985717773438_rp/)
1831 alpha_v(i_mp_qg,:) =(/ 15481.6904296875_rp, 311.642242431641_rp/)
1832 alpha_vn(i_mp_qg,:) =(/ 27574.6562500000_rp, 697.536132812500_rp/)
1834 beta_v(i_mp_qi,:) =(/ 0.504873454570770_rp, 0.324817866086960_rp/)
1835 beta_vn(i_mp_qi,:) =(/ 0.548495233058929_rp, 0.385287821292877_rp/)
1836 if( opt_m96_column_ice )
then
1837 beta_v(i_mp_qi,:) =(/ 0.465552181005478_rp, 0.223826110363007_rp/)
1838 beta_vn(i_mp_qi,:) =(/ 0.530453503131866_rp, 0.273761242628098_rp/)
1840 beta_v(i_mp_qs,:) =(/ 0.528109610080719_rp, 0.329863965511322_rp/)
1841 beta_vn(i_mp_qs,:) =(/ 0.567154467105865_rp, 0.393876969814301_rp/)
1842 beta_v(i_mp_qg,:) =(/ 0.534656763076782_rp, 0.330253750085831_rp/)
1843 beta_vn(i_mp_qg,:) =(/ 0.570551633834839_rp, 0.387124240398407_rp/)
1847 ax_area(:) = a_area(:)*a_m(:)**b_area(:)
1848 bx_area(:) = b_area(:)*b_m(:)
1852 a_rea(:) = sqrt(ax_area(:)/pi)
1853 b_rea(:) = bx_area(:)/2.0_rp
1854 a_rea2(:) = a_rea(:)**2
1855 b_rea2(:) = b_rea(:)*2.0_rp
1856 a_rea3(:) = a_rea(:)**3
1857 b_rea3(:) = b_rea(:)*3.0_rp
1859 a_d2vt(:)=alpha_v(:,2)*(1.0_rp/alpha_v(:,2))**(beta_v(:,2)/b_m(:))
1860 b_d2vt(:)=(beta_v(:,2)/b_m(:))
1880 w1(iw) = gammafunc( (n+nu(iw)+1.0_rp)/mu(iw) )
1881 w2(iw) = gammafunc( (nu(iw)+1.0_rp)/mu(iw) )
1882 w3(iw) = gammafunc( (nu(iw)+2.0_rp)/mu(iw) )
1883 coef_m2(iw) = w1(iw)/w2(iw)*( w2(iw)/w3(iw) )**n
1885 w4(iw) = gammafunc( (b_m(iw)+nu(iw)+1.0_rp)/mu(iw) )
1886 coef_d(iw) = a_m(iw) * w4(iw)/w2(iw)*( w2(iw)/w3(iw) )**b_m(iw)
1887 w5(iw) = gammafunc( (2.0_rp*b_m(iw)+beta_v(iw,2)+nu(iw)+1.0_rp)/mu(iw) )
1888 w6(iw) = gammafunc( (3.0_rp*b_m(iw)+beta_v(iw,2)+nu(iw)+1.0_rp)/mu(iw) )
1889 coef_d2v(iw) = a_m(iw) * w6(iw)/w5(iw)* ( w2(iw)/w3(iw) )**b_m(iw)
1890 coef_md2v(iw)= w5(iw)/w2(iw)* ( w2(iw)/w3(iw) )**(2.0_rp*b_m(iw)+beta_v(iw,2))
1892 w7(iw) = gammafunc( (3.0_rp*b_m(iw)+nu(iw)+1.0_rp)/mu(iw) )
1893 coef_d3(iw) = a_m(iw)**3 * w7(iw)/w2(iw)*( w2(iw)/w3(iw) )**(3.0_rp*b_m(iw))
1894 w8(iw) = gammafunc( (6.0_rp*b_m(iw)+nu(iw)+1.0_rp)/mu(iw) )
1895 coef_d6(iw) = a_m(iw)**6 * w8(iw)/w2(iw)*( w2(iw)/w3(iw) )**(6.0_rp*b_m(iw))
1898 coef_deplc = coef_d(i_mp_qc)/a_m(i_mp_qc)
1904 w1(iw) = gammafunc( (2.0_rp*b_m(iw)+nu(iw)+1.0_rp)/mu(iw) )
1905 w2(iw) = gammafunc( (nu(iw)+1.0_rp)/mu(iw) )
1906 w3(iw) = gammafunc( (nu(iw)+2.0_rp)/mu(iw) )
1908 w4(iw) = gammafunc( (3.0_rp*b_m(iw)+nu(iw)+1.0_rp)/mu(iw) )
1910 coef_r2(iw)=w1(iw)/w2(iw)*( w2(iw)/w3(iw) )**(2.0_rp*b_m(iw))
1911 coef_r3(iw)=w4(iw)/w2(iw)*( w2(iw)/w3(iw) )**(3.0_rp*b_m(iw))
1912 coef_re(iw)=coef_r3(iw)/coef_r2(iw)
1919 w1(iw) = gammafunc( (nu(iw)+1.0_rp)/mu(iw) )
1920 w2(iw) = gammafunc( (nu(iw)+2.0_rp)/mu(iw) )
1921 w3(iw) = gammafunc( (b_rea2(iw)+nu(iw)+1.0_rp)/mu(iw) )
1922 w4(iw) = gammafunc( (b_rea3(iw)+nu(iw)+1.0_rp)/mu(iw) )
1924 coef_rea2(iw) = w3(iw)/w1(iw)*( w1(iw)/w2(iw) )**b_rea2(iw)
1925 coef_rea3(iw) = w4(iw)/w1(iw)*( w1(iw)/w2(iw) )**b_rea3(iw)
1931 w1(iw) = gammafunc( (nu(iw) + 1.0_rp)/mu(iw) )
1932 w2(iw) = gammafunc( (nu(iw) + 2.0_rp)/mu(iw) )
1933 coef_a(iw) = mu(iw)/w1(iw)
1935 coef_lambda(iw) = (w1(iw)/w2(iw))**(-mu(iw))
1943 w1(iw) = gammafunc( (beta_vn(iw,ia) + nu(iw) + 1.0_rp + n)/mu(iw) )
1944 w2(iw) = gammafunc( ( nu(iw) + 1.0_rp + n)/mu(iw) )
1945 w3(iw) = gammafunc( (nu(iw) + 1.0_rp)/mu(iw) )
1946 w4(iw) = gammafunc( (nu(iw) + 2.0_rp)/mu(iw) )
1948 coef_vt0(iw,ia) = alpha_vn(iw,ia) * w1(iw) / w2(iw) * ( w3(iw) / w4(iw) )**beta_vn(iw,ia)
1949 log_coef_vt0(iw,ia) = log( coef_vt0(iw,ia) )
1951 w1(iw) = gammafunc( (beta_v(iw,ia) + nu(iw) + 1.0_rp + n)/mu(iw) )
1952 w2(iw) = gammafunc( ( nu(iw) + 1.0_rp + n)/mu(iw) )
1954 coef_vt1(iw,ia) = alpha_v(iw,ia) * w1(iw) / w2(iw) * ( w3(iw) / w4(iw) )**beta_v(iw,ia)
1955 log_coef_vt1(iw,ia) = log( coef_vt1(iw,ia) )
1960 w1(iw) = gammafunc( ( b_m(iw) + nu(iw) + 1.0_rp)/mu(iw) )
1961 w2(iw) = gammafunc( (1.0_rp + b_m(iw) + nu(iw) + 1.0_rp)/mu(iw) )
1962 w3(iw) = gammafunc( (nu(iw) + 1.0_rp)/mu(iw) )
1963 w4(iw) = gammafunc( (nu(iw) + 2.0_rp)/mu(iw) )
1964 coef_dave_n(iw) = ( w1(iw) / w3(iw) ) * ( w3(iw) / w4(iw) )**( b_m(iw))
1965 coef_dave_l(iw) = ( w2(iw) / w3(iw) ) * ( w3(iw) / w4(iw) )**(1.0_rp+b_m(iw))
1966 log_coef_dave_n(iw) = log( coef_dave_n(iw) )
1967 log_coef_dave_l(iw) = log( coef_dave_l(iw) )
1971 ah_vent(i_mp_qc,1:2) = (/1.0000_rp,1.0000_rp/)
1972 ah_vent(i_mp_qr,1:2) = (/1.0000_rp,0.780_rp/)
1973 ah_vent(i_mp_qi,1:2) = (/1.0000_rp,0.860_rp/)
1974 ah_vent(i_mp_qs,1:2) = (/1.0000_rp,0.780_rp/)
1975 ah_vent(i_mp_qg,1:2) = (/1.0000_rp,0.780_rp/)
1976 bh_vent(i_mp_qc,1:2) = (/0.0000_rp,0.0000_rp/)
1977 bh_vent(i_mp_qr,1:2) = (/0.108_rp,0.308_rp/)
1978 bh_vent(i_mp_qi,1:2) = (/0.140_rp,0.280_rp/)
1979 bh_vent(i_mp_qs,1:2) = (/0.108_rp,0.308_rp/)
1980 bh_vent(i_mp_qg,1:2) = (/0.108_rp,0.308_rp/)
1984 if( (nu(iw) + b_m(iw) + n) > eps_gamma )
then
1985 w1(iw) = gammafunc( (nu(iw) + b_m(iw) + n)/mu(iw) )
1986 w2(iw) = gammafunc( (nu(iw) + 1.0_rp)/mu(iw) )
1987 w3(iw) = gammafunc( (nu(iw) + 2.0_rp)/mu(iw) )
1988 ah_vent0(iw,1)= ah_vent(iw,1)*(w1(iw)/w2(iw))*(w2(iw)/w3(iw))**(b_m(iw)+n-1.0_rp)
1989 ah_vent0(iw,2)= ah_vent(iw,2)*(w1(iw)/w2(iw))*(w2(iw)/w3(iw))**(b_m(iw)+n-1.0_rp)
1990 flag_vent0(iw)=.true.
1992 ah_vent0(iw,1)= 1.0_rp
1993 ah_vent0(iw,2)= 1.0_rp
1994 flag_vent0(iw)=.false.
1997 if( (nu(iw) + b_m(iw) + n) > eps_gamma )
then
1998 w1(iw) = gammafunc( (nu(iw) + b_m(iw) + n)/mu(iw) )
1999 w2(iw) = gammafunc( (nu(iw) + 1.0_rp)/mu(iw) )
2000 w3(iw) = gammafunc( (nu(iw) + 2.0_rp)/mu(iw) )
2001 ah_vent1(iw,1)= ah_vent(iw,1)*(w1(iw)/w2(iw))*(w2(iw)/w3(iw))**(b_m(iw)+n-1.0_rp)
2002 ah_vent1(iw,2)= ah_vent(iw,2)*(w1(iw)/w2(iw))*(w2(iw)/w3(iw))**(b_m(iw)+n-1.0_rp)
2003 flag_vent1(iw)=.true.
2005 ah_vent1(iw,1)= 1.0_rp
2006 ah_vent1(iw,2)= 1.0_rp
2007 flag_vent1(iw)=.true.
2012 if( (nu(iw) + 1.5_rp*b_m(iw) + 0.5_rp*beta_v(iw,1) + n) < eps_gamma )
then
2013 flag_vent0(iw)=.false.
2015 if(flag_vent0(iw))
then
2017 w2(iw) = gammafunc( (nu(iw) + 1.0_rp)/mu(iw) )
2018 w3(iw) = gammafunc( (nu(iw) + 2.0_rp)/mu(iw) )
2020 w4(iw) = gammafunc( (nu(iw) + 2.0_rp*b_m(iw) + beta_v(iw,1) + n)/mu(iw) )
2021 bh_vent0(iw,1)=bh_vent(iw,1)*(w4(iw)/w2(iw))*(w2(iw)/w3(iw))**(2.00_rp*b_m(iw)+beta_v(iw,1)+n-1.0_rp)
2022 w5(iw) = gammafunc( (nu(iw) + 1.5_rp*b_m(iw) + 0.5_rp*beta_v(iw,2) + n)/mu(iw) )
2023 bh_vent0(iw,2)=bh_vent(iw,2)*(w5(iw)/w2(iw))*(w2(iw)/w3(iw))**(1.5_rp*b_m(iw)+0.5_rp*beta_v(iw,2)+n-1.0_rp)
2025 bh_vent0(iw,1) = 0.0_rp
2026 bh_vent0(iw,2) = 0.0_rp
2030 if( (nu(iw) + 1.5_rp*b_m(iw) + 0.5_rp*beta_v(iw,1) + n) < eps_gamma )
then
2031 flag_vent1(iw)=.false.
2033 if(flag_vent1(iw))
then
2035 w2(iw) = gammafunc( (nu(iw) + 1.0_rp)/mu(iw) )
2036 w3(iw) = gammafunc( (nu(iw) + 2.0_rp)/mu(iw) )
2038 w4(iw) = gammafunc( (nu(iw) + 2.0_rp*b_m(iw) + beta_v(iw,1) + n)/mu(iw) )
2039 bh_vent1(iw,1)=bh_vent(iw,1)*(w4(iw)/w2(iw))*(w2(iw)/w3(iw))**(2.00_rp*b_m(iw)+beta_v(iw,1)+n-1.0_rp)
2041 w5(iw) = gammafunc( (nu(iw) + 1.5_rp*b_m(iw) + 0.5_rp*beta_v(iw,2) + n)/mu(iw) )
2042 bh_vent1(iw,2)=bh_vent(iw,2)*(w5(iw)/w2(iw))*(w2(iw)/w3(iw))**(1.5_rp*b_m(iw)+0.5_rp*beta_v(iw,2)+n-1.0_rp)
2044 bh_vent1(iw,1) = 0.0_rp
2045 bh_vent1(iw,2) = 0.0_rp
2054 w1(iw) = gammafunc( (2.0_rp*b_rea(iw) + nu(iw) + 1.0_rp + n)/mu(iw) )
2055 w2(iw) = gammafunc( (nu(iw) + 1.0_rp)/mu(iw) )
2056 w3(iw) = gammafunc( (nu(iw) + 2.0_rp)/mu(iw) )
2057 delta_b0(iw) = w1(iw)/w2(iw) &
2058 *( w2(iw)/w3(iw) )**(2.0_rp*b_rea(iw) + n)
2060 w1(iw) = gammafunc( (2.0_rp*b_rea(iw) + nu(iw) + 1.0_rp + n)/mu(iw) )
2061 delta_b1(iw) = w1(iw)/w2(iw) &
2062 *( w2(iw)/w3(iw) )**(2.0_rp*b_rea(iw) + n)
2068 w1(iw) = gammafunc( (b_rea(iw) + nu(iw) + 1.0_rp + n)/mu(iw) )
2069 w2(iw) = gammafunc( (nu(iw) + 1.0_rp)/mu(iw) )
2070 w3(iw) = gammafunc( (nu(iw) + 2.0_rp)/mu(iw) )
2071 w4(iw) = gammafunc( (b_rea(iw) + nu(iw) + 1.0_rp )/mu(iw) )
2073 w5(iw) = gammafunc( (b_rea(iw) + nu(iw) + 1.0_rp + n)/mu(iw) )
2081 delta_ab0(ia,ib) = 2.0_rp*(w1(ib)/w2(ib))*(w4(ia)/w2(ia)) &
2082 * ( w2(ib)/w3(ib) )**(b_rea(ib)+n) &
2083 * ( w2(ia)/w3(ia) )**(b_rea(ia) )
2085 delta_ab1(ia,ib) = 2.0_rp*(w5(ib)/w2(ib))*(w4(ia)/w2(ia)) &
2086 * ( w2(ib)/w3(ib) )**(b_rea(ib)+n) &
2087 * ( w2(ia)/w3(ia) )**(b_rea(ia) )
2095 w1(iw) = gammafunc( (2.0_rp*beta_v(iw,2) + 2.0_rp*b_rea(iw) + nu(iw) + 1.0_rp + n)/mu(iw) )
2096 w2(iw) = gammafunc( ( 2.0_rp*b_rea(iw) + nu(iw) + 1.0_rp + n)/mu(iw) )
2097 w3(iw) = gammafunc( (nu(iw) + 1.0_rp)/mu(iw) )
2098 w4(iw) = gammafunc( (nu(iw) + 2.0_rp)/mu(iw) )
2099 theta_b0(iw) = w1(iw)/w2(iw) * ( w3(iw)/w4(iw) )**(2.0_rp*beta_v(iw,2))
2101 w1(iw) = gammafunc( (2.0_rp*beta_v(iw,2) + 2.0_rp*b_rea(iw) + nu(iw) + 1.0_rp + n)/mu(iw) )
2102 w2(iw) = gammafunc( ( 2.0_rp*b_rea(iw) + nu(iw) + 1.0_rp + n)/mu(iw) )
2103 theta_b1(iw) = w1(iw)/w2(iw) * ( w3(iw)/w4(iw) )**(2.0_rp*beta_v(iw,2))
2110 w1(iw) = gammafunc( (beta_v(iw,2) + 2.0_rp*b_rea(iw) + nu(iw) + 1.0_rp + n)/mu(iw) )
2111 w2(iw) = gammafunc( ( 2.0_rp*b_rea(iw) + nu(iw) + 1.0_rp + n)/mu(iw) )
2112 w3(iw) = gammafunc( (beta_v(iw,2) + 2.0_rp*b_rea(iw) + nu(iw) + 1.0_rp )/mu(iw) )
2113 w4(iw) = gammafunc( ( 2.0_rp*b_rea(iw) + nu(iw) + 1.0_rp )/mu(iw) )
2115 w5(iw) = gammafunc( (nu(iw) + 1.0_rp)/mu(iw) )
2116 w6(iw) = gammafunc( (nu(iw) + 2.0_rp)/mu(iw) )
2118 w7(iw) = gammafunc( (beta_v(iw,2) + b_rea(iw) + nu(iw) + 1.0_rp + n)/mu(iw) )
2119 w8(iw) = gammafunc( ( b_rea(iw) + nu(iw) + 1.0_rp + n)/mu(iw) )
2124 theta_ab0(ia,ib) = 2.0_rp * (w1(ib)/w2(ib))*(w3(ia)/w4(ia)) &
2125 * (w5(ia)/w6(ia))**beta_v(ia,2) &
2126 * (w5(ib)/w6(ib))**beta_v(ib,2)
2127 theta_ab1(ia,ib) = 2.0_rp * (w7(ib)/w8(ib))*(w3(ia)/w4(ia)) &
2128 * (w5(ia)/w6(ia))**beta_v(ia,2) &
2129 * (w5(ib)/w6(ib))**beta_v(ib,2)
2134 read(
io_fid_conf, nml=param_atmos_phy_mp_sn14_nucleation, iostat=ierr)
2136 log_info(
"ATMOS_PHY_MP_sn14_init",*)
'PARAM_ATMOS_PHY_MP_SN14_nucleation is not specified. Default used.'
2137 elseif( ierr > 0 )
then
2138 log_error(
"ATMOS_PHY_MP_sn14_init",*)
'Not appropriate names in namelist PARAM_ATMOS_PHY_MP_SN14_nucleation. Check!'
2141 log_nml(param_atmos_phy_mp_sn14_nucleation)
2142 if ( mp_couple_aerosol .AND. nucl_twomey )
then
2143 log_error(
"ATMOS_PHY_MP_SN14_nucleation_kij",*)
"nucl_twomey should be false when MP_couple_aerosol is true, stop"
2148 if ( opt_collection_bin )
then
2151 read(
io_fid_conf,nml=param_atmos_phy_mp_sn14_collection_bin,iostat=ierr)
2152 if ( ierr < 0 )
then
2153 log_info(
"ATMOS_PHY_MP_sn14_init",*)
'PARAM_ATMOS_PHY_MP_SN14_collection_bin is not specified. Default used.'
2154 elseif( ierr > 0 )
then
2155 log_error(
"ATMOS_PHY_MP_sn14_init",*)
'xxx Not appropriate names in namelist PARAM_ATMOS_PHY_MP_SN14_collection_bin. STOP.'
2158 log_nml(param_atmos_phy_mp_sn14_collection_bin)
2163 read(
io_fid_conf, nml=param_atmos_phy_mp_sn14_collection, iostat=ierr )
2165 log_info(
"ATMOS_PHY_MP_sn14_init",*)
'PARAM_ATMOS_PHY_MP_SN14_collection is not specified. Default used.'
2166 elseif( ierr > 0 )
then
2167 log_error(
"ATMOS_PHY_MP_sn14_init",*)
'Not appropriate names in namelist PARAM_ATMOS_PHY_MP_SN14_collection. Check!'
2170 log_nml(param_atmos_phy_mp_sn14_collection)
2176 read (
io_fid_conf,nml=param_atmos_phy_mp_sn14_condensation, iostat=ierr )
2178 log_info(
"ATMOS_PHY_MP_sn14_init",*)
'PARAM_ATMOS_PHY_MP_SN14_condensation is not specified. Default used.'
2179 elseif( ierr > 0 )
then
2180 log_error(
"ATMOS_PHY_MP_sn14_init",*)
'Not appropriate names in namelist PARAM_ATMOS_PHY_MP_SN14_condensation. Check!'
2183 log_nml(param_atmos_phy_mp_sn14_condensation)
2188 xc_cr = (2.0_rp*rc_cr/a_m(i_mp_qc))**(1.0_rp/b_m(i_mp_qc))
2189 alpha = (nu(i_mp_qc)+1.0_rp)/mu(i_mp_qc)
2190 gm = gammafunc(alpha)
2196 log_a_m(ia) = log( a_m(ia) )
2197 log_alpha_v(ia,1) = log( alpha_v(ia,1) )
2198 log_alpha_v(ia,2) = log( alpha_v(ia,2) )
2199 log_beta_v(ia,1) = log( beta_v(ia,1) )
2200 log_beta_v(ia,2) = log( beta_v(ia,2) )
2202 log_d0_li = log( d0_li )
2203 log_d0_ni = log( d0_ni )
2209 wlabel(5) =
"GRAUPEL"
2211 log_info(
"ATMOS_PHY_MP_sn14_init",
'(100a16)')
"LABEL ",wlabel(:)
2212 log_info(
"ATMOS_PHY_MP_sn14_init",
'(a,100ES16.6)')
"capacity ",cap(:)
2213 log_info(
"ATMOS_PHY_MP_sn14_init",
'(a,100ES16.6)')
"coef_m2 ",coef_m2(:)
2214 log_info(
"ATMOS_PHY_MP_sn14_init",
'(a,100ES16.6)')
"coef_d ",coef_d(:)
2216 log_info(
"ATMOS_PHY_MP_sn14_init",
'(a,100ES16.6)')
"coef_d3 ",coef_d3(:)
2217 log_info(
"ATMOS_PHY_MP_sn14_init",
'(a,100ES16.6)')
"coef_d6 ",coef_d6(:)
2218 log_info(
"ATMOS_PHY_MP_sn14_init",
'(a,100ES16.6)')
"coef_d2v ",coef_d2v(:)
2219 log_info(
"ATMOS_PHY_MP_sn14_init",
'(a,100ES16.6)')
"coef_md2v ",coef_md2v(:)
2220 log_info(
"ATMOS_PHY_MP_sn14_init",
'(a,100ES16.6)')
"a_d2vt ",a_d2vt(:)
2221 log_info(
"ATMOS_PHY_MP_sn14_init",
'(a,100ES16.6)')
"b_d2vt ",b_d2vt(:)
2223 log_info(
"ATMOS_PHY_MP_sn14_init",
'(a,100ES16.6)')
"coef_r2 ",coef_r2(:)
2224 log_info(
"ATMOS_PHY_MP_sn14_init",
'(a,100ES16.6)')
"coef_r3 ",coef_r3(:)
2225 log_info(
"ATMOS_PHY_MP_sn14_init",
'(a,100ES16.6)')
"coef_re ",coef_re(:)
2227 log_info(
"ATMOS_PHY_MP_sn14_init",
'(a,100ES16.6)')
"a_area ",a_area(:)
2228 log_info(
"ATMOS_PHY_MP_sn14_init",
'(a,100ES16.6)')
"b_area ",b_area(:)
2229 log_info(
"ATMOS_PHY_MP_sn14_init",
'(a,100ES16.6)')
"ax_area ",ax_area(:)
2230 log_info(
"ATMOS_PHY_MP_sn14_init",
'(a,100ES16.6)')
"bx_area ",bx_area(:)
2231 log_info(
"ATMOS_PHY_MP_sn14_init",
'(a,100ES16.6)')
"a_rea ",a_rea(:)
2232 log_info(
"ATMOS_PHY_MP_sn14_init",
'(a,100ES16.6)')
"b_rea ",b_rea(:)
2233 log_info(
"ATMOS_PHY_MP_sn14_init",
'(a,100ES16.6)')
"a_rea3 ",a_rea3(:)
2234 log_info(
"ATMOS_PHY_MP_sn14_init",
'(a,100ES16.6)')
"b_rea3 ",b_rea3(:)
2236 log_info(
"ATMOS_PHY_MP_sn14_init",
'(a,100ES16.6)')
"coef_rea2 ",coef_rea2(:)
2237 log_info(
"ATMOS_PHY_MP_sn14_init",
'(a,100ES16.6)')
"coef_rea3 ",coef_rea3(:)
2238 log_info(
"ATMOS_PHY_MP_sn14_init",
'(a,100ES16.6)')
"coef_vt0 ",coef_vt0(:,1)
2239 log_info(
"ATMOS_PHY_MP_sn14_init",
'(a,100ES16.6)')
"coef_vt1 ",coef_vt1(:,1)
2240 log_info(
"ATMOS_PHY_MP_sn14_init",
'(a,100ES16.6)')
"coef_A ",coef_a(:)
2241 log_info(
"ATMOS_PHY_MP_sn14_init",
'(a,100ES16.6)')
"coef_lambda ",coef_lambda(:)
2243 log_info(
"ATMOS_PHY_MP_sn14_init",
'(a,100ES16.6)')
"ah_vent0 sml",ah_vent0(:,1)
2244 log_info(
"ATMOS_PHY_MP_sn14_init",
'(a,100ES16.6)')
"ah_vent0 lrg",ah_vent0(:,2)
2245 log_info(
"ATMOS_PHY_MP_sn14_init",
'(a,100ES16.6)')
"ah_vent1 sml",ah_vent1(:,1)
2246 log_info(
"ATMOS_PHY_MP_sn14_init",
'(a,100ES16.6)')
"ah_vent1 lrg",ah_vent1(:,2)
2247 log_info(
"ATMOS_PHY_MP_sn14_init",
'(a,100ES16.6)')
"bh_vent0 sml",bh_vent0(:,1)
2248 log_info(
"ATMOS_PHY_MP_sn14_init",
'(a,100ES16.6)')
"bh_vent0 lrg",bh_vent0(:,2)
2249 log_info(
"ATMOS_PHY_MP_sn14_init",
'(a,100ES16.6)')
"bh_vent1 sml",bh_vent1(:,1)
2250 log_info(
"ATMOS_PHY_MP_sn14_init",
'(a,100ES16.6)')
"bh_vent1 lrg",bh_vent1(:,2)
2252 log_info(
"ATMOS_PHY_MP_sn14_init",
'(a,100ES16.6)')
"delta_b0 ",delta_b0(:)
2253 log_info(
"ATMOS_PHY_MP_sn14_init",
'(a,100ES16.6)')
"delta_b1 ",delta_b1(:)
2254 log_info(
"ATMOS_PHY_MP_sn14_init",
'(a,100ES16.6)')
"theta_b0 ",theta_b0(:)
2255 log_info(
"ATMOS_PHY_MP_sn14_init",
'(a,100ES16.6)')
"theta_b1 ",theta_b1(:)
2258 log_info(
"ATMOS_PHY_MP_sn14_init",
'(a,a10,a,100ES16.6)')
"delta0(a,b)=(",trim(wlabel(ia)),
",b)=",(delta_ab0(ia,ib),ib=1,hydro_max)
2261 log_info(
"ATMOS_PHY_MP_sn14_init",
'(a,a10,a,100ES16.6)')
"delta1(a,b)=(",trim(wlabel(ia)),
",b)=",(delta_ab1(ia,ib),ib=1,hydro_max)
2264 log_info(
"ATMOS_PHY_MP_sn14_init",
'(a,a10,a,100ES16.6)')
"theta0(a,b)=(",trim(wlabel(ia)),
",b)=",(theta_ab0(ia,ib),ib=1,hydro_max)
2267 log_info(
"ATMOS_PHY_MP_sn14_init",
'(a,a10,a,100ES16.6)')
"theta1(a,b)=(",trim(wlabel(ia)),
",b)=",(theta_ab1(ia,ib),ib=1,hydro_max)
2279 end subroutine mp_sn14_init
2281 subroutine mp_sn14 ( &
2282 KA, KS, KE, IA, IS, IE, JA, JS, JE, &
2317 moist_psat_liq => atmos_saturation_psat_liq, &
2318 moist_psat_ice => atmos_saturation_psat_ice, &
2319 moist_pres2qsat_ice => atmos_saturation_pres2qsat_ice
2321 file_history_query, &
2325 integer,
intent(in) :: ka, ks, ke
2326 integer,
intent(in) :: ia, is, ie
2327 integer,
intent(in) :: ja, js, je
2329 real(
rp),
intent(in) :: dens (ka,ia,ja)
2330 real(
rp),
intent(in) :: w (ka,ia,ja)
2331 real(
rp),
intent(in) :: qtrc (ka,ia,ja,
qa_mp)
2332 real(
rp),
intent(in) :: pres0 (ka,ia,ja)
2333 real(
rp),
intent(in) :: temp0 (ka,ia,ja)
2334 real(
rp),
intent(in) :: qdry (ka,ia,ja)
2335 real(
rp),
intent(in) :: cptot0(ka, ia, ja)
2336 real(
rp),
intent(in) :: cvtot0(ka, ia, ja)
2337 real(
rp),
intent(in) :: ccn (ka,ia,ja)
2338 real(
rp),
intent(in) :: dt
2339 real(
rp),
intent(in) :: cz( ka,ia,ja)
2340 real(
rp),
intent(in) :: fz(0:ka,ia,ja)
2342 real(
rp),
intent(out) :: rhoq_t(ka,ia,ja,
qa_mp)
2343 real(
rp),
intent(out) :: rhoe_t(ka,ia,ja)
2344 real(
rp),
intent(out) :: cptot_t(ka,ia,ja)
2345 real(
rp),
intent(out) :: cvtot_t(ka,ia,ja)
2347 real(
rp),
intent(out) :: evaporate(ka,ia,ja)
2350 logical,
intent(in),
optional :: flg_lt
2351 real(
rp),
intent(in),
optional :: d0_crg, v0_crg
2352 real(
rp),
intent(in),
optional :: dqcrg(ka,ia,ja)
2353 real(
rp),
intent(in),
optional :: beta_crg(ka,ia,ja)
2354 real(
rp),
intent(in),
optional :: qtrc_crg(ka,ia,ja,hydro_max)
2355 real(
rp),
intent(out),
optional :: qsplt_in(ka,ia,ja,3)
2356 real(
rp),
intent(out),
optional :: sarea(ka,ia,ja,hydro_max)
2357 real(
rp),
intent(out),
optional :: rhoqcrg_t_mp(ka,ia,ja,hydro_max)
2359 real(
rp) :: pres (ka)
2360 real(
rp) :: temp (ka)
2361 real(
rp) :: cva (ka)
2362 real(
rp) :: cpa (ka)
2363 real(
rp) :: rrho (ka)
2364 real(
rp) :: rhoe (ka)
2365 real(
rp) :: rhoq (ka,i_qv:i_ng)
2367 real(
rp) :: rhoq0_t (ka,
qa_mp)
2368 real(
rp) :: rhoe0_t (ka)
2369 real(
rp) :: cptot0_t(ka)
2370 real(
rp) :: cvtot0_t(ka)
2372 real(
rp) :: xq(ka,hydro_max)
2374 real(
rp) :: dq_xa(ka,hydro_max)
2375 real(
rp) :: vt_xa(ka,hydro_max,2)
2377 real(
rp) :: wtemp(ka)
2378 real(
rp) :: esw (ka)
2379 real(
rp) :: esi (ka)
2381 real(
rp) :: log_rho_fac
2382 real(
rp) :: log_rho_fac_q(ka,hydro_max)
2385 real(
rp) :: drhoqc, drhonc
2386 real(
rp) :: drhoqr, drhonr
2387 real(
rp) :: drhoqi, drhoni
2388 real(
rp) :: drhoqs, drhons
2389 real(
rp) :: drhoqg, drhong
2391 real(
rp) :: drhoqvhom
2392 real(
rp) :: drhoqihom, drhonihom
2395 real(
rp) :: pq(ka,pq_max)
2396 real(
rp) :: wrm_dqc, wrm_dnc
2397 real(
rp) :: wrm_dqr, wrm_dnr
2400 real(
rp) :: pac(ka,pac_max)
2402 real(
rp) :: gc_dqc, gc_dnc
2403 real(
rp) :: sc_dqc, sc_dnc
2404 real(
rp) :: ic_dqc, ic_dnc
2405 real(
rp) :: rg_dqg, rg_dng
2406 real(
rp) :: rg_dqr, rg_dnr
2407 real(
rp) :: rs_dqr, rs_dnr, rs_dqs, rs_dns
2408 real(
rp) :: ri_dqr, ri_dnr
2409 real(
rp) :: ri_dqi, ri_dni
2410 real(
rp) :: ii_dqi, ii_dni
2411 real(
rp) :: is_dqi, is_dni, ss_dns
2412 real(
rp) :: gs_dqs, gs_dns, gg_dng
2415 real(
rp) :: clp_dqc, clp_dnc, clm_dqc, clm_dnc
2416 real(
rp) :: clp_dqr, clp_dnr, clm_dqr, clm_dnr
2417 real(
rp) :: clp_dqi, clp_dni, clm_dqi, clm_dni
2418 real(
rp) :: clp_dqs, clp_dns, clm_dqs, clm_dns
2419 real(
rp) :: clp_dqg, clp_dng, clm_dqg, clm_dng
2420 real(
rp) :: fac1, fac3, fac4(ka), fac6(ka), fac7, fac9(ka)
2423 real(
rp) :: pco_dqi, pco_dni
2424 real(
rp) :: pco_dqs, pco_dns
2425 real(
rp) :: pco_dqg, pco_dng
2428 real(
rp) :: eml_dqc, eml_dnc
2429 real(
rp) :: eml_dqr, eml_dnr
2430 real(
rp) :: eml_dqi, eml_dni
2431 real(
rp) :: eml_dqs, eml_dns
2432 real(
rp) :: eml_dqg, eml_dng
2435 real(
rp) :: spl_dqi, spl_dni
2436 real(
rp) :: spl_dqg, spl_dqs
2441 real(
rp) :: dtdt_equiv_d(ka)
2443 real(
rp) :: dtdt_dep(ka)
2444 real(
rp) :: plidep_total(ka)
2451 real(
rp) :: sl_plcdep
2452 real(
rp) :: sl_plrdep, sl_pnrdep
2454 real(
rp) :: qke_d(ka)
2456 real(
rp),
parameter :: eps = 1.e-19_rp
2457 real(
rp),
parameter :: eps_qv = 1.e-19_rp
2458 real(
rp),
parameter :: eps_rhoe = 1.e-19_rp
2459 real(
rp),
parameter :: eps_rho = 1.e-19_rp
2462 real(
rp) :: di2l, dtem
2463 real(
rp) :: fact(ka)
2467 integer :: k, i, j, iq
2469 real(
rp) :: dqv, dql, dqi
2470 real(
rp) :: dcv, dcp
2471 real(
rp) :: dqvhom, dqihom
2472 real(
rp) :: dcvhom, dcphom
2478 real(
rp) :: v0_crg_l, d0_crg_l
2479 real(
rp) :: dqcrg_l(ka)
2480 real(
rp) :: beta_crg_l(ka)
2481 real(
rp) :: facq(i_qc:i_qg), f_crg
2482 integer :: grid(2), pp, qq
2483 real(
rp) :: drhoqcrg_c, drhoqcrg_r
2484 real(
rp) :: drhoqcrg_i, drhoqcrg_s, drhoqcrg_g
2487 real(
rp) :: pcrg1(ka,pq_max)
2488 real(
rp) :: pcrg2(ka,pcrg_max)
2489 real(
rp) :: rhoq_crg(ka,i_qc:i_qg)
2490 real(
rp) :: rhoqcrg0_t(ka,i_qc:i_qg)
2492 real(
rp) :: crs(ka,hydro_max)
2494 real(
rp) :: crg_split_s
2495 real(
rp) :: crg_split_g
2496 real(
rp) :: crg_split_i
2497 real(
rp) :: wrm_dnc_crg
2498 real(
rp) :: wrm_dnr_crg
2499 real(
rp) :: gc_dnc_crg
2500 real(
rp) :: sc_dnc_crg
2501 real(
rp) :: ic_dnc_crg
2502 real(
rp) :: rg_dng_crg
2503 real(
rp) :: rg_dnr_crg
2504 real(
rp) :: rs_dnr_crg
2505 real(
rp) :: rs_dns_crg
2506 real(
rp) :: ri_dnr_crg
2507 real(
rp) :: ri_dni_crg
2508 real(
rp) :: ii_dni_crg
2509 real(
rp) :: is_dni_crg
2510 real(
rp) :: ss_dns_crg
2511 real(
rp) :: gs_dns_crg
2512 real(
rp) :: gi_dni_crg
2513 real(
rp) :: gg_dng_crg
2515 real(
rp) :: clp_dnc_crg, clm_dnc_crg
2516 real(
rp) :: clp_dnr_crg, clm_dnr_crg
2517 real(
rp) :: clp_dni_crg, clm_dni_crg
2518 real(
rp) :: clp_dns_crg, clm_dns_crg
2519 real(
rp) :: clp_dng_crg, clm_dng_crg
2521 real(
rp) :: pco_dni_crg
2522 real(
rp) :: pco_dns_crg
2523 real(
rp) :: pco_dng_crg
2525 real(
rp) :: eml_dnc_crg
2526 real(
rp) :: eml_dnr_crg
2527 real(
rp) :: eml_dni_crg
2528 real(
rp) :: eml_dns_crg
2529 real(
rp) :: eml_dng_crg
2531 real(
rp) :: spl_dni_crg
2532 real(
rp) :: spl_dns_crg
2533 real(
rp) :: spl_dng_crg
2537 real(
rp) :: sw1, sw2
2541 logical :: hist_sw(w_nmax)
2544 if (
present(flg_lt) )
then
2559 qsplt_in(:,:,:,:) = 0.0_rp
2561 rhoqcrg_t_mp(:,:,:,:) = 0.0_rp
2577 call file_history_query( hist_id(ip), hist_sw(ip) )
2623 rhoq_t(k,i,j,:) = 0.0_rp
2624 rhoe_t(k,i,j) = 0.0_rp
2625 cptot_t(k,i,j) = 0.0_rp
2626 cvtot_t(k,i,j) = 0.0_rp
2631 cpa(k) = cptot0(k,i,j)
2632 cva(k) = cvtot0(k,i,j)
2633 pres(k) = pres0(k,i,j)
2634 temp(k) = temp0(k,i,j)
2648 rhoq(k,iq) = dens(k,i,j) * qtrc(k,i,j,iq)
2653 log_rho_fac = log(rho_0 / max(dens(k,i,j),rho_min))
2654 log_rho_fac_q(k,i_mp_qc) = log_rho_fac * gamma_v(i_mp_qc)
2655 log_rho_fac_q(k,i_mp_qr) = log_rho_fac * gamma_v(i_mp_qr)
2658 if( so22_het .or. opt_nucleation_ice_hom)
then
2661 log_rho_fac_q(k,i_mp_qi) = log(pres(k)/pre0_vt) * a_pre0_vt + log(temp(k)/tem0_vt) * a_tem0_vt
2662 log_rho_fac_q(k,i_mp_qs) = log_rho_fac_q(k,i_mp_qi)
2663 log_rho_fac_q(k,i_mp_qg) = log_rho_fac_q(k,i_mp_qi)
2666 call get_terminal_velocity( &
2668 vt_xa(:,:,:), xq(:,:), &
2670 log_rho_fac_q(:,:) )
2672 call get_diamiter( &
2685 rrho(k) = 1.0_rp / dens(k,i,j)
2686 rhoe(k) = dens(k,i,j) * temp(k) * cva(k)
2687 wtemp(k) = max(temp(k), tem_min)
2692 1, i, j, temp(:), dens(:,i,j), pres(:), qtrc(:,i,j,i_qv) )
2696 log_rho_fac_q(k,i_mp_qi) = log(pres(k)/pre0_vt) * a_pre0_vt + log(temp(k)/tem0_vt) * a_tem0_vt
2697 log_rho_fac_q(k,i_mp_qs) = log_rho_fac_q(k,i_mp_qi)
2698 log_rho_fac_q(k,i_mp_qg) = log_rho_fac_q(k,i_mp_qi)
2712 dtdt_equiv_d(k) = 0.0_rp
2716 nc_uplim_d(1,i,j) = c_ccn*1.5_rp
2721 cz(:,i,j), fz(:,i,j), &
2722 w(:,i,j), dens(:,i,j), &
2723 wtemp(:), pres(:), qdry(:,i,j), &
2724 rhoq(:,:), cpa(:), cva(:), &
2727 ccn(:,i,j), nc_uplim_d(1,i,j), &
2733 if( opt_nucleation_ice_hom )
then
2737 drhoqihom = pq(k,i_lihom)
2739 drhoqvhom = max( - rhoq(k,i_qv) / dt , tmp )
2740 fac1 = drhoqvhom / min( tmp, -eps )
2742 drhoqihom = drhoqihom * fac1
2744 rhoq0_t(k,i_qv) = drhoqvhom
2745 rhoq0_t(k,i_qi) = drhoqihom
2747 rhoe0_t(k) = - lhv * drhoqvhom + lhf * drhoqihom
2749 dqvhom = rrho(k) * drhoqvhom
2750 dqihom = rrho(k) * drhoqihom
2755 cvtot0_t(k) = dcvhom
2756 cptot0_t(k) = dcphom
2758 drhonihom = pq(k,i_nihom) * fac1
2759 rhoq0_t(k,i_ni) = drhonihom
2764 rhoe_t(k,i,j) = rhoe_t(k,i,j) + rhoe0_t(k)
2765 cvtot_t(k,i,j) = cvtot_t(k,i,j) + cvtot0_t(k)
2766 cptot_t(k,i,j) = cptot_t(k,i,j) + cptot0_t(k)
2771 rhoq(k,i_qv) = rhoq(k,i_qv) + rhoq0_t(k,i_qv)*dt
2772 rhoq(k,i_qi) = max(0.0_rp, rhoq(k,i_qi) + rhoq0_t(k,i_qi)*dt )
2773 rhoq(k,i_ni) = max(0.0_rp, rhoq(k,i_ni) + rhoq0_t(k,i_ni)*dt )
2777 rhoe(k) = rhoe(k) + rhoe0_t(k)*dt
2778 cva(k) = cva(k) + cvtot0_t(k)*dt
2779 cpa(k) = cpa(k) + cptot0_t(k)*dt
2781 temp(k) = rhoe(k) / ( dens(k,i,j) * cva(k) )
2782 pres(k) = dens(k,i,j) * (cpa(k)-cva(k)) * temp(k)
2783 wtemp(k) = max( temp(k), tem_min )
2790 drhoqc = pq(k,i_lcccn)
2791 drhoqi = pq(k,i_liccn)
2792 tmp = - drhoqc - drhoqi
2793 drhoqv = max( - rhoq(k,i_qv) / dt, tmp )
2796 fac1 = drhoqv / min( tmp, -eps )
2798 drhoqc = drhoqc * fac1
2799 drhoqi = drhoqi * fac1
2801 rhoq0_t(k,i_qv) = drhoqv
2802 rhoq0_t(k,i_qc) = drhoqc
2803 rhoq0_t(k,i_qi) = drhoqi
2805 rhoe0_t(k) = - lhv * drhoqv + lhf * drhoqi
2807 dqv = rrho(k) * drhoqv
2808 dql = rrho(k) * drhoqc
2809 dqi = rrho(k) * drhoqi
2817 drhonc = pq(k,i_ncccn) * fac1
2818 drhoni = pq(k,i_niccn) * fac1
2819 rhoq0_t(k,i_nc) = drhonc
2820 rhoq0_t(k,i_ni) = drhoni
2825 rhoe_t(k,i,j) = rhoe_t(k,i,j) + rhoe0_t(k)
2826 cvtot_t(k,i,j) = cvtot_t(k,i,j) + cvtot0_t(k)
2827 cptot_t(k,i,j) = cptot_t(k,i,j) + cptot0_t(k)
2832 rhoq(k,i_qv) = rhoq(k,i_qv) + rhoq0_t(k,i_qv)*dt
2833 rhoq(k,i_qc) = max(0.0_rp, rhoq(k,i_qc) + rhoq0_t(k,i_qc)*dt )
2834 rhoq(k,i_qi) = max(0.0_rp, rhoq(k,i_qi) + rhoq0_t(k,i_qi)*dt )
2835 rhoq(k,i_nc) = max(0.0_rp, rhoq(k,i_nc) + rhoq0_t(k,i_nc)*dt )
2836 rhoq(k,i_ni) = max(0.0_rp, rhoq(k,i_ni) + rhoq0_t(k,i_ni)*dt )
2839 rhoq(k,i_nc) = min( rhoq(k,i_nc), nc_uplim_d(1,i,j) )
2843 rhoe(k) = rhoe(k) + rhoe0_t(k)*dt
2844 cva(k) = cva(k) + cvtot0_t(k)*dt
2845 cpa(k) = cpa(k) + cptot0_t(k)*dt
2847 temp(k) = rhoe(k) / ( dens(k,i,j) * cva(k) )
2848 pres(k) = dens(k,i,j) * (cpa(k)-cva(k)) * temp(k)
2849 wtemp(k) = max( temp(k), tem_min )
2855 2, i, j, temp(:), dens(:,i,j), pres(:), qtrc(:,i,j,i_qv) )
2864 call get_terminal_velocity( &
2866 vt_xa(:,:,:), xq(:,:), &
2868 log_rho_fac_q(:,:) )
2870 call get_diamiter( &
2878 rhoq_crg(k,iq) = dens(k,i,j) * qtrc_crg(k,i,j,iq-1)
2883 call moist_psat_liq( ka, ks, ke, &
2885 call moist_psat_ice( ka, ks, ke, &
2891 rhoq(:,:), xq(:,:), temp(:), &
2894 call dep_vapor_melt_ice( &
2896 dens(:,i,j), wtemp(:), pres(:), qdry(:,i,j), rhoq(:,:), &
2897 esw(:), esi(:), xq(:,:), vt_xa(:,:,:), dq_xa(:,:), &
2903 call update_by_phase_change( &
2905 ntmax_phase_change, dt, &
2906 cz(:,i,j), fz(:,i,j), &
2909 dens(:,i,j), qdry(:,i,j), &
2911 rhoq(:,:), pres(:), temp(:), &
2915 sl_plcdep, sl_plrdep, sl_pnrdep, &
2916 rhoq0_t(:,:), rhoe0_t(:), &
2917 cptot0_t(:), cvtot0_t(:), &
2924 rhoe_t(k,i,j) = rhoe_t(k,i,j) + rhoe0_t(k)
2925 cvtot_t(k,i,j) = cvtot_t(k,i,j) + cvtot0_t(k)
2926 cptot_t(k,i,j) = cptot_t(k,i,j) + cptot0_t(k)
2932 rhoq(k,iq) = max(0.0_rp, rhoq(k,iq) + rhoq0_t(k,iq)*dt )
2937 rhoe(k) = rhoe(k) + rhoe0_t(k)*dt
2938 cva(k) = cva(k) + cvtot0_t(k)*dt
2939 cpa(k) = cpa(k) + cptot0_t(k)*dt
2940 temp(k) = rhoe(k) / ( dens(k,i,j) * cva(k) )
2941 pres(k) = dens(k,i,j) * ( cpa(k) - cva(k) ) * temp(k)
2947 rhoq_crg(k,iq) = rhoq_crg(k,iq) + rhoqcrg0_t(k,iq) * dt
2954 3, i, j, temp(:), dens(:,i,j), pres(:), qtrc(:,i,j,i_qv) )
2965 call get_terminal_velocity( &
2967 vt_xa(:,:,:), xq(:,:), &
2969 log_rho_fac_q(:,:) )
2973 dq_xa(k,i_mp_qc) = 2.0_rp*a_rea(i_mp_qc)*xq(k,i_mp_qc)**b_rea(i_mp_qc)
2974 dq_xa(k,i_mp_qr) = 2.0_rp*a_rea(i_mp_qr)*xq(k,i_mp_qr)**b_rea(i_mp_qr)
2975 dq_xa(k,i_mp_qi) = 2.0_rp*a_rea(i_mp_qi)*xq(k,i_mp_qi)**b_rea(i_mp_qi)
2976 dq_xa(k,i_mp_qs) = 2.0_rp*a_rea(i_mp_qs)*xq(k,i_mp_qs)**b_rea(i_mp_qs)
2977 dq_xa(k,i_mp_qg) = 2.0_rp*a_rea(i_mp_qg)*xq(k,i_mp_qg)**b_rea(i_mp_qg)
2984 if ( mp_doautoconversion )
then
2990 xq(:,:), dq_xa(:,:), &
2998 pq(k,i_lcaut) = 0.0_rp
2999 pq(k,i_ncaut) = 0.0_rp
3000 pq(k,i_nraut) = 0.0_rp
3001 pq(k,i_lcacc) = 0.0_rp
3002 pq(k,i_ncacc) = 0.0_rp
3003 pq(k,i_nrslc) = 0.0_rp
3004 pq(k,i_nrbrk) = 0.0_rp
3006 pcrg1(k,i_lcaut) = 0.0_rp
3007 pcrg1(k,i_ncaut) = 0.0_rp
3008 pcrg1(k,i_nraut) = 0.0_rp
3009 pcrg1(k,i_lcacc) = 0.0_rp
3010 pcrg1(k,i_ncacc) = 0.0_rp
3011 pcrg1(k,i_nrslc) = 0.0_rp
3012 pcrg1(k,i_nrbrk) = 0.0_rp
3016 if ( flg_lt_l )
then
3018 beta_crg_l(k) = beta_crg(k,i,j)
3019 dqcrg_l(k) = dqcrg(k,i,j)
3024 if( opt_collection_bin )
then
3028 d0_crg_l, v0_crg_l, &
3029 beta_crg_l(:), dqcrg_l(:), &
3030 temp(:), rhoq(:,:), &
3032 xq(:,:), dq_xa(:,:), vt_xa(:,:,:), &
3042 d0_crg_l, v0_crg_l, &
3043 beta_crg_l(:), dqcrg_l(:), &
3044 temp(:), rhoq(:,:), &
3046 xq(:,:), dq_xa(:,:), vt_xa(:,:,:), &
3058 temp(:), rhoq(:,:), &
3070 wrm_dqc = max( dt*( pq(k,i_lcaut)+pq(k,i_lcacc) ), -rhoq(k,i_qc) )
3071 wrm_dnc = max( dt*( pq(k,i_ncaut)+pq(k,i_ncacc) ), -rhoq(k,i_nc) )
3072 wrm_dnr = max( dt*( pq(k,i_nraut)+pq(k,i_nrslc)+pq(k,i_nrbrk) ), -rhoq(k,i_nr) )
3082 gc_dqc = max( dt*pac(k,i_lgaclc2lg), min(0.0_rp, -rhoq(k,i_qc)-wrm_dqc ))
3083 sc_dqc = max( dt*pac(k,i_lsaclc2ls), min(0.0_rp, -rhoq(k,i_qc)-wrm_dqc-gc_dqc ))
3084 ic_dqc = max( dt*pac(k,i_liaclc2li), min(0.0_rp, -rhoq(k,i_qc)-wrm_dqc-gc_dqc-sc_dqc ))
3086 gc_dnc = max( dt*pac(k,i_ngacnc2ng), min(0.0_rp, -rhoq(k,i_nc)-wrm_dnc ))
3087 sc_dnc = max( dt*pac(k,i_nsacnc2ns), min(0.0_rp, -rhoq(k,i_nc)-wrm_dnc-gc_dnc ))
3088 ic_dnc = max( dt*pac(k,i_niacnc2ni), min(0.0_rp, -rhoq(k,i_nc)-wrm_dnc-gc_dnc-sc_dnc ))
3091 sw = sign(0.5_rp, t00-temp(k)) + 0.5_rp
3092 rg_dqr = max( dt*pac(k,i_lraclg2lg ), min(0.0_rp, -rhoq(k,i_qr)-wrm_dqr )) * sw
3093 rg_dqg = max( dt*pac(k,i_lraclg2lg ), min(0.0_rp, -rhoq(k,i_qg) )) * ( 1.0_rp - sw )
3094 rs_dqr = max( dt*pac(k,i_lracls2lg_r), min(0.0_rp, -rhoq(k,i_qr)-wrm_dqr-rg_dqr )) * sw
3095 ri_dqr = max( dt*pac(k,i_lracli2lg_r), min(0.0_rp, -rhoq(k,i_qr)-wrm_dqr-rg_dqr-rs_dqr )) * sw
3098 rg_dnr = max( dt*pac(k,i_nracng2ng ), min(0.0_rp, -rhoq(k,i_nr)-wrm_dnr )) * sw
3099 rg_dng = max( dt*pac(k,i_nracng2ng ), min(0.0_rp, -rhoq(k,i_ng) )) * ( 1.0_rp - sw )
3100 rs_dnr = max( dt*pac(k,i_nracns2ng_r), min(0.0_rp, -rhoq(k,i_nr)-wrm_dnr-rg_dnr )) * sw
3101 ri_dnr = max( dt*pac(k,i_nracni2ng_r), min(0.0_rp, -rhoq(k,i_nr)-wrm_dnr-rg_dnr-rs_dnr )) * sw
3104 fac1 = (ri_dqr-eps)/ (dt*pac(k,i_lracli2lg_r)-eps)
3105 ri_dqi = max( dt*pac(k,i_lracli2lg_i)*fac1, min(0.0_rp, -rhoq(k,i_qi)+ic_dqc ))
3106 ii_dqi = max( dt*pac(k,i_liacli2ls ) , min(0.0_rp, -rhoq(k,i_qi)+ic_dqc-ri_dqi ))
3107 is_dqi = max( dt*pac(k,i_liacls2ls ) , min(0.0_rp, -rhoq(k,i_qi)+ic_dqc-ri_dqi-ii_dqi ))
3112 fac4(k) = (ri_dnr-eps)/ (dt*pac(k,i_nracni2ng_r)-eps)
3113 ri_dni = max( dt*pac(k,i_nracni2ng_i)*fac4(k), min(0.0_rp, -rhoq(k,i_ni) ))
3114 ii_dni = max( dt*pac(k,i_niacni2ns ) , min(0.0_rp, -rhoq(k,i_ni)-ri_dni ))
3115 is_dni = max( dt*pac(k,i_niacns2ns ) , min(0.0_rp, -rhoq(k,i_ni)-ri_dni-ii_dni ))
3120 fac3 = (rs_dqr-eps)/(dt*pac(k,i_lracls2lg_r)-eps)
3121 rs_dqs = max( dt*pac(k,i_lracls2lg_s)*fac3, min(0.0_rp, -rhoq(k,i_qs)+sc_dqc+ii_dqi+is_dqi ))
3122 gs_dqs = max( dt*pac(k,i_lgacls2lg ) , min(0.0_rp, -rhoq(k,i_qs)+sc_dqc+ii_dqi+is_dqi-rs_dqs ))
3124 fac6(k) = (rs_dnr-eps)/(dt*pac(k,i_nracns2ng_r)-eps)
3126 rs_dns = max( dt*pac(k,i_nracns2ng_s)*fac6(k), min(0.0_rp, -rhoq(k,i_ns)+0.50_rp*ii_dni+is_dni ))
3127 gs_dns = max( dt*pac(k,i_ngacns2ng ) , min(0.0_rp, -rhoq(k,i_ns)+0.50_rp*ii_dni+is_dni-rs_dns ))
3128 ss_dns = max( dt*pac(k,i_nsacns2ns ) , min(0.0_rp, -rhoq(k,i_ns)+0.50_rp*ii_dni+is_dni-rs_dns-gs_dns ))
3129 gg_dng = max( dt*pac(k,i_ngacng2ng ) , min(0.0_rp, -rhoq(k,i_ng) ))
3135 clp_dqr = (-rg_dqg-rs_dqs-ri_dqi) * (1.0_rp-sw)
3137 clp_dqs = -sc_dqc-ii_dqi-is_dqi
3138 clp_dqg = -gc_dqc -gs_dqs + (-rg_dqr-rs_dqr-rs_dqs-ri_dqr-ri_dqi) * sw
3143 clp_dns = -ii_dni*0.5_rp
3144 clp_dng = (-rs_dnr-ri_dnr) * sw
3148 clm_dqc = gc_dqc+sc_dqc+ic_dqc
3149 clm_dqr = (rg_dqr+rs_dqr+ri_dqr) * sw
3150 clm_dqi = ri_dqi+ii_dqi+is_dqi
3151 clm_dqs = rs_dqs+gs_dqs
3152 clm_dqg = rg_dqg * (1.0_rp-sw)
3154 clm_dnc = gc_dnc+sc_dnc+ic_dnc
3155 clm_dnr = (rg_dnr+rs_dnr+ri_dnr) * sw
3156 clm_dni = ri_dni+ii_dni+is_dni
3157 clm_dns = rs_dns+ss_dns+gs_dns
3158 clm_dng = gg_dng + rg_dng * (1.0_rp-sw)
3162 pco_dqi = max( dt*pq(k,i_licon), -clp_dqi )
3163 pco_dqs = max( dt*pq(k,i_lscon), -clp_dqs )
3164 pco_dqg = -pco_dqi-pco_dqs
3166 pco_dni = max( dt*pq(k,i_nicon), -clp_dni )
3167 pco_dns = max( dt*pq(k,i_nscon), -clp_dns )
3168 pco_dng = -pco_dni-pco_dns
3172 eml_dqi = max( dt*pq(k,i_liacm), min(0.0_rp, -rhoq(k,i_qi)-(clp_dqi+clm_dqi)-pco_dqi ))
3173 eml_dqs = max( dt*pq(k,i_lsacm), min(0.0_rp, -rhoq(k,i_qs)-(clp_dqs+clm_dqs)-pco_dqs ))
3174 eml_dqg = max( dt*(pq(k,i_lgacm)+pq(k,i_lgarm)+pq(k,i_lsarm)+pq(k,i_liarm)), &
3175 min(0.0_rp, -rhoq(k,i_qg)-(clp_dqg+clm_dqg)-pco_dqg ))
3177 eml_dqr = -eml_dqs-eml_dqg
3179 eml_dni = max( dt*pq(k,i_niacm), min(0.0_rp, -rhoq(k,i_ni)-(clp_dni+clm_dni)-pco_dni ))
3180 eml_dns = max( dt*pq(k,i_nsacm), min(0.0_rp, -rhoq(k,i_ns)-(clp_dns+clm_dns)-pco_dns ))
3181 eml_dng = max( dt*(pq(k,i_ngacm)+pq(k,i_ngarm)+pq(k,i_nsarm)+pq(k,i_niarm)), &
3182 min(0.0_rp, -rhoq(k,i_ng)-(clp_dng+clm_dng)-pco_dng ))
3184 eml_dnr = -eml_dns-eml_dng
3187 spl_dqg = max( dt*pq(k,i_lgspl), min(0.0_rp, -rhoq(k,i_qg)-(clp_dqg+clm_dqg)-pco_dqg-eml_dqg ))
3188 spl_dqs = max( dt*pq(k,i_lsspl), min(0.0_rp, -rhoq(k,i_qs)-(clp_dqs+clm_dqs)-pco_dqs-eml_dqs ))
3189 spl_dqi = -spl_dqg-spl_dqs
3190 fac9(k) = (spl_dqg-eps)/(dt*pq(k,i_lgspl)-eps) * (spl_dqs-eps)/(dt*pq(k,i_lsspl)-eps)
3191 spl_dni = dt*pq(k,i_nispl)*fac9(k)
3195 di2l = clp_dqc + clp_dqr + clm_dqc + clm_dqr + eml_dqc + eml_dqr
3196 dtem = - di2l * lhf0 / ( cva(k) * dens(k,i,j) )
3197 if ( abs(dtem) < eps )
then
3200 fact(k) = min( 1.0_rp, max( 0.0_rp, ( t00 - temp(k) ) / dtem ) )
3205 drhoqc = wrm_dqc + ( clp_dqc + clm_dqc + eml_dqc ) * fact(k)
3206 drhonc = wrm_dnc + ( clp_dnc + clm_dnc + eml_dnc ) * fact(k)
3208 drhoqr = wrm_dqr + ( clp_dqr + clm_dqr + eml_dqr ) * fact(k)
3209 drhonr = wrm_dnr + ( clp_dnr + clm_dnr + eml_dnr ) * fact(k)
3211 drhoqi = ( clp_dqi + clm_dqi + eml_dqi ) * fact(k) + pco_dqi + spl_dqi
3212 drhoni = ( clp_dni + clm_dni + eml_dni ) * fact(k) + pco_dni + spl_dni
3214 drhoqs = ( clp_dqs + clm_dqs + eml_dqs ) * fact(k) + pco_dqs + spl_dqs
3215 drhons = ( clp_dns + clm_dns + eml_dns ) * fact(k) + pco_dns
3217 drhoqg = ( clp_dqg + clm_dqg + eml_dqg ) * fact(k) + pco_dqg + spl_dqg
3218 drhong = ( clp_dng + clm_dng + eml_dng ) * fact(k) + pco_dng
3221 rhoq0_t(k,i_qc) = drhoqc / dt
3222 rhoq0_t(k,i_nc) = drhonc / dt
3223 rhoq0_t(k,i_qr) = drhoqr / dt
3224 rhoq0_t(k,i_nr) = drhonr / dt
3225 rhoq0_t(k,i_qi) = drhoqi / dt
3226 rhoq0_t(k,i_ni) = drhoni / dt
3227 rhoq0_t(k,i_qs) = drhoqs / dt
3228 rhoq0_t(k,i_ns) = drhons / dt
3229 rhoq0_t(k,i_qg) = drhoqg / dt
3230 rhoq0_t(k,i_ng) = drhong / dt
3232 rhoe0_t(k) = lhf * ( drhoqi + drhoqs + drhoqg ) / dt
3234 dql = rrho(k) * ( drhoqc + drhoqr )
3235 dqi = rrho(k) * ( drhoqi + drhoqs + drhoqg )
3240 cvtot0_t(k) = dcv / dt
3241 cptot0_t(k) = dcp / dt
3248 rhoe_t(k,i,j) = rhoe_t(k,i,j) + rhoe0_t(k)
3249 cvtot_t(k,i,j) = cvtot_t(k,i,j) + cvtot0_t(k)
3250 cptot_t(k,i,j) = cptot_t(k,i,j) + cptot0_t(k)
3256 rhoq(k,iq) = max(0.0_rp, rhoq(k,iq) + rhoq0_t(k,iq) * dt )
3263 rhoq_t(k,i,j,iq) = ( rhoq(k,iq) - dens(k,i,j)*qtrc(k,i,j,iq) )/dt
3268 if ( hist_sw(ip) )
then
3269 if(ip <= pq_max)
then
3271 w3d(k,i,j,hist_idx(ip)) = pq(k,ip)
3275 w3d(k,i,j,hist_idx(ip)) = pac(k,ip-pq_max)
3282 if ( flg_lt_l )
then
3286 sw = sign(0.5_rp, t00-temp(k)) + 0.5_rp
3288 wrm_dnc_crg = dt*( pcrg1(k,i_ncaut)+pcrg1(k,i_ncacc) )
3290 sw1 = min( abs(rhoq_crg(k,i_qc)),abs(wrm_dnc_crg) )
3291 wrm_dnc_crg = sign( sw1,wrm_dnc_crg )
3292 wrm_dnr_crg = - wrm_dnc_crg
3295 gc_dnc_crg = dt*pcrg2(k,i_ngacnc2ng)
3296 sc_dnc_crg = dt*pcrg2(k,i_nsacnc2ns)
3297 ic_dnc_crg = dt*pcrg2(k,i_niacnc2ni)
3299 sw1 = min( abs(rhoq_crg(k,i_qc)+wrm_dnc_crg ),abs(gc_dnc_crg) )
3300 gc_dnc_crg = sign( sw1,gc_dnc_crg )
3301 sw1 = min( abs(rhoq_crg(k,i_qc)+wrm_dnc_crg+gc_dnc_crg ),abs(sc_dnc_crg) )
3302 sc_dnc_crg = sign( sw1,sc_dnc_crg )
3303 sw1 = min( abs(rhoq_crg(k,i_qc)+wrm_dnc_crg+gc_dnc_crg+sc_dnc_crg),abs(ic_dnc_crg) )
3304 ic_dnc_crg = sign( sw1,ic_dnc_crg )
3307 rg_dnr_crg = dt*pcrg2(k,i_nracng2ng )* sw
3308 rg_dng_crg = dt*pcrg2(k,i_nracng2ng )* ( 1.0_rp - sw )
3309 rs_dnr_crg = dt*pcrg2(k,i_nracns2ng_r)* sw
3310 ri_dnr_crg = dt*pcrg2(k,i_nracni2ng_r)* sw
3312 sw1 = min( abs(rhoq_crg(k,i_qr)+wrm_dnr_crg),abs(rg_dnr_crg) )
3313 rg_dnr_crg = sign( sw1,rg_dnr_crg )
3314 sw1 = min( abs(rhoq_crg(k,i_qg) ),abs(rg_dng_crg) )
3315 rg_dng_crg = sign( sw1,rg_dng_crg )
3316 sw1 = min( abs(rhoq_crg(k,i_qr)+wrm_dnr_crg),abs(rs_dnr_crg) )
3317 rs_dnr_crg = sign( sw1,rs_dnr_crg )
3318 sw1 = min( abs(rhoq_crg(k,i_qr)+wrm_dnr_crg),abs(ri_dnr_crg) )
3319 ri_dnr_crg = sign( sw1,ri_dnr_crg )
3322 ri_dni_crg = dt*pcrg2(k,i_nracni2ng_i)*fac4(k)
3323 ii_dni_crg = dt*pcrg2(k,i_niacni2ns)
3324 is_dni_crg = dt*pcrg2(k,i_niacns2ns)
3328 sw1 = min( abs(rhoq_crg(k,i_qi)-ic_dnc_crg) ,abs(ri_dni_crg) )
3329 ri_dni_crg = sign( sw1,ri_dni_crg )
3330 sw1 = min( abs(rhoq_crg(k,i_qi)-ic_dnc_crg+ri_dni_crg) ,abs(ii_dni_crg) )
3331 ii_dni_crg = sign( sw1,ii_dni_crg )
3332 sw1 = min( abs(rhoq_crg(k,i_qi)-ic_dnc_crg+ri_dni_crg+ii_dni_crg),abs(is_dni_crg) )
3333 is_dni_crg = sign( sw1,is_dni_crg )
3339 rs_dns_crg = dt*pcrg2(k,i_nracns2ng_s)*fac6(k)
3340 gs_dns_crg = dt*pcrg2(k,i_ngacns2ng)
3344 sw1 = min( abs(rhoq_crg(k,i_qs)-sc_dnc_crg-ii_dni_crg-is_dni_crg), abs(rs_dns_crg) )
3345 rs_dns_crg = sign( sw1,rs_dns_crg )
3346 sw1 = min( abs(rhoq_crg(k,i_qs)-sc_dnc_crg-ii_dni_crg-is_dni_crg+rs_dns_crg),abs(gs_dns_crg) )
3347 gs_dns_crg = sign( sw1,gs_dns_crg )
3349 sw1 = sign(0.5_rp, abs( pcrg2(k,i_cgngacns2ng) )-eps ) + 0.5_rp
3350 sw2 = sign(0.5_rp, abs( pcrg2(k,i_cgngacni2ng) )-eps ) + 0.5_rp
3351 crg_split_g = dt*pcrg2(k,i_cgngacns2ng)*sw1 &
3352 + dt*pcrg2(k,i_cgngacni2ng)*sw2
3353 crg_split_s = -dt*pcrg2(k,i_cgngacns2ng)*sw1
3354 crg_split_i = 0.0_rp
3356 qsplt_in(k,i,j,1) = crg_split_g / dt
3357 qsplt_in(k,i,j,3) = crg_split_s / dt
3358 qsplt_in(k,i,j,2) = crg_split_i / dt
3361 clp_dnc_crg = 0.0_rp
3362 clp_dnr_crg = -rg_dng_crg*(1.0_rp-sw)
3363 clp_dni_crg = -ic_dnc_crg
3365 clp_dns_crg = -sc_dnc_crg-ii_dni_crg-is_dni_crg-ss_dns_crg &
3367 clp_dng_crg = -gc_dnc_crg+(-rg_dnr_crg-rs_dnr_crg-ri_dnr_crg)*sw &
3368 -ri_dni_crg-rs_dns_crg-gs_dns_crg-gg_dng_crg &
3372 clm_dnc_crg = gc_dnc_crg+sc_dnc_crg+ic_dnc_crg
3373 clm_dnr_crg = (rg_dnr_crg+rs_dnr_crg+ri_dnr_crg) * sw
3374 clm_dni_crg = ri_dni_crg+ii_dni_crg+is_dni_crg
3376 clm_dns_crg = rs_dns_crg+gs_dns_crg+ss_dns_crg
3377 clm_dng_crg = gg_dng_crg+rg_dng_crg*(1.0_rp-sw)
3379 pco_dni_crg = dt*pcrg1(k,i_nicon)
3380 pco_dns_crg = dt*pcrg1(k,i_nscon)
3382 sw1 = min( abs(rhoq_crg(k,i_qi)+clp_dni_crg ),abs(pco_dni_crg) )
3383 pco_dni_crg = sign( sw1,pco_dni_crg )
3384 sw1 = min( abs(rhoq_crg(k,i_qs)+clp_dns_crg ),abs(pco_dns_crg) )
3385 pco_dns_crg = sign( sw1,pco_dns_crg )
3386 pco_dng_crg = -pco_dni_crg-pco_dns_crg
3388 eml_dni_crg = dt*pcrg1(k,i_niacm)
3389 eml_dns_crg = dt*pcrg1(k,i_nsacm)
3390 eml_dng_crg = dt*(pcrg1(k,i_ngacm)+pcrg1(k,i_ngarm)+pcrg1(k,i_nsarm)+pcrg1(k,i_niarm))
3392 sw1 = min( abs(rhoq_crg(k,i_qi)+clp_dni_crg+clm_dni_crg+pco_dni_crg ),abs(eml_dni_crg) )
3393 eml_dni_crg = sign( sw1,eml_dni_crg )
3394 sw1 = min( abs(rhoq_crg(k,i_qs)+clp_dns_crg+clm_dns_crg+pco_dns_crg ),abs(eml_dns_crg) )
3395 eml_dns_crg = sign( sw1,eml_dns_crg )
3396 sw1 = min( abs(rhoq_crg(k,i_qg)+clp_dng_crg+clm_dng_crg+pco_dng_crg ),abs(eml_dng_crg) )
3397 eml_dng_crg = sign( sw1,eml_dng_crg )
3399 eml_dnc_crg = -eml_dni_crg
3400 eml_dnr_crg = -eml_dns_crg-eml_dng_crg
3402 spl_dns_crg = dt*pcrg1(k,i_nsspl)*fac9(k)
3403 spl_dng_crg = dt*pcrg1(k,i_ngspl)*fac9(k)
3405 sw1 = min( abs(rhoq_crg(k,i_qs)+clp_dns_crg+pco_dns_crg+eml_dns_crg ),abs(spl_dns_crg) )
3406 spl_dns_crg = sign( sw1,spl_dns_crg )
3407 sw1 = min( abs(rhoq_crg(k,i_qg)+clp_dng_crg+pco_dng_crg+eml_dng_crg ),abs(spl_dng_crg) )
3408 spl_dng_crg = sign( sw1,spl_dng_crg )
3409 spl_dni_crg = -spl_dns_crg-spl_dng_crg
3411 drhoqcrg_c = wrm_dnc_crg + ( clp_dnc_crg + clm_dnc_crg + eml_dnc_crg ) * fact(k)
3412 drhoqcrg_r = wrm_dnr_crg + ( clp_dnr_crg + clm_dnr_crg + eml_dnr_crg ) * fact(k)
3413 drhoqcrg_i = ( clp_dni_crg + clm_dni_crg + eml_dni_crg ) * fact(k) + pco_dni_crg + spl_dni_crg
3414 drhoqcrg_s = ( clp_dns_crg + clm_dns_crg + eml_dns_crg ) * fact(k) + pco_dns_crg + spl_dns_crg
3415 drhoqcrg_g = ( clp_dng_crg + clm_dng_crg + eml_dng_crg ) * fact(k) + pco_dng_crg + spl_dng_crg
3417 rhoqcrg0_t(k,i_qc) = drhoqcrg_c / dt
3418 rhoqcrg0_t(k,i_qr) = drhoqcrg_r / dt
3419 rhoqcrg0_t(k,i_qi) = drhoqcrg_i / dt
3420 rhoqcrg0_t(k,i_qs) = drhoqcrg_s / dt
3421 rhoqcrg0_t(k,i_qg) = drhoqcrg_g / dt
3427 rhoq_crg(k,iq) = rhoq_crg(k,iq) + rhoqcrg0_t(k,iq) * dt
3433 qtrc0(k,iq) = rhoq(k,iq) / dens(k,i,j)
3443 sarea(k,i,j,i_mp_qc) = crs(k,i_mp_qc)
3444 sarea(k,i,j,i_mp_qr) = crs(k,i_mp_qr)
3445 sarea(k,i,j,i_mp_qi) = crs(k,i_mp_qi)
3446 sarea(k,i,j,i_mp_qs) = crs(k,i_mp_qs)
3447 sarea(k,i,j,i_mp_qg) = crs(k,i_mp_qg)
3452 rhoqcrg_t_mp(k,i,j,iq-1) = ( rhoq_crg(k,iq) - dens(k,i,j)*qtrc_crg(k,i,j,iq-1) ) / dt
3460 4, i, j, temp(:), dens(:,i,j), pres(:), qtrc(:,i,j,i_qv) )
3467 if ( hist_sw(ip) )
call file_history_put( hist_id(ip), w3d(:,:,:,hist_idx(ip)) )
3471 end subroutine mp_sn14
3482 integer,
intent(in) :: KA, KS, KE
3484 integer,
intent(in) :: point
3485 integer,
intent(in) :: i, j
3486 real(RP),
intent(in) :: tem(KA)
3487 real(RP),
intent(in) :: rho(KA)
3488 real(RP),
intent(in) :: pre(KA)
3489 real(RP),
intent(in) :: qv (KA)
3495 if ( tem(k) < tem_min &
3496 .OR. rho(k) < rho_min &
3497 .OR. pre(k) < 1.0_rp )
then
3499 log_info(
"ATMOS_PHY_MP_SN14_debug_tem_kij",
'(A,I3,A,4(F16.5),3(I6))') &
3500 "point: ", point,
" low tem,rho,pre:", tem(k), rho(k), pre(k), qv(k), k, i, j,
prc_myrank
3511 rho, tem, pre, qdry, &
3522 moist_psat_liq => atmos_saturation_psat_liq, &
3523 moist_psat_ice => atmos_saturation_psat_ice, &
3524 moist_pres2qsat_liq => atmos_saturation_pres2qsat_liq, &
3525 moist_pres2qsat_ice => atmos_saturation_pres2qsat_ice, &
3526 moist_dqsi_dtem_dens => atmos_saturation_dqs_dtem_dens_liq, &
3527 moist_dqs_dtem_dpre_ice => atmos_saturation_dqs_dtem_dpre_ice
3533 integer,
intent(in) :: KA, KS, KE
3535 real(RP),
intent(in) :: cz( KA)
3536 real(RP),
intent(in) :: fz(0:KA)
3537 real(RP),
intent(in) :: w (KA)
3538 real(RP),
intent(in) :: rho (KA)
3539 real(RP),
intent(in) :: tem (KA)
3540 real(RP),
intent(in) :: pre (KA)
3541 real(RP),
intent(in) :: qdry(KA)
3543 real(RP),
intent(in) :: rhoq(KA,I_QV:I_NG)
3545 real(RP),
intent(in) :: cpa(KA)
3546 real(RP),
intent(in) :: dTdt_rad(KA)
3547 real(RP),
intent(in) :: qke(KA)
3548 real(RP),
intent(in) :: dt
3549 real(RP),
intent(in) :: CCN(KA)
3550 real(RP),
intent(in) :: nc_uplim_d
3552 real(RP),
intent(out) :: PQ(KA,PQ_MAX)
3563 real(RP) :: w_dssidz(KA)
3565 real(RP) :: ssi_below(KA)
3566 real(RP) :: z_below(KA)
3572 real(RP) :: dqsidtem_rho(KA)
3573 real(RP) :: dssidt_rad(KA)
3574 real(RP) :: wssi, wdssi
3578 real(RP) :: dq_xa(KA,HYDRO_MAX)
3579 real(RP) :: vt_xa(KA,HYDRO_MAX,2)
3580 real(RP) :: dTdt_dep(KA)
3581 real(RP) :: PLIdep_total(KA)
3582 real(RP) :: wtem(KA)
3583 real(RP) :: dqsidpre_tem(KA)
3584 real(RP) :: dqsidtem_pre(KA)
3586 real(RP) :: dssidt_mp(KA)
3587 real(RP) :: dssidt_dyn(KA)
3595 real(RP) :: sigma_w(KA)
3596 real(RP) :: weff(KA)
3597 real(RP) :: weff_max(KA)
3598 real(RP) :: velz(KA)
3600 real(RP) :: coef_ccn
3601 real(RP) :: slope_ccn
3602 real(RP) :: nc_new(KA)
3603 real(RP) :: nc_new_below(KA)
3605 real(RP) :: nc_new_max
3608 logical :: flag_nucleation(KA)
3610 real(RP) :: r_gravity
3611 real(RP),
parameter :: r_sqrt3=0.577350269_rp
3612 real(RP),
parameter :: eps=1.e-30_rp
3615 real(RP) :: dlcdt_max, dli_max
3616 real(RP) :: dncdt_max, dni_max
3629 wtem(k) = max( tem(k), tem_min )
3640 r_gravity = 1.0_rp/grav
3642 call moist_psat_liq ( ka, ks, ke, &
3644 call moist_psat_ice ( ka, ks, ke, &
3646 call moist_pres2qsat_liq ( ka, ks, ke, &
3647 tem(:), pre(:), qdry(:), &
3649 call moist_pres2qsat_ice ( ka, ks, ke, &
3650 tem(:), pre(:), qdry(:), &
3652 call moist_dqsi_dtem_dens( ka, ks, ke, &
3657 call moist_dqs_dtem_dpre_ice( ka, ks, ke, &
3658 wtem(:), pre(:), qdry(:), &
3659 dqsidtem_pre(:), dqsidpre_tem(:) )
3666 a_max = 1.e+6_rp*0.1_rp*(1.e-6_rp)**1.27_rp
3672 pv = rhoq(k,i_qv)*rvap*tem(k)
3673 ssw(k) = min( mp_ssw_lim, ( pv/esw(k)-1.0_rp ) )*100.0_rp
3674 ssi(k) = ( pv/esi(k) - 1.00_rp )
3676 ssi_below(k+1) = ssi(k)
3677 z_below(k+1) = cz(k)
3680 ssi_below(ks) = ssi(ks)
3681 z_below(ks) = cz(ks-1)
3686 coef_ccn = 1.e+6_rp*0.88_rp*(c_ccn*1.e-6_rp)**(2.0_rp/(kappa + 2.0_rp)) &
3688 * (70.0_rp)**(kappa/(kappa + 2.0_rp))
3690 slope_ccn = 1.5_rp*kappa/(kappa + 2.0_rp)
3693 sigma_w(k) = r_sqrt3*sqrt(max(qke(k),qke_min))
3695 sigma_w(ks-1) = sigma_w(ks)
3696 sigma_w(ke+1) = sigma_w(ke)
3699 weff(k) = w(k) - cpa(k)*r_gravity*dtdt_rad(k)
3702 if( mp_couple_aerosol )
then
3705 if( ssw(k) > 1.e-10_rp .AND. pre(k) > 300.e+2_rp )
then
3706 nc_new(k) = max( ccn(k), c_ccn )
3714 if( nucl_twomey )
then
3718 weff_max(k) = weff(k) + sigma_w(k)
3720 if( (weff(k) > 1.e-8_rp) .AND. (ssw(k) > 1.e-10_rp) .AND. pre(k) > 300.e+2_rp )
then
3722 nc_new_max = coef_ccn*weff_max(k)**slope_ccn
3723 nc_new(k) = a_max*nc_new_max**b_max
3732 if( ssw(k) > 1.e-10_rp .AND. pre(k) > 300.e+2_rp )
then
3733 nc_new(k) = c_ccn*ssw(k)**kappa
3744 if( nc_new(k) > nc_uplim_d )
then
3745 flag_nucleation(k) = .false.
3746 nc_new_below(k+1) = 1.e+30_rp
3747 else if( nc_new(k) > eps )
then
3748 flag_nucleation(k) = .true.
3749 nc_new_below(k+1) = nc_new(k)
3751 flag_nucleation(k) = .false.
3752 nc_new_below(k+1) = 0.0_rp
3755 nc_new_below(ks) = 0.0_rp
3765 if( mp_couple_aerosol )
then
3770 if ( flag_nucleation(k) .AND. &
3771 tem(k) > tem_ccn_low )
then
3772 dlcdt_max = ( rhoq(k,i_qv) - esw(k) / ( rvap * tem(k) ) ) * rdt
3773 dlcdt_max = max( dlcdt_max, 0.0_rp )
3774 dncdt_max = dlcdt_max/xc_min
3777 pq(k,i_ncccn) = min( dncdt_max, dnc_new*rdt )
3778 pq(k,i_lcccn) = min( dlcdt_max, xc_min*pq(k,i_ncccn) )
3780 pq(k,i_ncccn) = 0.0_rp
3781 pq(k,i_lcccn) = 0.0_rp
3786 if( nucl_twomey )
then
3791 if ( flag_nucleation(k) .AND. &
3792 tem(k) > tem_ccn_low .AND. &
3793 nc_new(k) > rhoq(k,i_nc) )
then
3794 dlcdt_max = ( rhoq(k,i_qv) - esw(k) / ( rvap * tem(k) ) ) * rdt
3795 dlcdt_max = max( dlcdt_max, 0.0_rp )
3796 dncdt_max = dlcdt_max/xc_min
3797 dnc_new = nc_new(k)-rhoq(k,i_nc)
3798 pq(k,i_ncccn) = min( dncdt_max, dnc_new*rdt )
3799 pq(k,i_lcccn) = min( dlcdt_max, xc_min*pq(k,i_ncccn) )
3801 pq(k,i_ncccn) = 0.0_rp
3802 pq(k,i_lcccn) = 0.0_rp
3808 if( tem(k) > tem_ccn_low .AND. &
3809 nc_new(k) > rhoq(k,i_nc) )
then
3810 dlcdt_max = ( rhoq(k,i_qv) - esw(k) / ( rvap * tem(k) ) ) * rdt
3811 dlcdt_max = max( dlcdt_max, 0.0_rp )
3812 dncdt_max = dlcdt_max/xc_min
3813 dnc_new = nc_new(k)-rhoq(k,i_nc)
3814 pq(k,i_ncccn) = min( dncdt_max, dnc_new*rdt )
3815 pq(k,i_lcccn) = min( dlcdt_max, xc_min*pq(k,i_ncccn) )
3817 pq(k,i_ncccn) = 0.0_rp
3818 pq(k,i_lcccn) = 0.0_rp
3834 if( so22_het .or. opt_nucleation_ice_hom )
then
3838 rho(:), tem(:), pre(:), &
3839 qdry(:), esi(:), qsi(:), &
3845 dtdt_dep(k) = (lhs0+(
cv_vapor-
cv_ice)*tem(k))*plidep_total(k)/(rho(k)*cva(k))
3848 dtdt_dep(:) = 0.0_rp
3852 velz(k) = ( w(k) * ( cz(k+1) - fz(k) ) + w(k+1) * ( fz(k) - cz(k) ) ) / ( cz(k+1) - cz(k) )
3856 dzh = cz(k) - z_below(k)
3857 w_dssidz(k) = velz(k) * (ssi(k) - ssi_below(k))/dzh
3858 dssidt_rad(k) = -rhoq(k,i_qv)/(rho(k)*qsi(k)*qsi(k))*dqsidtem_rho(k)*dtdt_rad(k)
3859 dli_max = ( rhoq(k,i_qv) - esi(k) / ( rvap * tem(k) ) ) * rdt
3860 dli_max = max( dli_max, 0.0_rp )
3861 dni_max = min( dli_max/xi_ccn, (in_max-rhoq(k,i_ni))*rdt )
3862 wdssi = min( w_dssidz(k)+dssidt_rad(k), 0.01_rp)
3863 wssi = min( ssi(k), ssi_max)
3867 dssidt_mp(k) = -plidep_total(k)/(rho(k)*qsi(k))
3869 dssidt_rad(k) = -rhoq(k,i_qv)/(rho(k)*qsi(k)*qsi(k))*dqsidtem_rho(k)*dtdt_rad(k)
3871 dssidt_dyn(k) = +rhoq(k,i_qv)/(rho(k)*qsi(k)*qsi(k))&
3872 * velz(k)*grav*(dqsidtem_pre(k)/cpa(k)+dqsidpre_tem(k)*rho(k))
3874 dssidt = dssidt_mp(k) + dssidt_rad(k) + dssidt_dyn(k)
3894 if( (tem(k) < 273.15_rp ) .AND. &
3895 (rhoq(k,i_ni) < in_max ) .AND. &
3896 (wssi >= eps ) )
then
3897 tmp = c_in * nm_m92 * exp( 0.3_rp * bm_m92 * ( wssi - 0.1_rp ) )
3898 if( inucl_w .and. wdssi > eps )
then
3899 tmp = bm_m92 * 0.3_rp * tmp * wdssi
3900 elseif( so22_het .and. dssidt > eps )
then
3901 tmp = bm_m92 * 0.3_rp * tmp * dssidt
3903 tmp = max( tmp - rhoq(k,i_ni), 0.0_rp ) * rdt
3905 pq(k,i_niccn) = min(dni_max, tmp)
3906 pq(k,i_liccn) = min(dli_max, pq(k,i_niccn)*xi_ccn )
3908 pq(k,i_niccn) = 0.0_rp
3909 pq(k,i_liccn) = 0.0_rp
3915 if( opt_nucleation_ice_hom )
then
3919 qdry, rhoq(:,i_qv), &
3928 pq(:,i_lihom) = 0.0_rp
3929 pq(:,i_nihom) = 0.0_rp
3941 qd, rhoq_qv, cva, cpa, &
3942 w, dTdt_rad, dTdt_dep, &
3943 PLIdep, dt, PLIhom, PNIhom )
3965 integer,
intent(in) :: KA, KS, KE
3967 real(RP),
intent(in) :: tem(KA)
3968 real(RP),
intent(in) :: pre(KA)
3969 real(RP),
intent(in) :: rho(KA)
3970 real(RP),
intent(in) :: qd(KA)
3971 real(RP),
intent(in) :: rhoq_qv(KA)
3972 real(RP),
intent(in) :: cpa(KA)
3973 real(RP),
intent(in) :: cva(KA)
3975 real(RP),
intent(in) :: w(KA)
3976 real(RP),
intent(in) :: dTdt_rad(KA)
3977 real(RP),
intent(in) :: dTdt_dep(KA)
3978 real(RP),
intent(in) :: PLIdep(KA)
3980 real(RP),
intent(out):: PLIhom(KA)
3981 real(RP),
intent(out):: PNIhom(KA)
3982 real(RP),
intent(in) :: dt
3983 real(RP),
parameter :: rhoi=916.0_rp
3984 real(RP),
parameter :: rrhoi=1.0_rp/rhoi
3985 real(RP),
parameter :: Mw=18.01528_rp
3986 real(RP),
parameter :: Nav=6.0221415e+23_rp
3987 real(RP),
parameter :: vw=(mw*1.e-3_rp/nav)/rhoi
3989 real(RP),
parameter :: r0=29.5e-9_rp
3990 real(RP),
parameter :: c_gf = 1.01187_rp
3991 real(RP),
parameter :: g_gf = -0.206449_rp
3992 real(RP),
parameter :: rho_min=1.e-5_rp
3993 real(RP),
parameter :: tem_min=150.0_rp
3994 real(RP),
parameter :: ni_max =300.e+6_rp
3997 real(RP) :: esi, esw
4000 real(RP) :: dqsidtem
4001 real(RP) :: den1, den2
4002 real(RP) :: dqsidt_pre
4003 real(RP) :: dqsidp_tem
4005 real(RP) :: temc_lim
4011 real(RP) :: dsidt_mp
4012 real(RP) :: dsidt_rd
4014 real(RP) :: a1,a2,a3
4017 real(RP) :: dtemdt_dyn
4025 real(RP),
parameter :: r2pi = 0.5_rp/pi
4026 real(RP),
parameter :: sqrt_pi = sqrt(pi)
4027 real(RP),
parameter :: coef_mi = 4.0_rp/3.0_rp*pi*rhoi
4028 real(RP),
parameter :: eps = 1.e-30_rp
4044 wtem= max(tem(k), tem_min)
4046 * ( wtem / t00 ) ** ( ( cpvap - ci ) / rvap ) &
4047 * exp( lhs00 / rvap &
4048 * ( 1.0_rp / t00 - 1.0_rp / wtem ) ), pre(k))
4050 * ( wtem / t00 ) ** ( ( cpvap - cl ) / rvap ) &
4051 * exp( lhv00 / rvap &
4052 * ( 1.0_rp / t00 - 1.0_rp / wtem ) )
4054 scr = 2.349_rp - wtem/259.0_rp
4055 qsi = epsvap * esi / ( pre(k) - ( 1.0_rp - epsvap ) * esi )
4056 si = rhoq_qv(k)*rvap*wtem/esi
4058 sw = min(rho(k)*rhoq_qv(k)*rvap*wtem/esw,0.999_rp)
4059 if ( si < scr )
then
4062 lhs = lhs00 + (cpvap - ci )*(wtem-t00)
4072 lhs = lhs0 + (cpvap - ci)*(wtem-t00)
4073 dqsidtem = esi/(rho(k)*rvap*wtem*wtem)&
4074 * (lhs/(rvap*wtem)-1.0_rp)
4075 dsidt_mp = -1.0_rp/(rho(k)*qsi) &
4076 * (1.0_rp+si*(lhv00+lhf00+(cvvap-ci)*wtem)/cva(k)*dqsidtem)&
4078 dsidt_rd = -si/qsi*dqsidtem*dtdt_rad(k)
4080 a1 = lhs0*grav/(cpa(k)*rvap*tem(k)*tem(k))&
4081 - grav/(rdry*tem(k))
4088 wp = w(k) + 1.0_rp/(a1*si)*(dsidt_mp+dsidt_rd)
4090 dlogjdt = -0.004_rp*wtem*wtem + 2.0_rp*wtem - 304.4_rp
4092 dtemdt_dyn= - grav*w(k)/cpa(k)
4093 rtau = dlogjdt*(dtdt_rad(k)+dtdt_dep(k)+dtemdt_dyn )
4095 rw = r0*c_gf*(1-sw)**g_gf
4097 if ( wp > eps .AND. rtau > eps )
then
4099 temc_lim= max(tem(k)-t00, temc_lim_diff )
4100 rho_lim = max(rho(k),rho_min)
4101 pre_lim = rho_lim*(qd(k)*rdry + rhoq_qv(k)*rvap)*(temc_lim+t00)
4102 dw = 0.211e-4_rp* (((temc_lim+t00)/t00)**1.94_rp) *(pstd/pre_lim)
4104 b2 = 0.5_rp/dw*sqrt(rvap*wtem*r2pi)
4105 b1 = (si-1.0_rp)*0.5_rp*rrhoi*esi/sqrt(2.0_rp*pi*rvap*wtem)
4106 a2 = mw*rvap*wtem/(nav*esi)
4107 a3 = epsvap*mw*lhs0*lhs0/(nav*cpa(k)*pre(k)*wtem)
4109 kappa = 2.0_rp*b1*b2/( rtau*(1.0_rp+delta)*(1.0_rp+delta) )
4111 rim_w = max(1.e-20_rp, 0.5_rp*(1.0_rp+delta)*(3.0_rp*kappa/(2.0_rp+sqrt(1.0_rp+9.0_rp/pi*kappa))) &
4112 + 1.0_rp/(1.0_rp+delta)*(3.0_rp /(2.0_rp+sqrt(1.0_rp+9.0_rp/pi*kappa)))+delta-1.0_rp )
4113 pnihom(k) = min( scr/(scr-1.0_rp)*a1*wp/(rim_w*4.0_rp*pi*dw/b2), ni_max )* rdt
4114 ri_wrk = 1.0_rp+b2*rw
4115 ri = ( sqrt(ri_wrk*ri_wrk + 2.0_rp*b1*b2*dt )-1.0_rp )/b2
4116 plihom(k) = coef_mi*ri*ri*ri*pnihom(k)
4132 rhoq_crg, xq, & ! in
4140 integer,
intent(in) :: KA, KS, KE
4142 real(RP),
intent(in) :: Pac(KA,Pac_MAX)
4143 real(RP),
intent(in) :: tem(KA)
4144 real(RP),
intent(in) :: rhoq(KA,I_QV:I_NG)
4145 real(RP),
intent(in) :: xq(KA,HYDRO_MAX)
4147 real(RP),
intent(inout):: PQ(KA,PQ_MAX)
4149 logical,
intent(in) :: flg_lt
4150 real(RP),
intent(in) :: rhoq_crg(KA,I_QC:I_QG)
4151 real(RP),
intent(inout):: Pcrg1(KA,PQ_MAX)
4154 real(RP),
parameter :: pice = 350.0e+6_rp
4156 real(RP),
parameter :: pnc = 250.0_rp
4163 real(RP) :: a0,a1,a2,a3,a4,a5
4164 real(RP) :: a6,a7,a8,a9,a10
4165 real(RP) :: an1,an2,b0,b1,b2,c0,c1,c2
4166 real(RP) :: d0,d1,d2,e1,e2,h0,h1,h2
4167 real(RP),
parameter :: eps=1.0e-30_rp
4171 real(RP) :: wn, wni, wns, wng
4181 if (tem(k) > 270.16_rp)
then
4183 else if(tem(k) >= 268.16_rp)
then
4184 fp = (270.16_rp-tem(k))*0.5_rp
4185 else if(tem(k) >= 265.16_rp)
then
4186 fp = (tem(k)-265.16_rp)*0.333333333_rp
4194 x = coef_lambda(i_mp_qc)*(xc_cr/xq(k,i_mp_qc))**mu(i_mp_qc)
4196 if(x<1.e-2_rp*alpha)
then
4198 else if(x<alpha+1.0_rp)
then
4201 a1 = a0*x/(alpha+1.0_rp)
4202 a2 = a1*x/(alpha+2.0_rp)
4203 a3 = a2*x/(alpha+3.0_rp)
4204 a4 = a3*x/(alpha+4.0_rp)
4205 a5 = a4*x/(alpha+5.0_rp)
4206 a6 = a5*x/(alpha+6.0_rp)
4207 a7 = a6*x/(alpha+7.0_rp)
4208 a8 = a7*x/(alpha+8.0_rp)
4209 a9 = a8*x/(alpha+9.0_rp)
4210 a10 = a9*x/(alpha+10.0_rp)
4211 igm = (a0+a1+a2+a3+a4+a5+a6+a7+a8+a9+a10)*exp( -x + alpha*log(x) - lgm )
4212 else if(x<alpha*100.0_rp)
then
4220 an1 = -(1.0_rp-alpha)
4222 d1 = 1.0_rp/(an1*d0+b1)
4227 an2 = -2.0_rp*(2.0_rp-alpha)
4229 d2 = 1.0_rp/(an2*d1+b2)
4234 igm = 1.0_rp - exp( -x + alpha*log(x) - lgm )*h2
4239 n12 = rhoq(k,i_nc)*(1.0_rp-igm)
4241 wn = (pice + n12/((rhoq(k,i_qc)+xc_min)*pnc) )*fp
4242 wni = wn*(-pac(k,i_liaclc2li) )
4243 wns = wn*(-pac(k,i_lsaclc2ls) )
4244 wng = wn*(-pac(k,i_lgaclc2lg) )
4245 pq(k,i_nispl) = wni+wns+wng
4247 pq(k,i_lsspl) = - wns*xq(k,i_mp_qi)
4248 pq(k,i_lgspl) = - wng*xq(k,i_mp_qi)
4250 sw1 = 0.5_rp - sign( 0.5_rp, rhoq(k,i_ns)-small )
4251 pcrg1(k,i_nsspl) = - wns*(1.0_rp-sw1) &
4252 / (rhoq(k,i_ns)+sw1)*rhoq_crg(k,i_qs)
4253 sw1 = 0.5_rp - sign( 0.5_rp, rhoq(k,i_ng)-small )
4254 pcrg1(k,i_ngspl) = - wng*(1.0_rp-sw1) &
4255 / (rhoq(k,i_ng)+sw1)*rhoq_crg(k,i_qg)
4256 pcrg1(k,i_nispl) = - ( pcrg1(k,i_nsspl) + pcrg1(k,i_ngspl) )
4267 ! collection process
4270 d0_crg, v0_crg, & ! in
4271 beta_crg, dqcrg, & ! in
4272 wtem, rhoq, rhoq_crg, & ! in
4273 xq, dq_xave, vt_xave, & ! in
4274 ! rho ! [Add] 11/08/30
4276 Pcrg1, Pcrg2, & ! inout
4279 moist_psat_ice => atmos_saturation_psat_ice
4282 integer,
intent(in) :: KA, KS, KE
4287 real(RP),
intent(in) :: wtem(KA)
4289 real(RP),
intent(in) :: rhoq(KA,I_QV:I_NG)
4291 real(RP),
intent(in) :: xq(KA,HYDRO_MAX)
4293 real(RP),
intent(in) :: dq_xave(KA,HYDRO_MAX)
4295 real(RP),
intent(in) :: vt_xave(KA,HYDRO_MAX,2)
4299 real(RP),
intent(inout):: PQ(KA,PQ_MAX)
4301 real(RP),
intent(out):: Pac(KA,Pac_MAX)
4303 logical,
intent(in) :: flg_lt
4304 real(RP),
intent(in) :: beta_crg(KA)
4305 real(RP),
intent(in) :: dqcrg(KA)
4306 real(RP),
intent(in) :: d0_crg, v0_crg
4307 real(RP),
intent(in) :: rhoq_crg(KA,I_QC:I_QG)
4308 real(RP),
intent(inout):: Pcrg1(KA,PQ_MAX)
4309 real(RP),
intent(inout):: Pcrg2(KA,Pcrg_MAX)
4311 real(RP),
parameter :: a_dec = 0.883_rp
4312 real(RP),
parameter :: b_dec = 0.093_rp
4313 real(RP),
parameter :: c_dec = 0.00348_rp
4314 real(RP),
parameter :: d_dec = 4.5185e-5_rp
4320 real(RP) :: E_c(KA), E_r, E_i, E_s, E_g
4321 real(RP) :: E_ic, E_sc, E_gc
4323 real(RP) :: E_stick(KA)
4325 real(RP) :: temc, temc2, temc3
4330 real(RP) :: temc_p, temc_m
4337 real(RP) :: ave_di(KA)
4338 real(RP) :: ave_ds(KA)
4341 real(RP) :: coef_acc_LCI, coef_acc_NCI
4342 real(RP) :: coef_acc_LCS, coef_acc_NCS
4344 real(RP) :: coef_acc_LCG, coef_acc_NCG
4345 real(RP) :: coef_acc_LRI_I, coef_acc_NRI_I
4346 real(RP) :: coef_acc_LRI_R, coef_acc_NRI_R
4347 real(RP) :: coef_acc_LRS_S, coef_acc_NRS_S
4348 real(RP) :: coef_acc_LRS_R, coef_acc_NRS_R
4349 real(RP) :: coef_acc_LRG, coef_acc_NRG
4350 real(RP) :: coef_acc_LII, coef_acc_NII
4351 real(RP) :: coef_acc_LIS, coef_acc_NIS
4352 real(RP) :: coef_acc_NSS
4353 real(RP) :: coef_acc_NGG
4354 real(RP) :: coef_acc_LSG, coef_acc_NSG(KA)
4356 real(RP) :: dcdc(KA), dcdi, dcds, dcdg
4357 real(RP) :: drdr(KA), drdi(KA), drds(KA), drdg
4358 real(RP) :: didi(KA), dids, didg
4359 real(RP) :: dsds(KA), dsdg
4360 real(RP) :: dgdg(KA)
4362 real(RP) :: vcvc(KA), vcvi, vcvs, vcvg
4363 real(RP) :: vrvr(KA), vrvi(KA), vrvs(KA), vrvg
4364 real(RP) :: vivi(KA), vivs, vivg
4365 real(RP) :: vsvs(KA), vsvg
4366 real(RP) :: vgvg(KA)
4368 real(RP) :: wx_cri, wx_crs
4369 real(RP) :: coef_emelt
4372 real(RP) :: sw, sw1, sw2
4373 real(RP) :: alpha_lt
4379 tem(k) = max( wtem(k), tem_min )
4382 call moist_psat_ice( ka, ks, ke, &
4385 if( opt_stick_ks96 )
then
4391 e_dec = max(0.0_rp, a_dec + b_dec*temc + c_dec*temc2 + d_dec*temc3 )
4392 esi_rat = rhoq(k,i_qv)*rvap*tem(k)/esi(k)
4393 e_stick(k) = min(1.0_rp, e_dec*esi_rat)
4395 else if( opt_stick_co86 )
then
4398 temc = min(tem(k) - t00,0.0_rp)
4399 w1 = 0.035_rp*temc-0.7_rp
4400 e_stick(k) = 10._rp**w1
4405 temc_m = min(tem(k) - t00,0.0_rp)
4406 e_stick(k) = exp(0.09_rp*temc_m)
4412 ave_dc = coef_d(i_mp_qc)*xq(k,i_mp_qc)**b_m(i_mp_qc)
4415 e_c(k) = max(0.0_rp, min(1.0_rp, (ave_dc-dc0)/(dc1-dc0) ))
4421 dcdc(k) = dq_xave(k,i_mp_qc) * dq_xave(k,i_mp_qc)
4422 drdr(k) = dq_xave(k,i_mp_qr) * dq_xave(k,i_mp_qr)
4423 didi(k) = dq_xave(k,i_mp_qi) * dq_xave(k,i_mp_qi)
4424 dsds(k) = dq_xave(k,i_mp_qs) * dq_xave(k,i_mp_qs)
4425 dgdg(k) = dq_xave(k,i_mp_qg) * dq_xave(k,i_mp_qg)
4426 drdi(k) = dq_xave(k,i_mp_qr) * dq_xave(k,i_mp_qi)
4427 drds(k) = dq_xave(k,i_mp_qr) * dq_xave(k,i_mp_qs)
4430 vcvc(k) = vt_xave(k,i_mp_qc,2) * vt_xave(k,i_mp_qc,2)
4431 vrvr(k) = vt_xave(k,i_mp_qr,2) * vt_xave(k,i_mp_qr,2)
4432 vivi(k) = vt_xave(k,i_mp_qi,2) * vt_xave(k,i_mp_qi,2)
4433 vsvs(k) = vt_xave(k,i_mp_qs,2) * vt_xave(k,i_mp_qs,2)
4434 vgvg(k) = vt_xave(k,i_mp_qg,2) * vt_xave(k,i_mp_qg,2)
4435 vrvi(k) = vt_xave(k,i_mp_qr,2) * vt_xave(k,i_mp_qi,2)
4436 vrvs(k) = vt_xave(k,i_mp_qr,2) * vt_xave(k,i_mp_qs,2)
4440 ave_di(k) = coef_d(i_mp_qi)*xq(k,i_mp_qi)**b_m(i_mp_qi)
4441 ave_ds(k) = coef_d(i_mp_qs)*xq(k,i_mp_qs)**b_m(i_mp_qs)
4453 dcdi = dq_xave(k,i_mp_qc) * dq_xave(k,i_mp_qi)
4454 vcvi = vt_xave(k,i_mp_qc,2) * vt_xave(k,i_mp_qi,2)
4455 sw = 0.5_rp - sign(0.5_rp, di0-ave_di(k))
4459 ( delta_b1(i_mp_qc)*dcdc(k) + delta_ab1(i_mp_qi,i_mp_qc)*dcdi + delta_b0(i_mp_qi)*didi(k) ) &
4460 * sqrt( theta_b1(i_mp_qc)*vcvc(k) - theta_ab1(i_mp_qi,i_mp_qc)*vcvi + theta_b0(i_mp_qi)*vivi(k) &
4461 + sigma_i + sigma_c )
4463 ( delta_b0(i_mp_qc)*dcdc(k) + delta_ab0(i_mp_qi,i_mp_qc)*dcdi + delta_b0(i_mp_qi)*didi(k) ) &
4464 * sqrt( theta_b0(i_mp_qc)*vcvc(k) - theta_ab0(i_mp_qi,i_mp_qc)*vcvi + theta_b0(i_mp_qi)*vivi(k) &
4465 + sigma_i + sigma_c )
4466 pac(k,i_liaclc2li)= -0.25_rp*pi*e_ic*rhoq(k,i_ni)*rhoq(k,i_qc)*coef_acc_lci
4467 pac(k,i_niacnc2ni)= -0.25_rp*pi*e_ic*rhoq(k,i_ni)*rhoq(k,i_nc)*coef_acc_nci
4473 dcds = dq_xave(k,i_mp_qc) * dq_xave(k,i_mp_qs)
4474 vcvs = vt_xave(k,i_mp_qc,2) * vt_xave(k,i_mp_qs,2)
4475 sw = 0.5_rp - sign(0.5_rp, ds0-ave_ds(k))
4479 ( delta_b1(i_mp_qc)*dcdc(k) + delta_ab1(i_mp_qs,i_mp_qc)*dcds + delta_b0(i_mp_qs)*dsds(k) ) &
4480 * sqrt( theta_b1(i_mp_qc)*vcvc(k) - theta_ab1(i_mp_qs,i_mp_qc)*vcvs + theta_b0(i_mp_qs)*vsvs(k) &
4481 + sigma_s + sigma_c )
4483 ( delta_b0(i_mp_qc)*dcdc(k) + delta_ab0(i_mp_qs,i_mp_qc)*dcds + delta_b0(i_mp_qs)*dsds(k) ) &
4484 * sqrt( theta_b0(i_mp_qc)*vcvc(k) - theta_ab0(i_mp_qs,i_mp_qc)*vcvs + theta_b0(i_mp_qs)*vsvs(k) &
4485 + sigma_s + sigma_c )
4486 pac(k,i_lsaclc2ls)= -0.25_rp*pi*e_sc*rhoq(k,i_ns)*rhoq(k,i_qc)*coef_acc_lcs
4487 pac(k,i_nsacnc2ns)= -0.25_rp*pi*e_sc*rhoq(k,i_ns)*rhoq(k,i_nc)*coef_acc_ncs
4493 dcdg = dq_xave(k,i_mp_qc) * dq_xave(k,i_mp_qg)
4494 vcvg = vt_xave(k,i_mp_qc,2) * vt_xave(k,i_mp_qg,2)
4495 ave_dg = coef_d(i_mp_qg)*xq(k,i_mp_qg)**b_m(i_mp_qg)
4496 sw = 0.5_rp - sign(0.5_rp, dg0-ave_dg)
4500 ( delta_b1(i_mp_qc)*dcdc(k) + delta_ab1(i_mp_qg,i_mp_qc)*dcdg + delta_b0(i_mp_qg)*dgdg(k) ) &
4501 * sqrt( theta_b1(i_mp_qc)*vcvc(k) - theta_ab1(i_mp_qg,i_mp_qc)*vcvg + theta_b0(i_mp_qg)*vgvg(k) &
4502 + sigma_g + sigma_c )
4504 ( delta_b0(i_mp_qc)*dcdc(k) + delta_ab0(i_mp_qg,i_mp_qc)*dcdg + delta_b0(i_mp_qg)*dgdg(k) ) &
4505 * sqrt( theta_b0(i_mp_qc)*vcvc(k) - theta_ab0(i_mp_qg,i_mp_qc)*vcvg + theta_b0(i_mp_qg)*vgvg(k) &
4506 + sigma_g + sigma_c )
4507 pac(k,i_lgaclc2lg)= -0.25_rp*pi*e_gc*rhoq(k,i_ng)*rhoq(k,i_qc)*coef_acc_lcg
4508 pac(k,i_ngacnc2ng)= -0.25_rp*pi*e_gc*rhoq(k,i_ng)*rhoq(k,i_nc)*coef_acc_ncg
4513 dsdg = dq_xave(k,i_mp_qs) * dq_xave(k,i_mp_qg)
4514 vsvg = vt_xave(k,i_mp_qs,2) * vt_xave(k,i_mp_qg,2)
4516 ( delta_b1(i_mp_qs)*dsds(k) + delta_ab1(i_mp_qg,i_mp_qs)*dsdg + delta_b0(i_mp_qg)*dgdg(k) ) &
4517 * sqrt( theta_b1(i_mp_qs)*vsvs(k) - theta_ab1(i_mp_qg,i_mp_qs)*vsvg + theta_b0(i_mp_qg)*vgvg(k) &
4518 + sigma_g + sigma_s )
4520 ( delta_b0(i_mp_qs)*dsds(k) + delta_ab0(i_mp_qg,i_mp_qs)*dsdg + delta_b0(i_mp_qg)*dgdg(k) ) &
4522 * sqrt( theta_b0(i_mp_qs)*vsvs(k) - theta_ab0(i_mp_qg,i_mp_qs)*vsvg + theta_b0(i_mp_qg)*vgvg(k) &
4523 + sigma_g + sigma_s )
4524 pac(k,i_lgacls2lg)= -0.25_rp*pi*e_stick(k)*e_gs*rhoq(k,i_ng)*rhoq(k,i_qs)*coef_acc_lsg
4525 pac(k,i_ngacns2ng)= -0.25_rp*pi*e_stick(k)*e_gs*rhoq(k,i_ng)*rhoq(k,i_ns)*coef_acc_nsg(k)
4550 dids = dq_xave(k,i_mp_qi) * dq_xave(k,i_mp_qs)
4551 vivs = vt_xave(k,i_mp_qi,2) * vt_xave(k,i_mp_qs,2)
4553 ( delta_b1(i_mp_qi)*didi(k) + delta_ab1(i_mp_qs,i_mp_qi)*dids + delta_b0(i_mp_qs)*dsds(k) ) &
4554 * sqrt( theta_b1(i_mp_qi)*vivi(k) - theta_ab1(i_mp_qs,i_mp_qi)*vivs + theta_b0(i_mp_qs)*vsvs(k) &
4555 + sigma_i + sigma_s )
4557 ( delta_b0(i_mp_qi)*didi(k) + delta_ab0(i_mp_qs,i_mp_qi)*dids + delta_b0(i_mp_qs)*dsds(k) ) &
4558 * sqrt( theta_b0(i_mp_qi)*vivi(k) - theta_ab0(i_mp_qs,i_mp_qi)*vivs + theta_b0(i_mp_qs)*vsvs(k) &
4559 + sigma_i + sigma_s )
4560 pac(k,i_liacls2ls)= -0.25_rp*pi*e_stick(k)*e_si*rhoq(k,i_ns)*rhoq(k,i_qi)*coef_acc_lis
4561 pac(k,i_niacns2ns)= -0.25_rp*pi*e_stick(k)*e_si*rhoq(k,i_ns)*rhoq(k,i_ni)*coef_acc_nis
4565 drdg = dq_xave(k,i_mp_qr) * dq_xave(k,i_mp_qg)
4566 vrvg = vt_xave(k,i_mp_qr,2) * vt_xave(k,i_mp_qg,2)
4567 sw = sign(0.5_rp, t00-tem(k)) + 0.5_rp
4577 ( ( delta_b1(i_mp_qr)*drdr(k) + delta_ab1(i_mp_qg,i_mp_qr)*drdg + delta_b0(i_mp_qg)*dgdg(k) ) * sw &
4578 + ( delta_b1(i_mp_qg)*dgdg(k) + delta_ab1(i_mp_qr,i_mp_qg)*drdg + delta_b0(i_mp_qr)*drdr(k) ) * (1.0_rp-sw) ) &
4579 * sqrt( ( theta_b1(i_mp_qr)*vrvr(k) - theta_ab1(i_mp_qg,i_mp_qr)*vrvg + theta_b0(i_mp_qg)*vgvg(k) ) * sw &
4580 + ( theta_b1(i_mp_qg)*vgvg(k) - theta_ab1(i_mp_qr,i_mp_qg)*vrvg + theta_b0(i_mp_qr)*vrvr(k) ) * (1.0_rp-sw) &
4581 + sigma_r + sigma_g )
4582 pac(k,i_lraclg2lg) = -0.25_rp*pi*e_gr*coef_acc_lrg * ( rhoq(k,i_ng)*rhoq(k,i_qr) * sw &
4583 + rhoq(k,i_nr)*rhoq(k,i_qg) * (1.0_rp-sw) )
4585 ( delta_b0(i_mp_qr)*drdr(k) + delta_ab0(i_mp_qg,i_mp_qr)*drdg + delta_b0(i_mp_qg)*dgdg(k) ) &
4586 * sqrt( theta_b0(i_mp_qr)*vrvr(k) - theta_ab0(i_mp_qg,i_mp_qr)*vrvg + theta_b0(i_mp_qg)*vgvg(k) &
4587 + sigma_r + sigma_g )
4588 pac(k,i_nracng2ng) = -0.25_rp*pi*e_gr*rhoq(k,i_ng)*rhoq(k,i_nr)*coef_acc_nrg
4601 ( delta_b1(i_mp_qi)*didi(k) + delta_ab1(i_mp_qr,i_mp_qi)*drdi(k) + delta_b0(i_mp_qr)*drdr(k) ) &
4602 * sqrt( theta_b1(i_mp_qi)*vivi(k) - theta_ab1(i_mp_qr,i_mp_qi)*vrvi(k) + theta_b0(i_mp_qr)*vrvr(k) &
4603 + sigma_r + sigma_i )
4605 ( delta_b0(i_mp_qi)*didi(k) + delta_ab0(i_mp_qr,i_mp_qi)*drdi(k) + delta_b0(i_mp_qr)*drdr(k) ) &
4606 * sqrt( theta_b0(i_mp_qi)*vivi(k) - theta_ab0(i_mp_qr,i_mp_qi)*vrvi(k) + theta_b0(i_mp_qr)*vrvr(k) &
4607 + sigma_r + sigma_i )
4608 pac(k,i_lracli2lg_i)= -0.25_rp*pi*e_ir*rhoq(k,i_nr)*rhoq(k,i_qi)*coef_acc_lri_i
4609 pac(k,i_nracni2ng_i)= -0.25_rp*pi*e_ir*rhoq(k,i_nr)*rhoq(k,i_ni)*coef_acc_nri_i
4615 ( delta_b1(i_mp_qr)*drdr(k) + delta_ab1(i_mp_qi,i_mp_qr)*drdi(k) + delta_b0(i_mp_qi)*didi(k) ) &
4616 * sqrt( theta_b1(i_mp_qr)*vrvr(k) - theta_ab1(i_mp_qi,i_mp_qr)*vrvi(k) + theta_b0(i_mp_qi)*vivi(k) &
4617 + sigma_r + sigma_i )
4619 ( delta_b0(i_mp_qr)*drdr(k) + delta_ab0(i_mp_qi,i_mp_qr)*drdi(k) + delta_b0(i_mp_qi)*didi(k) ) &
4620 * sqrt( theta_b0(i_mp_qr)*vrvr(k) - theta_ab0(i_mp_qi,i_mp_qr)*vrvi(k) + theta_b0(i_mp_qi)*vivi(k) &
4621 + sigma_r + sigma_i )
4622 pac(k,i_lracli2lg_r)= -0.25_rp*pi*e_ir*rhoq(k,i_ni)*rhoq(k,i_qr)*coef_acc_lri_r
4623 pac(k,i_nracni2ng_r)= -0.25_rp*pi*e_ir*rhoq(k,i_ni)*rhoq(k,i_nr)*coef_acc_nri_r
4630 ( delta_b1(i_mp_qs)*dsds(k) + delta_ab1(i_mp_qr,i_mp_qs)*drds(k) + delta_b0(i_mp_qr)*drdr(k) ) &
4631 * sqrt( theta_b1(i_mp_qs)*vsvs(k) - theta_ab1(i_mp_qr,i_mp_qs)*vrvs(k) + theta_b0(i_mp_qr)*vrvr(k) &
4632 + sigma_r + sigma_s )
4634 ( delta_b0(i_mp_qs)*dsds(k) + delta_ab0(i_mp_qr,i_mp_qs)*drds(k) + delta_b0(i_mp_qr)*drdr(k) ) &
4635 * sqrt( theta_b0(i_mp_qs)*vsvs(k) - theta_ab0(i_mp_qr,i_mp_qs)*vrvs(k) + theta_b0(i_mp_qr)*vrvr(k) &
4636 + sigma_r + sigma_s )
4637 pac(k,i_lracls2lg_s)= -0.25_rp*pi*e_sr*rhoq(k,i_nr)*rhoq(k,i_qs)*coef_acc_lrs_s
4638 pac(k,i_nracns2ng_s)= -0.25_rp*pi*e_sr*rhoq(k,i_nr)*rhoq(k,i_ns)*coef_acc_nrs_s
4644 ( delta_b1(i_mp_qr)*drdr(k) + delta_ab1(i_mp_qs,i_mp_qr)*drds(k) + delta_b0(i_mp_qs)*dsds(k) ) &
4645 * sqrt( theta_b1(i_mp_qr)*vrvr(k) - theta_ab1(i_mp_qs,i_mp_qr)*vrvs(k) + theta_b0(i_mp_qs)*vsvs(k) &
4646 + sigma_r + sigma_s )
4648 ( delta_b0(i_mp_qr)*drdr(k) + delta_ab0(i_mp_qs,i_mp_qr)*drds(k) + delta_b0(i_mp_qs)*dsds(k) ) &
4649 * sqrt( theta_b0(i_mp_qr)*vrvr(k) - theta_ab0(i_mp_qs,i_mp_qr)*vrvs(k) + theta_b0(i_mp_qs)*vsvs(k) &
4650 + sigma_r + sigma_s )
4651 pac(k,i_lracls2lg_r)= -0.25_rp*pi*e_sr*rhoq(k,i_ns)*rhoq(k,i_qr)*coef_acc_lrs_r
4652 pac(k,i_nracns2ng_r)= -0.25_rp*pi*e_sr*rhoq(k,i_ns)*rhoq(k,i_nr)*coef_acc_nrs_r
4664 ( delta_b0(i_mp_qi)*didi(k) + delta_ab1(i_mp_qi,i_mp_qi)*didi(k) + delta_b1(i_mp_qi)*didi(k) ) &
4665 * sqrt( theta_b0(i_mp_qi)*vivi(k) - theta_ab1(i_mp_qi,i_mp_qi)*vivi(k) + theta_b1(i_mp_qi)*vivi(k) &
4666 + sigma_i + sigma_i )
4668 ( delta_b0(i_mp_qi)*didi(k) + delta_ab0(i_mp_qi,i_mp_qi)*didi(k) + delta_b0(i_mp_qi)*didi(k) ) &
4669 * sqrt( theta_b0(i_mp_qi)*vivi(k) - theta_ab0(i_mp_qi,i_mp_qi)*vivi(k) + theta_b0(i_mp_qi)*vivi(k) &
4670 + sigma_i + sigma_i )
4671 pac(k,i_liacli2ls)= -0.25_rp*pi*e_stick(k)*e_ii*rhoq(k,i_ni)*rhoq(k,i_qi)*coef_acc_lii
4672 pac(k,i_niacni2ns)= -0.25_rp*pi*e_stick(k)*e_ii*rhoq(k,i_ni)*rhoq(k,i_ni)*coef_acc_nii
4688 ( delta_b0(i_mp_qs)*dsds(k) + delta_ab0(i_mp_qs,i_mp_qs)*dsds(k) + delta_b0(i_mp_qs)*dsds(k) ) &
4689 * sqrt( theta_b0(i_mp_qs)*vsvs(k) - theta_ab0(i_mp_qs,i_mp_qs)*vsvs(k) + theta_b0(i_mp_qs)*vsvs(k) &
4690 + sigma_s + sigma_s )
4691 pac(k,i_nsacns2ns)= -0.125_rp*pi*e_stick(k)*e_ss*rhoq(k,i_ns)*rhoq(k,i_ns)*coef_acc_nss
4697 ( delta_b0(i_mp_qg)*dgdg(k) + delta_ab0(i_mp_qg,i_mp_qg)*dgdg(k) + delta_b0(i_mp_qg)*dgdg(k) ) &
4698 * sqrt( theta_b0(i_mp_qg)*vgvg(k) - theta_ab0(i_mp_qg,i_mp_qg)*vgvg(k) + theta_b0(i_mp_qg)*vgvg(k) &
4699 + sigma_g + sigma_g )
4700 pac(k,i_ngacng2ng)= -0.125_rp*pi*e_stick(k)*e_gg*rhoq(k,i_ng)*rhoq(k,i_ng)*coef_acc_ngg
4710 sw = 0.5_rp - sign(0.5_rp,di_cri-ave_di(k))
4711 wx_cri = cfill_i*dwatr/rho_g*( pi/6.0_rp*rho_g*ave_di(k)**3/xq(k,i_mp_qi) - 1.0_rp ) * sw
4712 pq(k,i_licon) = i_iconv2g * pac(k,i_liaclc2li)/max(1.0_rp, wx_cri) * sw
4713 pq(k,i_nicon) = i_iconv2g * pq(k,i_licon)/xq(k,i_mp_qi) * sw
4718 wx_crs = cfill_s*dwatr/rho_g*( pi/6.0_rp*rho_g*ave_ds(k)**3/xq(k,i_mp_qs) - 1.0_rp )
4719 pq(k,i_lscon) = i_sconv2g * (pac(k,i_lsaclc2ls))/max(1.0_rp, wx_crs)
4720 pq(k,i_nscon) = i_sconv2g * pq(k,i_lscon)/xq(k,i_mp_qs)
4731 temc_p = max(tem(k) - t00, 0.0_rp)
4733 coef_emelt = cl/lhf0*temc_p
4735 pq(k,i_lgacm) = coef_emelt*pac(k,i_lgaclc2lg)
4736 pq(k,i_ngacm) = pq(k,i_lgacm)/xq(k,i_mp_qg)
4738 pq(k,i_lgarm) = coef_emelt*pac(k,i_lraclg2lg)
4739 pq(k,i_ngarm) = pq(k,i_lgarm)/xq(k,i_mp_qg)
4741 pq(k,i_lsacm) = coef_emelt*(pac(k,i_lsaclc2ls))
4742 pq(k,i_nsacm) = pq(k,i_lsacm)/xq(k,i_mp_qs)
4744 pq(k,i_lsarm) = coef_emelt*(pac(k,i_lracls2lg_r)+pac(k,i_lracls2lg_s))
4745 pq(k,i_nsarm) = pq(k,i_lsarm)/xq(k,i_mp_qg)
4747 pq(k,i_liacm) = coef_emelt*pac(k,i_liaclc2li)
4748 pq(k,i_niacm) = pq(k,i_liacm)/xq(k,i_mp_qi)
4750 pq(k,i_liarm) = coef_emelt*(pac(k,i_lracli2lg_r)+pac(k,i_lracli2lg_i))
4751 pq(k,i_niarm) = pq(k,i_liarm)/xq(k,i_mp_qg)
4759 sw1 = 0.5_rp - sign( 0.5_rp, rhoq(k,i_nc)-small )
4760 pcrg2(k,i_niacnc2ni) = pac(k,i_niacnc2ni)*(1.0_rp-sw1) / (rhoq(k,i_nc)+sw1) * rhoq_crg(k,i_qc)
4765 sw1 = 0.5_rp - sign( 0.5_rp, rhoq(k,i_nc)-small )
4766 pcrg2(k,i_nsacnc2ns) = pac(k,i_nsacnc2ns)*(1.0_rp-sw1) / (rhoq(k,i_nc)+sw1) * rhoq_crg(k,i_qc)
4771 sw1 = 0.5_rp - sign( 0.5_rp, rhoq(k,i_nc)-small )
4772 pcrg2(k,i_ngacnc2ng) = pac(k,i_ngacnc2ng)*(1.0_rp-sw1) / (rhoq(k,i_nc)+sw1) * rhoq_crg(k,i_qc)
4777 sw1 = 0.5_rp - sign( 0.5_rp, rhoq(k,i_ns)-small )
4778 pcrg2(k,i_ngacns2ng) = pac(k,i_ngacns2ng)*(1.0_rp-sw1) / (rhoq(k,i_ns)+sw1) * rhoq_crg(k,i_qs)
4783 alpha_lt = 5.0_rp * ( dq_xave(k,i_mp_qs) / d0_crg )**2 * vt_xave(k,i_mp_qg,2) / v0_crg
4784 alpha_lt = min( alpha_lt, 10.0_rp )
4785 pcrg2(k,i_cgngacns2ng)= 0.25_rp*pi*( 1.0_rp - e_stick(k) )*e_gs &
4786 * rhoq(k,i_ng)*rhoq(k,i_ns)*coef_acc_nsg(k) &
4787 * ( dqcrg(k)*alpha_lt ) &
4806 sw1 = 0.5_rp - sign( 0.5_rp, rhoq(k,i_ni)-small )
4807 pcrg2(k,i_niacns2ns) = pac(k,i_niacns2ns)*(1.0_rp-sw1) / (rhoq(k,i_ni)+sw1) * rhoq_crg(k,i_qi)
4812 sw = 0.5_rp + sign( 0.5_rp, t00-tem(k) )
4813 sw1 = 0.5_rp - sign( 0.5_rp, rhoq(k,i_nr)-small )
4814 sw2 = 0.5_rp - sign( 0.5_rp, rhoq(k,i_ng)-small )
4815 pcrg2(k,i_nracng2ng) = pac(k,i_nracng2ng)*(1.0_rp-sw1)/(rhoq(k,i_nr)+sw1) * rhoq_crg(k,i_qr) * sw &
4816 + pac(k,i_nracng2ng)*(1.0_rp-sw2)/(rhoq(k,i_ng)+sw2) * rhoq_crg(k,i_qg) * (1.0_rp-sw)
4821 sw1 = 0.5_rp - sign( 0.5_rp, rhoq(k,i_ni)-small )
4822 pcrg2(k,i_nracni2ng_i) = pac(k,i_nracni2ng_i)*(1.0_rp-sw1) / (rhoq(k,i_ni)+sw1) * rhoq_crg(k,i_qi)
4827 sw1 = 0.5_rp - sign( 0.5_rp, rhoq(k,i_nr)-small )
4828 pcrg2(k,i_nracni2ng_r) = pac(k,i_nracni2ng_r)*(1.0_rp-sw1) / (rhoq(k,i_nr)+sw1) * rhoq_crg(k,i_qr)
4833 sw1 = 0.5_rp - sign( 0.5_rp, rhoq(k,i_ns)-small )
4834 pcrg2(k,i_nracns2ng_s) = pac(k,i_nracns2ng_s)*(1.0_rp-sw1) / (rhoq(k,i_ns)+sw1) * rhoq_crg(k,i_qs)
4839 sw1 = 0.5_rp - sign( 0.5_rp, rhoq(k,i_nr)-small )
4840 pcrg2(k,i_nracns2ng_r) = pac(k,i_nracns2ng_r)*(1.0_rp-sw1) / (rhoq(k,i_nr)+sw1) * rhoq_crg(k,i_qr)
4845 sw1 = 0.5_rp - sign( 0.5_rp, rhoq(k,i_ni)-small )
4846 pcrg2(k,i_niacni2ns) = pac(k,i_niacni2ns)*(1.0_rp-sw1) / (rhoq(k,i_ni)+sw1) * rhoq_crg(k,i_qi)
4851 sw1 = 0.5_rp - sign( 0.5_rp, rhoq(k,i_ni)-small )
4852 pcrg1(k,i_nicon) = i_iconv2g * pq(k,i_nicon)*(1.0_rp-sw1) / (rhoq(k,i_ni)+sw1) * rhoq_crg(k,i_qi)
4857 sw1 = 0.5_rp - sign( 0.5_rp, rhoq(k,i_ns)-small )
4858 pcrg1(k,i_nscon) = i_sconv2g * pq(k,i_nscon)*(1.0_rp-sw1) / (rhoq(k,i_ns)+sw1) * rhoq_crg(k,i_qs)
4862 sw1 = 0.5_rp - sign( 0.5_rp, rhoq(k,i_ng)-small )
4863 pcrg1(k,i_ngacm) = pq(k,i_ngacm)*(1.0_rp-sw1) / (rhoq(k,i_ng)+sw1) * rhoq_crg(k,i_qg)
4867 sw1 = 0.5_rp - sign( 0.5_rp, rhoq(k,i_ng)-small )
4868 pcrg1(k,i_ngarm) = pq(k,i_ngarm)*(1.0_rp-sw1) / (rhoq(k,i_ng)+sw1) * rhoq_crg(k,i_qg)
4872 sw1 = 0.5_rp - sign( 0.5_rp, rhoq(k,i_ns)-small )
4873 pcrg1(k,i_nsacm) = pq(k,i_nsacm)*(1.0_rp-sw1) / (rhoq(k,i_ns)+sw1) * rhoq_crg(k,i_qs)
4877 sw1 = 0.5_rp - sign( 0.5_rp, rhoq(k,i_ns)-small )
4878 pcrg1(k,i_nsarm) = pq(k,i_nsarm)*(1.0_rp-sw1) / (rhoq(k,i_ns)+sw1) * rhoq_crg(k,i_qs)
4882 sw1 = 0.5_rp - sign( 0.5_rp, rhoq(k,i_ni)-small )
4883 pcrg1(k,i_niacm) = pq(k,i_niacm)*(1.0_rp-sw1) / (rhoq(k,i_ni)+sw1) * rhoq_crg(k,i_qi)
4887 sw1 = 0.5_rp - sign( 0.5_rp, rhoq(k,i_ni)-small )
4888 pcrg1(k,i_niarm) = pq(k,i_niarm)*(1.0_rp-sw1) / (rhoq(k,i_ni)+sw1) * rhoq_crg(k,i_qi)
4898 ! collection process
4901 d0_crg, v0_crg, & ! in
4902 beta_crg, dqcrg, & ! in
4903 wtem, rhoq, rhoq_crg, & ! in
4904 xq, dq_xave, vt_xave, & ! in
4907 Pcrg1, Pcrg2, & ! inout
4910 moist_psat_ice => atmos_saturation_psat_ice
4915 integer,
intent(in) :: KA, KS, KE
4920 real(RP),
intent(in) :: wtem(KA)
4922 real(RP),
intent(in) :: rhoq(KA,I_QV:I_NG)
4923 real(RP),
intent(in) :: rho(KA)
4925 real(RP),
intent(in) :: xq(KA,HYDRO_MAX)
4927 real(RP),
intent(in) :: dq_xave(KA,HYDRO_MAX)
4929 real(RP),
intent(in) :: vt_xave(KA,HYDRO_MAX,2)
4933 real(RP),
intent(inout):: PQ(KA,PQ_MAX)
4935 real(RP),
intent(out):: Pac(KA,Pac_MAX)
4937 logical,
intent(in) :: flg_lt
4938 real(RP),
intent(in) :: beta_crg(KA)
4939 real(RP),
intent(in) :: dqcrg(KA)
4940 real(RP),
intent(in) :: d0_crg, v0_crg
4941 real(RP),
intent(in) :: rhoq_crg(KA,I_QC:I_QG)
4942 real(RP),
intent(inout):: Pcrg1(KA,PQ_MAX)
4943 real(RP),
intent(inout):: Pcrg2(KA,Pcrg_MAX)
4945 real(RP),
parameter :: a_dec = 0.883_rp
4946 real(RP),
parameter :: b_dec = 0.093_rp
4947 real(RP),
parameter :: c_dec = 0.00348_rp
4948 real(RP),
parameter :: d_dec = 4.5185e-5_rp
4952 real(RP),
parameter :: E_C12(6)=(/&
4953 0.010_rp, 0.080_rp, 0.10_rp, 0.60_rp, 0.20_rp, 0.10_rp/)
4958 real(RP) :: E_c, E_r, E_i, E_s, E_g
4961 real(RP):: E_stick(KA)
4963 real(RP) :: temc, temc2, temc3
4965 real(RP) :: esi_rat(KA)
4968 real(RP) :: temc_p, temc_m
4975 real(RP) :: ave_di(KA)
4976 real(RP) :: ave_ds(KA)
4979 real(RP) :: coef_acc_LCI, coef_acc_NCI
4980 real(RP) :: coef_acc_LCS, coef_acc_NCS
4982 real(RP) :: coef_acc_LCG, coef_acc_NCG
4983 real(RP) :: coef_acc_LRI_I, coef_acc_NRI_I
4984 real(RP) :: coef_acc_LRI_R, coef_acc_NRI_R
4985 real(RP) :: coef_acc_LRS_S, coef_acc_NRS_S
4986 real(RP) :: coef_acc_LRS_R, coef_acc_NRS_R
4987 real(RP) :: coef_acc_LRG, coef_acc_NRG
4988 real(RP) :: coef_acc_LII, coef_acc_NII
4989 real(RP) :: coef_acc_LIS, coef_acc_NIS
4990 real(RP) :: coef_acc_NSS
4991 real(RP) :: coef_acc_NGG
4992 real(RP) :: coef_acc_LSG, coef_acc_NSG(KA)
4994 real(RP) :: dcdc(KA), dcdi, dcds, dcdg
4995 real(RP) :: drdr(KA), drdi(KA), drds(KA), drdg
4996 real(RP) :: didi(KA), dids, didg
4997 real(RP) :: dsds(KA), dsdg
4998 real(RP) :: dgdg(KA)
5010 real(RP) :: sw, sw1, sw2, tmp
5011 real(RP) :: alpha_lt
5016 real(RP) :: tem_e(KA)
5023 integer,
parameter :: ngmax=4
5025 real(RP) :: lambdac(KA), lambdar(KA), lambdai(KA), lambdas(KA), lambdag(KA)
5026 real(RP) :: A_dsdc(KA), A_dsdr(KA), A_dsdi(KA), A_dsds(KA), A_dsdg(KA)
5030 real(RP) :: dNc_glx(KA,ngmax), dNr_glx(KA,ngmax), dNi_glx(KA,ngmax), dNs_glx(KA,ngmax), dNg_glx(KA,ngmax)
5031 real(RP) :: dNc_gly, dNr_gly(KA,ngmax), dNi_gly(KA,ngmax), dNs_gly(KA,ngmax), dNg_gly(KA,ngmax)
5033 real(RP) :: dc_glx, dr_glx, di_glx, ds_glx, dg_glx
5034 real(RP) :: dc_gly, dr_gly, di_gly, ds_gly, dg_gly
5035 real(RP) :: xc_glx(KA,ngmax), xr_glx(KA,ngmax), xi_glx(KA,ngmax), xs_glx(KA,ngmax), xg_glx(KA,ngmax)
5036 real(RP) :: xc_gly, xr_gly(KA,ngmax), xi_gly, xs_gly, xg_gly
5038 real(RP) :: vtc_glx(KA,ngmax), vtr_glx(KA,ngmax), vti_glx(KA,ngmax), vts_glx(KA,ngmax), vtg_glx(KA,ngmax)
5039 real(RP) :: vtc_gly, vtr_gly(KA,ngmax), vti_gly(KA,ngmax), vts_gly(KA,ngmax), vtg_gly(KA,ngmax)
5040 real(RP) :: dac_glx(KA,ngmax), dar_glx(KA,ngmax), dai_glx(KA,ngmax), das_glx(KA,ngmax), dag_glx(KA,ngmax)
5041 real(RP) :: dac_gly, dar_gly(KA,ngmax), dai_gly(KA,ngmax), das_gly(KA,ngmax), dag_gly(KA,ngmax)
5045 real(RP) :: E_ic(KA), E_sc(KA), E_gc(KA)
5049 real(RP) :: acx, bcx, gcx, scx
5050 real(RP) :: acy, bcy, gcy, scy
5051 real(RP),
parameter :: as = 0.59452551_rp
5052 real(RP),
parameter :: bs = 2.4490_rp
5053 real(RP),
parameter :: gs = 0.131488_rp
5054 real(RP),
parameter :: ss = 1.880000_rp
5055 real(RP),
parameter :: ag = 19.5072514_rp
5056 real(RP),
parameter :: bg = 2.8_rp
5057 real(RP),
parameter :: gg = 0.5_rp
5058 real(RP),
parameter :: sg = 2.0_rp
5059 real(RP) :: num_Besti_glx, num_Bests_glx, num_Bestg_glx
5060 real(RP) :: num_Besti_gly, num_Bests_gly, num_Bestg_gly
5061 real(RP) :: num_Rei_glx, num_Res_glx, num_Reg_glx
5062 real(RP) :: num_Rei_gly, num_Res_gly, num_Reg_gly
5063 real(RP),
parameter :: c0=0.6_rp
5064 real(RP),
parameter :: d0=5.83_rp
5066 real(RP) :: mua(KA), nua(KA)
5068 real(RP),
parameter :: mua0 = 1.718e-5_rp
5070 real(RP),
parameter :: dmua_dT = 5.28e-8_rp
5076 real(RP) :: kernel_cg, kernel_cs, kernel_ci
5077 real(RP) :: kernel_rg, kernel_rs, kernel_ri
5078 real(RP) :: kernel_ig, kernel_is, kernel_ii
5079 real(RP) :: kernel_sg, kernel_ss
5080 real(RP) :: kernel_gg
5081 real(RP) :: kernel_sg_reb
5098 real(RP),
parameter :: gauss_rangec=2.0_rp
5099 real(RP),
parameter :: wc_gl(ngmax)=(/&
5100 0.2411146051511425e+00_rp, &
5101 0.4520325754088027e+00_rp, &
5102 0.4520325754088027e+00_rp, &
5103 0.2411146051511425e+00_rp &
5105 real(RP),
parameter :: coefc_d_gl(ngmax)=(/&
5106 0.5505187813766612e+00_rp, &
5107 0.7900516927471093e+00_rp, &
5108 0.1265739962562290e+01_rp, &
5109 0.1816468454535444e+01_rp &
5111 real(RP),
parameter :: gauss_ranger=8.0_rp
5112 real(RP),
parameter :: wr_gl(ngmax)=(/&
5113 0.723343815453428e+00_rp,&
5114 1.35609772622641e+00_rp, &
5115 1.35609772622641e+00_rp, &
5116 0.723343815453428e+00_rp &
5118 real(RP),
parameter :: coefr_d_gl(ngmax)=(/&
5119 0.166846238310235e+00_rp, &
5120 0.493135790663523e+00_rp, &
5121 2.02783902311062e+00_rp, &
5122 5.99354237846583e+00_rp &
5124 real(RP),
parameter :: gauss_range=5.0_rp
5125 real(RP),
parameter :: w_gl(ngmax)=(/&
5126 0.559850775788111e+00_rp, &
5127 1.04958713664599e+00_rp, &
5128 1.04958713664599e+00_rp, &
5129 0.559850775788111e+00_rp &
5131 real(RP),
parameter :: coef_d_gl(ngmax)=(/&
5132 0.2500872485877803e+00_rp, &
5133 0.5785800417604080e+00_rp, &
5134 0.1728369331505741e+01_rp, &
5135 0.3998604509613778e+01_rp &
5138 real(RP) :: wx_cri, wx_crs
5139 real(RP) :: coef_emelt
5149 tem(k) = max( wtem(k), tem_min )
5152 call moist_psat_ice( ka, ks, ke, &
5155 if( opt_stick_ks96 )
then
5161 e_dec = max(0.0_rp, a_dec + b_dec*temc + c_dec*temc2 + d_dec*temc3 )
5162 esi_rat(k) = rhoq(k,i_qv)*rvap*tem(k)/esi(k)
5163 e_stick(k) = min(1.0_rp, e_dec*esi_rat(k))
5165 else if( opt_stick_co86 )
then
5168 temc = min(tem(k) - t00,0.0_rp)
5169 w1 = 0.035_rp*temc-0.7_rp
5170 e_stick(k) = 10._rp**w1
5175 temc_m = min(tem(k) - t00,0.0_rp)
5176 e_stick(k) = exp(0.09_rp*temc_m)
5185 tem(:) = max(wtem(:), tem_min )
5186 tem_e(:) = max(wtem(:), tem_min_estick )
5188 call moist_psat_ice( ka, ks, ke, tem(:), esi(:) )
5191 if ( opt_stick_ks96 )
then
5194 temc = tem_e(k) - t00
5197 e_dec = max(0.0_rp, a_dec + b_dec*temc + c_dec*temc2 + d_dec*temc3 )
5198 esi_rat(k) = rhoq(k,i_qv)*rvap*tem(k)/esi(k)
5199 e_stick(k) = min(1.0_rp, e_dec*esi_rat(k))
5201 elseif( opt_stick_co86 )
then
5203 temc = min(tem_e(k) - t00,0.0_rp)
5204 w1 = 0.035_rp*temc-0.7_rp
5205 e_stick(k) = 10.0_rp**w1
5207 elseif( opt_stick_c12 )
then
5209 if (tem_e(k)>273.15_rp)
then
5211 elseif(tem_e(k)<243.15_rp)
then
5213 elseif(tem_e(k)<248.15_rp)
then
5214 e_stick(k)=e_c12(1)+0.2_rp*(e_c12(2)-e_c12(1))*(tem_e(k)-243.15_rp)
5215 elseif(tem_e(k)<253.15_rp)
then
5216 e_stick(k)=e_c12(2)+0.2_rp*(e_c12(3)-e_c12(2))*(tem_e(k)-248.15_rp)
5217 elseif(tem_e(k)<258.15_rp)
then
5218 e_stick(k)=e_c12(3)+0.2_rp*(e_c12(4)-e_c12(3))*(tem_e(k)-253.15_rp)
5219 elseif(tem_e(k)<263.15_rp)
then
5220 e_stick(k)=e_c12(4)+0.2_rp*(e_c12(5)-e_c12(4))*(tem_e(k)-258.15_rp)
5221 elseif(tem_e(k)<268.15_rp)
then
5222 e_stick(k)=e_c12(5)+0.2_rp*(e_c12(6)-e_c12(5))*(tem_e(k)-263.15_rp)
5228 if ( opt_stick_rhh57 )
then
5230 if ( tem_e(k) < 270.0_rp .AND. rhoq(k,i_qv)*rvap*tem(k) < esi(k) )
then
5236 elseif( opt_stick_rhks96 )
then
5238 esi_rat(k) = min( rhoq(k,i_qv)*rvap*tem(k)/esi(k),1.0_rp )
5246 temc_m = min(tem_e(k) - t00,0.0_rp)
5247 e_stick(k) = exp(0.09_rp*temc_m)*esi_rat(k)
5256 mua(k) = mua0 + dmua_dt*(tem(k)-273.15_rp)
5257 nua(k) = mua(k)/rho(k)
5260 lambdac(k) = xq(k,i_mp_qc)**(-mu(i_mp_qc))*coef_lambda(i_mp_qc)
5261 a_dsdc(k) = rhoq(k,i_nc)*coef_a(i_mp_qc)*lambdac(k)**((nu(i_mp_qc)+1.0_rp)/mu(i_mp_qc))
5264 lambdar(k) = xq(k,i_mp_qr)**(-mu(i_mp_qr))*coef_lambda(i_mp_qr)
5265 a_dsdr(k) = rhoq(k,i_nr)*coef_a(i_mp_qr)*lambdar(k)**((nu(i_mp_qr)+1.0_rp)/mu(i_mp_qr))
5268 lambdai(k) = xq(k,i_mp_qi)**(-mu(i_mp_qi))*coef_lambda(i_mp_qi)
5269 a_dsdi(k) = rhoq(k,i_ni)*coef_a(i_mp_qi)*lambdai(k)**((nu(i_mp_qi)+1.0_rp)/mu(i_mp_qi))
5272 lambdas(k) = xq(k,i_mp_qs)**(-mu(i_mp_qs))*coef_lambda(i_mp_qs)
5273 a_dsds(k) = rhoq(k,i_ns)*coef_a(i_mp_qs)*lambdas(k)**((nu(i_mp_qs)+1.0_rp)/mu(i_mp_qs))
5276 lambdag(k) = xq(k,i_mp_qg)**(-mu(i_mp_qg))*coef_lambda(i_mp_qg)
5277 a_dsdg(k) = rhoq(k,i_ng)*coef_a(i_mp_qg)*lambdag(k)**((nu(i_mp_qg)+1.0_rp)/mu(i_mp_qg))
5286 dc_glx = dq_xave(k,i_mp_qc)*coefc_d_gl(ngx)
5287 xc_glx(k,ngx) = ( (dc_glx/a_m(i_mp_qc)) )**(1.0_rp/b_m(i_mp_qc))
5288 dnc_glx(k,ngx) = a_dsdc(k)*(xc_glx(k,ngx)**nu(i_mp_qc)) * exp(-lambdac(k)*xc_glx(k,ngx)**mu(i_mp_qc))&
5289 *(xc_glx(k,ngx)/(b_m(i_mp_qc)*dc_glx))*dc_glx*wc_gl(ngx)
5291 dr_glx = dq_xave(k,i_mp_qr)*coefr_d_gl(ngx)
5292 xr_glx(k,ngx) = ( (dr_glx/a_m(i_mp_qr)) )**(1.0_rp/b_m(i_mp_qr))
5293 dnr_glx(k,ngx) = a_dsdr(k)*(xr_glx(k,ngx)**nu(i_mp_qr)) * exp(-lambdar(k)*xr_glx(k,ngx)**mu(i_mp_qr))&
5294 *(xr_glx(k,ngx)/(b_m(i_mp_qr)*dr_glx))*dr_glx*wr_gl(ngx)
5296 di_glx = dq_xave(k,i_mp_qi)*coef_d_gl(ngx)
5297 xi_glx(k,ngx) = ( (di_glx/a_m(i_mp_qi)) )**(1.0_rp/b_m(i_mp_qi))
5298 dni_glx(k,ngx) = a_dsdi(k)*(xi_glx(k,ngx)**nu(i_mp_qi)) * exp(-lambdai(k)*xi_glx(k,ngx)**mu(i_mp_qi))&
5299 *(xi_glx(k,ngx)/(b_m(i_mp_qi)*di_glx))*di_glx*w_gl(ngx)
5301 ds_glx = dq_xave(k,i_mp_qs)*coef_d_gl(ngx)
5302 xs_glx(k,ngx) = ( (ds_glx/a_m(i_mp_qs)) )**(1.0_rp/b_m(i_mp_qs))
5303 dns_glx(k,ngx) = a_dsds(k)*(xs_glx(k,ngx)**nu(i_mp_qs)) * exp(-lambdas(k)*xs_glx(k,ngx)**mu(i_mp_qs))&
5304 *(xs_glx(k,ngx)/(b_m(i_mp_qs)*ds_glx))*ds_glx*w_gl(ngx)
5306 dg_glx = dq_xave(k,i_mp_qg)*coef_d_gl(ngx)
5307 xg_glx(k,ngx) = ( (dg_glx/a_m(i_mp_qg)) )**(1.0_rp/b_m(i_mp_qg))
5308 dng_glx(k,ngx) = a_dsdg(k)*(xg_glx(k,ngx)**nu(i_mp_qg)) * exp(-lambdag(k)*xg_glx(k,ngx)**mu(i_mp_qg))&
5309 *(xg_glx(k,ngx)/(b_m(i_mp_qg)*dg_glx))*dg_glx*w_gl(ngx)
5323 sw = 0.5_rp + sign(0.5_rp, di_glx - 100.e-6_rp )
5324 acx = ( 0.1677_rp*(1.0_rp-sw) + 0.00166_rp*sw ) * 1.e-3_rp * 100.0_rp**( 2.91_rp*(1.0_rp-sw) + 1.91_rp*sw )
5325 bcx = 2.91_rp*(1.0_rp-sw) + 1.91_rp*sw
5326 gcx = (0.684_rp*(1.0_rp-sw) + 0.0696_rp*sw ) * 1.e-4_rp * 10.0_rp**( 4.0_rp*(1.0_rp-sw) + 3.0_rp*sw )
5327 scx = 2.0_rp*(1.0_rp-sw) + 1.5_rp*sw
5328 num_besti_glx = 2.0_rp*acx*grav*rho(k)*di_glx**(bcx+2.0_rp-scx)/(gcx*mua(k)**2)
5329 num_bests_glx = 2.0_rp*as *grav*rho(k)*ds_glx**(bs +2.0_rp-ss )/(gs *mua(k)**2)
5330 num_bestg_glx = 2.0_rp*ag *grav*rho(k)*dg_glx**(bg +2.0_rp-sg )/(gg *mua(k)**2)
5331 num_rei_glx = 0.25_rp*d0*d0*( sqrt(1.0_rp+4.0_rp*sqrt(num_besti_glx)/(d0*d0*sqrt(c0)))-1.0_rp )**2
5332 num_res_glx = 0.25_rp*d0*d0*( sqrt(1.0_rp+4.0_rp*sqrt(num_bests_glx)/(d0*d0*sqrt(c0)))-1.0_rp )**2
5333 num_reg_glx = 0.25_rp*d0*d0*( sqrt(1.0_rp+4.0_rp*sqrt(num_bestg_glx)/(d0*d0*sqrt(c0)))-1.0_rp )**2
5335 vtc_glx(k,ngx) = coef_vtr_ar2*dc_glx*(1.0_rp-exp(-coef_vtr_br2*dc_glx))
5342 sw = 0.5_rp + sign( 0.5_rp, dr_glx - d_vtr_branch )
5343 tmp = exp( - ( coef_vtr_br2*(1.0_rp-sw) + coef_vtr_cr1*sw ) * dr_glx )
5344 vtr_glx(k,ngx) = coef_vtr_ar2 * dr_glx * ( 1.0_rp - tmp ) * (1.0_rp-sw) &
5345 + ( coef_vtr_ar1 - coef_vtr_br1 * tmp ) * sw
5347 vti_glx(k,ngx) = num_rei_glx*nua(k)/di_glx
5348 vts_glx(k,ngx) = num_res_glx*nua(k)/ds_glx
5349 vtg_glx(k,ngx) = num_reg_glx*nua(k)/dg_glx
5351 dac_glx(k,ngx) = dc_glx
5352 dar_glx(k,ngx) = dr_glx
5353 dai_glx(k,ngx) = 2.0_rp*sqrt( (gcx*di_glx**scx)/pi )
5354 das_glx(k,ngx) = 2.0_rp*sqrt( (gs *ds_glx**ss )/pi )
5355 dag_glx(k,ngx) = 2.0_rp*sqrt( (gg *dg_glx**sg )/pi )
5365 dr_gly = dq_xave(k,i_mp_qr)*coefr_d_gl(ngy)
5366 xr_gly(k,ngy) = ( (dr_gly/a_m(i_mp_qr)) )**(1.0_rp/b_m(i_mp_qr))
5367 dnr_gly(k,ngy) = a_dsdr(k)*(xr_gly(k,ngy)**nu(i_mp_qr)) * exp(-lambdar(k)*xr_gly(k,ngy)**mu(i_mp_qr))&
5368 *(xr_gly(k,ngy)/(b_m(i_mp_qr)*dr_gly))*dr_gly*wr_gl(ngy)
5370 di_gly = dq_xave(k,i_mp_qi)*coef_d_gl(ngy)
5371 xi_gly = ( (di_gly/a_m(i_mp_qi)) )**(1.0_rp/b_m(i_mp_qi))
5372 dni_gly(k,ngy) = a_dsdi(k)*(xi_gly**nu(i_mp_qi)) * exp(-lambdai(k)*xi_gly**mu(i_mp_qi))&
5373 *(xi_gly/(b_m(i_mp_qi)*di_gly))*di_gly*w_gl(ngy)
5375 ds_gly = dq_xave(k,i_mp_qs)*coef_d_gl(ngy)
5376 xs_gly = ( (ds_gly/a_m(i_mp_qs)) )**(1.0_rp/b_m(i_mp_qs))
5377 dns_gly(k,ngy) = a_dsds(k)*(xs_gly**nu(i_mp_qs)) * exp(-lambdas(k)*xs_gly**mu(i_mp_qs))&
5378 *(xs_gly/(b_m(i_mp_qs)*ds_gly))*ds_gly*w_gl(ngy)
5380 dg_gly = dq_xave(k,i_mp_qg)*coef_d_gl(ngy)
5381 xg_gly = ( (dg_gly/a_m(i_mp_qg)) )**(1.0_rp/b_m(i_mp_qg))
5382 dng_gly(k,ngy) = a_dsdg(k)*(xg_gly**nu(i_mp_qg)) * exp(-lambdag(k)*xg_gly**mu(i_mp_qg))&
5383 *(xg_gly/(b_m(i_mp_qg)*dg_gly))*dg_gly*w_gl(ngy)
5397 sw = 0.5_rp + sign( 0.5_rp, di_gly - 100.e-6_rp )
5398 acy = ( 0.1677_rp*(1.0_rp-sw) + 0.00166_rp*sw ) * 1.e-3_rp * 100.0_rp**( 2.91_rp*(1.0_rp-sw) + 1.91_rp*sw )
5399 bcy = 2.91_rp*(1.0_rp-sw) + 1.91_rp*sw
5400 gcy = ( 0.684_rp*(1.0_rp-sw) + 0.0696_rp*sw ) * 1.e-4_rp * 10.0_rp**( 4.0_rp*(1.0_rp-sw) + 3.0_rp*sw )
5401 scy = 2.0_rp*(1.0_rp-sw) + 1.5_rp*sw
5402 num_besti_gly = 2.0_rp*acy*grav*rho(k)*di_gly**(bcy+2.0_rp-scy)/(gcy*mua(k)**2)
5403 num_bests_gly = 2.0_rp*as *grav*rho(k)*ds_gly**(bs +2.0_rp-ss )/(gs *mua(k)**2)
5404 num_bestg_gly = 2.0_rp*ag *grav*rho(k)*dg_gly**(bg +2.0_rp-sg )/(gg *mua(k)**2)
5405 num_rei_gly = 0.25_rp*d0*d0*( sqrt(1.0_rp+4.0_rp*sqrt(num_besti_gly)/(d0*d0*sqrt(c0)))-1.0_rp )**2
5406 num_res_gly = 0.25_rp*d0*d0*( sqrt(1.0_rp+4.0_rp*sqrt(num_bests_gly)/(d0*d0*sqrt(c0)))-1.0_rp )**2
5407 num_reg_gly = 0.25_rp*d0*d0*( sqrt(1.0_rp+4.0_rp*sqrt(num_bestg_gly)/(d0*d0*sqrt(c0)))-1.0_rp )**2
5414 sw = 0.5_rp + sign( 0.5_rp, dr_gly - d_vtr_branch )
5415 tmp = exp( - ( coef_vtr_br2*(1.0_rp-sw) + coef_vtr_cr1*sw ) * dr_gly )
5416 vtr_gly(k,ngy) = coef_vtr_ar2 * dr_gly * ( 1.0_rp - tmp ) * (1.0_rp-sw) &
5417 + ( coef_vtr_ar1 - coef_vtr_br1 * tmp ) * sw
5419 vti_gly(k,ngy) = num_rei_gly*nua(k)/di_gly
5420 vts_gly(k,ngy) = num_res_gly*nua(k)/ds_gly
5421 vtg_gly(k,ngy) = num_reg_gly*nua(k)/dg_gly
5423 dar_gly(k,ngy) = dr_gly
5424 dai_gly(k,ngy) = 2.0_rp*sqrt( (gcy*di_gly**scy)/pi )
5425 das_gly(k,ngy) = 2.0_rp*sqrt( (gs *ds_gly**ss )/pi )
5426 dag_gly(k,ngy) = 2.0_rp*sqrt( (gg *dg_gly**sg )/pi )
5434 e_c = max(0.0_rp, min(1.0_rp, (dq_xave(k,i_mp_qc)-dc0)/(dc1-dc0) ))
5441 sw = 0.5_rp + sign( 0.5_rp, dq_xave(k,i_mp_qi)-di0 )
5448 sw = 0.5_rp + sign( 0.5_rp, dq_xave(k,i_mp_qs)-ds0 )
5455 sw = 0.5_rp + sign( 0.5_rp, dq_xave(k,i_mp_qg)-dg0 )
5475 kernel_cg = 0.25_rp * pi * (dag_gly(k,ngy)+dac_glx(k,ngx))**2 * abs(vtg_gly(k,ngy)-vtc_glx(k,ngx)) * e_gc(k)
5476 pac(k,i_ngacnc2ng) = pac(k,i_ngacnc2ng) - kernel_cg *dnc_glx(k,ngx)*dng_gly(k,ngy)
5477 pac(k,i_lgaclc2lg) = pac(k,i_lgaclc2lg) - kernel_cg*xc_glx(k,ngx)*dnc_glx(k,ngx)*dng_gly(k,ngy)
5484 kernel_cs = 0.25_rp * pi * (das_gly(k,ngy)+dac_glx(k,ngx))**2 * abs(vts_gly(k,ngy)-vtc_glx(k,ngx)) * e_sc(k)
5485 pac(k,i_nsacnc2ns) = pac(k,i_nsacnc2ns) - kernel_cs *dnc_glx(k,ngx)*dns_gly(k,ngy)
5486 pac(k,i_lsaclc2ls) = pac(k,i_lsaclc2ls) - kernel_cs*xc_glx(k,ngx)*dnc_glx(k,ngx)*dns_gly(k,ngy)
5493 kernel_ci = 0.25_rp * pi * (dai_gly(k,ngy)+dac_glx(k,ngx))**2 * abs(vti_gly(k,ngy)-vtc_glx(k,ngx)) * e_ic(k)
5494 pac(k,i_niacnc2ni) = pac(k,i_niacnc2ni) - kernel_ci *dnc_glx(k,ngx)*dni_gly(k,ngy)
5495 pac(k,i_liaclc2li) = pac(k,i_liaclc2li) - kernel_ci*xc_glx(k,ngx)*dnc_glx(k,ngx)*dni_gly(k,ngy)
5502 kernel_rg = 0.25_rp * pi * (dag_gly(k,ngy)+dar_glx(k,ngx))**2 * abs(vtg_gly(k,ngy)-vtr_glx(k,ngx)) * e_gr
5504 pac(k,i_nracng2ng) = pac(k,i_nracng2ng) - kernel_rg *dnr_glx(k,ngx)*dng_gly(k,ngy)
5505 pac(k,i_lraclg2lg) = pac(k,i_lraclg2lg) - kernel_rg*xr_glx(k,ngx)*dnr_glx(k,ngx)*dng_gly(k,ngy)
5507 pac(k,i_nracng2nr) = pac(k,i_nracng2nr) - kernel_rg *dng_glx(k,ngx)*dnr_gly(k,ngy)
5508 pac(k,i_lraclg2lr) = pac(k,i_lraclg2lr) - kernel_rg*xg_glx(k,ngx)*dng_glx(k,ngx)*dnr_gly(k,ngy)
5515 kernel_rs = 0.25_rp * pi * (das_glx(k,ngx)+dar_gly(k,ngy))**2 * abs(vts_glx(k,ngx)-vtr_gly(k,ngy)) * e_sr
5517 pac(k,i_nracns2ng_r) = pac(k,i_nracns2ng_r) - kernel_rs *dns_glx(k,ngx)*dnr_gly(k,ngy)
5518 pac(k,i_lracls2lg_r) = pac(k,i_lracls2lg_r) - kernel_rs*xr_gly(k,ngy)*dns_glx(k,ngx)*dnr_gly(k,ngy)
5520 pac(k,i_nracns2ng_s) = pac(k,i_nracns2ng_s) - kernel_rs *dns_glx(k,ngx)*dnr_gly(k,ngy)
5521 pac(k,i_lracls2lg_s) = pac(k,i_lracls2lg_s) - kernel_rs*xs_glx(k,ngx)*dns_glx(k,ngx)*dnr_gly(k,ngy)
5528 kernel_ri = 0.25_rp * pi * (dai_glx(k,ngx)+dar_gly(k,ngy))**2 * abs(vti_glx(k,ngx)-vtr_gly(k,ngy)) * e_ir
5530 pac(k,i_nracni2ng_r) = pac(k,i_nracni2ng_r) - kernel_ri *dni_glx(k,ngx)*dnr_gly(k,ngy)
5531 pac(k,i_lracli2lg_r) = pac(k,i_lracli2lg_r) - kernel_ri*xr_gly(k,ngy)*dni_glx(k,ngx)*dnr_gly(k,ngy)
5533 pac(k,i_nracni2ng_i) = pac(k,i_nracni2ng_i) - kernel_ri *dni_glx(k,ngx)*dnr_gly(k,ngy)
5534 pac(k,i_lracli2lg_i) = pac(k,i_lracli2lg_i) - kernel_ri*xi_glx(k,ngx)*dni_glx(k,ngx)*dnr_gly(k,ngy)
5541 kernel_ig = 0.25_rp * pi * (dai_glx(k,ngx)+dag_gly(k,ngy))**2 * abs(vti_glx(k,ngx)-vtg_gly(k,ngy)) * e_stick(k) * e_gi
5542 pac(k,i_niacng2ng) = pac(k,i_niacng2ng) - kernel_ig *dni_glx(k,ngx)*dng_gly(k,ngy)
5543 pac(k,i_liaclg2lg) = pac(k,i_liaclg2lg) - kernel_ig*xi_glx(k,ngx)*dni_glx(k,ngx)*dng_gly(k,ngy)
5550 kernel_is = 0.25_rp * pi * (dai_glx(k,ngx)+das_gly(k,ngy))**2 * abs(vti_glx(k,ngx)-vts_gly(k,ngy)) * e_stick(k) * e_si
5551 pac(k,i_niacns2ns) = pac(k,i_niacns2ns) - kernel_is *dni_glx(k,ngx)*dns_gly(k,ngy)
5552 pac(k,i_liacls2ls) = pac(k,i_liacls2ls) - kernel_is*xi_glx(k,ngx)*dni_glx(k,ngx)*dns_gly(k,ngy)
5559 kernel_ii = 0.25_rp * pi * (dai_glx(k,ngx)+dai_gly(k,ngy))**2 * abs(vti_glx(k,ngx)-vti_gly(k,ngy)) * e_stick(k) * e_ii
5560 pac(k,i_niacni2ns) = pac(k,i_niacni2ns) - kernel_ii *dni_glx(k,ngx)*dni_gly(k,ngy)
5561 pac(k,i_liacli2ls) = pac(k,i_liacli2ls) - kernel_ii*xi_glx(k,ngx)*dni_glx(k,ngx)*dni_gly(k,ngy)
5568 kernel_sg = 0.25_rp * pi * (das_glx(k,ngx)+dag_gly(k,ngy))**2 * abs(vts_glx(k,ngx)-vtg_gly(k,ngy)) * e_stick(k) * e_gs
5569 pac(k,i_ngacns2ng) = pac(k,i_ngacns2ng) - kernel_sg *dns_glx(k,ngx)*dng_gly(k,ngy)
5570 pac(k,i_lgacls2lg) = pac(k,i_lgacls2lg) - kernel_sg*xs_glx(k,ngx)*dns_glx(k,ngx)*dng_gly(k,ngy)
5577 kernel_ss = 0.125_rp * pi * (das_glx(k,ngx)+das_gly(k,ngy))**2 * abs(vts_glx(k,ngx)-vts_gly(k,ngy)) * e_stick(k) * e_ss
5578 pac(k,i_nsacns2ns) = pac(k,i_nsacns2ns) - kernel_ss*dns_glx(k,ngx)*dns_gly(k,ngy)
5585 kernel_gg = 0.125_rp * pi * (dag_glx(k,ngx)+dag_gly(k,ngy))**2 * abs(vtg_glx(k,ngx)-vtg_gly(k,ngy)) * e_stick(k) * e_gg
5586 pac(k,i_ngacng2ng) = pac(k,i_ngacng2ng) - kernel_gg*dng_glx(k,ngx)*dng_gly(k,ngy)
5599 alpha_lt = 5.0_rp * ( das_glx(k,ngx) / d0_crg )**2*vtg_gly(k,ngy)/v0_crg
5600 alpha_lt = min( alpha_lt, 10.0_rp )
5602 kernel_sg_reb = 0.25_rp * pi * (das_glx(k,ngx)+dag_gly(k,ngy))**2 * abs(vts_glx(k,ngx)-vtg_gly(k,ngy)) &
5603 * ( 1.0_rp - e_stick(k) ) * e_gs
5604 pcrg2(k,i_cgngacns2ng) = pcrg2(k,i_cgngacns2ng) + kernel_sg_reb*dns_glx(k,ngx)*dng_gly(k,ngy)*dqcrg(k)*alpha_lt*beta_crg(k)
5613 temc_p = max(tem(k) - t00,0.0_rp)
5619 if ( dq_xave(k,i_mp_qi) > di_cri )
then
5620 wx_cri = cfill_i*rhow/rho_g*( pi/6.0_rp*rho_g*dq_xave(k,i_mp_qi)*dq_xave(k,i_mp_qi)*dq_xave(k,i_mp_qi)/xq(k,i_mp_qi) - 1.0_rp )
5621 pq(k,i_licon) = i_iconv2g* pac(k,i_liaclc2li)/max(1.0_rp, wx_cri)
5622 pq(k,i_nicon) = i_iconv2g* pq(k,i_licon)/xq(k,i_mp_qi)
5625 pq(k,i_licon) = 0.0_rp
5626 pq(k,i_nicon) = 0.0_rp
5629 wx_crs = cfill_s*rhow/rho_g*( pi/6.0_rp*rho_g*dq_xave(k,i_mp_qs)*dq_xave(k,i_mp_qs)*dq_xave(k,i_mp_qs)/xq(k,i_mp_qs) - 1.0_rp )
5630 pq(k,i_lscon) = i_sconv2g* (pac(k,i_lsaclc2ls))/max(1.0_rp, wx_crs)
5631 pq(k,i_nscon) = i_sconv2g* pq(k,i_lscon)/xq(k,i_mp_qs)
5639 coef_emelt = cl/lhf0*temc_p
5641 pq(k,i_lgacm) = coef_emelt*pac(k,i_lgaclc2lg)
5642 pq(k,i_ngacm) = pq(k,i_lgacm)/xq(k,i_mp_qg)
5644 pq(k,i_lgarm) = coef_emelt*pac(k,i_lraclg2lg)
5645 pq(k,i_ngarm) = pq(k,i_lgarm)/xq(k,i_mp_qg)
5647 pq(k,i_lsacm) = coef_emelt*(pac(k,i_lsaclc2ls))
5648 pq(k,i_nsacm) = pq(k,i_lsacm)/xq(k,i_mp_qs)
5650 pq(k,i_lsarm) = coef_emelt*(pac(k,i_lracls2lg_r)+pac(k,i_lracls2lg_s))
5651 pq(k,i_nsarm) = pq(k,i_lsarm)/xq(k,i_mp_qg)
5653 pq(k,i_liacm) = coef_emelt*pac(k,i_liaclc2li)
5654 pq(k,i_niacm) = pq(k,i_liacm)/xq(k,i_mp_qi)
5656 pq(k,i_liarm) = coef_emelt*(pac(k,i_lracli2lg_r)+pac(k,i_lracli2lg_i))
5657 pq(k,i_niarm) = pq(k,i_liarm)/xq(k,i_mp_qg)
5665 sw1 = 0.5_rp - sign( 0.5_rp, rhoq(k,i_nc)-small )
5666 pcrg2(k,i_ngacnc2ng) = pac(k,i_ngacnc2ng)*(1.0_rp-sw1) / (rhoq(k,i_nc)+sw1) * rhoq_crg(k,i_qc)
5671 sw1 = 0.5_rp - sign( 0.5_rp, rhoq(k,i_nc)-small )
5672 pcrg2(k,i_nsacnc2ns) = pac(k,i_nsacnc2ns)*(1.0_rp-sw1) / (rhoq(k,i_nc)+sw1) * rhoq_crg(k,i_qc)
5677 sw1 = 0.5_rp - sign( 0.5_rp, rhoq(k,i_nc)-small )
5678 pcrg2(k,i_niacnc2ni) = pac(k,i_niacnc2ni)*(1.0_rp-sw1) / (rhoq(k,i_nc)+sw1) * rhoq_crg(k,i_qc)
5683 sw1 = 0.5_rp - sign( 0.5_rp, rhoq(k,i_nr)-small )
5684 sw2 = 0.5_rp - sign( 0.5_rp, rhoq(k,i_ng)-small )
5685 pcrg2(k,i_nracng2ng) = pac(k,i_nracng2ng)*(1.0_rp-sw1) / (rhoq(k,i_nr)+sw1) * rhoq_crg(k,i_qr)
5686 pcrg2(k,i_nracng2nr) = pac(k,i_nracng2nr)*(1.0_rp-sw2) / (rhoq(k,i_ng)+sw2) * rhoq_crg(k,i_qg)
5691 sw1 = 0.5_rp - sign( 0.5_rp, rhoq(k,i_nr)-small )
5692 sw2 = 0.5_rp - sign( 0.5_rp, rhoq(k,i_ns)-small )
5693 pcrg2(k,i_nracns2ng_r) = pac(k,i_nracns2ng_r)*(1.0_rp-sw1) / (rhoq(k,i_nr)+sw1) * rhoq_crg(k,i_qr)
5694 pcrg2(k,i_nracns2ng_s) = pac(k,i_nracns2ng_s)*(1.0_rp-sw2) / (rhoq(k,i_ns)+sw2) * rhoq_crg(k,i_qs)
5700 sw1 = 0.5_rp - sign( 0.5_rp, rhoq(k,i_nr)-small )
5701 sw2 = 0.5_rp - sign( 0.5_rp, rhoq(k,i_ni)-small )
5702 pcrg2(k,i_nracni2ng_r) = pac(k,i_nracni2ng_r)*(1.0_rp-sw1) / (rhoq(k,i_nr)+sw1) * rhoq_crg(k,i_qr)
5703 pcrg2(k,i_nracni2ng_i) = pac(k,i_nracni2ng_i)*(1.0_rp-sw2) / (rhoq(k,i_ni)+sw2) * rhoq_crg(k,i_qi)
5708 sw1 = 0.5_rp - sign( 0.5_rp, rhoq(k,i_ni)-small )
5709 pcrg2(k,i_niacng2ng) = pac(k,i_niacng2ng)*(1.0_rp-sw1) / (rhoq(k,i_ni)+sw1) * rhoq_crg(k,i_qi)
5714 sw1 = 0.5_rp - sign( 0.5_rp, rhoq(k,i_ni)-small )
5715 pcrg2(k,i_niacns2ns) = pac(k,i_niacns2ns)*(1.0_rp-sw1) / (rhoq(k,i_ni)+sw1) * rhoq_crg(k,i_qi)
5720 sw1 = 0.5_rp - sign( 0.5_rp, rhoq(k,i_ni)-small )
5721 pcrg2(k,i_niacni2ns) = pac(k,i_niacni2ns)*(1.0_rp-sw1) / (rhoq(k,i_ni)+sw1) * rhoq_crg(k,i_qi)
5726 sw1 = 0.5_rp - sign( 0.5_rp, rhoq(k,i_ns)-small )
5727 pcrg2(k,i_ngacns2ng) = pac(k,i_ngacns2ng)*(1.0_rp-sw1) / (rhoq(k,i_ns)+sw1) * rhoq_crg(k,i_qs)
5732 pcrg2(k,i_nsacns2ns) = 0.0_rp
5737 pcrg2(k,i_ngacng2ng) = 0.0_rp
5743 sw1 = 0.5_rp - sign( 0.5_rp, rhoq(k,i_ni)-small )
5744 pcrg1(k,i_nicon) = pq(k,i_nicon)*(1.0_rp-sw1) / (rhoq(k,i_ni)+sw1) * rhoq_crg(k,i_qi)
5749 sw1 = 0.5_rp - sign( 0.5_rp, rhoq(k,i_ns)-small )
5750 pcrg1(k,i_nscon) = pq(k,i_nscon)*(1.0_rp-sw1) / (rhoq(k,i_ns)+sw1) * rhoq_crg(k,i_qs)
5756 sw1 = 0.5_rp - sign( 0.5_rp, rhoq(k,i_ng)-small )
5757 pcrg1(k,i_ngacm) = pq(k,i_ngacm)*(1.0_rp-sw1) / (rhoq(k,i_ng)+sw1) * rhoq_crg(k,i_qg)
5762 sw1 = 0.5_rp - sign( 0.5_rp, rhoq(k,i_ng)-small )
5763 pcrg1(k,i_ngarm) = pq(k,i_ngarm)*(1.0_rp-sw1) / (rhoq(k,i_ng)+sw1) * rhoq_crg(k,i_qg)
5768 sw1 = 0.5_rp - sign( 0.5_rp, rhoq(k,i_ns)-small )
5769 pcrg1(k,i_nsacm) = pq(k,i_nsacm)*(1.0_rp-sw1) / (rhoq(k,i_ns)+sw1) * rhoq_crg(k,i_qs)
5774 sw1 = 0.5_rp - sign( 0.5_rp, rhoq(k,i_ns)-small )
5775 pcrg1(k,i_nsarm) = pq(k,i_nsarm)*(1.0_rp-sw1) / (rhoq(k,i_ns)+sw1) * rhoq_crg(k,i_qs)
5780 sw1 = 0.5_rp - sign( 0.5_rp, rhoq(k,i_ni)-small )
5781 pcrg1(k,i_niacm) = pq(k,i_niacm)*(1.0_rp-sw1) / (rhoq(k,i_ni)+sw1) * rhoq_crg(k,i_qi)
5786 sw1 = 0.5_rp - sign( 0.5_rp, rhoq(k,i_ni)-small )
5787 pcrg1(k,i_niarm) = pq(k,i_niarm)*(1.0_rp-sw1) / (rhoq(k,i_ni)+sw1) * rhoq_crg(k,i_qi)
5807 integer,
intent(in) :: KA, KS, KE
5809 real(RP),
intent(in) :: rhoq(KA,I_QV:I_NG)
5810 real(RP),
intent(in) :: rhoq_crg(KA,I_QC:I_QG)
5811 logical,
intent(in) :: flg_lt
5812 real(RP),
intent(in) :: xq(KA,HYDRO_MAX)
5813 real(RP),
intent(in) :: dq_xave(KA,HYDRO_MAX)
5814 real(RP),
intent(in) :: rho(KA)
5816 real(RP),
intent(inout) :: PQ(KA,PQ_MAX)
5817 real(RP),
intent(inout) :: Pcrg(KA,PQ_MAX)
5820 real(RP),
parameter :: kcc = 4.44e+9_rp
5821 real(RP),
parameter :: tau_min = 1.e-20_rp
5822 real(RP),
parameter :: rx_sep = 1.0_rp/x_sep
5825 real(RP),
parameter :: kcr = 5.8_rp
5826 real(RP),
parameter :: thr_acc = 5.e-5_rp
5829 real(RP),
parameter :: krr = 4.33_rp
5830 real(RP),
parameter :: kaprr = 60.7_rp
5831 real(RP),
parameter :: kbr = 1000._rp
5832 real(RP),
parameter :: kapbr = 2.3e+3_rp
5833 real(RP),
parameter :: dr_min = 0.35e-3_rp
5836 real(RP) :: coef_nuc0
5837 real(RP) :: coef_nuc1
5838 real(RP) :: coef_aut0
5839 real(RP) :: coef_aut1
5851 coef_nuc0 = (nu(i_mp_qc)+2.0_rp)/(nu(i_mp_qc)+1.0_rp)
5852 coef_nuc1 = (nu(i_mp_qc)+2.0_rp)*(nu(i_mp_qc)+4.0_rp)/(nu(i_mp_qc)+1.0_rp)/(nu(i_mp_qc)+1.0_rp)
5853 coef_aut0 = -kcc*coef_nuc0
5854 coef_aut1 = -kcc/x_sep/20._rp*coef_nuc1
5858 lwc = rhoq(k,i_qr) + rhoq(k,i_qc)
5859 if( lwc > xc_min )
then
5860 tau = max(tau_min, rhoq(k,i_qr)/lwc)
5864 rho_fac = sqrt(rho_0/max(rho(k),rho_min))
5867 psi_aut = 400._rp*(tau**0.7_rp)*(1.0_rp - (tau**0.7_rp))**3
5868 pq(k,i_ncaut) = coef_aut0*rhoq(k,i_qc)*rhoq(k,i_qc)*rho_fac*rho_fac
5870 pq(k,i_lcaut) = coef_aut1*lwc*lwc*xq(k,i_mp_qc)*xq(k,i_mp_qc) &
5871 *((1.0_rp-tau)*(1.0_rp-tau) + psi_aut)*rho_fac*rho_fac
5872 pq(k,i_nraut) = -rx_sep*pq(k,i_lcaut)
5875 sw = 0.5_rp - sign( 0.5_rp, rhoq(k,i_nc)-small )
5876 pcrg(k,i_ncaut) = pq(k,i_ncaut)*(1.0_rp-sw)/(rhoq(k,i_nc)+sw)*rhoq_crg(k,i_qc)
5877 pcrg(k,i_nraut) = -pcrg(k,i_ncaut)
5881 psi_acc =(tau/(tau+thr_acc))**4
5882 pq(k,i_lcacc) = -kcr*rhoq(k,i_qc)*rhoq(k,i_qr)*rho_fac*psi_acc
5883 pq(k,i_ncacc) = -kcr*rhoq(k,i_nc)*rhoq(k,i_qr)*rho_fac*psi_acc
5886 sw = 0.5_rp - sign( 0.5_rp, rhoq(k,i_nc)-small )
5887 pcrg(k,i_ncacc) = pq(k,i_ncacc)*(1.0_rp-sw)/(rhoq(k,i_nc)+sw)*rhoq(k,i_qc)
5891 pq(k,i_nrslc) = -krr*rhoq(k,i_nr)*rhoq(k,i_qr)*rho_fac
5894 ddr = min(1.e-3_rp, dq_xave(k,i_mp_qr) - dr_eq )
5895 if ( dq_xave(k,i_mp_qr) < dr_min )
then
5897 else if ( dq_xave(k,i_mp_qr) <= dr_eq )
then
5900 psi_brk = exp(kapbr*ddr) - 1.0_rp
5902 pq(k,i_nrbrk) = - (psi_brk + 1.0_rp)*pq(k,i_nrslc)
5911 subroutine dep_vapor_melt_ice( &
5913 rho, tem, pre, qd, & ! in
5916 xq, vt_xave, dq_xave, & ! in
5922 integer,
intent(in) :: KA, KS, KE
5925 real(RP),
intent(inout) :: PQ(KA,PQ_MAX)
5927 real(RP),
intent(in) :: rho(KA)
5928 real(RP),
intent(in) :: tem(KA)
5929 real(RP),
intent(in) :: pre(KA)
5930 real(RP),
intent(in) :: qd (KA)
5931 real(RP),
intent(in) :: esw(KA)
5932 real(RP),
intent(in) :: esi(KA)
5933 real(RP),
intent(in) :: rhoq(KA,I_QV:I_NG)
5934 real(RP),
intent(in) :: xq(KA,HYDRO_MAX)
5938 real(RP),
intent(in) :: vt_xave(KA,HYDRO_MAX,2)
5940 real(RP),
intent(in) :: dq_xave(KA,HYDRO_MAX)
5943 real(RP) :: temc_lim
5950 real(RP) :: nua, r_nua
5952 real(RP) :: Kalfa(KA)
5956 real(RP) :: Gwr, Gii, Gis, Gig
5961 real(RP) :: Nrers_r2, Nreis_r2
5962 real(RP) :: Nress_r2, Nregs_r2
5964 real(RP) :: Nrerl_r2, Nreil_r2
5965 real(RP) :: Nresl_r2, Nregl_r2
5966 real(RP) :: NscNrer_s, NscNrer_l
5967 real(RP) :: NscNrei_s, NscNrei_l
5968 real(RP) :: NscNres_s, NscNres_l
5969 real(RP) :: NscNreg_s, NscNreg_l
5970 real(RP) :: ventLR_s, ventLR_l
5971 real(RP) :: ventNI_s, ventNI_l, ventLI_s, ventLI_l
5972 real(RP) :: ventNS_s, ventNS_l, ventLS_s, ventLS_l
5973 real(RP) :: ventNG_s, ventNG_l, ventLG_s, ventLG_l
5975 real(RP) :: wtr, wti, wts, wtg
5976 real(RP),
parameter :: r_14=1.0_rp/1.4_rp
5977 real(RP),
parameter :: r_15=1.0_rp/1.5_rp
5980 real(RP) :: ventNI(KA), ventLI(KA)
5981 real(RP) :: ventNS(KA), ventLS(KA)
5982 real(RP) :: ventNG(KA), ventLG(KA)
5984 real(RP),
parameter :: Re_max=1.e+3_rp
5985 real(RP),
parameter :: Re_min=1.e-4_rp
6000 temc_lim= max(temc, -40._rp )
6001 rho_lim = max(rho(k),rho_min)
6002 qv = rhoq(k,i_qv)/rho_lim
6003 pre_lim = rho_lim*(qd(k)*rdry + qv*rvap)*(temc_lim+t00)
6011 dw(k) = 0.211e-4_rp* (((temc_lim+t00)/t00)**1.94_rp) *(p00/pre_lim)
6012 kalfa(k) = ka0 + temc_lim*dka_dt
6013 mua = mua0 + temc_lim*dmua_dt
6016 gw = (lhv0/kalfa(k)/tem(k))*(lhv0/rvap/tem(k)-1.0_rp)+(rvap*tem(k)/dw(k)/esw(k))
6017 gi = (lhs0/kalfa(k)/tem(k))*(lhs0/rvap/tem(k)-1.0_rp)+(rvap*tem(k)/dw(k)/esi(k))
6019 gwr = 4.0_rp*pi/cap(i_mp_qr)/gw
6020 gii = 4.0_rp*pi/cap(i_mp_qi)/gi
6021 gis = 4.0_rp*pi/cap(i_mp_qs)/gi
6022 gig = 4.0_rp*pi/cap(i_mp_qg)/gi
6025 nsc_r3 = (nua/dw(k))**(0.33333333_rp)
6028 nrers_r2 = sqrt(max(re_min,min(re_max,vt_xave(k,i_mp_qr,1)*dq_xave(k,i_mp_qr)*r_nua)))
6029 nreis_r2 = sqrt(max(re_min,min(re_max,vt_xave(k,i_mp_qi,1)*dq_xave(k,i_mp_qi)*r_nua)))
6030 nress_r2 = sqrt(max(re_min,min(re_max,vt_xave(k,i_mp_qs,1)*dq_xave(k,i_mp_qs)*r_nua)))
6031 nregs_r2 = sqrt(max(re_min,min(re_max,vt_xave(k,i_mp_qg,1)*dq_xave(k,i_mp_qg)*r_nua)))
6034 nrerl_r2 = sqrt(max(re_min,min(re_max,vt_xave(k,i_mp_qr,2)*dq_xave(k,i_mp_qr)*r_nua)))
6035 nreil_r2 = sqrt(max(re_min,min(re_max,vt_xave(k,i_mp_qi,2)*dq_xave(k,i_mp_qi)*r_nua)))
6036 nresl_r2 = sqrt(max(re_min,min(re_max,vt_xave(k,i_mp_qs,2)*dq_xave(k,i_mp_qs)*r_nua)))
6037 nregl_r2 = sqrt(max(re_min,min(re_max,vt_xave(k,i_mp_qg,2)*dq_xave(k,i_mp_qg)*r_nua)))
6038 nscnrer_s=nsc_r3*nrers_r2
6039 nscnrer_l=nsc_r3*nrerl_r2
6041 nscnrei_s=nsc_r3*nreis_r2
6042 nscnrei_l=nsc_r3*nreil_r2
6044 nscnres_s=nsc_r3*nress_r2
6045 nscnres_l=nsc_r3*nresl_r2
6047 nscnreg_s=nsc_r3*nregs_r2
6048 nscnreg_l=nsc_r3*nregl_r2
6050 ventlr_s = ah_vent1(i_mp_qr,1) + bh_vent1(i_mp_qr,1)*nscnrer_s
6051 ventlr_l = ah_vent1(i_mp_qr,2) + bh_vent1(i_mp_qr,2)*nscnrer_l
6053 ventni_s = ah_vent0(i_mp_qi,1) + bh_vent0(i_mp_qi,1)*nscnrei_s
6054 ventni_l = ah_vent0(i_mp_qi,2) + bh_vent0(i_mp_qi,2)*nscnrei_l
6055 ventli_s = ah_vent1(i_mp_qi,1) + bh_vent1(i_mp_qi,1)*nscnrei_s
6056 ventli_l = ah_vent1(i_mp_qi,2) + bh_vent1(i_mp_qi,2)*nscnrei_l
6058 ventns_s = ah_vent0(i_mp_qs,1) + bh_vent0(i_mp_qs,1)*nscnres_s
6059 ventns_l = ah_vent0(i_mp_qs,2) + bh_vent0(i_mp_qs,2)*nscnres_l
6060 ventls_s = ah_vent1(i_mp_qs,1) + bh_vent1(i_mp_qs,1)*nscnres_s
6061 ventls_l = ah_vent1(i_mp_qs,2) + bh_vent1(i_mp_qs,2)*nscnres_l
6063 ventng_s = ah_vent0(i_mp_qg,1) + bh_vent0(i_mp_qg,1)*nscnreg_s
6064 ventng_l = ah_vent0(i_mp_qg,2) + bh_vent0(i_mp_qg,2)*nscnreg_l
6065 ventlg_s = ah_vent1(i_mp_qg,1) + bh_vent1(i_mp_qg,1)*nscnreg_s
6066 ventlg_l = ah_vent1(i_mp_qg,2) + bh_vent1(i_mp_qg,2)*nscnreg_l
6070 wtr = ( min(max( nscnrer_s*r_14, 0.5_rp), 2.0_rp) -0.5_rp )*r_15
6071 wti = ( min(max( nscnrei_s , 0.5_rp), 2.0_rp) -0.5_rp )*r_15
6072 wts = ( min(max( nscnres_s*r_14, 0.5_rp), 2.0_rp) -0.5_rp )*r_15
6073 wtg = ( min(max( nscnreg_s*r_14, 0.5_rp), 2.0_rp) -0.5_rp )*r_15
6075 ventni(k) = (1.0_rp-wti)*ventni_s + wti*ventni_l
6076 ventns(k) = (1.0_rp-wts)*ventns_s + wts*ventns_l
6077 ventng(k) = (1.0_rp-wtg)*ventng_s + wtg*ventng_l
6079 ventlr = (1.0_rp-wtr)*ventlr_s + wtr*ventlr_l
6080 ventli(k) = (1.0_rp-wti)*ventli_s + wti*ventli_l
6081 ventls(k) = (1.0_rp-wts)*ventls_s + wts*ventls_l
6082 ventlg(k) = (1.0_rp-wtg)*ventlg_s + wtg*ventlg_l
6101 pq(k,i_lcdep) = gwr*rhoq(k,i_nc)*dq_xave(k,i_mp_qc)*coef_deplc
6102 pq(k,i_lrdep) = gwr*rhoq(k,i_nr)*dq_xave(k,i_mp_qr)*ventlr
6103 pq(k,i_lidep) = gii*rhoq(k,i_ni)*dq_xave(k,i_mp_qi)*ventli(k)
6104 pq(k,i_lsdep) = gis*rhoq(k,i_ns)*dq_xave(k,i_mp_qs)*ventls(k)
6105 pq(k,i_lgdep) = gig*rhoq(k,i_ng)*dq_xave(k,i_mp_qg)*ventlg(k)
6106 pq(k,i_nrdep) = pq(k,i_lrdep)/xq(k,i_mp_qr)
6107 pq(k,i_nidep) = 0.0_rp
6108 pq(k,i_nsdep) = pq(k,i_lsdep)/xq(k,i_mp_qs)
6109 pq(k,i_ngdep) = pq(k,i_lgdep)/xq(k,i_mp_qg)
6120 dt = kalfa(k)/(cpvap*rho_0)
6126 gm = 2.0_rp*pi/emelt&
6127 * ( (kalfa(k)*dt/dw(k))*(temc) + (dw(k)*lhs0/rvap)*(esi(k)/tem(k)-psat0/t00) )
6132 sw = ( sign(0.5_rp,temc) + 0.5_rp ) * ( sign(0.5_rp,gm-eps) + 0.5_rp )
6136 pq(k,i_limlt) = - gm * rhoq(k,i_qi)*dq_xave(k,i_mp_qi)*ventli(k)/xq(k,i_mp_qi) * sw
6137 pq(k,i_nimlt) = - gm * rhoq(k,i_ni)*dq_xave(k,i_mp_qi)*ventni(k)/xq(k,i_mp_qi) * sw
6138 pq(k,i_lsmlt) = - gm * rhoq(k,i_qs)*dq_xave(k,i_mp_qs)*ventls(k)/xq(k,i_mp_qs) * sw
6139 pq(k,i_nsmlt) = - gm * rhoq(k,i_ns)*dq_xave(k,i_mp_qs)*ventns(k)/xq(k,i_mp_qs) * sw
6140 pq(k,i_lgmlt) = - gm * rhoq(k,i_qg)*dq_xave(k,i_mp_qg)*ventlg(k)/xq(k,i_mp_qg) * sw
6141 pq(k,i_ngmlt) = - gm * rhoq(k,i_ng)*dq_xave(k,i_mp_qg)*ventng(k)/xq(k,i_mp_qg) * sw
6145 end subroutine dep_vapor_melt_ice
6171 integer,
intent(in) :: KA
6172 integer,
intent(in) :: KS
6173 integer,
intent(in) :: KE
6175 real(RP),
intent(out) :: PLIdep_total(KA)
6176 real(RP),
intent(in) :: rho(KA)
6177 real(RP),
intent(in) :: tem(KA)
6178 real(RP),
intent(in) :: pre(KA)
6179 real(RP),
intent(in) :: qd(KA)
6180 real(RP),
intent(in) :: esi(KA)
6181 real(RP),
intent(in) :: qsi(KA)
6182 real(RP),
intent(in) :: rhoq(KA,I_QV:I_NG)
6186 real(RP),
intent(in) :: vt_xave(KA,HYDRO_MAX,1:2)
6187 real(RP),
intent(in) :: dq_xave(KA,HYDRO_MAX)
6188 real(RP),
intent(in) :: dt
6194 real(RP) :: temc_lim
6200 real(RP) :: nua, r_nua
6206 real(RP) :: Gii, Gis, Gig
6210 real(RP) :: Nreis_r2
6211 real(RP) :: Nress_r2, Nregs_r2
6212 real(RP) :: Nreil_r2
6213 real(RP) :: Nresl_r2, Nregl_r2
6214 real(RP) :: NscNrei_s, NscNrei_l
6215 real(RP) :: NscNres_s, NscNres_l
6216 real(RP) :: NscNreg_s, NscNreg_l
6217 real(RP) :: ventLI_s, ventLI_l
6218 real(RP) :: ventLS_s, ventLS_l
6219 real(RP) :: ventLG_s, ventLG_l
6220 real(RP) :: wti, wts, wtg
6221 real(RP),
parameter :: r_14=1.0_rp/1.4_rp
6222 real(RP),
parameter :: r_15=1.0_rp/1.5_rp
6227 real(RP) :: total_dep
6228 real(RP) :: PLIdep_wrk
6229 real(RP) :: PLSdep_wrk
6230 real(RP) :: PLGdep_wrk
6231 real(RP) :: dep_limiter
6233 real(RP),
parameter :: Re_max=1.e3_rp
6234 real(RP),
parameter :: Re_min=1.e-4_rp
6239 plidep_total(:)=0.0_rp
6244 temc_lim= max(temc, temc_lim_diff)
6245 rho_lim = max(rho(k),rho_min)
6246 qv = rhoq(k,i_qv)/rho_lim
6247 pre_lim = rho_lim*(qd(k)*rdry + qv*rvap)*(temc_lim+t00)
6254 dw = 0.211e-4_rp* (((temc_lim+t00)/t00)**1.94_rp) *(pstd/pre_lim)
6255 kat = ka0 + temc_lim*dka_dt
6256 mua = mua0 + temc_lim*dmua_dt
6259 gi = (lhs0/kat/tem(k))*(lhs0/rvap/tem(k)-1.0_rp)+(rvap*tem(k)/dw/esi(k))
6261 gii = 4.0_rp*pi/cap(i_mp_qi)/gi
6262 gis = 4.0_rp*pi/cap(i_mp_qs)/gi
6263 gig = 4.0_rp*pi/cap(i_mp_qg)/gi
6266 nsc_r3 = (nua/dw)**(0.33333333_rp)
6269 nreis_r2 = sqrt(max(re_min,min(re_max,vt_xave(k,i_mp_qi,1)*dq_xave(k,i_mp_qi)*r_nua)))
6270 nress_r2 = sqrt(max(re_min,min(re_max,vt_xave(k,i_mp_qs,1)*dq_xave(k,i_mp_qs)*r_nua)))
6271 nregs_r2 = sqrt(max(re_min,min(re_max,vt_xave(k,i_mp_qg,1)*dq_xave(k,i_mp_qg)*r_nua)))
6272 nreil_r2 = sqrt(max(re_min,min(re_max,vt_xave(k,i_mp_qi,2)*dq_xave(k,i_mp_qi)*r_nua)))
6273 nresl_r2 = sqrt(max(re_min,min(re_max,vt_xave(k,i_mp_qs,2)*dq_xave(k,i_mp_qs)*r_nua)))
6274 nregl_r2 = sqrt(max(re_min,min(re_max,vt_xave(k,i_mp_qg,2)*dq_xave(k,i_mp_qg)*r_nua)))
6276 nscnrei_s=nsc_r3*nreis_r2
6277 nscnrei_l=nsc_r3*nreil_r2
6278 nscnres_s=nsc_r3*nress_r2
6279 nscnres_l=nsc_r3*nresl_r2
6280 nscnreg_s=nsc_r3*nregs_r2
6281 nscnreg_l=nsc_r3*nregl_r2
6283 ventli_s = ah_vent1(i_mp_qi,1) + bh_vent1(i_mp_qi,1)*nscnrei_s
6284 ventli_l = ah_vent1(i_mp_qi,2) + bh_vent1(i_mp_qi,2)*nscnrei_l
6285 ventls_s = ah_vent1(i_mp_qs,1) + bh_vent1(i_mp_qs,1)*nscnres_s
6286 ventls_l = ah_vent1(i_mp_qs,2) + bh_vent1(i_mp_qs,2)*nscnres_l
6287 ventlg_s = ah_vent1(i_mp_qg,1) + bh_vent1(i_mp_qg,1)*nscnreg_s
6288 ventlg_l = ah_vent1(i_mp_qg,2) + bh_vent1(i_mp_qg,2)*nscnreg_l
6290 wti = ( min(max( nscnrei_s , 0.5_rp), 2.0_rp) -0.5_rp )*r_15
6291 wts = ( min(max( nscnres_s*r_14, 0.5_rp), 2.0_rp) -0.5_rp )*r_15
6292 wtg = ( min(max( nscnreg_s*r_14, 0.5_rp), 2.0_rp) -0.5_rp )*r_15
6294 ventli = (1.0_rp-wti)*ventli_s + wti*ventli_l
6295 ventls = (1.0_rp-wts)*ventls_s + wts*ventls_l
6296 ventlg = (1.0_rp-wtg)*ventlg_s + wtg*ventlg_l
6298 ssi = qv/qsi(k) - 1.0_rp
6299 plidep_wrk = gii*ssi*max(rhoq(k,i_ni),0.0_rp)*dq_xave(k,i_mp_qi)*ventli
6300 plsdep_wrk = gis*ssi*max(rhoq(k,i_ns),0.0_rp)*dq_xave(k,i_mp_qs)*ventls
6301 plgdep_wrk = gig*ssi*max(rhoq(k,i_ng),0.0_rp)*dq_xave(k,i_mp_qg)*ventlg
6303 dep_limiter = rho(k)*(qv-qsi(k))/dt
6304 if (ssi < -1.e-30_rp)
then
6305 plidep_total(k) = max(plidep_wrk+plsdep_wrk+plgdep_wrk, dep_limiter)
6306 else if (ssi > 1.e-30_rp)
then
6307 plidep_total(k) = min(plidep_wrk+plsdep_wrk+plgdep_wrk, dep_limiter)
6309 plidep_total(k) = 0.0_rp
6328 integer,
intent(in) :: KA, KS, KE
6330 real(RP),
intent(in) :: dt
6332 real(RP),
intent(in) :: tem(KA)
6334 real(RP),
intent(in) :: rhoq(KA,I_QV:I_NG)
6335 real(RP),
intent(in) :: xq(KA,HYDRO_MAX)
6337 real(RP),
intent(inout):: PQ(KA,PQ_MAX)
6339 real(RP),
parameter :: temc_min = -65.0_rp
6340 real(RP),
parameter :: a_het = 0.2_rp
6341 real(RP),
parameter :: b_het = 0.65_rp
6343 real(RP) :: coef_m2_c
6344 real(RP) :: coef_m2_r
6346 real(RP) :: temc, temc2, temc3, temc4
6348 real(RP) :: Jhom, Jhet, Jh(KA)
6356 coef_m2_c = coef_m2(i_mp_qc)
6357 coef_m2_r = coef_m2(i_mp_qr)
6369 pq(k,i_lchom) = 0.0_rp
6370 pq(k,i_nchom) = 0.0_rp
6375 temc = max( tem(k) - t00, temc_min )
6378 jhet = a_het*( exp( -b_het*temc ) - 1.0_rp )
6381 if( temc < -30.0_rp )
then
6386 - 243.40_rp - 14.75_rp*temc - 0.307_rp*temc2 &
6387 - 0.00287_rp*temc3 - 0.0000102_rp*temc4 ) *1.e+3_rp
6388 else if( temc < 0.0_rp)
then
6389 jhom = 10._rp**(-7.63_rp-2.996_rp*(temc+30.0_rp))*1.e+3_rp
6394 jh(k) = ( jhet + jhom ) * dt
6398 #if defined(NVIDIA) || defined(SX)
6399 tmp = min( xq(k,i_mp_qc)*jh(k), 1.e+3_rp)
6400 pq(k,i_lchet) = -rdt*rhoq(k,i_qc)*( 1.0_rp - exp( -coef_m2_c*tmp ) )
6401 pq(k,i_nchet) = -rdt*rhoq(k,i_nc)*( 1.0_rp - exp( - tmp ) )
6403 tmp = min( xq(k,i_mp_qr)*jh(k), 1.e+3_rp)
6404 pq(k,i_lrhet) = -rdt*rhoq(k,i_qr)*( 1.0_rp - exp( -coef_m2_r*tmp ) )
6405 pq(k,i_nrhet) = -rdt*rhoq(k,i_nr)*( 1.0_rp - exp( - tmp ) )
6407 pq(k,i_lchet) = -rdt*rhoq(k,i_qc)*( 1.0_rp - exp( -coef_m2_c*xq(k,i_mp_qc)*jh(k) ) )
6408 pq(k,i_nchet) = -rdt*rhoq(k,i_nc)*( 1.0_rp - exp( - xq(k,i_mp_qc)*jh(k) ) )
6409 pq(k,i_lrhet) = -rdt*rhoq(k,i_qr)*( 1.0_rp - exp( -coef_m2_r*xq(k,i_mp_qr)*jh(k) ) )
6410 pq(k,i_nrhet) = -rdt*rhoq(k,i_nr)*( 1.0_rp - exp( - xq(k,i_mp_qr)*jh(k) ) )
6420 subroutine update_by_phase_change( &
6430 esw, esi, rhoq, & ! in
6435 sl_PLCdep, & ! inout
6436 sl_PLRdep, sl_PNRdep, & ! inout
6441 qc_evaporate, & ! out
6442 rhoq_crg, & ! in:optional
6453 moist_pres2qsat_liq => atmos_saturation_pres2qsat_liq, &
6454 moist_pres2qsat_ice => atmos_saturation_pres2qsat_ice, &
6455 moist_dqs_dtem_dens_liq => atmos_saturation_dqs_dtem_dens_liq, &
6456 moist_dqs_dtem_dens_ice => atmos_saturation_dqs_dtem_dens_ice, &
6457 moist_dqs_dtem_dpre_liq => atmos_saturation_dqs_dtem_dpre_liq, &
6458 moist_dqs_dtem_dpre_ice => atmos_saturation_dqs_dtem_dpre_ice
6461 integer,
intent(in) :: KA, KS, KE
6463 integer,
intent(in) :: ntmax
6465 real(RP),
intent(in) :: dt
6466 real(RP),
intent(in) :: cz(KA)
6467 real(RP),
intent(in) :: fz(0:KA)
6468 real(RP),
intent(in) :: w (KA)
6469 real(RP),
intent(in) :: dTdt_rad(KA)
6470 real(RP),
intent(in) :: rho (KA)
6471 real(RP),
intent(in) :: qdry(KA)
6472 real(RP),
intent(in) :: esw (KA)
6473 real(RP),
intent(in) :: esi (KA)
6474 real(RP),
intent(in) :: rhoq(KA,I_QV:I_NG)
6476 real(RP),
intent(in) :: tem(KA)
6477 real(RP),
intent(in) :: pre(KA)
6478 real(RP),
intent(in) :: cpa(KA)
6479 real(RP),
intent(in) :: cva(KA)
6482 real(RP),
intent(inout) :: PQ(KA,PQ_MAX)
6484 real(RP),
intent(inout) :: sl_PLCdep
6485 real(RP),
intent(inout) :: sl_PLRdep, sl_PNRdep
6487 real(RP),
intent(out) :: RHOQ_t(KA,QA_MP)
6488 real(RP),
intent(out) :: RHOE_t(KA)
6489 real(RP),
intent(out) :: CPtot_t(KA)
6490 real(RP),
intent(out) :: CVtot_t(KA)
6493 real(RP),
intent(out) :: qc_evaporate(KA)
6496 logical,
intent(in) :: flg_lt
6497 real(RP),
intent(in),
optional :: rhoq_crg(KA,I_QC:I_QG)
6498 real(RP),
intent(out),
optional :: RHOQcrg_t(KA,I_QC:I_QG)
6502 real(RP) :: wtem(KA)
6509 real(RP) :: dqswdtem_rho(KA)
6510 real(RP) :: dqsidtem_rho(KA)
6511 real(RP) :: dqswdtem_pre(KA)
6512 real(RP) :: dqsidtem_pre(KA)
6513 real(RP) :: dqswdpre_tem(KA)
6514 real(RP) :: dqsidpre_tem(KA)
6519 real(RP) :: aliqliq, asolliq
6520 real(RP) :: aliqsol, asolsol
6525 real(RP) :: taucnd, r_taucnd
6526 real(RP) :: taudep, r_taudep
6527 real(RP) :: taucnd_c(KA), r_taucnd_c
6528 real(RP) :: taucnd_r(KA), r_taucnd_r
6529 real(RP) :: taudep_i(KA), r_taudep_i
6530 real(RP) :: taudep_s(KA), r_taudep_s
6531 real(RP) :: taudep_g(KA), r_taudep_g
6534 real(RP) :: PLR2NR, PLI2NI, PLS2NS, PLG2NG
6535 real(RP) :: coef_a_cnd, coef_b_cnd
6536 real(RP) :: coef_a_dep, coef_b_dep
6539 real(RP) :: frz_dnc(KA)
6541 real(RP) :: frz_dnr(KA)
6543 real(RP) :: mlt_dni(KA)
6545 real(RP) :: mlt_dns(KA)
6547 real(RP) :: mlt_dng(KA)
6549 real(RP) :: dep_dqi(KA)
6550 real(RP) :: dep_dni(KA)
6551 real(RP) :: dep_dqs(KA)
6552 real(RP) :: dep_dns(KA)
6553 real(RP) :: dep_dqg(KA)
6554 real(RP) :: dep_dng(KA)
6555 real(RP) :: dep_dqr(KA)
6556 real(RP) :: dep_dnr(KA)
6557 real(RP) :: dep_dqc(KA)
6558 real(RP) :: dep_dnc(KA)
6559 real(RP) :: r_xc_ccn, r_xi_ccn
6561 real(RP) :: drhoqv(KA)
6562 real(RP) :: drhoqc(KA), drhoqr(KA), drhoqi(KA), drhoqs(KA), drhoqg(KA)
6563 real(RP) :: drhonc(KA), drhonr(KA), drhoni(KA), drhons(KA), drhong(KA)
6565 real(RP) :: drhoqcrg_c(KA), drhoqcrg_r(KA)
6566 real(RP) :: drhoqcrg_i(KA), drhoqcrg_s(KA), drhoqcrg_g(KA)
6567 real(RP) :: frz_dnc_crg
6568 real(RP) :: frz_dnr_crg
6569 real(RP) :: mlt_dni_crg
6570 real(RP) :: mlt_dns_crg
6571 real(RP) :: mlt_dng_crg
6572 real(RP) :: dep_dni_crg
6573 real(RP) :: dep_dns_crg
6574 real(RP) :: dep_dng_crg
6575 real(RP) :: dep_dnr_crg
6576 real(RP) :: dep_dnc_crg
6578 real(RP) :: fac1, fac2, fac3, fac4, fac5, fac6
6579 real(RP) :: r_rvaptem(KA)
6581 real(RP) :: lvsw, lvsi
6582 real(RP) :: dlvsw, dlvsi
6584 real(RP) :: dcnd, ddep
6585 real(RP) :: uplim_cnd
6586 real(RP) :: lowlim_cnd
6588 real(RP) :: uplim_dep
6589 real(RP) :: lowlim_dep
6590 real(RP) :: ssw, ssi
6591 real(RP) :: r_esw, r_esi
6592 real(RP) :: r_lvsw, r_lvsi
6594 real(RP) :: ssw_o, ssi_o
6601 real(RP) :: fac_cndc_wrk
6603 real(RP),
parameter :: tau100day = 1.e+7_rp
6604 real(RP),
parameter :: r_tau100day = 1.e-7_rp
6605 real(RP),
parameter :: eps=1.e-30_rp
6607 real(RP) :: PLCdep(KA), PLRdep(KA), PNRdep(KA)
6612 real(RP) :: dqv, dql, dqi
6613 real(RP) :: dcv, dcp
6614 real(RP) :: dqc_crg, dqr_crg, dqi_crg, dqs_crg, dqg_crg
6624 r_xc_ccn=1.0_rp/xc_ccn
6627 if( opt_fix_taucnd_c )
then
6628 fac_cndc_wrk = fac_cndc**(1.0_rp-b_m(i_mp_qc))
6630 pq(k,i_lcdep) = pq(k,i_lcdep)*fac_cndc_wrk
6632 log_info(
"ATMOS_PHY_MP_SN14_update_by_phase_change",*)
"taucnd:fac_cndc_wrk=",fac_cndc_wrk
6639 wtem(k) = max( tem(k), tem_min )
6642 call moist_pres2qsat_liq( ka, ks, ke, &
6643 wtem(:), pre(:), qdry(:), &
6645 call moist_pres2qsat_ice( ka, ks, ke, &
6646 wtem(:), pre(:), qdry(:), &
6648 call moist_dqs_dtem_dens_liq( ka, ks, ke, &
6651 call moist_dqs_dtem_dens_ice( ka, ks, ke, &
6654 call moist_dqs_dtem_dpre_liq( ka, ks, ke, &
6655 wtem(:), pre(:), qdry(:), &
6656 dqswdtem_pre(:), dqswdpre_tem(:) )
6657 call moist_dqs_dtem_dpre_ice( ka, ks, ke, &
6658 wtem(:), pre(:), qdry(:), &
6659 dqsidtem_pre(:), dqsidpre_tem(:) )
6662 if( cz(k) <= 25000.0_rp )
then
6667 if( pre(k) < esw(k)+1.e-10_rp )
then
6669 dqswdtem_rho(k) = 0.0_rp
6670 dqswdtem_pre(k) = 0.0_rp
6671 dqswdpre_tem(k) = 0.0_rp
6673 if( pre(k) < esi(k)+1.e-10_rp )
then
6675 dqsidtem_rho(k) = 0.0_rp
6676 dqsidtem_pre(k) = 0.0_rp
6677 dqsidpre_tem(k) = 0.0_rp
6683 r_rvaptem(k) = 1.0_rp/(rvap*wtem(k))
6684 lvsw = esw(k)*r_rvaptem(k)
6685 lvsi = esi(k)*r_rvaptem(k)
6686 pv = rhoq(k,i_qv)*rvap*tem(k)
6687 r_esw = 1.0_rp/esw(k)
6688 r_esi = 1.0_rp/esi(k)
6689 ssw = min( mp_ssw_lim, ( pv*r_esw-1.0_rp ) )
6690 ssi = pv*r_esi - 1.0_rp
6691 r_lvsw = 1.0_rp/lvsw
6692 r_lvsi = 1.0_rp/lvsi
6693 r_taucnd_c = pq(k,i_lcdep)*r_lvsw
6694 r_taucnd_r = pq(k,i_lrdep)*r_lvsw
6695 r_taudep_i = pq(k,i_lidep)*r_lvsi
6696 r_taudep_s = pq(k,i_lsdep)*r_lvsi
6697 r_taudep_g = pq(k,i_lgdep)*r_lvsi
6704 r_cva = 1.0_rp / cva(k)
6705 r_cpa = 1.0_rp / cpa(k)
6709 + r_cva*( lhv00 + (cvvap-cl)*tem(k) )*dqswdtem_rho(k)
6712 + r_cva*( lhv00 + lhf00 + (cvvap-ci)*tem(k) )*dqswdtem_rho(k)
6715 + r_cva*( lhv00 + (cvvap-cl)*tem(k) )*dqsidtem_rho(k)
6718 + r_cva*( lhv00 + lhf00 + (cvvap-ci)*tem(k) )*dqsidtem_rho(k)
6719 pdynliq = w2(k) * grav * ( r_cpa*dqswdtem_pre(k) + rho(k)*dqswdpre_tem(k) )
6720 pdynsol = w2(k) * grav * ( r_cpa*dqsidtem_pre(k) + rho(k)*dqsidpre_tem(k) )
6721 pradliq = -dtdt_rad(k) * dqswdtem_rho(k)
6722 pradsol = -dtdt_rad(k) * dqsidtem_rho(k)
6730 + aliqliq*( r_taucnd_c+r_taucnd_r ) &
6731 + asolliq*( r_taudep_i+r_taudep_s+r_taudep_g )
6733 + aliqsol*( r_taucnd_c+r_taucnd_r )&
6734 + asolsol*( r_taudep_i+r_taudep_s+r_taudep_g )
6736 if( r_taucnd < r_tau100day )
then
6737 uplim_cnd = max( rho(k)*ssw_o*qsw(k)*r_dt, 0.0_rp )
6738 lowlim_cnd = min( rho(k)*ssw_o*qsw(k)*r_dt, 0.0_rp )
6740 pq(k,i_lcdep) = max(lowlim_cnd, min(uplim_cnd, pq(k,i_lcdep)*ssw_o ))
6741 pq(k,i_lrdep) = max(lowlim_cnd, min(uplim_cnd, pq(k,i_lrdep)*ssw_o ))
6742 pq(k,i_nrdep) = min(0.0_rp, pq(k,i_nrdep)*ssw_o )
6745 acnd = pdynliq + pradliq &
6746 - ( r_taudep_i+r_taudep_s+r_taudep_g ) * ( qsw(k) - qsi(k) )
6747 taucnd = 1.0_rp/r_taucnd
6749 coef_a_cnd = rho(k)*acnd*taucnd
6750 coef_b_cnd = rho(k)*taucnd*r_dt*(ssw_o*qsw(k)-acnd*taucnd) * ( exp(-dt*r_taucnd) - 1.0_rp )
6751 pq(k,i_lcdep) = coef_a_cnd*r_taucnd_c - coef_b_cnd*r_taucnd_c
6752 plr2nr = pq(k,i_nrdep)/(pq(k,i_lrdep)+1.e-30_rp)
6753 pq(k,i_lrdep) = coef_a_cnd*r_taucnd_r - coef_b_cnd*r_taucnd_r
6754 pq(k,i_nrdep) = min(0.0_rp, pq(k,i_lrdep)*plr2nr )
6757 if( r_taudep < r_tau100day )
then
6758 uplim_dep = max( rho(k)*ssi_o*qsi(k)*r_dt, 0.0_rp )
6759 lowlim_dep = min( rho(k)*ssi_o*qsi(k)*r_dt, 0.0_rp )
6761 pq(k,i_lidep) = max(lowlim_dep, min(uplim_dep, pq(k,i_lidep)*ssi_o ))
6762 pq(k,i_lsdep) = max(lowlim_dep, min(uplim_dep, pq(k,i_lsdep)*ssi_o ))
6763 pq(k,i_lgdep) = max(lowlim_dep, min(uplim_dep, pq(k,i_lgdep)*ssi_o ))
6764 pq(k,i_nidep) = min(0.0_rp, pq(k,i_nidep)*ssi_o )
6765 pq(k,i_nsdep) = min(0.0_rp, pq(k,i_nsdep)*ssi_o )
6766 pq(k,i_ngdep) = min(0.0_rp, pq(k,i_ngdep)*ssi_o )
6768 adep = pdynsol + pradsol &
6769 + ( r_taucnd_c+r_taucnd_r ) * ( qsw(k) - qsi(k) )
6770 taudep = 1.0_rp/r_taudep
6772 coef_a_dep = rho(k)*adep*taudep
6773 coef_b_dep = rho(k)*taudep*r_dt*(ssi_o*qsi(k)-adep*taudep) * ( exp(-dt*r_taudep) - 1.0_rp )
6774 pli2ni = pq(k,i_nidep)/max(pq(k,i_lidep),1.e-30_rp)
6775 pls2ns = pq(k,i_nsdep)/max(pq(k,i_lsdep),1.e-30_rp)
6776 plg2ng = pq(k,i_ngdep)/max(pq(k,i_lgdep),1.e-30_rp)
6777 pq(k,i_lidep) = coef_a_dep*r_taudep_i - coef_b_dep*r_taudep_i
6778 pq(k,i_lsdep) = coef_a_dep*r_taudep_s - coef_b_dep*r_taudep_s
6779 pq(k,i_lgdep) = coef_a_dep*r_taudep_g - coef_b_dep*r_taudep_g
6780 pq(k,i_nidep) = min(0.0_rp, pq(k,i_lidep)*pli2ni )
6781 pq(k,i_nsdep) = min(0.0_rp, pq(k,i_lsdep)*pls2ns )
6782 pq(k,i_ngdep) = min(0.0_rp, pq(k,i_lgdep)*plg2ng )
6790 sw = 0.5_rp - sign(0.5_rp, pq(k,i_lcdep)+eps)
6791 pncdep = min(0.0_rp, ((rhoq(k,i_qc)+pq(k,i_lcdep)*dt)*r_xc_ccn - rhoq(k,i_nc))*r_dt ) * sw
6803 lvsw = esw(k)*r_rvaptem(k)
6804 dlvsw = rhoq(k,i_qv)-lvsw
6805 dcnd = dt*(pq(k,i_lcdep)+pq(k,i_lrdep))
6807 sw = ( sign(0.5_rp,dcnd) + sign(0.5_rp,dlvsw) ) &
6808 * ( 0.5_rp + sign(0.5_rp,abs(dcnd)-eps) )
6812 fac1 = min(dlvsw*sw,dcnd*sw)*sw / (abs(sw)-1.0_rp+dcnd) &
6814 dep_dqc(k) = max( dt*pq(k,i_lcdep)*fac1, &
6815 -rhoq(k,i_qc) - 1e30_rp*(sw+1.0_rp) )*abs(sw)
6816 dep_dqr(k) = max( dt*pq(k,i_lrdep)*fac1, &
6817 -rhoq(k,i_qr) - 1e30_rp*(sw+1.0_rp) )*abs(sw)
6836 dep_dnc(k) = max( dt*pncdep*fac1, -rhoq(k,i_nc) )
6837 dep_dnr(k) = max( dt*pq(k,i_nrdep)*fac1, -rhoq(k,i_nr) )
6839 qc_evaporate(k) = - dep_dnc(k)
6845 lvsi = esi(k)*r_rvaptem(k)
6846 ddep = dt*(pq(k,i_lidep)+pq(k,i_lsdep)+pq(k,i_lgdep))
6847 dlvsi = rhoq(k,i_qv)-lvsi
6849 sw = ( sign(0.5_rp,ddep) + sign(0.5_rp,dlvsi) ) &
6850 * ( 0.5_rp + sign(0.5_rp,abs(ddep)-eps) )
6854 fac2 = min(dlvsi*sw,ddep*sw)*sw / (abs(sw)-1.0_rp+ddep) &
6856 dep_dqi(k) = max( dt*pq(k,i_lidep) &
6857 * ( 1.0_rp-abs(sw) + fac2*abs(sw) ), &
6858 -rhoq(k,i_qi) - 1e30_rp*(sw+1.0_rp) )
6859 dep_dqs(k) = max( dt*pq(k,i_lsdep) &
6860 * ( 1.0_rp-abs(sw) + fac2*abs(sw) ), &
6861 -rhoq(k,i_qs) - 1e30_rp*(sw+1.0_rp) )
6862 dep_dqg(k) = max( dt*pq(k,i_lgdep) &
6863 * ( 1.0_rp-abs(sw) + fac2*abs(sw) ), &
6864 -rhoq(k,i_qg) - 1e30_rp*(sw+1.0_rp) )
6886 dep_dni(k) = max( dt*pq(k,i_nidep)*fac2, -rhoq(k,i_ni) )
6887 dep_dns(k) = max( dt*pq(k,i_nsdep)*fac2, -rhoq(k,i_ns) )
6888 dep_dng(k) = max( dt*pq(k,i_ngdep)*fac2, -rhoq(k,i_ng) )
6894 frz_dqc = max( dt*(pq(k,i_lchom)+pq(k,i_lchet)), -rhoq(k,i_qc)-dep_dqc(k) )
6895 frz_dnc(k) = max( dt*(pq(k,i_nchom)+pq(k,i_nchet)), -rhoq(k,i_nc)-dep_dnc(k) )
6898 drhonc(k) = frz_dnc(k)
6899 drhoqi(k) = - frz_dqc
6900 drhoni(k) = - frz_dnc(k)
6902 fac3 = ( frz_dqc -eps )/( dt*(pq(k,i_lchom)+pq(k,i_lchet))-eps )
6903 fac4 = ( frz_dnc(k)-eps )/( dt*(pq(k,i_nchom)+pq(k,i_nchet))-eps )
6904 pq(k,i_lchom) = fac3*pq(k,i_lchom)
6905 pq(k,i_lchet) = fac3*pq(k,i_lchet)
6906 pq(k,i_nchom) = fac4*pq(k,i_nchom)
6907 pq(k,i_nchet) = fac4*pq(k,i_nchet)
6914 mlt_dqi = max( dt*pq(k,i_limlt), -rhoq(k,i_qi)-dep_dqi(k) )
6915 mlt_dni(k) = max( dt*pq(k,i_nimlt), -rhoq(k,i_ni)-dep_dni(k) )
6918 mlt_dqs = max( dt*pq(k,i_lsmlt), -rhoq(k,i_qs)-dep_dqs(k) )
6919 mlt_dns(k) = max( dt*pq(k,i_nsmlt), -rhoq(k,i_ns)-dep_dns(k) )
6922 mlt_dqg = max( dt*pq(k,i_lgmlt), -rhoq(k,i_qg)-dep_dqg(k) )
6923 mlt_dng(k) = max( dt*pq(k,i_ngmlt), -rhoq(k,i_ng)-dep_dng(k) )
6925 xi = min(xi_max, max(xi_min, rhoq(k,i_qi)/(rhoq(k,i_ni)+ni_min) ))
6926 sw = 0.5_rp + sign(0.5_rp,xi-x_sep)
6929 drhoqc(k) = drhoqc(k) - mlt_dqi * (1.0_rp-sw)
6930 drhonc(k) = drhonc(k) - mlt_dni(k) * (1.0_rp-sw)
6932 drhoqr(k) = - mlt_dqi * sw - mlt_dqs - mlt_dqg
6933 drhonr(k) = - mlt_dni(k) * sw - mlt_dns(k) - mlt_dng(k)
6935 drhoqi(k) = drhoqi(k) + mlt_dqi
6936 drhoni(k) = drhoni(k) + mlt_dni(k)
6939 drhons(k) = mlt_dns(k)
6942 drhong(k) = mlt_dng(k)
6948 frz_dqr = max( dt*(pq(k,i_lrhet)), min(0.0_rp, -rhoq(k,i_qr)-dep_dqr(k)) )
6949 frz_dnr(k) = max( dt*(pq(k,i_nrhet)), min(0.0_rp, -rhoq(k,i_nr)-dep_dnr(k)) )
6951 drhoqr(k) = drhoqr(k) + frz_dqr
6952 drhonr(k) = drhonr(k) + frz_dnr(k)
6953 drhoqg(k) = drhoqg(k) - frz_dqr
6954 drhong(k) = drhong(k) - frz_dnr(k)
6956 fac5 = ( frz_dqr -eps )/( dt*pq(k,i_lrhet)-eps )
6957 pq(k,i_lrhet) = fac5*pq(k,i_lrhet)
6958 fac6 = ( frz_dnr(k)-eps )/( dt*pq(k,i_nrhet)-eps )
6959 pq(k,i_nrhet) = fac6*pq(k,i_nrhet)
6965 dep_qv = - ( dep_dqc(k) + dep_dqr(k) + dep_dqi(k) + dep_dqs(k) + dep_dqg(k) )
6968 sw = 0.5_rp - sign(0.5_rp, abs(dep_qv) - eps)
6969 fact = ( max( rhoq(k,i_qv) + dep_qv * dt, 0.0_rp ) - rhoq(k,i_qv) ) / dt / ( dep_qv + sw ) * ( 1.0_rp - sw ) &
6971 fact = min( 1.0_rp, max( 0.0_rp, fact ) )
6973 dep_qv = dep_qv * fact
6975 dep_dqc(k) = dep_dqc(k) * fact
6976 dep_dnc(k) = dep_dnc(k) * fact
6977 dep_dqr(k) = dep_dqr(k) * fact
6978 dep_dnr(k) = dep_dnr(k) * fact
6979 dep_dqi(k) = dep_dqi(k) * fact
6980 dep_dni(k) = dep_dni(k) * fact
6981 dep_dqs(k) = dep_dqs(k) * fact
6982 dep_dns(k) = dep_dns(k) * fact
6983 dep_dqg(k) = dep_dqg(k) * fact
6984 dep_dng(k) = dep_dng(k) * fact
6988 drhoqc(k) = drhoqc(k) + dep_dqc(k)
6989 drhonc(k) = drhonc(k) + dep_dnc(k)
6990 drhoqr(k) = drhoqr(k) + dep_dqr(k)
6991 drhonr(k) = drhonr(k) + dep_dnr(k)
6992 drhoqi(k) = drhoqi(k) + dep_dqi(k)
6993 drhoni(k) = drhoni(k) + dep_dni(k)
6994 drhoqs(k) = drhoqs(k) + dep_dqs(k)
6995 drhons(k) = drhons(k) + dep_dns(k)
6996 drhoqg(k) = drhoqg(k) + dep_dqg(k)
6997 drhong(k) = drhong(k) + dep_dng(k)
6999 dz = fz(k) - fz(k-1)
7000 sl_plcdep = sl_plcdep + dep_dqc(k) * dz
7001 sl_plrdep = sl_plrdep + dep_dqr(k) * dz
7002 sl_pnrdep = sl_pnrdep + dep_dnr(k) * dz
7008 rhoq_t(k,i_qv) = drhoqv(k) / dt
7009 rhoq_t(k,i_qc) = drhoqc(k) / dt
7010 rhoq_t(k,i_nc) = drhonc(k) / dt
7011 rhoq_t(k,i_qr) = drhoqr(k) / dt
7012 rhoq_t(k,i_nr) = drhonr(k) / dt
7013 rhoq_t(k,i_qi) = drhoqi(k) / dt
7014 rhoq_t(k,i_ni) = drhoni(k) / dt
7015 rhoq_t(k,i_qs) = drhoqs(k) / dt
7016 rhoq_t(k,i_ns) = drhons(k) / dt
7017 rhoq_t(k,i_qg) = drhoqg(k) / dt
7018 rhoq_t(k,i_ng) = drhong(k) / dt
7020 rhoe_t(k) = ( - lhv * drhoqv(k) + lhf * ( drhoqi(k) + drhoqs(k) + drhoqg(k) ) ) / dt
7022 rrho = 1.0_rp/rho(k)
7023 dqv = rrho * drhoqv(k)
7024 dql = rrho * ( drhoqc(k) + drhoqr(k) )
7025 dqi = rrho * ( drhoqi(k) + drhoqs(k) + drhoqg(k) )
7039 sw = 0.5_rp - sign( 0.5_rp, rhoq(k,i_nc)-small )
7040 dep_dnc_crg = dep_dnc(k) * ( 1.0_rp-sw ) / ( rhoq(k,i_nc)+sw ) * rhoq_crg(k,i_qc)
7041 sw = 0.5_rp - sign( 0.5_rp, rhoq(k,i_nr)-small )
7042 dep_dnr_crg = dep_dnr(k) * ( 1.0_rp-sw ) / ( rhoq(k,i_nr)+sw ) * rhoq_crg(k,i_qr)
7044 sw = min( abs(rhoq_crg(k,i_qc)), abs(dep_dnc_crg) )
7045 dep_dnc_crg = sign( sw, dep_dnc_crg )
7046 sw = min( abs(rhoq_crg(k,i_qr)), abs(dep_dnr_crg) )
7047 dep_dnr_crg = sign( sw, dep_dnr_crg )
7049 drhoqcrg_c(k) = dep_dnc_crg
7050 drhoqcrg_r(k) = dep_dnr_crg
7054 sw = 0.5_rp - sign( 0.5_rp, rhoq(k,i_ni)-small )
7055 dep_dni_crg = dep_dni(k) * ( 1.0_rp-sw ) / ( rhoq(k,i_ni)+sw ) * rhoq_crg(k,i_qi)
7056 sw = 0.5_rp - sign( 0.5_rp, rhoq(k,i_ns)-small )
7057 dep_dns_crg = dep_dns(k) * ( 1.0_rp-sw ) / ( rhoq(k,i_ns)+sw ) * rhoq_crg(k,i_qs)
7058 sw = 0.5_rp - sign( 0.5_rp, rhoq(k,i_ng)-small )
7059 dep_dng_crg = dep_dng(k) * ( 1.0_rp-sw ) / ( rhoq(k,i_ng)+sw ) * rhoq_crg(k,i_qg)
7061 sw = min( abs(rhoq_crg(k,i_qi)), abs(dep_dni_crg) )
7062 dep_dni_crg = sign( sw, dep_dni_crg )
7063 sw = min( abs(rhoq_crg(k,i_qs)), abs(dep_dns_crg) )
7064 dep_dns_crg = sign( sw, dep_dns_crg )
7065 sw = min( abs(rhoq_crg(k,i_qg)), abs(dep_dng_crg) )
7066 dep_dng_crg = sign( sw, dep_dng_crg )
7068 drhoqcrg_i(k) = dep_dni_crg
7069 drhoqcrg_s(k) = dep_dns_crg
7070 drhoqcrg_g(k) = dep_dng_crg
7074 sw = 0.5_rp - sign( 0.5_rp, rhoq(k,i_nc)-small )
7075 frz_dnc_crg = frz_dnc(k) * ( 1.0_rp-sw ) / ( rhoq(k,i_nc)+sw ) * rhoq_crg(k,i_qc)
7077 sw = min( abs(rhoq_crg(k,i_qc) + drhoqcrg_c(k)), abs(frz_dnc_crg) )
7078 frz_dnc_crg = sign( sw, frz_dnc_crg )
7080 drhoqcrg_c(k) = drhoqcrg_c(k) + frz_dnc_crg
7081 drhoqcrg_i(k) = drhoqcrg_i(k) - frz_dnc_crg
7085 xi = min(xi_max, max(xi_min, rhoq(k,i_qi)/(rhoq(k,i_ni)+ni_min) ))
7086 sw = 0.5_rp + sign(0.5_rp,xi-x_sep)
7088 sw2 = 0.5_rp - sign( 0.5_rp, rhoq(k,i_ni)-small )
7089 mlt_dni_crg = mlt_dni(k) * ( 1.0_rp-sw2 ) / ( rhoq(k,i_ni)+sw2 ) * rhoq_crg(k,i_qi)
7090 sw2 = 0.5_rp - sign( 0.5_rp, rhoq(k,i_ns)-small )
7091 mlt_dns_crg = mlt_dns(k) * ( 1.0_rp-sw2 ) / ( rhoq(k,i_ns)+sw2 ) * rhoq_crg(k,i_qs)
7092 sw2 = 0.5_rp - sign( 0.5_rp, rhoq(k,i_ng)-small )
7093 mlt_dng_crg = mlt_dng(k) * ( 1.0_rp-sw2 ) / ( rhoq(k,i_ng)+sw2 ) * rhoq_crg(k,i_qg)
7096 sw2 = min( abs(rhoq_crg(k,i_qi) + drhoqcrg_i(k)), abs(mlt_dni_crg) )
7097 mlt_dni_crg = sign( sw2, mlt_dni_crg )
7098 sw2 = min( abs(rhoq_crg(k,i_qs) + drhoqcrg_s(k)), abs(mlt_dns_crg) )
7099 mlt_dns_crg = sign( sw2, mlt_dns_crg )
7100 sw2 = min( abs(rhoq_crg(k,i_qg) + drhoqcrg_g(k)), abs(mlt_dng_crg) )
7101 mlt_dng_crg = sign( sw2, mlt_dng_crg )
7103 drhoqcrg_c(k) = drhoqcrg_c(k) - mlt_dni_crg * (1.0_rp-sw)
7104 drhoqcrg_r(k) = drhoqcrg_r(k) - mlt_dni_crg * sw - mlt_dns_crg - mlt_dng_crg
7105 drhoqcrg_i(k) = drhoqcrg_i(k) + mlt_dni_crg
7106 drhoqcrg_s(k) = drhoqcrg_s(k) + mlt_dns_crg
7107 drhoqcrg_g(k) = drhoqcrg_g(k) + mlt_dng_crg
7111 sw = 0.5_rp - sign( 0.5_rp, rhoq(k,i_nr)-small )
7112 frz_dnr_crg = frz_dnr(k) * ( 1.0_rp-sw ) / ( rhoq(k,i_nr)+sw ) * rhoq_crg(k,i_qr)
7114 sw = min( abs(rhoq_crg(k,i_qr) + drhoqcrg_r(k)), abs(frz_dnr_crg) )
7115 frz_dnr_crg = sign( sw, frz_dnr_crg )
7117 drhoqcrg_r(k) = drhoqcrg_r(k) + frz_dnr_crg
7118 drhoqcrg_g(k) = drhoqcrg_g(k) - frz_dnr_crg
7123 rhoqcrg_t(k,i_qc) = drhoqcrg_c(k) / dt
7124 rhoqcrg_t(k,i_qr) = drhoqcrg_r(k) / dt
7125 rhoqcrg_t(k,i_qi) = drhoqcrg_i(k) / dt
7126 rhoqcrg_t(k,i_qs) = drhoqcrg_s(k) / dt
7127 rhoqcrg_t(k,i_qg) = drhoqcrg_g(k) / dt
7133 end subroutine update_by_phase_change
7145 integer,
intent(in) :: KA, KS, KE
7146 integer,
intent(in) :: QA_MP
7147 real(RP),
intent(in) :: QTRC0(KA,QA_MP)
7148 real(RP),
intent(in) :: DENS0(KA)
7149 real(RP),
intent(out) :: Crs(KA,HYDRO_MAX)
7160 real(RP) :: coef_Fuetal1998
7162 real(RP),
parameter :: r2m_min=1.e-12_rp
7163 real(RP),
parameter :: um2cm = 100.0_rp
7165 real(RP) :: limitsw, zerosw
7171 xc(k) = min( xc_max, max( xc_min, dens0(k)*qtrc0(k,i_qc)/(qtrc0(k,i_nc)+nc_min) ) )
7172 xr(k) = min( xr_max, max( xr_min, dens0(k)*qtrc0(k,i_qr)/(qtrc0(k,i_nr)+nr_min) ) )
7173 xi(k) = min( xi_max, max( xi_min, dens0(k)*qtrc0(k,i_qi)/(qtrc0(k,i_ni)+ni_min) ) )
7174 xs(k) = min( xs_max, max( xs_min, dens0(k)*qtrc0(k,i_qs)/(qtrc0(k,i_ns)+ns_min) ) )
7175 xg(k) = min( xg_max, max( xg_min, dens0(k)*qtrc0(k,i_qg)/(qtrc0(k,i_ng)+ng_min) ) )
7180 crs(k,i_mp_qc) = pi * coef_r2(i_mp_qc) * qtrc0(k,i_nc) * a_rea2(i_mp_qc) * xc(k)**b_rea2(i_mp_qc)
7184 crs(k,i_mp_qr) = pi * coef_r2(i_mp_qr) * qtrc0(k,i_nr) * a_rea2(i_mp_qr) * xr(k)**b_rea2(i_mp_qr)
7188 crs(k,i_mp_qi) = pi * coef_rea2(i_mp_qi) * qtrc0(k,i_ni) * a_rea2(i_mp_qi) * xi(k)**b_rea2(i_mp_qi)
7189 crs(k,i_mp_qs) = pi * coef_rea2(i_mp_qs) * qtrc0(k,i_ns) * a_rea2(i_mp_qs) * xs(k)**b_rea2(i_mp_qs)
7190 crs(k,i_mp_qg) = pi * coef_rea2(i_mp_qg) * qtrc0(k,i_ng) * a_rea2(i_mp_qg) * xg(k)**b_rea2(i_mp_qg)
7197 subroutine get_terminal_velocity( &
7203 integer,
intent(in) :: KA, KS, KE
7204 real(RP),
intent(out) :: vt_xa (KA,HYDRO_MAX,2)
7205 real(RP),
intent(out) :: xq (KA,HYDRO_MAX)
7206 real(RP),
intent(in) :: rhoq (KA,I_QV:I_NG)
7207 real(RP),
intent(in) :: log_rho_fac_q(KA,HYDRO_MAX)
7215 xq(k,i_mp_qc) = min(xc_max, max(xc_min, rhoq(k,i_qc)/(rhoq(k,i_nc)+nc_min) ))
7217 log_xq = log(xq(k,i_mp_qc))
7218 vt_xa(k,i_mp_qc,1) = exp( log_alpha_v(i_mp_qc,1) + log_xq * beta_v(i_mp_qc,1) + log_rho_fac_q(k,i_mp_qc) )
7219 vt_xa(k,i_mp_qc,2) = exp( log_alpha_v(i_mp_qc,2) + log_xq * beta_v(i_mp_qc,2) + log_rho_fac_q(k,i_mp_qc) )
7221 xq(k,i_mp_qr) = min(xr_max, max(xr_min, rhoq(k,i_qr)/(rhoq(k,i_nr)+nr_min) ))
7222 log_xq = log(xq(k,i_mp_qr))
7223 vt_xa(k,i_mp_qr,1) = exp( log_alpha_v(i_mp_qr,1) + log_xq * beta_v(i_mp_qr,1) + log_rho_fac_q(k,i_mp_qr) )
7224 vt_xa(k,i_mp_qr,2) = vt_xa(k,i_mp_qr,1)
7226 xq(k,i_mp_qi) = min(xi_max, max(xi_min, rhoq(k,i_qi)/(rhoq(k,i_ni)+ni_min) ))
7227 log_xq = log(xq(k,i_mp_qi))
7228 vt_xa(k,i_mp_qi,1) = exp( log_alpha_v(i_mp_qi,1) + log_xq * beta_v(i_mp_qi,1) + log_rho_fac_q(k,i_mp_qi) )
7229 vt_xa(k,i_mp_qi,2) = exp( log_alpha_v(i_mp_qi,2) + log_xq * beta_v(i_mp_qi,2) + log_rho_fac_q(k,i_mp_qi) )
7231 xq(k,i_mp_qs) = min(xs_max, max(xs_min, rhoq(k,i_qs)/(rhoq(k,i_ns)+ns_min) ))
7232 log_xq = log(xq(k,i_mp_qs))
7233 vt_xa(k,i_mp_qs,1) = exp( log_alpha_v(i_mp_qs,1) + log_xq * beta_v(i_mp_qs,1) + log_rho_fac_q(k,i_mp_qs) )
7234 vt_xa(k,i_mp_qs,2) = exp( log_alpha_v(i_mp_qs,2) + log_xq * beta_v(i_mp_qs,2) + log_rho_fac_q(k,i_mp_qs) )
7236 xq(k,i_mp_qg) = min(xg_max, max(xg_min, rhoq(k,i_qg)/(rhoq(k,i_ng)+ng_min) ))
7237 log_xq = log(xq(k,i_mp_qg))
7238 vt_xa(k,i_mp_qg,1) = exp( log_alpha_v(i_mp_qg,1) + log_xq * beta_v(i_mp_qg,1) + log_rho_fac_q(k,i_mp_qg) )
7239 vt_xa(k,i_mp_qg,2) = exp( log_alpha_v(i_mp_qg,2) + log_xq * beta_v(i_mp_qg,2) + log_rho_fac_q(k,i_mp_qg) )
7243 end subroutine get_terminal_velocity
7246 subroutine get_diamiter( &
7251 integer,
intent(in) :: KA, KS, KE
7252 real(RP),
intent(out) :: dq_xa(KA,HYDRO_MAX)
7253 real(RP),
intent(in) :: xq (KA,HYDRO_MAX)
7260 dq_xa(k,i_mp_qc) = a_m(i_mp_qc)*xq(k,i_mp_qc)**b_m(i_mp_qc)
7261 dq_xa(k,i_mp_qr) = a_m(i_mp_qr)*xq(k,i_mp_qr)**b_m(i_mp_qr)
7262 dq_xa(k,i_mp_qi) = a_m(i_mp_qi)*xq(k,i_mp_qi)**b_m(i_mp_qi)
7263 dq_xa(k,i_mp_qs) = a_m(i_mp_qs)*xq(k,i_mp_qs)**b_m(i_mp_qs)
7264 dq_xa(k,i_mp_qg) = a_m(i_mp_qg)*xq(k,i_mp_qg)**b_m(i_mp_qg)
7268 end subroutine get_diamiter