51 private :: mp_tomita08
52 private :: mp_tomita08_vterm
53 private :: mp_tomita08_bergeronparam
59 logical,
private :: mp_donegative_fixer = .true.
60 logical,
private :: mp_doprecipitation = .true.
61 logical,
private :: mp_couple_aerosol = .false.
63 logical,
private :: mp_doexpricit_icegen = .false.
64 logical,
private :: only_liquid = .false.
65 real(RP),
private :: sw_useicegen = 0.0_rp
67 real(RP),
private :: dens00 = 1.28_rp
70 real(RP),
private :: n0r = 8.e6_rp
71 real(RP),
private :: n0s = 3.e6_rp
72 real(RP),
private :: n0g = 4.e6_rp
74 real(RP),
private :: dens_s = 100.0_rp
75 real(RP),
private :: dens_g = 400.0_rp
78 real(RP),
private :: drag_g = 0.6_rp
79 real(RP),
private :: re_qc = 8.e-6_rp
80 real(RP),
private :: re_qi = 40.e-6_rp
81 real(RP),
private :: cr = 130.0_rp
82 real(RP),
private :: cs = 4.84_rp
85 real(RP),
private :: ar, as, ag
86 real(RP),
private :: br, bs, bg
87 real(RP),
private :: cg
88 real(RP),
private :: dr, ds, dg
91 real(RP),
private :: gam, gam_2, gam_3
93 real(RP),
private :: gam_1br, gam_2br, gam_3br
94 real(RP),
private :: gam_3dr
95 real(RP),
private :: gam_6dr
96 real(RP),
private :: gam_1brdr
97 real(RP),
private :: gam_5dr_h
99 real(RP),
private :: gam_1bs, gam_2bs, gam_3bs
100 real(RP),
private :: gam_3ds
101 real(RP),
private :: gam_1bsds
102 real(RP),
private :: gam_5ds_h
104 real(RP),
private :: gam_1bg, gam_3dg
105 real(RP),
private :: gam_1bgdg
106 real(RP),
private :: gam_5dg_h
109 real(RP),
private :: sw_kk2000 = 0.0_rp
112 real(RP),
private :: sw_roh2014 = 0.0_rp
113 real(RP),
private,
parameter :: coef_a(10) = (/ 5.065339_rp, -0.062659_rp, -3.032362_rp, 0.029469_rp, -0.000285_rp, &
114 0.31255_rp, 0.000204_rp, 0.003199_rp, 0.0_rp, -0.015952_rp /)
115 real(RP),
private,
parameter :: coef_b(10) = (/ 0.476221_rp, -0.015896_rp, 0.165977_rp, 0.007468_rp, -0.000141_rp, &
116 0.060366_rp, 0.000079_rp, 0.000594_rp, 0.0_rp, -0.003577_rp /)
119 real(RP),
private :: eiw = 1.0_rp
120 real(RP),
private :: erw = 1.0_rp
121 real(RP),
private :: esw = 1.0_rp
122 real(RP),
private :: egw = 1.0_rp
123 real(RP),
private :: eri = 1.0_rp
124 real(RP),
private :: esi = 1.0_rp
125 real(RP),
private :: egi = 0.1_rp
126 real(RP),
private :: esr = 1.0_rp
127 real(RP),
private :: egr = 1.0_rp
128 real(RP),
private :: egs = 1.0_rp
129 real(RP),
private :: gamma_sacr = 25.e-3_rp
130 real(RP),
private :: gamma_gacs = 90.e-3_rp
133 real(RP),
private,
parameter :: nc_lnd = 2000.0_rp
134 real(RP),
private,
parameter :: nc_ocn = 50.0_rp
135 real(RP),
private,
allocatable :: nc_def(:,:)
137 real(RP),
private :: beta_saut = 6.e-3_rp
138 real(RP),
private :: gamma_saut = 60.e-3_rp
139 real(RP),
private :: beta_gaut = 1.e-3_rp
140 real(RP),
private :: gamma_gaut = 90.e-3_rp
141 real(RP),
private :: qicrt_saut = 0.0_rp
142 real(RP),
private :: qscrt_gaut = 6.e-4_rp
145 real(RP),
private,
parameter :: da0 = 2.428e-2_rp
146 real(RP),
private,
parameter :: dda_dt = 7.47e-5_rp
147 real(RP),
private,
parameter :: dw0 = 2.222e-5_rp
148 real(RP),
private,
parameter :: ddw_dt = 1.37e-7_rp
149 real(RP),
private,
parameter :: mu0 = 1.718e-5_rp
150 real(RP),
private,
parameter :: dmu_dt = 5.28e-8_rp
152 real(RP),
private :: f1r = 0.78_rp
153 real(RP),
private :: f2r = 0.27_rp
154 real(RP),
private :: f1s = 0.65_rp
155 real(RP),
private :: f2s = 0.39_rp
156 real(RP),
private :: f1g = 0.78_rp
157 real(RP),
private :: f2g = 0.27_rp
160 real(RP),
private :: a_frz = 0.66_rp
161 real(RP),
private :: b_frz = 100.0_rp
164 real(RP),
private :: mi40 = 2.46e-10_rp
165 real(RP),
private :: mi50 = 4.80e-10_rp
166 real(RP),
private :: vti50 = 1.0_rp
167 real(RP),
private :: ri50 = 5.e-5_rp
169 integer,
private,
parameter :: w_nmax = 42
170 integer,
private,
parameter :: i_dqv_dt = 1
171 integer,
private,
parameter :: i_dqc_dt = 2
172 integer,
private,
parameter :: i_dqr_dt = 3
173 integer,
private,
parameter :: i_dqi_dt = 4
174 integer,
private,
parameter :: i_dqs_dt = 5
175 integer,
private,
parameter :: i_dqg_dt = 6
176 integer,
private,
parameter :: i_delta1 = 7
177 integer,
private,
parameter :: i_delta2 = 8
178 integer,
private,
parameter :: i_delta3 = 9
179 integer,
private,
parameter :: i_rlmdr = 10
180 integer,
private,
parameter :: i_rlmds = 11
181 integer,
private,
parameter :: i_rlmdg = 12
182 integer,
private,
parameter :: i_piacr = 13
183 integer,
private,
parameter :: i_psacr = 14
184 integer,
private,
parameter :: i_praci = 15
185 integer,
private,
parameter :: i_psmlt = 16
186 integer,
private,
parameter :: i_pgmlt = 17
187 integer,
private,
parameter :: i_praut = 18
188 integer,
private,
parameter :: i_pracw = 19
189 integer,
private,
parameter :: i_psacw = 20
190 integer,
private,
parameter :: i_psfw = 21
191 integer,
private,
parameter :: i_pgacw = 22
192 integer,
private,
parameter :: i_prevp = 23
193 integer,
private,
parameter :: i_piacr_s = 24
194 integer,
private,
parameter :: i_psacr_s = 25
195 integer,
private,
parameter :: i_piacr_g = 26
196 integer,
private,
parameter :: i_psacr_g = 27
197 integer,
private,
parameter :: i_pgacr = 28
198 integer,
private,
parameter :: i_pgfrz = 29
199 integer,
private,
parameter :: i_psaut = 30
200 integer,
private,
parameter :: i_praci_s = 31
201 integer,
private,
parameter :: i_psaci = 32
202 integer,
private,
parameter :: i_psfi = 33
203 integer,
private,
parameter :: i_praci_g = 34
204 integer,
private,
parameter :: i_pgaci = 35
205 integer,
private,
parameter :: i_psdep = 36
206 integer,
private,
parameter :: i_pssub = 37
207 integer,
private,
parameter :: i_pgaut = 38
208 integer,
private,
parameter :: i_pracs = 39
209 integer,
private,
parameter :: i_pgacs = 40
210 integer,
private,
parameter :: i_pgdep = 41
211 integer,
private,
parameter :: i_pgsub = 42
213 integer,
private :: w_histid (w_nmax) = -999
214 logical,
private :: w_zinterp(w_nmax) = .false.
215 character(len=H_SHORT),
private :: w_name (w_nmax)
216 character(len=H_MID),
private :: w_desc (w_nmax) =
'' 217 character(len=H_SHORT),
private :: w_unit (w_nmax) =
'kg/kg/s' 219 data w_name /
'dqv_dt ', &
262 real(RP),
private,
allocatable :: work3d(:,:,:)
264 integer,
private :: mp_ntmax_sedimentation = 1
266 integer,
private :: mp_nstep_sedimentation
267 real(RP),
private :: mp_rnstep_sedimentation
268 real(DP),
private :: mp_dtsec_sedimentation
270 logical,
private :: debug
294 character(len=*),
intent(in) :: MP_TYPE
296 real(RP) :: autoconv_nc = nc_ocn
297 logical :: enable_kk2000 = .false.
298 logical :: enable_roh2014 = .false.
300 namelist / param_atmos_phy_mp / &
301 mp_doprecipitation, &
302 mp_donegative_fixer, &
303 mp_doexpricit_icegen, &
304 mp_ntmax_sedimentation, &
307 namelist / param_atmos_phy_mp_tomita08 / &
325 real(RP),
parameter :: max_term_vel = 10.0_rp
333 if(
io_l )
write(
io_fid_log,*)
'++++++ Module[Cloud Microphysics] / Categ[ATMOS PHYSICS] / Origin[SCALElib]' 334 if(
io_l )
write(
io_fid_log,*)
'*** TOMITA08: 1-moment bulk 6 category' 336 if ( mp_type /=
'TOMITA08' )
then 337 write(*,*)
'xxx ATMOS_PHY_MP_TYPE is not TOMITA08. Check!' 346 .OR. i_qg <= 0 )
then 347 write(*,*)
'xxx TOMITA08 needs QV/C/R/I/S/G tracer. Check!' 351 allocate( work3d(
ka,
ia,
ja) )
352 work3d(:,:,:) = 0.0_rp
354 allocate( nc_def(
ia,
ja) )
358 read(
io_fid_conf,nml=param_atmos_phy_mp,iostat=ierr)
360 if(
io_l )
write(
io_fid_log,*)
'*** Not found namelist. Default used.' 361 elseif( ierr > 0 )
then 362 write(*,*)
'xxx Not appropriate names in namelist PARAM_ATMOS_PHY_MP. Check!' 368 if (
io_l )
write(
io_fid_log,*)
'*** Enable negative fixer? : ', mp_donegative_fixer
369 if (
io_l )
write(
io_fid_log,*)
'*** Enable sedimentation (precipitation)? : ', mp_doprecipitation
370 if (
io_l )
write(
io_fid_log,*)
'*** Enable explicit ice generation? : ', mp_doexpricit_icegen
373 mp_ntmax_sedimentation = max( mp_ntmax_sedimentation, nstep_max )
375 mp_nstep_sedimentation = mp_ntmax_sedimentation
376 mp_rnstep_sedimentation = 1.0_rp /
real(mp_ntmax_sedimentation,kind=
rp)
379 if (
io_l )
write(
io_fid_log,*)
'*** Timestep of sedimentation is divided into : ', mp_ntmax_sedimentation,
'step' 380 if (
io_l )
write(
io_fid_log,*)
'*** DT of sedimentation : ', mp_dtsec_sedimentation,
'[s]' 384 read(
io_fid_conf,nml=param_atmos_phy_mp_tomita08,iostat=ierr)
386 if(
io_l )
write(
io_fid_log,*)
'*** Not found namelist. Default used.' 387 elseif( ierr > 0 )
then 388 write(*,*)
'xxx Not appropriate names in namelist PARAM_ATMOS_PHY_MP_TOMITA08. Check!' 394 if (
io_l )
write(
io_fid_log,*)
'*** density of the snow [kg/m3] : ', dens_s
395 if (
io_l )
write(
io_fid_log,*)
'*** density of the graupel [kg/m3] : ', dens_g
396 if (
io_l )
write(
io_fid_log,*)
'*** Nc for auto-conversion [num/m3]: ', autoconv_nc
397 if (
io_l )
write(
io_fid_log,*)
'*** Use k-k scheme? : ', enable_kk2000
398 if (
io_l )
write(
io_fid_log,*)
'*** Use Roh scheme? : ', enable_roh2014
409 ar = pi * dens_w / 6.0_rp
410 as = pi * dens_s / 6.0_rp
411 ag = pi * dens_g / 6.0_rp
417 cg = sqrt( ( 4.0_rp * dens_g * grav ) / ( 3.0_rp * dens00 * drag_g ) )
423 if ( enable_roh2014 )
then 440 gam_1brdr =
sf_gamma( 1.0_rp + br + dr )
441 gam_5dr_h =
sf_gamma( 0.5_rp * (5.0_rp+dr) )
447 gam_1bsds =
sf_gamma( 1.0_rp + bs + ds )
448 gam_5ds_h =
sf_gamma( 0.5_rp * (5.0_rp+ds) )
452 gam_1bgdg =
sf_gamma( 1.0_rp + bg + dg)
453 gam_5dg_h =
sf_gamma( 0.5_rp * (5.0_rp+dg) )
457 nc_def(i,j) = autoconv_nc
461 if ( mp_doexpricit_icegen )
then 463 sw_useicegen = 1.0_rp
465 only_liquid = .false.
466 sw_useicegen = 0.0_rp
469 if ( enable_kk2000 )
then 476 w_desc(:) = w_name(:)
478 call hist_reg( w_histid(ip), w_zinterp(ip), w_name(ip), w_desc(ip), w_unit(ip), ndim=3 )
508 thermodyn_rhoe => atmos_thermodyn_rhoe, &
509 thermodyn_rhot => atmos_thermodyn_rhot, &
510 thermodyn_temp_pres_e => atmos_thermodyn_temp_pres_e
517 real(RP),
intent(inout) :: dens(
ka,
ia,
ja)
518 real(RP),
intent(inout) :: MOMZ(
ka,
ia,
ja)
519 real(RP),
intent(inout) :: MOMX(
ka,
ia,
ja)
520 real(RP),
intent(inout) :: MOMY(
ka,
ia,
ja)
521 real(RP),
intent(inout) :: RHOT(
ka,
ia,
ja)
522 real(RP),
intent(inout) :: QTRC(
ka,
ia,
ja,qad)
523 real(RP),
intent(in) :: CCN(
ka,
ia,
ja)
524 real(RP),
intent(out) :: EVAPORATE(
ka,
ia,
ja)
525 real(RP),
intent(out) :: SFLX_rain(
ia,
ja)
526 real(RP),
intent(out) :: SFLX_snow(
ia,
ja)
528 real(RP) :: RHOE_t(
ka,
ia,
ja)
530 real(RP) :: RHOE (
ka,
ia,
ja)
531 real(RP) :: temp (
ka,
ia,
ja)
532 real(RP) :: pres (
ka,
ia,
ja)
535 real(RP) :: FLX_rain (
ka,
ia,
ja)
536 real(RP) :: FLX_snow (
ka,
ia,
ja)
537 real(RP) :: wflux_rain(
ka,
ia,
ja)
538 real(RP) :: wflux_snow(
ka,
ia,
ja)
539 real(RP) :: qc_before_satadj(
ka,
ia,
ja)
544 if(
io_l )
write(
io_fid_log,*)
'*** Physics step: Cloud microphysics(tomita08)' 546 if ( mp_donegative_fixer )
then 547 call mp_negative_fixer( dens(:,:,:), &
552 call thermodyn_rhoe( rhoe(:,:,:), &
557 call mp_tomita08( rhoe_t(:,:,:), &
564 flx_rain(:,:,:) = 0.0_rp
565 flx_snow(:,:,:) = 0.0_rp
567 vterm(:,:,:,:) = 0.0_rp
569 if ( mp_doprecipitation )
then 571 do step = 1, mp_nstep_sedimentation
573 call thermodyn_temp_pres_e( temp(:,:,:), &
579 call mp_tomita08_vterm( vterm(:,:,:,:), &
584 call mp_precipitation( wflux_rain(:,:,:), &
594 mp_dtsec_sedimentation )
599 flx_rain(k,i,j) = flx_rain(k,i,j) + wflux_rain(k,i,j) * mp_rnstep_sedimentation
600 flx_snow(k,i,j) = flx_snow(k,i,j) + wflux_snow(k,i,j) * mp_rnstep_sedimentation
608 vterm(:,:,:,:) = 0.0_rp
611 call hist_in( vterm(:,:,:,i_qr),
'Vterm_QR',
'terminal velocity of QR',
'm/s' )
612 call hist_in( vterm(:,:,:,i_qi),
'Vterm_QI',
'terminal velocity of QI',
'm/s' )
613 call hist_in( vterm(:,:,:,i_qs),
'Vterm_QS',
'terminal velocity of QS',
'm/s' )
614 call hist_in( vterm(:,:,:,i_qg),
'Vterm_QG',
'terminal velocity of QG',
'm/s' )
619 qc_before_satadj(k,i,j) = qtrc(k,i,j,i_qc)
624 call mp_saturation_adjustment( rhoe_t(:,:,:), &
634 evaporate(k,i,j) = max( qc_before_satadj(k,i,j) - qtrc(k,i,j,i_qc), 0.0_rp ) / dt
635 evaporate(k,i,j) = evaporate(k,i,j) * dens(k,i,j) &
636 / (4.0_rp/3.0_rp*pi*dwatr*re_qc**3)
643 call thermodyn_rhot( rhot(:,:,:), &
647 if ( mp_donegative_fixer )
then 648 call mp_negative_fixer( dens(:,:,:), &
653 sflx_rain(:,:) = flx_rain(
ks-1,:,:)
654 sflx_snow(:,:) = flx_snow(
ks-1,:,:)
661 subroutine mp_tomita08( &
682 thermodyn_temp_pres_e => atmos_thermodyn_temp_pres_e, &
683 atmos_thermodyn_templhv, &
684 atmos_thermodyn_templhs, &
685 atmos_thermodyn_templhf
687 saturation_dens2qsat_liq => atmos_saturation_dens2qsat_liq, &
688 saturation_dens2qsat_ice => atmos_saturation_dens2qsat_ice
691 real(RP),
intent(out) :: RHOE_t(
ka,
ia,
ja)
692 real(RP),
intent(out) :: QTRC_t(
ka,
ia,
ja,
qa)
693 real(RP),
intent(inout) :: RHOE0 (
ka,
ia,
ja)
694 real(RP),
intent(inout) :: QTRC0 (
ka,
ia,
ja,
qa)
695 real(RP),
intent(in) :: CCN (
ka,
ia,
ja)
696 real(RP),
intent(in) :: DENS0 (
ka,
ia,
ja)
701 real(RP) :: TEMP0(
ka,
ia,
ja)
702 real(RP) :: PRES0(
ka,
ia,
ja)
703 real(RP) :: QSATL(
ka,
ia,
ja)
704 real(RP) :: QSATI(
ka,
ia,
ja)
718 real(RP) :: RLMDr, RLMDr_2, RLMDr_3
719 real(RP) :: RLMDs, RLMDs_2, RLMDs_3
720 real(RP) :: RLMDg, RLMDg_2, RLMDg_3
721 real(RP) :: RLMDr_1br, RLMDr_2br, RLMDr_3br
722 real(RP) :: RLMDs_1bs, RLMDs_2bs, RLMDs_3bs
723 real(RP) :: RLMDr_dr, RLMDr_3dr, RLMDr_5dr
724 real(RP) :: RLMDs_ds, RLMDs_3ds, RLMDs_5ds
725 real(RP) :: RLMDg_dg, RLMDg_3dg, RLMDg_5dg
727 real(RP) :: RLMDr_6dr
730 real(RP) :: tems, rhoqs, Xs2
731 real(RP) :: MOMs_0, MOMs_1, MOMs_2
732 real(RP) :: MOMs_0bs, MOMs_1bs, MOMs_2bs
733 real(RP) :: MOMs_2ds, MOMs_5ds_h, RMOMs_Vt
734 real(RP) :: coef_at(4), coef_bt(4)
735 real(RP) :: loga_, b_, nm
737 real(RP) :: Vti, Vtr, Vts, Vtg
738 real(RP) :: Esi_mod, Egs_mod
741 real(RP) :: Pracw_orig, Pracw_kk
742 real(RP) :: Praut_berry, Praut_kk
744 real(RP) :: betai, betas
748 real(RP) :: Glv, Giv, Gil
749 real(RP) :: ventr, vents, ventg
750 real(RP) :: Bergeron_sw
758 real(RP),
parameter :: Di_max = 500.e-6_rp
759 real(RP),
parameter :: Di_a = 11.9_rp
760 real(RP) :: sw, rhoqi, XNi, XMi, Di, Ni0, Qi0, dq, qtmp
761 real(RP) :: Pidep, Pigen
765 real(RP) :: net, fac, fac_sw, fac_warm, fac_ice
766 real(RP) :: w(w_nmax)
768 real(RP) :: tend(i_qv:i_qg)
772 real(RP) :: LHVEx(
ka,
ia,
ja)
773 real(RP) :: LHFEx(
ka,
ia,
ja)
774 real(RP) :: LHSEx(
ka,
ia,
ja)
776 integer :: k, i, j, iq
784 if ( mp_couple_aerosol )
then 788 nc(k,i,j) = max( ccn(k,i,j)*1.e-6_rp, nc_def(i,j) )
796 nc(k,i,j) = nc_def(i,j)
804 call thermodyn_temp_pres_e( temp0(:,:,:), &
810 call saturation_dens2qsat_liq( qsatl(:,:,:), &
814 call saturation_dens2qsat_ice( qsati(:,:,:), &
818 call mp_tomita08_bergeronparam( temp0(:,:,:), &
823 call atmos_thermodyn_templhv( lhvex, temp0 )
824 call atmos_thermodyn_templhf( lhfex, temp0 )
825 call atmos_thermodyn_templhs( lhsex, temp0 )
851 q(iq) = qtrc0(k,i,j,iq)
855 sliq = q(i_qv) / max( qsatl(k,i,j), eps )
856 sice = q(i_qv) / max( qsati(k,i,j), eps )
858 rdens = 1.0_rp / dens
859 rho_fact = sqrt( dens00 * rdens )
862 w(i_delta1) = ( 0.5_rp + sign(0.5_rp, q(i_qr) - 1.e-4_rp ) )
864 w(i_delta2) = ( 0.5_rp + sign(0.5_rp, 1.e-4_rp - q(i_qr) ) ) &
865 * ( 0.5_rp + sign(0.5_rp, 1.e-4_rp - q(i_qs) ) )
867 w(i_delta3) = 0.5_rp + sign(0.5_rp, sice - 1.0_rp )
869 w(i_dqv_dt) = q(i_qv) * rdt
870 w(i_dqc_dt) = q(i_qc) * rdt
871 w(i_dqr_dt) = q(i_qr) * rdt
872 w(i_dqi_dt) = q(i_qi) * rdt
873 w(i_dqs_dt) = q(i_qs) * rdt
874 w(i_dqg_dt) = q(i_qg) * rdt
876 bergeron_sw = ( 0.5_rp + sign(0.5_rp, temc + 30.0_rp ) ) &
877 * ( 0.5_rp + sign(0.5_rp, 0.0_rp - temc ) ) &
878 * ( 1.0_rp - sw_useicegen )
881 zerosw = 0.5_rp - sign(0.5_rp, q(i_qr) - 1.e-12_rp )
882 rlmdr = sqrt(sqrt( dens * q(i_qr) / ( ar * n0r * gam_1br ) + zerosw )) * ( 1.0_rp - zerosw )
884 rlmdr_dr = sqrt( rlmdr )
891 rlmdr_3dr = rlmdr**3 * rlmdr_dr
892 rlmdr_5dr = rlmdr**5 * rlmdr_dr
893 rlmdr_6dr = rlmdr**6 * rlmdr_dr
896 zerosw = 0.5_rp - sign(0.5_rp, q(i_qs) - 1.e-12_rp )
897 rlmds = sqrt(sqrt( dens * q(i_qs) / ( as * n0s * gam_1bs ) + zerosw )) * ( 1.0_rp - zerosw )
899 rlmds_ds = sqrt( sqrt(rlmds) )
905 rlmds_3ds = rlmds**3 * rlmds_ds
906 rlmds_5ds = rlmds**5 * rlmds_ds
908 moms_0 = n0s * gam * rlmds
909 moms_1 = n0s * gam_2 * rlmds_2
910 moms_2 = n0s * gam_3 * rlmds_3
911 moms_0bs = n0s * gam_1bs * rlmds_1bs
912 moms_1bs = n0s * gam_2bs * rlmds_2bs
913 moms_2bs = n0s * gam_3bs * rlmds_3bs
914 moms_2ds = n0s * gam_3ds * rlmds_3ds
915 moms_5ds_h = n0s * gam_5ds_h * sqrt(rlmds_5ds)
916 rmoms_vt = gam_1bsds / gam_1bs * rlmds_ds
920 rhoqs = dens * q(i_qs)
921 zerosw = 0.5_rp - sign(0.5_rp, rhoqs - 1.e-12_rp )
922 xs2 = rhoqs / as * ( 1.0_rp - zerosw )
924 tems = min( -0.1_rp, temc )
925 coef_at(1) = coef_a( 1) + tems * ( coef_a( 2) + tems * ( coef_a( 5) + tems * coef_a( 9) ) )
926 coef_at(2) = coef_a( 3) + tems * ( coef_a( 4) + tems * coef_a( 7) )
927 coef_at(3) = coef_a( 6) + tems * coef_a( 8)
928 coef_at(4) = coef_a(10)
929 coef_bt(1) = coef_b( 1) + tems * ( coef_b( 2) + tems * ( coef_b( 5) + tems * coef_b( 9) ) )
930 coef_bt(2) = coef_b( 3) + tems * ( coef_b( 4) + tems * coef_b( 7) )
931 coef_bt(3) = coef_b( 6) + tems * coef_b( 8)
932 coef_bt(4) = coef_b(10)
936 moms_0 = ( sw_roh2014 ) * 10.0_rp**loga_ * xs2**b_ &
937 + ( 1.0_rp-sw_roh2014 ) * moms_0
940 loga_ = coef_at(1) + nm * ( coef_at(2) + nm * ( coef_at(3) + nm * coef_at(4) ) )
941 b_ = coef_bt(1) + nm * ( coef_bt(2) + nm * ( coef_bt(3) + nm * coef_bt(4) ) )
942 moms_1 = ( sw_roh2014 ) * 10.0_rp**loga_ * xs2**b_ &
943 + ( 1.0_rp-sw_roh2014 ) * moms_1
945 moms_2 = ( sw_roh2014 ) * xs2 &
946 + ( 1.0_rp-sw_roh2014 ) * moms_2
949 loga_ = coef_at(1) + nm * ( coef_at(2) + nm * ( coef_at(3) + nm * coef_at(4) ) )
950 b_ = coef_bt(1) + nm * ( coef_bt(2) + nm * ( coef_bt(3) + nm * coef_bt(4) ) )
951 moms_0bs = ( sw_roh2014 ) * 10.0_rp**loga_ * xs2**b_ &
952 + ( 1.0_rp-sw_roh2014 ) * moms_0bs
955 loga_ = coef_at(1) + nm * ( coef_at(2) + nm * ( coef_at(3) + nm * coef_at(4) ) )
956 b_ = coef_bt(1) + nm * ( coef_bt(2) + nm * ( coef_bt(3) + nm * coef_bt(4) ) )
957 moms_1bs = ( sw_roh2014 ) * 10.0_rp**loga_ * xs2**b_ &
958 + ( 1.0_rp-sw_roh2014 ) * moms_1bs
961 loga_ = coef_at(1) + nm * ( coef_at(2) + nm * ( coef_at(3) + nm * coef_at(4) ) )
962 b_ = coef_bt(1) + nm * ( coef_bt(2) + nm * ( coef_bt(3) + nm * coef_bt(4) ) )
963 moms_2bs = ( sw_roh2014 ) * 10.0_rp**loga_ * xs2**b_ &
964 + ( 1.0_rp-sw_roh2014 ) * moms_2bs
967 loga_ = coef_at(1) + nm * ( coef_at(2) + nm * ( coef_at(3) + nm * coef_at(4) ) )
968 b_ = coef_bt(1) + nm * ( coef_bt(2) + nm * ( coef_bt(3) + nm * coef_bt(4) ) )
969 moms_2ds = ( sw_roh2014 ) * 10.0_rp**loga_ * xs2**b_ &
970 + ( 1.0_rp-sw_roh2014 ) * moms_2ds
973 loga_ = coef_at(1) + nm * ( coef_at(2) + nm * ( coef_at(3) + nm * coef_at(4) ) )
974 b_ = coef_bt(1) + nm * ( coef_bt(2) + nm * ( coef_bt(3) + nm * coef_bt(4) ) )
975 moms_5ds_h = ( sw_roh2014 ) * 10.0_rp**loga_ * xs2**b_ &
976 + ( 1.0_rp-sw_roh2014 ) * moms_5ds_h
979 loga_ = coef_at(1) + nm * ( coef_at(2) + nm * ( coef_at(3) + nm * coef_at(4) ) )
980 b_ = coef_bt(1) + nm * ( coef_bt(2) + nm * ( coef_bt(3) + nm * coef_bt(4) ) )
981 rmoms_vt = ( sw_roh2014 ) * 10.0_rp**loga_ * xs2**b_ / ( moms_0bs + zerosw ) &
982 + ( 1.0_rp-sw_roh2014 ) * rmoms_vt
985 zerosw = 0.5_rp - sign(0.5_rp, q(i_qg) - 1.e-12_rp )
986 rlmdg = sqrt(sqrt( dens * q(i_qg) / ( ag * n0g * gam_1bg ) + zerosw )) * ( 1.0_rp - zerosw )
988 rlmdg_dg = sqrt( rlmdg )
991 rlmdg_3dg = rlmdg**3 * rlmdg_dg
992 rlmdg_5dg = rlmdg**5 * rlmdg_dg
999 zerosw = 0.5_rp + sign(0.5_rp, q(i_qi) - 1.e-8_rp )
1000 vti = -3.29_rp * ( dens * q(i_qi) * zerosw )**0.16_rp
1001 vtr = -cr * rho_fact * gam_1brdr / gam_1br * rlmdr_dr
1002 vts = -cs * rho_fact * rmoms_vt
1003 vtg = -cg * rho_fact * gam_1bgdg / gam_1bg * rlmdg_dg
1006 esi_mod = min( esi, esi * exp( gamma_sacr * temc ) )
1007 egs_mod = min( egs, egs * exp( gamma_gacs * temc ) )
1010 pracw_orig = q(i_qc) * 0.25_rp * pi * erw * n0r * cr * gam_3dr * rlmdr_3dr * rho_fact
1012 pracw_kk = 67.0_rp * ( q(i_qc) * q(i_qr) )**1.15_rp
1015 w(i_pracw) = ( 1.0_rp - sw_kk2000 ) * pracw_orig &
1016 + ( sw_kk2000 ) * pracw_kk
1019 w(i_psacw) = q(i_qc) * 0.25_rp * pi * esw * cs * moms_2ds * rho_fact
1022 w(i_pgacw) = q(i_qc) * 0.25_rp * pi * egw * n0g * cg * gam_3dg * rlmdg_3dg * rho_fact
1025 w(i_praci) = q(i_qi) * 0.25_rp * pi * eri * n0r * cr * gam_3dr * rlmdr_3dr * rho_fact
1028 w(i_psaci) = q(i_qi) * 0.25_rp * pi * esi_mod * cs * moms_2ds * rho_fact
1031 w(i_pgaci) = q(i_qi) * 0.25_rp * pi * egi * n0g * cg * gam_3dg * rlmdg_3dg * rho_fact * ( 1.0_rp-sw_roh2014 )
1034 w(i_piacr) = q(i_qi) * ar / 4.19e-13_rp * 0.25_rp * pi * eri * n0r * cr * gam_6dr * rlmdr_6dr * rho_fact
1037 w(i_psacr) = ar * 0.25_rp * pi * rdens * esr * n0r * abs(vtr-vts) &
1038 * ( gam_1br * rlmdr_1br * moms_2 &
1039 + 2.0_rp * gam_2br * rlmdr_2br * moms_1 &
1040 + gam_3br * rlmdr_3br * moms_0 )
1043 w(i_pgacr) = ar * 0.25_rp * pi * rdens * egr * n0g * n0r * abs(vtg-vtr) &
1044 * ( gam_1br * rlmdr_1br * gam_3 * rlmdg_3 &
1045 + 2.0_rp * gam_2br * rlmdr_2br * gam_2 * rlmdg_2 &
1046 + gam_3br * rlmdr_3br * gam * rlmdg )
1049 w(i_pracs) = as * 0.25_rp * pi * rdens * esr * n0r * abs(vtr-vts) &
1050 * ( moms_0bs * gam_3 * rlmdr_3 &
1051 + 2.0_rp * moms_1bs * gam_2 * rlmdr_2 &
1052 + moms_2bs * gam * rlmdr )
1055 w(i_pgacs) = as * 0.25_rp * pi * rdens * egs_mod * n0g * abs(vtg-vts) * ( 1.0_rp-sw_roh2014 ) &
1056 * ( moms_0bs * gam_3 * rlmdg_3 &
1057 + 2.0_rp * moms_1bs * gam_2 * rlmdg_2 &
1058 + moms_2bs * gam * rlmdg )
1062 rhoqc = dens * q(i_qc) * 1000.0_rp
1063 dc = 0.146_rp - 5.964e-2_rp *
log( nc(k,i,j) / 2000.0_rp )
1064 praut_berry = rdens * 1.67e-5_rp * rhoqc * rhoqc / ( 5.0_rp + 3.66e-2_rp * nc(k,i,j) / ( dc * rhoqc + eps ) )
1066 praut_kk = 1350.0_rp * q(i_qc)**2.47_rp * nc(k,i,j)**(-1.79_rp)
1069 w(i_praut) = ( 1.0_rp - sw_kk2000 ) * praut_berry &
1070 + ( sw_kk2000 ) * praut_kk
1073 betai = min( beta_saut, beta_saut * exp( gamma_saut * temc ) )
1074 w(i_psaut) = max( betai*(q(i_qi)-qicrt_saut), 0.0_rp )
1077 betas = min( beta_gaut, beta_gaut * exp( gamma_gaut * temc ) )
1078 w(i_pgaut) = max( betas*(q(i_qs)-qscrt_gaut), 0.0_rp )
1081 da = ( da0 + dda_dt * temc )
1082 kd = ( dw0 + ddw_dt * temc ) * pre00 / pres
1083 nu = ( mu0 + dmu_dt * temc ) * rdens
1085 glv = 1.0_rp / ( lhvex(k,i,j)/(da*temp) * ( lhvex(k,i,j)/(rvap*temp) - 1.0_rp ) + 1.0_rp/(kd*dens*qsatl(k,i,j)) )
1086 giv = 1.0_rp / ( lhsex(k,i,j)/(da*temp) * ( lhsex(k,i,j)/(rvap*temp) - 1.0_rp ) + 1.0_rp/(kd*dens*qsati(k,i,j)) )
1087 gil = 1.0_rp / lhfex(k,i,j) * (da*temc)
1090 ventr = f1r * gam_2 * rlmdr_2 + f2r * sqrt( cr * rho_fact / nu * rlmdr_5dr ) * gam_5dr_h
1092 w(i_prevp) = 2.0_rp * pi * rdens * n0r * ( 1.0_rp-min(sliq,1.0_rp) ) * glv * ventr
1095 vents = f1s * moms_1 + f2s * sqrt( cs * rho_fact / nu ) * moms_5ds_h
1097 tmp = 2.0_rp * pi * rdens * ( sice-1.0_rp ) * giv * vents
1099 w(i_psdep) = ( w(i_delta3) ) * tmp
1100 w(i_pssub) = ( w(i_delta3)-1.0_rp ) * tmp
1103 w(i_psmlt) = 2.0_rp * pi * rdens * gil * vents &
1104 + cl * temc / lhfex(k,i,j) * ( w(i_psacw) + w(i_psacr) )
1107 ventg = f1g * gam_2 * rlmdg_2 + f2g * sqrt( cg * rho_fact / nu * rlmdg_5dg ) * gam_5dg_h
1109 tmp = 2.0_rp * pi * rdens * n0g * ( sice-1.0_rp ) * giv * ventg
1111 w(i_pgdep) = ( w(i_delta3) ) * tmp
1112 w(i_pgsub) = ( w(i_delta3)-1.0_rp ) * tmp
1115 w(i_pgmlt) = 2.0_rp * pi * rdens * n0g * gil * ventg &
1116 + cl * temc / lhfex(k,i,j) * ( w(i_pgacw) + w(i_pgacr) )
1119 w(i_pgfrz) = 2.0_rp * pi * rdens * n0r * 60.0_rp * b_frz * ar * ( exp(-a_frz*temc) - 1.0_rp ) * rlmdr_7
1122 dt1 = ( mi50**ma2(k,i,j) - mi40**ma2(k,i,j) ) / ( a1(k,i,j) * ma2(k,i,j) )
1123 ni50 = q(i_qi) * dt / ( mi50 * dt1 )
1125 w(i_psfw) = bergeron_sw * ni50 * ( a1(k,i,j) * mi50**a2(k,i,j) &
1126 + pi * eiw * dens * q(i_qc) * ri50*ri50 * vti50 )
1127 w(i_psfi) = bergeron_sw * q(i_qi) / dt1
1129 w(i_psdep) = min( w(i_psdep), w(i_dqv_dt) )
1130 w(i_pgdep) = min( w(i_pgdep), w(i_dqv_dt) )
1132 w(i_praut) = min( w(i_praut), w(i_dqc_dt) )
1133 w(i_pracw) = min( w(i_pracw), w(i_dqc_dt) )
1134 w(i_psacw) = min( w(i_psacw), w(i_dqc_dt) )
1135 w(i_pgacw) = min( w(i_pgacw), w(i_dqc_dt) )
1136 w(i_psfw ) = min( w(i_psfw ), w(i_dqc_dt) )
1138 w(i_prevp) = min( w(i_prevp), w(i_dqr_dt) )
1139 w(i_piacr) = min( w(i_piacr), w(i_dqr_dt) )
1140 w(i_psacr) = min( w(i_psacr), w(i_dqr_dt) )
1141 w(i_pgacr) = min( w(i_pgacr), w(i_dqr_dt) )
1142 w(i_pgfrz) = min( w(i_pgfrz), w(i_dqr_dt) )
1144 w(i_psaut) = min( w(i_psaut), w(i_dqi_dt) )
1145 w(i_praci) = min( w(i_praci), w(i_dqi_dt) )
1146 w(i_psaci) = min( w(i_psaci), w(i_dqi_dt) )
1147 w(i_pgaci) = min( w(i_pgaci), w(i_dqi_dt) )
1148 w(i_psfi ) = min( w(i_psfi ), w(i_dqi_dt) )
1150 w(i_pgaut) = min( w(i_pgaut), w(i_dqs_dt) )
1151 w(i_pracs) = min( w(i_pracs), w(i_dqs_dt) )
1152 w(i_pgacs) = min( w(i_pgacs), w(i_dqs_dt) )
1153 w(i_psmlt) = max( w(i_psmlt), 0.0_rp )
1154 w(i_psmlt) = min( w(i_psmlt), w(i_dqs_dt) )
1155 w(i_pssub) = min( w(i_pssub), w(i_dqs_dt) )
1157 w(i_pgmlt) = max( w(i_pgmlt), 0.0_rp )
1158 w(i_pgmlt) = min( w(i_pgmlt), w(i_dqg_dt) )
1159 w(i_pgsub) = min( w(i_pgsub), w(i_dqg_dt) )
1161 w(i_piacr_s) = ( 1.0_rp - w(i_delta1) ) * w(i_piacr)
1162 w(i_piacr_g) = ( w(i_delta1) ) * w(i_piacr)
1163 w(i_praci_s) = ( 1.0_rp - w(i_delta1) ) * w(i_praci)
1164 w(i_praci_g) = ( w(i_delta1) ) * w(i_praci)
1165 w(i_psacr_s) = ( w(i_delta2) ) * w(i_psacr)
1166 w(i_psacr_g) = ( 1.0_rp - w(i_delta2) ) * w(i_psacr)
1167 w(i_pracs ) = ( 1.0_rp - w(i_delta2) ) * w(i_pracs)
1169 ice = 0.5_rp - sign( 0.5_rp, temp0(k,i,j)-tem00 )
1179 fac_sw = 0.5_rp + sign( 0.5_rp, net+eps )
1181 + ( 1.0_rp - fac_sw ) * min( -w(i_dqc_dt)/(net-fac_sw), 1.0_rp )
1183 w(i_praut) = w(i_praut) * fac
1184 w(i_pracw) = w(i_pracw) * fac
1185 w(i_psacw) = w(i_psacw) * fac
1186 w(i_pgacw) = w(i_pgacw) * fac
1187 w(i_psfw ) = w(i_psfw ) * fac
1198 fac_sw = 0.5_rp + sign( 0.5_rp, net+eps )
1200 + ( 1.0_rp - fac_sw ) * min( -w(i_dqi_dt)/(net-fac_sw), 1.0_rp )
1202 w(i_praci_s) = w(i_praci_s) * fac
1203 w(i_psaut ) = w(i_psaut ) * fac
1204 w(i_psaci ) = w(i_psaci ) * fac
1205 w(i_psfi ) = w(i_psfi ) * fac
1206 w(i_praci_g) = w(i_praci_g) * fac
1207 w(i_pgaci ) = w(i_pgaci ) * fac
1218 ) * ( 1.0_rp - ice ) &
1228 fac_sw = 0.5_rp + sign( 0.5_rp, net+eps )
1230 + ( 1.0_rp - fac_sw ) * min( -w(i_dqr_dt)/(net-fac_sw), 1.0_rp )
1232 fac_warm = fac * (1.0_rp-ice) + 1.0_rp * ice
1233 fac_ice = fac * ice + 1.0_rp * (1.0_rp-ice)
1235 w(i_praut) = w(i_praut) * fac
1236 w(i_pracw) = w(i_pracw) * fac
1237 w(i_prevp) = w(i_prevp) * fac
1239 w(i_psacw) = w(i_psacw) * fac_warm
1240 w(i_pgacw) = w(i_pgacw) * fac_warm
1241 w(i_psmlt) = w(i_psmlt) * fac_warm
1242 w(i_pgmlt) = w(i_pgmlt) * fac_warm
1244 w(i_piacr_s) = w(i_piacr_s) * fac_ice
1245 w(i_psacr_s) = w(i_psacr_s) * fac_ice
1246 w(i_piacr_g) = w(i_piacr_g) * fac_ice
1247 w(i_psacr_g) = w(i_psacr_g) * fac_ice
1248 w(i_pgacr ) = w(i_pgacr ) * fac_ice
1249 w(i_pgfrz ) = w(i_pgfrz ) * fac_ice
1259 fac_sw = 0.5_rp + sign( 0.5_rp, net+eps )
1261 + ( 1.0_rp - fac_sw ) * min( -w(i_dqv_dt)/(net-fac_sw), 1.0_rp )
1263 fac = ( w(i_delta3) ) * fac &
1264 + ( 1.0_rp - w(i_delta3) )
1266 fac = fac * ice + 1.0_rp * (1.0_rp - ice)
1268 w(i_prevp) = w(i_prevp) * fac
1269 w(i_pssub) = w(i_pssub) * fac
1270 w(i_pgsub) = w(i_pgsub) * fac
1271 w(i_psdep) = w(i_psdep) * fac
1272 w(i_pgdep) = w(i_pgdep) * fac
1279 ) * ( 1.0_rp - ice ) &
1295 fac_sw = 0.5_rp + sign( 0.5_rp, net+eps )
1297 + ( 1.0_rp - fac_sw ) * min( -w(i_dqs_dt)/(net-fac_sw), 1.0_rp )
1299 fac_warm = fac * (1.0_rp - ice) + 1.0_rp * ice
1300 fac_ice = fac * ice + 1.0_rp * (1.0_rp-ice)
1302 w(i_pgacs) = w(i_pgacs) * fac
1304 w(i_psmlt) = w(i_psmlt) * fac_warm
1306 w(i_psdep ) = w(i_psdep ) * fac_ice
1307 w(i_psacw ) = w(i_psacw ) * fac_ice
1308 w(i_psfw ) = w(i_psfw ) * fac_ice
1309 w(i_piacr_s) = w(i_piacr_s) * fac_ice
1310 w(i_psacr_s) = w(i_psacr_s) * fac_ice
1311 w(i_psaut ) = w(i_psaut ) * fac_ice
1312 w(i_praci_s) = w(i_praci_s) * fac_ice
1313 w(i_psaci ) = w(i_psaci ) * fac_ice
1314 w(i_psfi ) = w(i_psfi ) * fac_ice
1315 w(i_pssub ) = w(i_pssub ) * fac_ice
1316 w(i_pracs ) = w(i_pracs ) * fac_ice
1317 w(i_pgaut ) = w(i_pgaut ) * fac_ice
1323 ) * ( 1.0_rp - ice ) &
1338 fac_sw = 0.5_rp + sign( 0.5_rp, net+eps )
1340 + ( 1.0_rp - fac_sw ) * min( -w(i_dqg_dt)/(net-fac_sw), 1.0_rp )
1342 fac_warm = fac * (1.0_rp - ice) + 1.0_rp * ice
1343 fac_ice = fac * ice + 1.0_rp * (1.0_rp-ice)
1345 w(i_pgacs) = w(i_pgacs) * fac
1347 w(i_pgmlt) = w(i_pgmlt) * fac_warm
1349 w(i_pgdep ) = w(i_pgdep ) * fac_ice
1350 w(i_pgacw ) = w(i_pgacw ) * fac_ice
1351 w(i_piacr_g) = w(i_piacr_g) * fac_ice
1352 w(i_psacr_g) = w(i_psacr_g) * fac_ice
1353 w(i_pgacr ) = w(i_pgacr ) * fac_ice
1354 w(i_pgfrz ) = w(i_pgfrz ) * fac_ice
1355 w(i_praci_g) = w(i_praci_g) * fac_ice
1356 w(i_pgaci ) = w(i_pgaci ) * fac_ice
1357 w(i_pgaut ) = w(i_pgaut ) * fac_ice
1358 w(i_pracs ) = w(i_pracs ) * fac_ice
1359 w(i_pgsub ) = w(i_pgsub ) * fac_ice
1371 tend(i_qr) = w(i_praut ) &
1379 ) * ( 1.0_rp - ice ) &
1402 ) * ( 1.0_rp - ice ) &
1418 tend(i_qg) = w(i_pgacs ) &
1421 ) * ( 1.0_rp - ice ) &
1436 tend(i_qc) = max( tend(i_qc), -w(i_dqc_dt) )
1437 tend(i_qr) = max( tend(i_qr), -w(i_dqr_dt) )
1438 tend(i_qi) = max( tend(i_qi), -w(i_dqi_dt) )
1439 tend(i_qs) = max( tend(i_qs), -w(i_dqs_dt) )
1440 tend(i_qg) = max( tend(i_qg), -w(i_dqg_dt) )
1442 tend(i_qv) = - ( tend(i_qc) &
1448 qtrc_t(k,i,j,i_qv) = tend(i_qv)
1449 qtrc_t(k,i,j,i_qc) = tend(i_qc)
1450 qtrc_t(k,i,j,i_qr) = tend(i_qr)
1451 qtrc_t(k,i,j,i_qi) = tend(i_qi)
1452 qtrc_t(k,i,j,i_qs) = tend(i_qs)
1453 qtrc_t(k,i,j,i_qg) = tend(i_qg)
1455 qtrc0(k,i,j,i_qv) = qtrc0(k,i,j,i_qv) + qtrc_t(k,i,j,i_qv) * dt
1456 qtrc0(k,i,j,i_qc) = qtrc0(k,i,j,i_qc) + qtrc_t(k,i,j,i_qc) * dt
1457 qtrc0(k,i,j,i_qr) = qtrc0(k,i,j,i_qr) + qtrc_t(k,i,j,i_qr) * dt
1458 qtrc0(k,i,j,i_qi) = qtrc0(k,i,j,i_qi) + qtrc_t(k,i,j,i_qi) * dt
1459 qtrc0(k,i,j,i_qs) = qtrc0(k,i,j,i_qs) + qtrc_t(k,i,j,i_qs) * dt
1460 qtrc0(k,i,j,i_qg) = qtrc0(k,i,j,i_qg) + qtrc_t(k,i,j,i_qg) * dt
1466 if ( mp_doexpricit_icegen )
then 1476 sice = qtrc0(k,i,j,i_qv) / max( qsati(k,i,j), eps )
1478 rdens = 1.0_rp / dens
1480 rhoqi = dens * qtrc0(k,i,j,i_qi)
1482 da = ( da0 + dda_dt * temc )
1483 kd = ( dw0 + ddw_dt * temc ) * pre00 / pres
1485 giv = 1.0_rp / ( lhsex(k,i,j)/(da*temp) * ( lhsex(k,i,j)/(rvap*temp) - 1.0_rp ) + 1.0_rp/(kd*dens*qsati(k,i,j)) )
1488 sw = ( 0.5_rp + sign(0.5_rp, 0.0_rp - temc ) ) &
1489 * ( 0.5_rp + sign(0.5_rp, rhoqi ) )
1491 rhoqi = max(rhoqi,eps)
1493 xni = min( max( 5.38e7_rp * rhoqi**0.75_rp, 1.e3_rp ), 1.e6_rp )
1495 di = min( di_a * sqrt(xmi), di_max )
1497 pidep = sw * 4.0_rp * di * xni * rdens * ( sice-1.0_rp ) * giv
1500 sw = ( 0.5_rp + sign(0.5_rp, 0.0_rp - temc ) ) &
1501 * ( 0.5_rp + sign(0.5_rp, sice - 1.0_rp ) )
1503 ni0 = max( exp(-0.1_rp*temc), 1.0_rp ) * 1000.0_rp
1504 qi0 = 4.92e-11 * ni0**1.33_rp * rdens
1506 pigen = sw * max( min( qi0-qtrc0(k,i,j,i_qi), qtrc0(k,i,j,i_qv)-qsati(k,i,j) ), 0.0_rp ) / dt
1509 dq = ( pigen + pidep ) * dt
1510 qtmp = qtrc0(k,i,j,i_qv) - dq
1511 if ( dq > 0.0_rp )
then 1512 qtmp = max( qtmp, qsati(k,i,j) )
1514 qtmp = min( qtmp, qsati(k,i,j) )
1516 dq = qtrc0(k,i,j,i_qv) - qtmp
1517 qtmp = qtrc0(k,i,j,i_qi) + dq
1518 qtmp = max( qtmp, 0.0_rp )
1519 dq = qtmp - qtrc0(k,i,j,i_qi)
1520 qtrc0(k,i,j,i_qi) = qtrc0(k,i,j,i_qi) + dq
1521 qtrc0(k,i,j,i_qv) = qtrc0(k,i,j,i_qv) - dq
1522 qtrc_t(k,i,j,i_qi) = qtrc_t(k,i,j,i_qi) + dq /dt
1523 qtrc_t(k,i,j,i_qv) = qtrc_t(k,i,j,i_qv) - dq /dt
1528 sw = ( 0.5_rp - sign(0.5_rp, temc + 40.0_rp ) )
1530 dq = sw * qtrc0(k,i,j,i_qc)
1531 qtrc0(k,i,j,i_qi) = qtrc0(k,i,j,i_qi) + dq
1532 qtrc0(k,i,j,i_qc) = qtrc0(k,i,j,i_qc) - dq
1533 qtrc_t(k,i,j,i_qi) = qtrc_t(k,i,j,i_qi) + dq /dt
1534 qtrc_t(k,i,j,i_qc) = qtrc_t(k,i,j,i_qc) - dq /dt
1537 sw = ( 0.5_rp + sign(0.5_rp, temc + 40.0_rp ) ) &
1538 * ( 0.5_rp + sign(0.5_rp, 0.0_rp - temc ) )
1540 dq = sw * ( dens / dwatr * qtrc0(k,i,j,i_qc)**2 / (nc(k,i,j)*1.e+6) ) &
1541 * b_frz * ( exp(-a_frz*temc) - 1.0_rp ) * dt
1542 qtmp = qtrc0(k,i,j,i_qc) - dq
1543 qtmp = max( qtmp, 0.0_rp )
1544 dq = qtrc0(k,i,j,i_qc) - qtmp
1545 qtrc0(k,i,j,i_qi) = qtrc0(k,i,j,i_qi) + dq
1546 qtrc0(k,i,j,i_qc) = qtrc0(k,i,j,i_qc) - dq
1547 qtrc_t(k,i,j,i_qi) = qtrc_t(k,i,j,i_qi) + dq /dt
1548 qtrc_t(k,i,j,i_qc) = qtrc_t(k,i,j,i_qc) - dq /dt
1551 sw = ( 0.5_rp - sign(0.5_rp, 0.0_rp - temc ) )
1553 dq = - sw * qtrc0(k,i,j,i_qi)
1554 qtrc0(k,i,j,i_qi) = qtrc0(k,i,j,i_qi) + dq
1555 qtrc0(k,i,j,i_qc) = qtrc0(k,i,j,i_qc) - dq
1556 qtrc_t(k,i,j,i_qi) = qtrc_t(k,i,j,i_qi) + dq /dt
1557 qtrc_t(k,i,j,i_qc) = qtrc_t(k,i,j,i_qc) - dq /dt
1567 rhoe_t(k,i,j) = - dens0(k,i,j) * ( lhvex(k,i,j) * qtrc_t(k,i,j,i_qv) &
1568 - lhfex(k,i,j) * qtrc_t(k,i,j,i_qi) &
1569 - lhfex(k,i,j) * qtrc_t(k,i,j,i_qs) &
1570 - lhfex(k,i,j) * qtrc_t(k,i,j,i_qg) )
1572 rhoe0(k,i,j) = rhoe0(k,i,j) + rhoe_t(k,i,j) * dt
1628 end subroutine mp_tomita08
1632 subroutine mp_tomita08_vterm( &
1641 real(RP),
intent(out) :: vterm(
ka,
ia,
ja,
qa)
1642 real(RP),
intent(in) :: DENS0(
ka,
ia,
ja)
1643 real(RP),
intent(in) :: TEMP0(
ka,
ia,
ja)
1644 real(RP),
intent(in) :: QTRC0(
ka,
ia,
ja,
qa)
1650 real(RP) :: rho_fact
1652 real(RP) :: RLMDr, RLMDs, RLMDg
1653 real(RP) :: RLMDr_dr, RLMDs_ds, RLMDg_dg
1656 real(RP) :: tems, rhoqs, Xs2
1657 real(RP) :: MOMs_0bs, RMOMs_Vt
1658 real(RP) :: coef_at(4), coef_bt(4)
1659 real(RP) :: loga_, b_, nm
1662 integer :: k, i, j, iq
1670 temc = temp0(k,i,j) - tem00
1672 q(iq) = qtrc0(k,i,j,iq)
1675 rho_fact = sqrt( dens00 / dens )
1678 zerosw = 0.5_rp - sign(0.5_rp, q(i_qr) - 1.e-12_rp )
1679 rlmdr = sqrt(sqrt( dens * q(i_qr) / ( ar * n0r * gam_1br ) + zerosw )) * ( 1.0_rp - zerosw )
1681 rlmdr_dr = sqrt( rlmdr )
1684 zerosw = 0.5_rp - sign(0.5_rp, q(i_qs) - 1.e-12_rp )
1685 rlmds = sqrt(sqrt( dens * q(i_qs) / ( as * n0s * gam_1bs ) + zerosw )) * ( 1.0_rp - zerosw )
1687 rlmds_ds = sqrt( sqrt(rlmds) )
1688 rmoms_vt = gam_1bsds / gam_1bs * rlmds_ds
1692 rhoqs = dens * q(i_qs)
1693 zerosw = 0.5_rp - sign(0.5_rp, rhoqs - 1.e-12_rp )
1694 xs2 = rhoqs / as * ( 1.0_rp - zerosw )
1696 tems = min( -0.1_rp, temc )
1697 coef_at(1) = coef_a( 1) + tems * ( coef_a( 2) + tems * ( coef_a( 5) + tems * coef_a( 9) ) )
1698 coef_at(2) = coef_a( 3) + tems * ( coef_a( 4) + tems * coef_a( 7) )
1699 coef_at(3) = coef_a( 6) + tems * coef_a( 8)
1700 coef_at(4) = coef_a(10)
1701 coef_bt(1) = coef_b( 1) + tems * ( coef_b( 2) + tems * ( coef_b( 5) + tems * coef_b( 9) ) )
1702 coef_bt(2) = coef_b( 3) + tems * ( coef_b( 4) + tems * coef_b( 7) )
1703 coef_bt(3) = coef_b( 6) + tems * coef_b( 8)
1704 coef_bt(4) = coef_b(10)
1707 loga_ = coef_at(1) + nm * ( coef_at(2) + nm * ( coef_at(3) + nm * coef_at(4) ) )
1708 b_ = coef_bt(1) + nm * ( coef_bt(2) + nm * ( coef_bt(3) + nm * coef_bt(4) ) )
1709 moms_0bs = 10.0_rp**loga_ * xs2**b_
1712 loga_ = coef_at(1) + nm * ( coef_at(2) + nm * ( coef_at(3) + nm * coef_at(4) ) )
1713 b_ = coef_bt(1) + nm * ( coef_bt(2) + nm * ( coef_bt(3) + nm * coef_bt(4) ) )
1714 rmoms_vt = ( sw_roh2014 ) * 10.0_rp**loga_ * xs2**b_ / ( moms_0bs + zerosw ) &
1715 + ( 1.0_rp-sw_roh2014 ) * rmoms_vt
1718 zerosw = 0.5_rp - sign(0.5_rp, q(i_qg) - 1.e-12_rp )
1719 rlmdg = sqrt(sqrt( dens * q(i_qg) / ( ag * n0g * gam_1bg ) + zerosw )) * ( 1.0_rp - zerosw )
1721 rlmdg_dg = sqrt( rlmdg )
1724 zerosw = 0.5_rp + sign(0.5_rp, q(i_qi) - 1.e-8_rp )
1725 vterm(k,i,j,i_qv) = 0.0_rp
1726 vterm(k,i,j,i_qc) = 0.0_rp
1727 vterm(k,i,j,i_qi) = -3.29_rp * ( dens * q(i_qi) * zerosw )**0.16_rp
1728 vterm(k,i,j,i_qr) = -cr * rho_fact * gam_1brdr / gam_1br * rlmdr_dr
1729 vterm(k,i,j,i_qs) = -cs * rho_fact * rmoms_vt
1730 vterm(k,i,j,i_qg) = -cg * rho_fact * gam_1bgdg / gam_1bg * rlmdg_dg
1737 vterm( 1:
ks-1,i,j,:) = 0.0_rp
1738 vterm(
ke+1:
ka ,i,j,:) = 0.0_rp
1743 end subroutine mp_tomita08_vterm
1746 subroutine mp_tomita08_bergeronparam( &
1755 real(RP),
intent(in) :: temp(
ka,
ia,
ja)
1756 real(RP),
intent(out) :: a1 (
ka,
ia,
ja)
1757 real(RP),
intent(out) :: a2 (
ka,
ia,
ja)
1758 real(RP),
intent(out) :: ma2 (
ka,
ia,
ja)
1760 real(RP) :: a1_tab(32)
1761 real(RP) :: a2_tab(32)
1763 data a1_tab / 0.0001e-7_rp, 0.7939e-7_rp, 0.7841e-6_rp, 0.3369e-5_rp, 0.4336e-5_rp, &
1764 0.5285e-5_rp, 0.3728e-5_rp, 0.1852e-5_rp, 0.2991e-6_rp, 0.4248e-6_rp, &
1765 0.7434e-6_rp, 0.1812e-5_rp, 0.4394e-5_rp, 0.9145e-5_rp, 0.1725e-4_rp, &
1766 0.3348e-4_rp, 0.1725e-4_rp, 0.9175e-5_rp, 0.4412e-5_rp, 0.2252e-5_rp, &
1767 0.9115e-6_rp, 0.4876e-6_rp, 0.3473e-6_rp, 0.4758e-6_rp, 0.6306e-6_rp, &
1768 0.8573e-6_rp, 0.7868e-6_rp, 0.7192e-6_rp, 0.6513e-6_rp, 0.5956e-6_rp, &
1769 0.5333e-6_rp, 0.4834e-6_rp /
1771 data a2_tab / 0.0100_rp, 0.4006_rp, 0.4831_rp, 0.5320_rp, 0.5307_rp, &
1772 0.5319_rp, 0.5249_rp, 0.4888_rp, 0.3849_rp, 0.4047_rp, &
1773 0.4318_rp, 0.4771_rp, 0.5183_rp, 0.5463_rp, 0.5651_rp, &
1774 0.5813_rp, 0.5655_rp, 0.5478_rp, 0.5203_rp, 0.4906_rp, &
1775 0.4447_rp, 0.4126_rp, 0.3960_rp, 0.4149_rp, 0.4320_rp, &
1776 0.4506_rp, 0.4483_rp, 0.4460_rp, 0.4433_rp, 0.4413_rp, &
1777 0.4382_rp, 0.4361_rp /
1789 temc = min( max( temp(k,i,j)-tem00, -30.99_rp ), 0.0_rp )
1790 itemc = int( -temc ) + 1
1791 fact = - ( temc +
real(itemc-1,kind=8) )
1793 a1(k,i,j) = ( 1.0_rp-fact ) * a1_tab(itemc ) &
1794 + ( fact ) * a1_tab(itemc+1)
1796 a2(k,i,j) = ( 1.0_rp-fact ) * a2_tab(itemc ) &
1797 + ( fact ) * a2_tab(itemc+1)
1799 ma2(k,i,j) = 1.0_rp - a2(k,i,j)
1801 a1(k,i,j) = a1(k,i,j) * 1.e-3_rp**ma2(k,i,j)
1807 end subroutine mp_tomita08_bergeronparam
1820 real(RP),
intent(out) :: cldfrac(
ka,
ia,
ja)
1821 real(RP),
intent(in) :: QTRC (
ka,
ia,
ja,qad)
1822 real(RP),
intent(in) :: mask_criterion
1825 integer :: k, i, j, iq
1833 qhydro = qhydro + qtrc(k,i,j,i_mp2all(iq))
1835 cldfrac(k,i,j) = 0.5_rp + sign(0.5_rp,qhydro-mask_criterion)
1858 real(RP),
intent(out) :: Re (
ka,
ia,
ja,mp_qad)
1859 real(RP),
intent(in) :: QTRC0(
ka,
ia,
ja,qad)
1860 real(RP),
intent(in) :: DENS0(
ka,
ia,
ja)
1861 real(RP),
intent(in) :: TEMP0(
ka,
ia,
ja)
1866 real(RP) :: RLMDr, RLMDs, RLMDg
1868 real(RP),
parameter :: um2cm = 100.0_rp
1871 real(RP) :: tems, rhoqs, Xs2
1872 real(RP) :: MOMs_2, MOMs_1bs
1873 real(RP) :: coef_at(4), coef_bt(4)
1874 real(RP) :: loga_, b_, nm
1877 integer :: k, i, j, iq
1880 re(:,:,:,i_mp_qc) = re_qc * um2cm
1881 re(:,:,:,i_mp_qi) = re_qi * um2cm
1887 temc = temp0(k,i,j) - tem00
1889 q(iq) = qtrc0(k,i,j,iq)
1893 zerosw = 0.5_rp - sign(0.5_rp, q(i_qr) - 1.e-12_rp )
1894 rlmdr = sqrt(sqrt( dens * q(i_qr) / ( ar * n0r * gam_1br ) + zerosw )) * ( 1.0_rp - zerosw )
1897 re(k,i,j,i_mp_qr) = 1.5_rp * rlmdr * um2cm
1899 zerosw = 0.5_rp - sign(0.5_rp, q(i_qs) - 1.e-12_rp )
1900 rlmds = sqrt(sqrt( dens * q(i_qs) / ( as * n0s * gam_1bs ) + zerosw )) * ( 1.0_rp - zerosw )
1904 rhoqs = dens * q(i_qs)
1905 zerosw = 0.5_rp - sign(0.5_rp, rhoqs - 1.e-12_rp )
1906 xs2 = rhoqs / as * ( 1.0_rp - zerosw )
1908 tems = min( -0.1_rp, temc )
1909 coef_at(1) = coef_a( 1) + tems * ( coef_a( 2) + tems * ( coef_a( 5) + tems * coef_a( 9) ) )
1910 coef_at(2) = coef_a( 3) + tems * ( coef_a( 4) + tems * coef_a( 7) )
1911 coef_at(3) = coef_a( 6) + tems * coef_a( 8)
1912 coef_at(4) = coef_a(10)
1913 coef_bt(1) = coef_b( 1) + tems * ( coef_b( 2) + tems * ( coef_b( 5) + tems * coef_b( 9) ) )
1914 coef_bt(2) = coef_b( 3) + tems * ( coef_b( 4) + tems * coef_b( 7) )
1915 coef_bt(3) = coef_b( 6) + tems * coef_b( 8)
1916 coef_bt(4) = coef_b(10)
1921 loga_ = coef_at(1) + nm * ( coef_at(2) + nm * ( coef_at(3) + nm * coef_at(4) ) )
1922 b_ = coef_bt(1) + nm * ( coef_bt(2) + nm * ( coef_bt(3) + nm * coef_bt(4) ) )
1923 moms_1bs = 10.0_rp**loga_ * xs2**b_
1925 re(k,i,j,i_mp_qs) = ( sw_roh2014 ) * 0.5_rp * moms_1bs / ( moms_2 + zerosw ) * um2cm &
1926 + ( 1.0_rp-sw_roh2014 ) * 1.5_rp * rlmds * um2cm
1928 zerosw = 0.5_rp - sign(0.5_rp, q(i_qg) - 1.e-12_rp )
1929 rlmdg = sqrt(sqrt( dens * q(i_qg) / ( ag * n0g * gam_1bg ) + zerosw )) * ( 1.0_rp - zerosw )
1931 re(k,i,j,i_mp_qg) = 1.5_rp * rlmdg * um2cm
1950 real(RP),
intent(out) :: Qe (
ka,
ia,
ja,mp_qad)
1951 real(RP),
intent(in) :: QTRC0(
ka,
ia,
ja,qad)
1956 do ihydro = 1,
mp_qa 1957 qe(:,:,:,ihydro) = qtrc0(:,:,:,i_mp2all(ihydro))
integer, public is
start point of inner domain: x, local
integer, public je
end point of inner domain: y, local
subroutine, public hist_reg(itemid, zinterp, item, desc, unit, ndim, xdim, ydim, zdim)
Register/Append variable to history file.
module ATMOSPHERE / Saturation adjustment
subroutine, public prc_mpistop
Abort MPI.
subroutine, public atmos_phy_mp_precipitation(flux_rain, flux_snow, DENS, MOMZ, MOMX, MOMY, RHOE, QTRC, vterm, temp, dt)
precipitation transport
real(rp), parameter, public const_dwatr
density of water [kg/m3]
real(dp), public time_dtsec_atmos_phy_mp
time interval of physics(microphysics) [sec]
logical, public io_l
output log or not? (this process)
real(rp) function, public sf_gamma(x)
Gamma function.
real(rp), parameter, public const_cl
specific heat (liquid water) [J/kg/K]
real(rp), dimension(mp_qa), target, public atmos_phy_mp_dens
integer, public ke
end point of inner domain: z, local
real(rp), parameter, public const_tem00
temperature reference (0C) [K]
subroutine, public atmos_phy_mp_tomita08_mixingratio(Qe, QTRC0)
Calculate mixing ratio of each category.
real(rp), parameter, public const_dice
density of ice [kg/m3]
module ATMOSPHERE / Physics Cloud Microphysics - Common
subroutine, public hist_query(itemid, answer)
Check time to putting data.
integer, public ia
of x whole cells (local, with HALO)
integer, public ka
of z whole cells (local, with HALO)
real(rp), public const_pre00
pressure reference [Pa]
real(rp), public const_grav
standard acceleration of gravity [m/s2]
integer, public js
start point of inner domain: y, local
subroutine, public log(type, message)
real(rp), parameter, public const_rvap
specific gas constant (water vapor) [J/kg/K]
integer, public ks
start point of inner domain: z, local
subroutine, public atmos_phy_mp_negative_fixer(DENS, RHOT, QTRC)
Negative fixer.
subroutine, public prof_rapstart(rapname_base, level)
Start raptime.
subroutine, public atmos_phy_mp_tomita08(DENS, MOMZ, MOMX, MOMY, RHOT, QTRC, CCN, EVAPORATE, SFLX_rain, SFLX_snow)
Cloud Microphysics.
integer, public ie
end point of inner domain: x, local
real(rp), public const_eps
small number
module ATMOSPHERE / Thermodynamics
subroutine, public atmos_phy_mp_tomita08_cloudfraction(cldfrac, QTRC, mask_criterion)
Calculate Cloud Fraction.
logical, public io_lnml
output log or not? (for namelist, this process)
real(rp), dimension(:), allocatable, public grid_cdz
z-length of control volume [m]
real(rp), public const_pi
pi
integer, public io_fid_conf
Config file ID.
subroutine, public atmos_phy_mp_saturation_adjustment(RHOE_t, QTRC_t, RHOE0, QTRC0, DENS0, flag_liquid)
Saturation adjustment.
integer, public io_fid_log
Log file ID.
module ATMOSPHERE / Physics Cloud Microphysics
subroutine, public prof_rapend(rapname_base, level)
Save raptime.
integer, parameter, public rp
subroutine, public atmos_phy_mp_tomita08_setup(MP_TYPE)
Setup.
subroutine, public atmos_phy_mp_tomita08_effectiveradius(Re, QTRC0, DENS0, TEMP0)
Calculate Effective Radius.
integer, public ja
of y whole cells (local, with HALO)