55 #define PROFILE_START(name) call fapp_start(name, 1, 1) 56 #define PROFILE_STOP(name) call fapp_stop (name, 1, 1) 57 #elif defined(PROFILE_FINEPA) 58 #define PROFILE_START(name) call start_collection(name) 59 #define PROFILE_STOP(name) call stop_collection (name) 61 #define PROFILE_START(name) 62 #define PROFILE_STOP(name) 65 #include "macro_thermodyn.h" 125 private :: mp_sn14_init
127 private :: mp_terminal_velocity
133 integer,
parameter :: hydro_max = 6
134 integer,
parameter :: i_c = 1
135 integer,
parameter :: i_r = 2
136 integer,
parameter :: i_i = 3
137 integer,
parameter :: i_s = 4
138 integer,
parameter :: i_g = 5
142 integer,
parameter :: i_lcccn = 1
143 integer,
parameter :: i_ncccn = 2
144 integer,
parameter :: i_liccn = 3
145 integer,
parameter :: i_niccn = 4
147 integer,
parameter :: i_lchom = 5
148 integer,
parameter :: i_nchom = 6
149 integer,
parameter :: i_lchet = 7
150 integer,
parameter :: i_nchet = 8
151 integer,
parameter :: i_lrhet = 9
152 integer,
parameter :: i_nrhet = 10
154 integer,
parameter :: i_limlt = 11
155 integer,
parameter :: i_nimlt = 12
156 integer,
parameter :: i_lsmlt = 13
157 integer,
parameter :: i_nsmlt = 14
158 integer,
parameter :: i_lgmlt = 15
159 integer,
parameter :: i_ngmlt = 16
161 integer,
parameter :: i_lrdep = 17
162 integer,
parameter :: i_nrdep = 18
163 integer,
parameter :: i_lidep = 19
164 integer,
parameter :: i_nidep = 20
165 integer,
parameter :: i_lsdep = 21
166 integer,
parameter :: i_nsdep = 22
167 integer,
parameter :: i_lgdep = 23
168 integer,
parameter :: i_ngdep = 24
169 integer,
parameter :: i_lcdep = 25
173 integer,
parameter :: i_lcaut = 26
174 integer,
parameter :: i_ncaut = 27
175 integer,
parameter :: i_nraut = 28
177 integer,
parameter :: i_lcacc = 29
178 integer,
parameter :: i_ncacc = 30
180 integer,
parameter :: i_nrslc = 31
181 integer,
parameter :: i_nrbrk = 32
184 integer,
parameter :: i_licon = 33
185 integer,
parameter :: i_nicon = 34
186 integer,
parameter :: i_lscon = 35
187 integer,
parameter :: i_nscon = 36
189 integer,
parameter :: i_liacm = 37
190 integer,
parameter :: i_niacm = 38
191 integer,
parameter :: i_liarm = 39
192 integer,
parameter :: i_niarm = 40
193 integer,
parameter :: i_lsacm = 41
194 integer,
parameter :: i_nsacm = 42
195 integer,
parameter :: i_lsarm = 43
196 integer,
parameter :: i_nsarm = 44
197 integer,
parameter :: i_lgacm = 45
198 integer,
parameter :: i_ngacm = 46
199 integer,
parameter :: i_lgarm = 47
200 integer,
parameter :: i_ngarm = 48
202 integer,
parameter :: i_lgspl = 49
203 integer,
parameter :: i_lsspl = 50
204 integer,
parameter :: i_nispl = 51
206 integer,
parameter :: pq_max = 51
210 integer,
parameter :: i_liaclc2li = 1
211 integer,
parameter :: i_niacnc2ni = 2
212 integer,
parameter :: i_lsaclc2ls = 3
213 integer,
parameter :: i_nsacnc2ns = 4
214 integer,
parameter :: i_lgaclc2lg = 5
215 integer,
parameter :: i_ngacnc2ng = 6
216 integer,
parameter :: i_lracli2lg_i = 7
217 integer,
parameter :: i_nracni2ng_i = 8
218 integer,
parameter :: i_lracli2lg_r = 9
219 integer,
parameter :: i_nracni2ng_r = 10
220 integer,
parameter :: i_lracls2lg_s = 11
221 integer,
parameter :: i_nracns2ng_s = 12
222 integer,
parameter :: i_lracls2lg_r = 13
223 integer,
parameter :: i_nracns2ng_r = 14
224 integer,
parameter :: i_lraclg2lg = 15
225 integer,
parameter :: i_nracng2ng = 16
226 integer,
parameter :: i_liacli2ls = 17
227 integer,
parameter :: i_niacni2ns = 18
228 integer,
parameter :: i_liacls2ls = 19
229 integer,
parameter :: i_niacns2ns = 20
230 integer,
parameter :: i_nsacns2ns = 21
231 integer,
parameter :: i_ngacng2ng = 22
232 integer,
parameter :: i_lgacls2lg = 23
233 integer,
parameter :: i_ngacns2ng = 24
235 integer,
parameter :: pac_max = 24
239 character(len=H_SHORT),
save :: wlabel(11)
242 real(RP),
private,
parameter :: nqmin(6) = (/ 0.0_rp, 1.e+4_rp, 1.0_rp, 1.0_rp, 1.e-4_rp, 1.e-4_rp /)
245 real(RP),
private,
parameter :: xqmax(6) = (/ 0.0_rp, 2.6e-10_rp, 5.0e-6_rp, 1.377e-6_rp, 7.519e-6_rp, 4.90e-5_rp /)
248 real(RP),
private,
parameter :: xqmin(6) = (/ 0.0_rp, 4.20e-15_rp, 2.60e-10_rp, 3.382e-13_rp, 1.847e-12_rp, 1.230e-10_rp /)
254 real(RP),
private,
parameter :: xc_min = 4.20e-15_rp
255 real(RP),
private,
parameter :: xr_min = 2.60e-10_rp
256 real(RP),
private,
parameter :: xi_min = 3.382e-13_rp
257 real(RP),
private,
parameter :: xs_min = 1.847e-12_rp
258 real(RP),
private,
parameter :: xg_min = 1.230e-10_rp
260 real(RP),
private,
parameter :: xc_max = 2.6e-10_rp
261 real(RP),
private,
parameter :: xr_max = 5.00e-6_rp
262 real(RP),
private,
parameter :: xi_max = 1.377e-6_rp
263 real(RP),
private,
parameter :: xs_max = 7.519e-6_rp
264 real(RP),
private,
parameter :: xg_max = 4.900e-5_rp
266 real(RP),
private,
parameter :: xmin_filter= xc_min
268 real(RP),
private,
parameter :: rmin_re= 1.e-6_rp
271 real(RP),
private,
parameter :: n0r_min= 2.5e+5_rp
272 real(RP),
private,
parameter :: n0r_max= 2.0e+7_rp
273 real(RP),
private,
parameter :: lambdar_min= 1.e+3_rp
274 real(RP),
private,
parameter :: lambdar_max= 1.e+4_rp
276 real(RP),
private,
parameter :: nc_min = 1.e+4_rp
277 real(RP),
private,
parameter :: nr_min = 1.0_rp
278 real(RP),
private,
parameter :: ni_min = 1.0_rp
279 real(RP),
private,
parameter :: ns_min = 1.e-4_rp
280 real(RP),
private,
parameter :: ng_min = 1.e-4_rp
282 real(RP),
private,
parameter :: lc_min = xc_min*nc_min
283 real(RP),
private,
parameter :: lr_min = xr_min*nr_min
284 real(RP),
private,
parameter :: li_min = xi_min*ni_min
285 real(RP),
private,
parameter :: ls_min = xs_min*ns_min
286 real(RP),
private,
parameter :: lg_min = xg_min*ng_min
288 real(RP),
private,
parameter :: x_sep = 2.6e-10_rp
290 real(RP),
private,
parameter :: tem_min=100.0_rp
291 real(RP),
private,
parameter :: rho_min=1.e-5_rp
292 real(RP),
private,
parameter :: rhoi = 916.70_rp
295 real(RP),
private,
parameter :: gfac_coef(6)=(/&
296 +76.180091729471460_rp, -86.505320329416770_rp, +24.014098240830910_rp,&
297 -1.2317395724501550_rp, +0.1208650973866179e-2_rp, -0.5395239384953e-5_rp /)
298 real(RP),
private,
parameter :: gfac_ser0=1.000000000190015_rp
300 integer,
private,
save :: ntmax_phase_change = 1
301 integer,
private,
save :: ntmax_collection = 1
302 integer,
private,
save :: mp_ntmax_sedimentation= 1
305 real(RP),
private,
parameter :: rho_0 = 1.280_rp
307 real(RP),
allocatable,
private,
save :: nc_uplim_d(:,:,:)
310 real(RP),
private,
parameter :: ka0 = 2.428e-2_rp
312 real(RP),
private,
parameter :: dka_dt = 7.47e-5_rp
317 real(RP),
private,
parameter :: mua0 = 1.718e-5_rp
319 real(RP),
private,
parameter :: dmua_dt = 5.28e-8_rp
323 real(RP),
private,
save :: xc_ccn = 1.e-12_rp
324 real(RP),
private,
save :: xi_ccn = 1.e-12_rp
328 real(RP),
private,
save :: cap(hydro_max)
332 real(RP),
private,
save :: a_m(hydro_max)
333 real(RP),
private,
save :: b_m(hydro_max)
336 real(RP),
private,
save :: alpha_v(hydro_max,2)
337 real(RP),
private,
save :: beta_v(hydro_max,2)
338 real(RP),
private,
save :: alpha_vn(hydro_max,2)
339 real(RP),
private,
save :: beta_vn(hydro_max,2)
340 real(RP),
private,
save :: gamma_v(hydro_max)
343 real(RP),
private,
parameter :: pre0_vt = 300.e+2_rp
344 real(RP),
private,
parameter :: tem0_vt = 233.0_rp
345 real(RP),
private,
parameter :: a_pre0_vt = -0.1780_rp
346 real(RP),
private,
parameter :: a_tem0_vt = -0.3940_rp
354 real(RP),
private,
save :: nu(hydro_max)
355 real(RP),
private,
save :: mu(hydro_max)
361 real(RP),
private,
save :: a_area(hydro_max)
362 real(RP),
private,
save :: b_area(hydro_max)
363 real(RP),
private,
save :: ax_area(hydro_max)
364 real(RP),
private,
save :: bx_area(hydro_max)
367 real(RP),
private,
save :: a_rea(hydro_max)
368 real(RP),
private,
save :: b_rea(hydro_max)
369 real(RP),
private,
save :: a_rea2(hydro_max)
370 real(RP),
private,
save :: b_rea2(hydro_max)
371 real(RP),
private,
save :: a_rea3(hydro_max)
372 real(RP),
private,
save :: b_rea3(hydro_max)
374 real(RP),
private,
save :: a_d2vt(hydro_max)
375 real(RP),
private,
save :: b_d2vt(hydro_max)
379 real(RP),
private,
save :: coef_m2(hydro_max)
381 real(RP),
private,
save :: coef_d6(hydro_max)
383 real(RP),
private,
save :: coef_d3(hydro_max)
385 real(RP),
private,
save :: coef_d(hydro_max)
387 real(RP),
private,
save :: coef_d2v(hydro_max)
389 real(RP),
private,
save :: coef_md2v(hydro_max)
392 real(RP),
private,
save :: coef_r2(hydro_max)
393 real(RP),
private,
save :: coef_r3(hydro_max)
394 real(RP),
private,
save :: coef_re(hydro_max)
396 real(RP),
private,
save :: coef_rea2(hydro_max)
397 real(RP),
private,
save :: coef_rea3(hydro_max)
398 logical,
private,
save :: opt_m96_ice=.true.
399 logical,
private,
save :: opt_m96_column_ice=.false.
404 real(RP),
private,
save :: coef_vt0(hydro_max,2)
405 real(RP),
private,
save :: coef_vt1(hydro_max,2)
406 real(RP),
private,
save :: coef_deplc
407 real(RP),
private,
save :: coef_dave_n(hydro_max)
408 real(RP),
private,
save :: coef_dave_l(hydro_max)
411 real(RP),
private,
save :: d0_ni=261.76e-6_rp
412 real(RP),
private,
save :: d0_li=398.54e-6_rp
413 real(RP),
private,
parameter :: d0_ns=270.03e-6_rp
414 real(RP),
private,
parameter :: d0_ls=397.47e-6_rp
415 real(RP),
private,
parameter :: d0_ng=269.08e-6_rp
416 real(RP),
private,
parameter :: d0_lg=376.36e-6_rp
418 real(RP),
private,
parameter :: coef_vtr_ar1=9.65_rp
420 real(RP),
private,
parameter :: coef_vtr_br1=10.43_rp
421 real(RP),
private,
parameter :: coef_vtr_cr1=600.0_rp
422 real(RP),
private,
parameter :: coef_vtr_ar2=4.e+3_rp
423 real(RP),
private,
parameter :: coef_vtr_br2=12.e+3_rp
424 real(RP),
private,
parameter :: d_vtr_branch=0.745e-3_rp
426 real(RP),
private,
parameter :: dr_eq = 1.10e-3_rp
431 real(RP),
private,
save :: coef_a(hydro_max)
432 real(RP),
private,
save :: coef_lambda(hydro_max)
436 real(RP),
private,
save :: ah_vent (hydro_max,2)
437 real(RP),
private,
save :: bh_vent (hydro_max,2)
438 real(RP),
private,
save :: ah_vent0 (hydro_max,2)
439 real(RP),
private,
save :: bh_vent0 (hydro_max,2)
440 real(RP),
private,
save :: ah_vent1 (hydro_max,2)
441 real(RP),
private,
save :: bh_vent1 (hydro_max,2)
443 real(RP),
private,
save :: delta_b0 (hydro_max)
444 real(RP),
private,
save :: delta_b1 (hydro_max)
445 real(RP),
private,
save :: delta_ab0(hydro_max,hydro_max)
446 real(RP),
private,
save :: delta_ab1(hydro_max,hydro_max)
448 real(RP),
private,
save :: theta_b0 (hydro_max)
449 real(RP),
private,
save :: theta_b1 (hydro_max)
450 real(RP),
private,
save :: theta_ab0(hydro_max,hydro_max)
451 real(RP),
private,
save :: theta_ab1(hydro_max,hydro_max)
453 logical,
private,
save :: opt_debug=.false.
455 logical,
private,
save :: opt_debug_tem=.false.
456 logical,
private,
save :: opt_debug_inc=.true.
457 logical,
private,
save :: opt_debug_act=.true.
458 logical,
private,
save :: opt_debug_ree=.true.
459 logical,
private,
save :: opt_debug_bcs=.true.
461 integer,
private,
save :: mp_nstep_sedimentation
462 real(RP),
private,
save :: mp_rnstep_sedimentation
463 real(DP),
private,
save :: mp_dtsec_sedimentation
469 real(RP),
private,
allocatable,
save :: gsgam2_d (:,:,:)
470 real(RP),
private,
allocatable,
save :: gsgam2h_d(:,:,:)
471 real(RP),
private,
allocatable,
save :: gam2_d (:,:,:)
472 real(RP),
private,
allocatable,
save :: gam2h_d (:,:,:)
473 real(RP),
private,
allocatable,
save :: rgsgam2_d(:,:,:)
474 real(RP),
private,
allocatable,
save :: rgs_d (:,:,:)
475 real(RP),
private,
allocatable,
save :: rgsh_d (:,:,:)
477 logical,
private,
save :: mp_doautoconversion = .true.
478 logical,
private,
save :: mp_doprecipitation = .true.
479 logical,
private,
save :: mp_couple_aerosol = .false.
480 real(RP),
private,
save :: mp_ssw_lim = 1.e+1_rp
499 character(len=*),
intent(in) :: MP_TYPE
501 namelist / param_atmos_phy_mp / &
502 mp_doautoconversion, &
503 mp_doprecipitation, &
506 mp_ntmax_sedimentation
508 real(RP),
parameter :: max_term_vel = 10.0_rp
514 if(
io_l )
write(
io_fid_log,*)
'+++ Module[Cloud Microphisics]/Categ[ATMOS]' 517 if ( mp_type /=
'SN14' )
then 518 write(*,*)
'xxx ATMOS_PHY_MP_TYPE is not SN14. Check!' 532 .OR. i_ng <= 0 )
then 533 write(*,*)
'xxx SN14 needs QV/C/R/I/S/G and NC/R/I/S/G tracer. Check!' 539 read(
io_fid_conf,nml=param_atmos_phy_mp,iostat=ierr)
541 if(
io_l )
write(
io_fid_log,*)
'*** Not found namelist. Default used.' 542 elseif( ierr > 0 )
then 543 write(*,*)
'xxx Not appropriate names in namelist PARAM_ATMOS_PHY_MP. Check!' 559 wlabel( 6) =
"GRAUPEL" 560 wlabel( 7) =
"CLOUD_NUM" 561 wlabel( 8) =
"RAIN_NUM" 562 wlabel( 9) =
"ICE_NUM" 563 wlabel(10) =
"SNOW_NUM" 564 wlabel(11) =
"GRAUPEL_NUM" 568 allocate(nc_uplim_d(1,
ia,
ja))
569 nc_uplim_d(:,:,:) = 150.e6_rp
572 mp_ntmax_sedimentation = max( mp_ntmax_sedimentation, nstep_max )
574 mp_nstep_sedimentation = mp_ntmax_sedimentation
575 mp_rnstep_sedimentation = 1.0_rp /
real(mp_ntmax_sedimentation,kind=
rp)
579 if (
io_l )
write(
io_fid_log,*)
'*** Timestep of sedimentation is divided into : ', mp_ntmax_sedimentation,
' step' 580 if (
io_l )
write(
io_fid_log,*)
'*** DT of sedimentation is : ', mp_dtsec_sedimentation,
'[s]' 583 allocate( gsgam2_d(
ka,
ia,
ja) )
584 allocate( gsgam2h_d(
ka,
ia,
ja) )
585 allocate( gam2_d(
ka,
ia,
ja) )
586 allocate( gam2h_d(
ka,
ia,
ja) )
587 allocate( rgsgam2_d(
ka,
ia,
ja) )
588 allocate( rgs_d(
ka,
ia,
ja) )
589 allocate( rgsh_d(
ka,
ia,
ja) )
590 gsgam2_d(:,:,:) = 1.0_rp
591 gsgam2h_d(:,:,:) = 1.0_rp
592 gam2_d(:,:,:) = 1.0_rp
593 gam2h_d(:,:,:) = 1.0_rp
594 rgsgam2_d(:,:,:) = 1.0_rp
595 rgs_d(:,:,:) = 1.0_rp
596 rgsh_d(:,:,:) = 1.0_rp
621 real(RP),
intent(inout) :: dens(
ka,
ia,
ja)
622 real(RP),
intent(inout) :: MOMZ(
ka,
ia,
ja)
623 real(RP),
intent(inout) :: MOMX(
ka,
ia,
ja)
624 real(RP),
intent(inout) :: MOMY(
ka,
ia,
ja)
625 real(RP),
intent(inout) :: RHOT(
ka,
ia,
ja)
626 real(RP),
intent(inout) :: QTRC(
ka,
ia,
ja,qad)
627 real(RP),
intent(in) :: CCN(
ka,
ia,
ja)
628 real(RP),
intent(out) :: EVAPORATE(
ka,
ia,
ja)
629 real(RP),
intent(out) :: SFLX_rain(
ia,
ja)
630 real(RP),
intent(out) :: SFLX_snow(
ia,
ja)
633 if(
io_l )
write(
io_fid_log,*)
'*** Physics step: Cloud microphysics(SN14)' 641 call mp_sn14( dens, &
662 subroutine mp_sn14_init
669 real(RP),
allocatable :: w1(:),w2(:),w3(:),w4(:),w5(:),w6(:),w7(:),w8(:)
671 real(RP) :: ar_ice_fix = 0.7_rp
672 real(RP) :: wcap1, wcap2
674 logical :: flag_vent0(hydro_max), flag_vent1(hydro_max)
676 integer :: iw, ia, ib
679 namelist /nm_mp_sn14_init/ &
686 ntmax_phase_change, &
689 namelist /nm_mp_sn14_particles/ &
690 a_m, b_m, alpha_v, beta_v, gamma_v, &
692 a_area, b_area, cap, &
694 opt_m96_column_ice, &
697 real(RP),
parameter :: eps_gamma=1.e-30_rp
701 alpha_v(:,:) = undef8
703 alpha_vn(:,:) = undef8
704 beta_vn(:,:) = undef8
722 coef_dave_n(:) = undef8
723 coef_dave_l(:) = undef8
728 coef_md2v(:) = undef8
732 coef_rea2(:) = undef8
733 coef_rea3(:) = undef8
736 coef_lambda(:) = undef8
737 coef_vt0(:,:) = undef8
738 coef_vt1(:,:) = undef8
741 delta_ab0(:,:) = undef8
742 delta_ab1(:,:) = undef8
745 theta_ab0(:,:) = undef8
746 theta_ab1(:,:) = undef8
748 ah_vent(:,:) = undef8
749 ah_vent0(:,:) = undef8
750 ah_vent1(:,:) = undef8
751 bh_vent(:,:) = undef8
752 bh_vent0(:,:) = undef8
753 bh_vent1(:,:) = undef8
764 if(
io_l )
write(
io_fid_log,*)
'*** Not found namelist. Default used.' 765 elseif( ierr > 0 )
then 766 write(*,*)
'xxx Not appropriate names in namelist nm_mp_sn14_init. Check!' 775 a_area(i_qc) = pi/4.0_rp
776 a_area(i_qr) = pi/4.0_rp
777 a_area(i_qi) = 0.65_rp*1.e-4_rp*100.0_rp**(2.00_rp)
778 a_area(i_qs) = 0.2285_rp*1.e-4_rp*100.0_rp**(1.88_rp)
779 a_area(i_qg) = 0.50_rp*1.e-4_rp*100.0_rp**(2.0_rp)
780 b_area(i_qc) = 2.0_rp
781 b_area(i_qr) = 2.0_rp
782 b_area(i_qi) = 2.0_rp
783 b_area(i_qs) = 1.88_rp
784 b_area(i_qg) = 2.0_rp
795 b_m(i_qc) = 1.0_rp/3.0_rp
796 b_m(i_qr) = 1.0_rp/3.0_rp
803 alpha_v(i_qc,:)= 3.75e+5_rp
804 alpha_v(i_qr,:)= 159.0_rp
805 alpha_v(i_qi,:)= 317.0_rp
806 alpha_v(i_qs,:)= 27.70_rp
807 alpha_v(i_qg,:)= 40.0_rp
808 beta_v(i_qc,:) = 2.0_rp/3.0_rp
809 beta_v(i_qr,:) = 0.266_rp
810 beta_v(i_qi,:) = 0.363_rp
811 beta_v(i_qs,:) = 0.216_rp
812 beta_v(i_qg,:) = 0.230_rp
813 gamma_v(i_qc) = 1.0_rp
815 gamma_v(i_qr) = 1.0_rp/2.0_rp
816 gamma_v(i_qi) = 1.0_rp/2.0_rp
817 gamma_v(i_qs) = 1.0_rp/2.0_rp
818 gamma_v(i_qg) = 1.0_rp/2.0_rp
827 nu(i_qr) = -1.0_rp/3.0_rp
833 mu(i_qr) = 1.0_rp/3.0_rp
834 mu(i_qi) = 1.0_rp/3.0_rp
835 mu(i_qs) = 1.0_rp/3.0_rp
836 mu(i_qg) = 1.0_rp/3.0_rp
851 alpha_vn(:,:) = alpha_v(:,:)
852 beta_vn(:,:) = beta_v(:,:)
860 read(
io_fid_conf,nml=nm_mp_sn14_particles,iostat=ierr)
863 if(
io_l )
write(
io_fid_log,*)
'*** Not found namelist. Default used.' 864 elseif( ierr > 0 )
then 865 write(*,*)
'xxx Not appropriate names in namelist nm_mp_sn14_particles. Check!' 872 if( opt_m96_ice )
then 876 a_area(i_qi) = 0.120284936_rp
877 a_area(i_qs) = 0.131488_rp
878 a_area(i_qg) = 0.5_rp
879 b_area(i_qi) = 1.850000_rp
880 b_area(i_qs) = 1.880000_rp
881 b_area(i_qg) = 2.0_rp
882 a_m(i_qi) = 1.23655360084766_rp
883 a_m(i_qs) = a_m(i_qi)
884 a_m(i_qg) = 0.346111225718402_rp
885 b_m(i_qi) = 0.408329930583912_rp
886 b_m(i_qs) = b_m(i_qi)
887 b_m(i_qg) = 0.357142857142857_rp
889 if( opt_m96_column_ice )
then 892 a_area(i_qi)= (0.684_rp*1.e-4_rp)*10.0_rp**(2.0_rp*2.00_rp)
894 a_m(i_qi) = 0.19834046116844_rp
895 b_m(i_qi) = 0.343642611683849_rp
898 wcap1 = sqrt(1.0_rp-ar_ice_fix**2)
899 wcap2 =
log( (1.0_rp+wcap1)/ar_ice_fix )
900 cap(i_qi) = 2.0_rp*wcap2/wcap1
909 alpha_v(i_qi,:) =(/ 5798.60107421875_rp, 167.347076416016_rp/)
910 alpha_vn(i_qi,:) =(/ 12408.177734375_rp, 421.799865722656_rp/)
911 if( opt_m96_column_ice )
then 912 alpha_v(i_qi,:) = (/2901.0_rp, 32.20_rp/)
913 alpha_vn(i_qi,:) = (/9675.2_rp, 64.16_rp/)
915 alpha_v(i_qs,:) =(/ 15173.3916015625_rp, 305.678619384766_rp/)
916 alpha_vn(i_qs,:) =(/ 29257.1601562500_rp, 817.985717773438_rp/)
917 alpha_v(i_qg,:) =(/ 15481.6904296875_rp, 311.642242431641_rp/)
918 alpha_vn(i_qg,:) =(/ 27574.6562500000_rp, 697.536132812500_rp/)
920 beta_v(i_qi,:) =(/ 0.504873454570770_rp, 0.324817866086960_rp/)
921 beta_vn(i_qi,:) =(/ 0.548495233058929_rp, 0.385287821292877_rp/)
922 if( opt_m96_column_ice )
then 923 beta_v(i_qi,:) =(/ 0.465552181005478_rp, 0.223826110363007_rp/)
924 beta_vn(i_qi,:) =(/ 0.530453503131866_rp, 0.273761242628098_rp/)
926 beta_v(i_qs,:) =(/ 0.528109610080719_rp, 0.329863965511322_rp/)
927 beta_vn(i_qs,:) =(/ 0.567154467105865_rp, 0.393876969814301_rp/)
928 beta_v(i_qg,:) =(/ 0.534656763076782_rp, 0.330253750085831_rp/)
929 beta_vn(i_qg,:) =(/ 0.570551633834839_rp, 0.387124240398407_rp/)
933 ax_area(i_qc:i_qg) = a_area(i_qc:i_qg)*a_m(i_qc:i_qg)**b_area(i_qc:i_qg)
934 bx_area(i_qc:i_qg) = b_area(i_qc:i_qg)*b_m(i_qc:i_qg)
938 a_rea(i_qc:i_qg) = sqrt(ax_area(i_qc:i_qg)/pi)
939 b_rea(i_qc:i_qg) = bx_area(i_qc:i_qg)/2.0_rp
940 a_rea2(i_qc:i_qg) = a_rea(i_qc:i_qg)**2
941 b_rea2(i_qc:i_qg) = b_rea(i_qc:i_qg)*2.0_rp
942 a_rea3(i_qc:i_qg) = a_rea(i_qc:i_qg)**3
943 b_rea3(i_qc:i_qg) = b_rea(i_qc:i_qg)*3.0_rp
945 a_d2vt(i_qc:i_qg)=alpha_v(i_qc:i_qg,2)*(1.0_rp/alpha_v(i_qc:i_qg,2))**(beta_v(i_qc:i_qg,2)/b_m(i_qc:i_qg))
946 b_d2vt(i_qc:i_qg)=(beta_v(i_qc:i_qg,2)/b_m(i_qc:i_qg))
950 allocate( w1(i_qc:i_qg), w2(i_qc:i_qg), w3(i_qc:i_qg), w4(i_qc:i_qg) )
951 allocate( w5(i_qc:i_qg), w6(i_qc:i_qg), w7(i_qc:i_qg), w8(i_qc:i_qg) )
968 w1(iw) = gammafunc( (n+nu(iw)+1.0_rp)/mu(iw) )
969 w2(iw) = gammafunc( (nu(iw)+1.0_rp)/mu(iw) )
970 w3(iw) = gammafunc( (nu(iw)+2.0_rp)/mu(iw) )
971 coef_m2(iw) = w1(iw)/w2(iw)*( w2(iw)/w3(iw) )**n
973 w4(iw) = gammafunc( (b_m(iw)+nu(iw)+1.0_rp)/mu(iw) )
974 coef_d(iw) = a_m(iw) * w4(iw)/w2(iw)*( w2(iw)/w3(iw) )**b_m(iw)
975 w5(iw) = gammafunc( (2.0_rp*b_m(iw)+beta_v(iw,2)+nu(iw)+1.0_rp)/mu(iw) )
976 w6(iw) = gammafunc( (3.0_rp*b_m(iw)+beta_v(iw,2)+nu(iw)+1.0_rp)/mu(iw) )
977 coef_d2v(iw) = a_m(iw) * w6(iw)/w5(iw)* ( w2(iw)/w3(iw) )**b_m(iw)
978 coef_md2v(iw)= w5(iw)/w2(iw)* ( w2(iw)/w3(iw) )**(2.0_rp*b_m(iw)+beta_v(iw,2))
980 w7(iw) = gammafunc( (3.0_rp*b_m(iw)+nu(iw)+1.0_rp)/mu(iw) )
981 coef_d3(iw) = a_m(iw)**3 * w7(iw)/w2(iw)*( w2(iw)/w3(iw) )**(3.0_rp*b_m(iw))
982 w8(iw) = gammafunc( (6.0_rp*b_m(iw)+nu(iw)+1.0_rp)/mu(iw) )
983 coef_d6(iw) = a_m(iw)**6 * w8(iw)/w2(iw)*( w2(iw)/w3(iw) )**(6.0_rp*b_m(iw))
986 coef_deplc = coef_d(i_qc)/a_m(i_qc)
992 w1(iw) = gammafunc( (2.0_rp*b_m(iw)+nu(iw)+1.0_rp)/mu(iw) )
993 w2(iw) = gammafunc( (nu(iw)+1.0_rp)/mu(iw) )
994 w3(iw) = gammafunc( (nu(iw)+2.0_rp)/mu(iw) )
996 w4(iw) = gammafunc( (3.0_rp*b_m(iw)+nu(iw)+1.0_rp)/mu(iw) )
998 coef_r2(iw)=w1(iw)/w2(iw)*( w2(iw)/w3(iw) )**(2.0_rp*b_m(iw))
999 coef_r3(iw)=w4(iw)/w2(iw)*( w2(iw)/w3(iw) )**(3.0_rp*b_m(iw))
1000 coef_re(iw)=coef_r3(iw)/coef_r2(iw)
1007 w1(iw) = gammafunc( (nu(iw)+1.0_rp)/mu(iw) )
1008 w2(iw) = gammafunc( (nu(iw)+2.0_rp)/mu(iw) )
1009 w3(iw) = gammafunc( (b_rea2(iw)+nu(iw)+1.0_rp)/mu(iw) )
1010 w4(iw) = gammafunc( (b_rea3(iw)+nu(iw)+1.0_rp)/mu(iw) )
1012 coef_rea2(iw) = w3(iw)/w1(iw)*( w1(iw)/w2(iw) )**b_rea2(iw)
1013 coef_rea3(iw) = w4(iw)/w1(iw)*( w1(iw)/w2(iw) )**b_rea3(iw)
1019 w1(iw) = gammafunc( (nu(iw) + 1.0_rp)/mu(iw) )
1020 w2(iw) = gammafunc( (nu(iw) + 2.0_rp)/mu(iw) )
1021 coef_a(iw) = mu(iw)/w1(iw)
1023 coef_lambda(iw) = (w1(iw)/w2(iw))**(-mu(iw))
1031 w1(iw) = gammafunc( (beta_vn(iw,ia) + nu(iw) + 1.0_rp + n)/mu(iw) )
1032 w2(iw) = gammafunc( ( nu(iw) + 1.0_rp + n)/mu(iw) )
1033 w3(iw) = gammafunc( (nu(iw) + 1.0_rp)/mu(iw) )
1034 w4(iw) = gammafunc( (nu(iw) + 2.0_rp)/mu(iw) )
1036 coef_vt0(iw,ia)=alpha_vn(iw,ia)*w1(iw)/w2(iw)*(w3(iw)/w4(iw))**beta_vn(iw,ia)
1038 w1(iw) = gammafunc( (beta_v(iw,ia) + nu(iw) + 1.0_rp + n)/mu(iw) )
1039 w2(iw) = gammafunc( ( nu(iw) + 1.0_rp + n)/mu(iw) )
1041 coef_vt1(iw,ia)=alpha_v(iw,ia)*w1(iw)/w2(iw)*(w3(iw)/w4(iw))**beta_v(iw,ia)
1046 w1(iw) = gammafunc( ( b_m(iw) + nu(iw) + 1.0_rp)/mu(iw) )
1047 w2(iw) = gammafunc( (1.0_rp + b_m(iw) + nu(iw) + 1.0_rp)/mu(iw) )
1048 w3(iw) = gammafunc( (nu(iw) + 1.0_rp)/mu(iw) )
1049 w4(iw) = gammafunc( (nu(iw) + 2.0_rp)/mu(iw) )
1050 coef_dave_n(iw) = (w1(iw)/w3(iw))*(w3(iw)/w4(iw))** b_m(iw)
1051 coef_dave_l(iw) = (w2(iw)/w3(iw))*(w3(iw)/w4(iw))**(1.0_rp+b_m(iw))
1055 ah_vent(i_qc,1:2) = (/1.0000_rp,1.0000_rp/)
1056 ah_vent(i_qr,1:2) = (/1.0000_rp,0.780_rp/)
1057 ah_vent(i_qi,1:2) = (/1.0000_rp,0.860_rp/)
1058 ah_vent(i_qs,1:2) = (/1.0000_rp,0.780_rp/)
1059 ah_vent(i_qg,1:2) = (/1.0000_rp,0.780_rp/)
1060 bh_vent(i_qc,1:2) = (/0.0000_rp,0.0000_rp/)
1061 bh_vent(i_qr,1:2) = (/0.108_rp,0.308_rp/)
1062 bh_vent(i_qi,1:2) = (/0.140_rp,0.280_rp/)
1063 bh_vent(i_qs,1:2) = (/0.108_rp,0.308_rp/)
1064 bh_vent(i_qg,1:2) = (/0.108_rp,0.308_rp/)
1068 if( (nu(iw) + b_m(iw) + n) > eps_gamma )
then 1069 w1(iw) = gammafunc( (nu(iw) + b_m(iw) + n)/mu(iw) )
1070 w2(iw) = gammafunc( (nu(iw) + 1.0_rp)/mu(iw) )
1071 w3(iw) = gammafunc( (nu(iw) + 2.0_rp)/mu(iw) )
1072 ah_vent0(iw,1)= ah_vent(iw,1)*(w1(iw)/w2(iw))*(w2(iw)/w3(iw))**(b_m(iw)+n-1.0_rp)
1073 ah_vent0(iw,2)= ah_vent(iw,2)*(w1(iw)/w2(iw))*(w2(iw)/w3(iw))**(b_m(iw)+n-1.0_rp)
1074 flag_vent0(iw)=.true.
1076 ah_vent0(iw,1)= 1.0_rp
1077 ah_vent0(iw,2)= 1.0_rp
1078 flag_vent0(iw)=.false.
1081 if( (nu(iw) + b_m(iw) + n) > eps_gamma )
then 1082 w1(iw) = gammafunc( (nu(iw) + b_m(iw) + n)/mu(iw) )
1083 w2(iw) = gammafunc( (nu(iw) + 1.0_rp)/mu(iw) )
1084 w3(iw) = gammafunc( (nu(iw) + 2.0_rp)/mu(iw) )
1085 ah_vent1(iw,1)= ah_vent(iw,1)*(w1(iw)/w2(iw))*(w2(iw)/w3(iw))**(b_m(iw)+n-1.0_rp)
1086 ah_vent1(iw,2)= ah_vent(iw,2)*(w1(iw)/w2(iw))*(w2(iw)/w3(iw))**(b_m(iw)+n-1.0_rp)
1087 flag_vent1(iw)=.true.
1089 ah_vent1(iw,1)= 1.0_rp
1090 ah_vent1(iw,2)= 1.0_rp
1091 flag_vent1(iw)=.true.
1096 if( (nu(iw) + 1.5_rp*b_m(iw) + 0.5_rp*beta_v(iw,1) + n) < eps_gamma )
then 1097 flag_vent0(iw)=.false.
1099 if(flag_vent0(iw))
then 1100 w1(iw) = gammafunc( (nu(iw) + 1.5_rp*b_m(iw) + 0.5_rp*beta_v(iw,1) + n)/mu(iw) )
1101 w2(iw) = gammafunc( (nu(iw) + 1.0_rp)/mu(iw) )
1102 w3(iw) = gammafunc( (nu(iw) + 2.0_rp)/mu(iw) )
1104 w4(iw) = gammafunc( (nu(iw) + 2.0_rp*b_m(iw) + beta_v(iw,1) + n)/mu(iw) )
1105 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)
1106 w5(iw) = gammafunc( (nu(iw) + 1.5_rp*b_m(iw) + 0.5_rp*beta_v(iw,2) + n)/mu(iw) )
1107 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)
1109 bh_vent0(iw,1) = 0.0_rp
1110 bh_vent0(iw,2) = 0.0_rp
1114 if( (nu(iw) + 1.5_rp*b_m(iw) + 0.5_rp*beta_v(iw,1) + n) < eps_gamma )
then 1115 flag_vent1(iw)=.false.
1117 if(flag_vent1(iw))
then 1118 w1(iw) = gammafunc( (nu(iw) + 1.5_rp*b_m(iw) + 0.5_rp*beta_v(iw,1) + n)/mu(iw) )
1119 w2(iw) = gammafunc( (nu(iw) + 1.0_rp)/mu(iw) )
1120 w3(iw) = gammafunc( (nu(iw) + 2.0_rp)/mu(iw) )
1122 w4(iw) = gammafunc( (nu(iw) + 2.0_rp*b_m(iw) + beta_v(iw,1) + n)/mu(iw) )
1123 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)
1125 w5(iw) = gammafunc( (nu(iw) + 1.5_rp*b_m(iw) + 0.5_rp*beta_v(iw,2) + n)/mu(iw) )
1126 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)
1128 bh_vent1(iw,1) = 0.0_rp
1129 bh_vent1(iw,2) = 0.0_rp
1138 w1(iw) = gammafunc( (2.0_rp*b_rea(iw) + nu(iw) + 1.0_rp + n)/mu(iw) )
1139 w2(iw) = gammafunc( (nu(iw) + 1.0_rp)/mu(iw) )
1140 w3(iw) = gammafunc( (nu(iw) + 2.0_rp)/mu(iw) )
1141 delta_b0(iw) = w1(iw)/w2(iw) &
1142 *( w2(iw)/w3(iw) )**(2.0_rp*b_rea(iw) + n)
1144 w1(iw) = gammafunc( (2.0_rp*b_rea(iw) + nu(iw) + 1.0_rp + n)/mu(iw) )
1145 delta_b1(iw) = w1(iw)/w2(iw) &
1146 *( w2(iw)/w3(iw) )**(2.0_rp*b_rea(iw) + n)
1152 w1(iw) = gammafunc( (b_rea(iw) + nu(iw) + 1.0_rp + n)/mu(iw) )
1153 w2(iw) = gammafunc( (nu(iw) + 1.0_rp)/mu(iw) )
1154 w3(iw) = gammafunc( (nu(iw) + 2.0_rp)/mu(iw) )
1155 w4(iw) = gammafunc( (b_rea(iw) + nu(iw) + 1.0_rp )/mu(iw) )
1157 w5(iw) = gammafunc( (b_rea(iw) + nu(iw) + 1.0_rp + n)/mu(iw) )
1165 delta_ab0(ia,ib) = 2.0_rp*(w1(ib)/w2(ib))*(w4(ia)/w2(ia)) &
1166 * ( w2(ib)/w3(ib) )**(b_rea(ib)+n) &
1167 * ( w2(ia)/w3(ia) )**(b_rea(ia) )
1169 delta_ab1(ia,ib) = 2.0_rp*(w5(ib)/w2(ib))*(w4(ia)/w2(ia)) &
1170 * ( w2(ib)/w3(ib) )**(b_rea(ib)+n) &
1171 * ( w2(ia)/w3(ia) )**(b_rea(ia) )
1179 w1(iw) = gammafunc( (2.0_rp*beta_v(iw,2) + 2.0_rp*b_rea(iw) + nu(iw) + 1.0_rp + n)/mu(iw) )
1180 w2(iw) = gammafunc( ( 2.0_rp*b_rea(iw) + nu(iw) + 1.0_rp + n)/mu(iw) )
1181 w3(iw) = gammafunc( (nu(iw) + 1.0_rp)/mu(iw) )
1182 w4(iw) = gammafunc( (nu(iw) + 2.0_rp)/mu(iw) )
1183 theta_b0(iw) = w1(iw)/w2(iw) * ( w3(iw)/w4(iw) )**(2.0_rp*beta_v(iw,2))
1185 w1(iw) = gammafunc( (2.0_rp*beta_v(iw,2) + 2.0_rp*b_rea(iw) + nu(iw) + 1.0_rp + n)/mu(iw) )
1186 w2(iw) = gammafunc( ( 2.0_rp*b_rea(iw) + nu(iw) + 1.0_rp + n)/mu(iw) )
1187 theta_b1(iw) = w1(iw)/w2(iw) * ( w3(iw)/w4(iw) )**(2.0_rp*beta_v(iw,2))
1194 w1(iw) = gammafunc( (beta_v(iw,2) + 2.0_rp*b_rea(iw) + nu(iw) + 1.0_rp + n)/mu(iw) )
1195 w2(iw) = gammafunc( ( 2.0_rp*b_rea(iw) + nu(iw) + 1.0_rp + n)/mu(iw) )
1196 w3(iw) = gammafunc( (beta_v(iw,2) + 2.0_rp*b_rea(iw) + nu(iw) + 1.0_rp )/mu(iw) )
1197 w4(iw) = gammafunc( ( 2.0_rp*b_rea(iw) + nu(iw) + 1.0_rp )/mu(iw) )
1199 w5(iw) = gammafunc( (nu(iw) + 1.0_rp)/mu(iw) )
1200 w6(iw) = gammafunc( (nu(iw) + 2.0_rp)/mu(iw) )
1202 w7(iw) = gammafunc( (beta_v(iw,2) + b_rea(iw) + nu(iw) + 1.0_rp + n)/mu(iw) )
1203 w8(iw) = gammafunc( ( b_rea(iw) + nu(iw) + 1.0_rp + n)/mu(iw) )
1208 theta_ab0(ia,ib) = 2.0_rp * (w1(ib)/w2(ib))*(w3(ia)/w4(ia)) &
1209 * (w5(ia)/w6(ia))**beta_v(ia,2) &
1210 * (w5(ib)/w6(ib))**beta_v(ib,2)
1211 theta_ab1(ia,ib) = 2.0_rp * (w7(ib)/w8(ib))*(w3(ia)/w4(ia)) &
1212 * (w5(ia)/w6(ia))**beta_v(ia,2) &
1213 * (w5(ib)/w6(ib))**beta_v(ib,2)
1217 deallocate(w1,w2,w3,w4,w5,w6,w7,w8)
1221 if(
io_l )
write(
io_fid_log,
'(a,100ES16.6)')
"coef_m2 ",coef_m2(:)
1224 if(
io_l )
write(
io_fid_log,
'(a,100ES16.6)')
"coef_d3 ",coef_d3(:)
1225 if(
io_l )
write(
io_fid_log,
'(a,100ES16.6)')
"coef_d6 ",coef_d6(:)
1226 if(
io_l )
write(
io_fid_log,
'(a,100ES16.6)')
"coef_d2v ",coef_d2v(:)
1227 if(
io_l )
write(
io_fid_log,
'(a,100ES16.6)')
"coef_md2v ",coef_md2v(:)
1231 if(
io_l )
write(
io_fid_log,
'(a,100ES16.6)')
"coef_r2 ",coef_r2(:)
1232 if(
io_l )
write(
io_fid_log,
'(a,100ES16.6)')
"coef_r3 ",coef_r3(:)
1233 if(
io_l )
write(
io_fid_log,
'(a,100ES16.6)')
"coef_re ",coef_re(:)
1237 if(
io_l )
write(
io_fid_log,
'(a,100ES16.6)')
"ax_area ",ax_area(:)
1238 if(
io_l )
write(
io_fid_log,
'(a,100ES16.6)')
"bx_area ",bx_area(:)
1244 if(
io_l )
write(
io_fid_log,
'(a,100ES16.6)')
"coef_rea2 ",coef_rea2(:)
1245 if(
io_l )
write(
io_fid_log,
'(a,100ES16.6)')
"coef_rea3 ",coef_rea3(:)
1246 if(
io_l )
write(
io_fid_log,
'(a,100ES16.6)')
"coef_vt0 ",coef_vt0(:,1)
1247 if(
io_l )
write(
io_fid_log,
'(a,100ES16.6)')
"coef_vt1 ",coef_vt1(:,1)
1249 if(
io_l )
write(
io_fid_log,
'(a,100ES16.6)')
"coef_lambda ",coef_lambda(:)
1251 if(
io_l )
write(
io_fid_log,
'(a,100ES16.6)')
"ah_vent0 sml",ah_vent0(:,1)
1252 if(
io_l )
write(
io_fid_log,
'(a,100ES16.6)')
"ah_vent0 lrg",ah_vent0(:,2)
1253 if(
io_l )
write(
io_fid_log,
'(a,100ES16.6)')
"ah_vent1 sml",ah_vent1(:,1)
1254 if(
io_l )
write(
io_fid_log,
'(a,100ES16.6)')
"ah_vent1 lrg",ah_vent1(:,2)
1255 if(
io_l )
write(
io_fid_log,
'(a,100ES16.6)')
"bh_vent0 sml",bh_vent0(:,1)
1256 if(
io_l )
write(
io_fid_log,
'(a,100ES16.6)')
"bh_vent0 lrg",bh_vent0(:,2)
1257 if(
io_l )
write(
io_fid_log,
'(a,100ES16.6)')
"bh_vent1 sml",bh_vent1(:,1)
1258 if(
io_l )
write(
io_fid_log,
'(a,100ES16.6)')
"bh_vent1 lrg",bh_vent1(:,2)
1260 if(
io_l )
write(
io_fid_log,
'(a,100ES16.6)')
"delta_b0 ",delta_b0(:)
1261 if(
io_l )
write(
io_fid_log,
'(a,100ES16.6)')
"delta_b1 ",delta_b1(:)
1262 if(
io_l )
write(
io_fid_log,
'(a,100ES16.6)')
"theta_b0 ",theta_b0(:)
1263 if(
io_l )
write(
io_fid_log,
'(a,100ES16.6)')
"theta_b1 ",theta_b1(:)
1266 if(
io_l )
write(
io_fid_log,
'(a,a10,a,100ES16.6)')
"delta0(a,b)=(",trim(wlabel(ia)),
",b)=",(delta_ab0(ia,ib),ib=qqs,qqe)
1269 if(
io_l )
write(
io_fid_log,
'(a,a10,a,100ES16.6)')
"delta1(a,b)=(",trim(wlabel(ia)),
",b)=",(delta_ab1(ia,ib),ib=qqs,qqe)
1272 if(
io_l )
write(
io_fid_log,
'(a,a10,a,100ES16.6)')
"theta0(a,b)=(",trim(wlabel(ia)),
",b)=",(theta_ab0(ia,ib),ib=qqs,qqe)
1275 if(
io_l )
write(
io_fid_log,
'(a,a10,a,100ES16.6)')
"theta1(a,b)=(",trim(wlabel(ia)),
",b)=",(theta_ab1(ia,ib),ib=qqs,qqe)
1279 end subroutine mp_sn14_init
1281 subroutine mp_sn14 ( &
1303 moist_psat_liq => atmos_saturation_psat_liq, &
1304 moist_psat_ice => atmos_saturation_psat_ice
1307 real(RP),
intent(inout) :: DENS(
ka,
ia,
ja)
1308 real(RP),
intent(inout) :: MOMZ(
ka,
ia,
ja)
1309 real(RP),
intent(inout) :: MOMX(
ka,
ia,
ja)
1310 real(RP),
intent(inout) :: MOMY(
ka,
ia,
ja)
1311 real(RP),
intent(inout) :: RHOT(
ka,
ia,
ja)
1312 real(RP),
intent(inout) :: QTRC(
ka,
ia,
ja,
qa)
1313 real(RP),
intent(in) :: CCN(
ka,
ia,
ja)
1314 real(RP),
intent(out) :: EVAPORATE(
ka,
ia,
ja)
1315 real(RP),
intent(out) :: SFLX_rain(
ia,
ja)
1316 real(RP),
intent(out) :: SFLX_snow(
ia,
ja)
1322 real(RP) :: pott (
ka,
ia,
ja)
1326 real(RP) :: qdry(
ka,
ia,
ja)
1327 real(RP) :: temp(
ka,
ia,
ja)
1328 real(RP) :: pres(
ka,
ia,
ja)
1329 real(RP) :: rhoe(
ka,
ia,
ja)
1330 real(RP) :: velz(
ka,
ia,
ja)
1334 real(RP) :: xq(5,
ka,
ia,
ja)
1336 real(RP) :: dq_xa(5,
ka,
ia,
ja)
1337 real(RP) :: vt_xa(5,2,
ka,
ia,
ja)
1339 real(RP) :: wtemp(
ka,
ia,
ja)
1340 real(RP) :: esw(
ka,
ia,
ja)
1341 real(RP) :: esi(
ka,
ia,
ja)
1344 real(RP) :: rho_fac_q(5,
ka,
ia,
ja)
1345 real(RP) :: cva(
ka,
ia,
ja)
1346 real(RP) :: cpa(
ka,
ia,
ja)
1349 real(RP) :: drhogqc, drhognc
1350 real(RP) :: drhogqr, drhognr
1351 real(RP) :: drhogqi, drhogni
1352 real(RP) :: drhogqs, drhogns
1353 real(RP) :: drhogqg, drhogng
1356 real(RP) :: PQ(pq_max,
ka,
ia,
ja)
1358 real(RP) :: wrm_dqc, wrm_dnc
1359 real(RP) :: wrm_dqr, wrm_dnr
1362 real(RP) :: Pac(pac_max,
ka,
ia,
ja)
1364 real(RP) :: gc_dqc, gc_dnc
1365 real(RP) :: sc_dqc, sc_dnc
1366 real(RP) :: ic_dqc, ic_dnc
1367 real(RP) :: rg_dqg, rg_dng
1368 real(RP) :: rg_dqr, rg_dnr
1369 real(RP) :: rs_dqr, rs_dnr, rs_dqs, rs_dns
1370 real(RP) :: ri_dqr, ri_dnr
1371 real(RP) :: ri_dqi, ri_dni
1372 real(RP) :: ii_dqi, ii_dni
1373 real(RP) :: is_dqi, is_dni, ss_dns
1374 real(RP) :: gs_dqs, gs_dns, gg_dng
1376 real(RP) :: clp_dqc, clp_dnc, clm_dqc, clm_dnc
1377 real(RP) :: clp_dqr, clp_dnr, clm_dqr, clm_dnr
1378 real(RP) :: clp_dqi, clp_dni, clm_dqi, clm_dni
1379 real(RP) :: clp_dqs, clp_dns, clm_dqs, clm_dns
1380 real(RP) :: clp_dqg, clp_dng, clm_dqg, clm_dng
1381 real(RP) :: fac1, fac3, fac4, fac6, fac7, fac9, fac10
1383 real(RP) :: pco_dqi, pco_dni
1384 real(RP) :: pco_dqs, pco_dns
1385 real(RP) :: pco_dqg, pco_dng
1387 real(RP) :: eml_dqc, eml_dnc
1388 real(RP) :: eml_dqr, eml_dnr
1389 real(RP) :: eml_dqi, eml_dni
1390 real(RP) :: eml_dqs, eml_dns
1391 real(RP) :: eml_dqg, eml_dng
1393 real(RP) :: spl_dqi, spl_dni
1394 real(RP) :: spl_dqg, spl_dqs
1396 real(RP) :: rrho(
ka,
ia,
ja)
1401 real(RP) :: dTdt_equiv_d(
ka,
ia,
ja)
1408 real(RP) :: sl_PLCdep(
ia,
ja)
1409 real(RP) :: sl_PLRdep(
ia,
ja), sl_PNRdep(
ia,
ja)
1411 real(RP) :: qke_d(
ka,
ia,
ja)
1413 real(RP),
parameter :: eps = 1.e-19_rp
1414 real(RP),
parameter :: eps_qv = 1.e-19_rp
1415 real(RP),
parameter :: eps_rhoge = 1.e-19_rp
1416 real(RP),
parameter :: eps_rhog = 1.e-19_rp
1422 real(RP) :: FLX_rain (
ka,
ia,
ja)
1423 real(RP) :: FLX_snow (
ka,
ia,
ja)
1424 real(RP) :: FLX_tot (
ka,
ia,
ja)
1425 real(RP) :: wflux_rain(
ka,
ia,
ja)
1426 real(RP) :: wflux_snow(
ka,
ia,
ja)
1431 integer :: k, i, j, iq
1457 rhoq(iq,k,i,j) = dens(k,i,j) * qtrc(k,i,j,iq)
1459 rhoq2(i_qv,k,i,j) = dens(k,i,j)*qtrc(k,i,j,i_qv)
1460 rhoq2(i_ni,k,i,j) = max( 0.0_rp, dens(k,i,j)*qtrc(k,i,j,i_ni) )
1461 rhoq2(i_nc,k,i,j) = max( 0.0_rp, dens(k,i,j)*qtrc(k,i,j,i_nc) )
1468 velz(
ks-1,i,j) = 0.0_rp
1470 velz(k,i,j) = momz(k,i,j) / ( dens(k,i,j) + dens(k+1,i,j) ) * 2.0_rp
1472 velz(
ke,i,j) = 0.0_rp
1479 rrho(k,i,j) = 1.0_rp / dens(k,i,j)
1480 pott(k,i,j) = rhot(k,i,j) * rrho(k,i,j)
1481 calc_qdry( qdry(k,i,j), qtrc, k, i, j, iq )
1482 calc_cv( cva(k,i,j), qdry(k,i,j), qtrc, k, i, j, iq, cvdry,
aq_cv )
1483 calc_r( rmoist, qtrc(k,i,j,i_qv), qdry(k,i,j), rdry, rvap )
1484 cpa(k,i,j) = cva(k,i,j) + rmoist
1485 calc_pre( pres(k,i,j), dens(k,i,j), pott(k,i,j), rmoist, cpa(k,i,j), p00 )
1486 temp(k,i,j) = pres(k,i,j) / ( dens(k,i,j) * rmoist )
1487 rhoe(k,i,j) = dens(k,i,j) * temp(k,i,j) * cva(k,i,j)
1488 wtemp(k,i,j) = max(temp(k,i,j), tem_min)
1493 if( opt_debug_tem )
call debug_tem_kij( 1, temp(:,:,:), dens(:,:,:), pres(:,:,:), qtrc(:,:,:,i_qv) )
1498 rho_fac = rho_0 / max(dens(k,i,j),rho_min)
1499 rho_fac_q(i_c,k,i,j) = rho_fac**gamma_v(i_qc)
1500 rho_fac_q(i_r,k,i,j) = rho_fac**gamma_v(i_qr)
1501 rho_fac_q(i_i,k,i,j) = (pres(k,i,j)/pre0_vt)**a_pre0_vt * (temp(k,i,j)/tem0_vt)**a_tem0_vt
1502 rho_fac_q(i_s,k,i,j) = rho_fac_q(i_i,k,i,j)
1503 rho_fac_q(i_g,k,i,j) = rho_fac_q(i_i,k,i,j)
1511 sl_plcdep(i,j) = 0.0_rp
1512 sl_plrdep(i,j) = 0.0_rp
1513 sl_pnrdep(i,j) = 0.0_rp
1521 qke_d(k,i,j) = 0.0_rp
1530 dtdt_equiv_d(k,i,j) = 0.0_rp
1541 dens, wtemp, pres, &
1554 drhogqc = dt * pq(i_lcccn,k,i,j)
1555 drhognc = dt * pq(i_ncccn,k,i,j)
1556 drhogqi = dt * pq(i_liccn,k,i,j)
1557 drhogni = dt * pq(i_niccn,k,i,j)
1558 drhogqv = max( -rhoq(i_qv,k,i,j), -drhogqc-drhogqi )
1559 fac1 = drhogqv / min( -drhogqc-drhogqi, -eps )
1561 rhoq(i_qv,k,i,j) = rhoq(i_qv,k,i,j) + drhogqv
1562 rhoq(i_qc,k,i,j) = max(0.0_rp, rhoq(i_qc,k,i,j) + drhogqc*fac1)
1563 rhoq(i_qi,k,i,j) = max(0.0_rp, rhoq(i_qi,k,i,j) + drhogqi*fac1)
1564 rhoq(i_nc,k,i,j) = max(0.0_rp, rhoq(i_nc,k,i,j) + drhognc)
1565 rhoq(i_ni,k,i,j) = max(0.0_rp, rhoq(i_ni,k,i,j) + drhogni)
1568 rhoq(i_nc,k,i,j) = min( rhoq(i_nc,k,i,j), nc_uplim_d(1,i,j) )
1570 rhoe(k,i,j) = rhoe(k,i,j) - lhv * drhogqv + lhf * drhogqi*fac1
1572 qtrc(k,i,j,i_qv) = rhoq(i_qv,k,i,j) * rrho(k,i,j)
1573 qtrc(k,i,j,i_qc) = rhoq(i_qc,k,i,j) * rrho(k,i,j)
1574 qtrc(k,i,j,i_qi) = rhoq(i_qi,k,i,j) * rrho(k,i,j)
1575 qtrc(k,i,j,i_nc) = rhoq(i_nc,k,i,j) * rrho(k,i,j)
1576 qtrc(k,i,j,i_ni) = rhoq(i_ni,k,i,j) * rrho(k,i,j)
1578 calc_qdry( qdry(k,i,j), qtrc, k, i, j, iq )
1579 calc_cv( cva(k,i,j), qdry(k,i,j), qtrc, k, i, j, iq, cvdry,
aq_cv )
1580 calc_r( rmoist, qtrc(k,i,j,i_qv), qdry(k,i,j), rdry, rvap )
1581 temp(k,i,j) = rhoe(k,i,j) / ( dens(k,i,j) * cva(k,i,j) )
1582 pres(k,i,j) = dens(k,i,j) * rmoist * temp(k,i,j)
1583 wtemp(k,i,j) = max( temp(k,i,j), tem_min )
1589 if( opt_debug_tem )
call debug_tem_kij( 2, temp(:,:,:), dens(:,:,:), pres(:,:,:), qtrc(:,:,:,i_qv) )
1603 rhoq2(i_qr,k,i,j) = rhoq(i_qr,k,i,j)
1604 rhoq2(i_nr,k,i,j) = rhoq(i_nr,k,i,j)
1605 xq(i_r,k,i,j) = max(xr_min, min(xr_max, rhoq2(i_qr,k,i,j)/(rhoq2(i_nr,k,i,j)+nr_min) ))
1607 dq_xa(i_r,k,i,j) = a_m(i_qr)*xq(i_r,k,i,j)**b_m(i_qr)
1608 vt_xa(i_r,1,k,i,j) = alpha_v(i_qr,1)*(xq(i_r,k,i,j)**beta_v(i_qr,1))*rho_fac_q(i_r,k,i,j)
1609 vt_xa(i_r,2,k,i,j) = vt_xa(i_r,1,k,i,j)
1613 rhoq2(i_qv,k,i,j) = rhoq(i_qv,k,i,j)
1614 rhoq2(i_qc,k,i,j) = rhoq(i_qc,k,i,j)
1615 rhoq2(i_qi,k,i,j) = rhoq(i_qi,k,i,j)
1616 rhoq2(i_qs,k,i,j) = rhoq(i_qs,k,i,j)
1617 rhoq2(i_qg,k,i,j) = rhoq(i_qg,k,i,j)
1619 rhoq2(i_nc,k,i,j) = rhoq(i_nc,k,i,j)
1620 rhoq2(i_ni,k,i,j) = rhoq(i_ni,k,i,j)
1621 rhoq2(i_ns,k,i,j) = rhoq(i_ns,k,i,j)
1622 rhoq2(i_ng,k,i,j) = rhoq(i_ng,k,i,j)
1627 xq(i_c,k,i,j) = min(xc_max, max(xc_min, rhoq2(i_qc,k,i,j)/(rhoq2(i_nc,k,i,j)+nc_min) ))
1628 xq(i_i,k,i,j) = min(xi_max, max(xi_min, rhoq2(i_qi,k,i,j)/(rhoq2(i_ni,k,i,j)+ni_min) ))
1629 xq(i_s,k,i,j) = min(xs_max, max(xs_min, rhoq2(i_qs,k,i,j)/(rhoq2(i_ns,k,i,j)+ns_min) ))
1630 xq(i_g,k,i,j) = min(xg_max, max(xg_min, rhoq2(i_qg,k,i,j)/(rhoq2(i_ng,k,i,j)+ng_min) ))
1633 dq_xa(i_c,k,i,j) = a_m(i_qc)*xq(i_c,k,i,j)**b_m(i_qc)
1634 dq_xa(i_i,k,i,j) = a_m(i_qi)*xq(i_i,k,i,j)**b_m(i_qi)
1635 dq_xa(i_s,k,i,j) = a_m(i_qs)*xq(i_s,k,i,j)**b_m(i_qs)
1636 dq_xa(i_g,k,i,j) = a_m(i_qg)*xq(i_g,k,i,j)**b_m(i_qg)
1639 vt_xa(i_c,1,k,i,j) = alpha_v(i_qc,1)*(xq(i_c,k,i,j)**beta_v(i_qc,1))*rho_fac_q(i_c,k,i,j)
1640 vt_xa(i_i,1,k,i,j) = alpha_v(i_qi,1)*(xq(i_i,k,i,j)**beta_v(i_qi,1))*rho_fac_q(i_i,k,i,j)
1641 vt_xa(i_s,1,k,i,j) = alpha_v(i_qs,1)*(xq(i_s,k,i,j)**beta_v(i_qs,1))*rho_fac_q(i_s,k,i,j)
1642 vt_xa(i_g,1,k,i,j) = alpha_v(i_qg,1)*(xq(i_g,k,i,j)**beta_v(i_qg,1))*rho_fac_q(i_g,k,i,j)
1643 vt_xa(i_c,2,k,i,j) = alpha_v(i_qc,2)*(xq(i_c,k,i,j)**beta_v(i_qc,2))*rho_fac_q(i_c,k,i,j)
1644 vt_xa(i_i,2,k,i,j) = alpha_v(i_qi,2)*(xq(i_i,k,i,j)**beta_v(i_qi,2))*rho_fac_q(i_i,k,i,j)
1645 vt_xa(i_s,2,k,i,j) = alpha_v(i_qs,2)*(xq(i_s,k,i,j)**beta_v(i_qs,2))*rho_fac_q(i_s,k,i,j)
1646 vt_xa(i_g,2,k,i,j) = alpha_v(i_qg,2)*(xq(i_g,k,i,j)**beta_v(i_qg,2))*rho_fac_q(i_g,k,i,j)
1652 call moist_psat_liq( esw, wtemp )
1653 call moist_psat_ice( esi, wtemp )
1660 call dep_vapor_melt_ice_kij( &
1662 dens, wtemp, pres, qdry, &
1673 ntdiv, ntmax_phase_change, &
1689 sl_plrdep, sl_pnrdep )
1692 if( opt_debug_tem )
call debug_tem_kij( 3, temp(:,:,:), dens(:,:,:), pres(:,:,:), qtrc(:,:,:,i_qv) )
1708 rhoq2(i_qv,k,i,j) = rhoq(i_qv,k,i,j)
1709 rhoq2(i_qc,k,i,j) = rhoq(i_qc,k,i,j)
1710 rhoq2(i_qr,k,i,j) = rhoq(i_qr,k,i,j)
1711 rhoq2(i_qi,k,i,j) = rhoq(i_qi,k,i,j)
1712 rhoq2(i_qs,k,i,j) = rhoq(i_qs,k,i,j)
1713 rhoq2(i_qg,k,i,j) = rhoq(i_qg,k,i,j)
1715 rhoq2(i_nc,k,i,j) = rhoq(i_nc,k,i,j)
1716 rhoq2(i_nr,k,i,j) = rhoq(i_nr,k,i,j)
1717 rhoq2(i_ni,k,i,j) = rhoq(i_ni,k,i,j)
1718 rhoq2(i_ns,k,i,j) = rhoq(i_ns,k,i,j)
1719 rhoq2(i_ng,k,i,j) = rhoq(i_ng,k,i,j)
1722 xq(i_c,k,i,j) = min(xc_max, max(xc_min, rhoq2(i_qc,k,i,j)/(rhoq2(i_nc,k,i,j)+nc_min) ) )
1723 xq(i_r,k,i,j) = min(xr_max, max(xr_min, rhoq2(i_qr,k,i,j)/(rhoq2(i_nr,k,i,j)+nr_min) ) )
1724 xq(i_i,k,i,j) = min(xi_max, max(xi_min, rhoq2(i_qi,k,i,j)/(rhoq2(i_ni,k,i,j)+ni_min) ) )
1725 xq(i_s,k,i,j) = min(xs_max, max(xs_min, rhoq2(i_qs,k,i,j)/(rhoq2(i_ns,k,i,j)+ns_min) ) )
1726 xq(i_g,k,i,j) = min(xg_max, max(xg_min, rhoq2(i_qg,k,i,j)/(rhoq2(i_ng,k,i,j)+ng_min) ) )
1729 dq_xa(i_c,k,i,j) = 2.0_rp*a_rea(i_qc)*xq(i_c,k,i,j)**b_rea(i_qc)
1730 dq_xa(i_r,k,i,j) = 2.0_rp*a_rea(i_qr)*xq(i_r,k,i,j)**b_rea(i_qr)
1731 dq_xa(i_i,k,i,j) = 2.0_rp*a_rea(i_qi)*xq(i_i,k,i,j)**b_rea(i_qi)
1732 dq_xa(i_s,k,i,j) = 2.0_rp*a_rea(i_qs)*xq(i_s,k,i,j)**b_rea(i_qs)
1733 dq_xa(i_g,k,i,j) = 2.0_rp*a_rea(i_qg)*xq(i_g,k,i,j)**b_rea(i_qg)
1737 vt_xa(i_c,2,k,i,j) = alpha_v(i_qc,2)*(xq(i_c,k,i,j)**beta_v(i_qc,2))*rho_fac_q(i_c,k,i,j)
1738 vt_xa(i_r,2,k,i,j) = alpha_v(i_qr,2)*(xq(i_r,k,i,j)**beta_v(i_qr,2))*rho_fac_q(i_r,k,i,j)
1739 vt_xa(i_i,2,k,i,j) = alpha_v(i_qi,2)*(xq(i_i,k,i,j)**beta_v(i_qi,2))*rho_fac_q(i_i,k,i,j)
1740 vt_xa(i_s,2,k,i,j) = alpha_v(i_qs,2)*(xq(i_s,k,i,j)**beta_v(i_qs,2))*rho_fac_q(i_s,k,i,j)
1741 vt_xa(i_g,2,k,i,j) = alpha_v(i_qg,2)*(xq(i_g,k,i,j)**beta_v(i_qg,2))*rho_fac_q(i_g,k,i,j)
1748 if ( mp_doautoconversion )
then 1758 pq(i_lcaut,k,i,j) = 0.0_rp
1759 pq(i_ncaut,k,i,j) = 0.0_rp
1760 pq(i_nraut,k,i,j) = 0.0_rp
1761 pq(i_lcacc,k,i,j) = 0.0_rp
1762 pq(i_ncacc,k,i,j) = 0.0_rp
1763 pq(i_nrslc,k,i,j) = 0.0_rp
1764 pq(i_nrbrk,k,i,j) = 0.0_rp
1786 profile_start(
"sn14_update_rhoq")
1792 wrm_dqc = max( dt*( pq(i_lcaut,k,i,j)+pq(i_lcacc,k,i,j) ), -rhoq2(i_qc,k,i,j) )
1793 wrm_dnc = max( dt*( pq(i_ncaut,k,i,j)+pq(i_ncacc,k,i,j) ), -rhoq2(i_nc,k,i,j) )
1794 wrm_dnr = max( dt*( pq(i_nraut,k,i,j)+pq(i_nrslc,k,i,j)+pq(i_nrbrk,k,i,j) ), -rhoq2(i_nr,k,i,j) )
1803 gc_dqc = max( dt*pac(i_lgaclc2lg,k,i,j) , min(0.0_rp, -rhoq2(i_qc,k,i,j)-wrm_dqc ))
1804 sc_dqc = max( dt*pac(i_lsaclc2ls,k,i,j) , min(0.0_rp, -rhoq2(i_qc,k,i,j)-wrm_dqc-gc_dqc ))
1805 ic_dqc = max( dt*pac(i_liaclc2li,k,i,j) , min(0.0_rp, -rhoq2(i_qc,k,i,j)-wrm_dqc-gc_dqc-sc_dqc ))
1807 gc_dnc = max( dt*pac(i_ngacnc2ng,k,i,j) , min(0.0_rp, -rhoq2(i_nc,k,i,j)-wrm_dnc ))
1808 sc_dnc = max( dt*pac(i_nsacnc2ns,k,i,j) , min(0.0_rp, -rhoq2(i_nc,k,i,j)-wrm_dnc-gc_dnc ))
1809 ic_dnc = max( dt*pac(i_niacnc2ni,k,i,j) , min(0.0_rp, -rhoq2(i_nc,k,i,j)-wrm_dnc-gc_dnc-sc_dnc ))
1812 sw = sign(0.5_rp, t00-temp(k,i,j)) + 0.5_rp
1813 rg_dqr = max( dt*pac(i_lraclg2lg, k,i,j), min(0.0_rp, -rhoq2(i_qr,k,i,j)-wrm_dqr )) * sw
1814 rg_dqg = max( dt*pac(i_lraclg2lg, k,i,j), min(0.0_rp, -rhoq2(i_qg,k,i,j) )) * ( 1.0_rp - sw )
1815 rs_dqr = max( dt*pac(i_lracls2lg_r,k,i,j), min(0.0_rp, -rhoq2(i_qr,k,i,j)-wrm_dqr-rg_dqr )) * sw
1816 ri_dqr = max( dt*pac(i_lracli2lg_r,k,i,j), min(0.0_rp, -rhoq2(i_qr,k,i,j)-wrm_dqr-rg_dqr-rs_dqr )) * sw
1818 rg_dnr = max( dt*pac(i_nracng2ng, k,i,j), min(0.0_rp, -rhoq2(i_nr,k,i,j)-wrm_dnr )) * sw
1819 rg_dng = max( dt*pac(i_nracng2ng, k,i,j), min(0.0_rp, -rhoq2(i_ng,k,i,j) )) * ( 1.0_rp - sw )
1820 rs_dnr = max( dt*pac(i_nracns2ng_r,k,i,j), min(0.0_rp, -rhoq2(i_nr,k,i,j)-wrm_dnr-rg_dnr )) * sw
1821 ri_dnr = max( dt*pac(i_nracni2ng_r,k,i,j), min(0.0_rp, -rhoq2(i_nr,k,i,j)-wrm_dnr-rg_dnr-rs_dnr )) * sw
1824 fac1 = (ri_dqr-eps)/ (dt*pac(i_lracli2lg_r,k,i,j)-eps)
1825 ri_dqi = max( dt*pac(i_lracli2lg_i,k,i,j)*fac1, min(0.0_rp, -rhoq2(i_qi,k,i,j)+ic_dqc ))
1826 ii_dqi = max( dt*pac(i_liacli2ls,k,i,j) , min(0.0_rp, -rhoq2(i_qi,k,i,j)+ic_dqc-ri_dqi ))
1827 is_dqi = max( dt*pac(i_liacls2ls,k,i,j) , min(0.0_rp, -rhoq2(i_qi,k,i,j)+ic_dqc-ri_dqi-ii_dqi ))
1829 fac4 = (ri_dnr-eps)/ (dt*pac(i_nracni2ng_r,k,i,j)-eps)
1830 ri_dni = max( dt*pac(i_nracni2ng_i,k,i,j)*fac4, min(0.0_rp, -rhoq2(i_ni,k,i,j) ))
1831 ii_dni = max( dt*pac(i_niacni2ns,k,i,j) , min(0.0_rp, -rhoq2(i_ni,k,i,j)-ri_dni ))
1832 is_dni = max( dt*pac(i_niacns2ns,k,i,j) , min(0.0_rp, -rhoq2(i_ni,k,i,j)-ri_dni-ii_dni ))
1834 fac3 = (rs_dqr-eps)/(dt*pac(i_lracls2lg_r,k,i,j)-eps)
1835 rs_dqs = max( dt*pac(i_lracls2lg_s,k,i,j)*fac3, min(0.0_rp, -rhoq2(i_qs,k,i,j)+sc_dqc+ii_dqi+is_dqi ))
1836 gs_dqs = max( dt*pac(i_lgacls2lg,k,i,j) , min(0.0_rp, -rhoq2(i_qs,k,i,j)+sc_dqc+ii_dqi+is_dqi-rs_dqs ))
1838 fac6 = (rs_dnr-eps)/(dt*pac(i_nracns2ng_r,k,i,j)-eps)
1840 rs_dns = max( dt*pac(i_nracns2ng_s,k,i,j)*fac6, min(0.0_rp, -rhoq2(i_ns,k,i,j)+0.50_rp*ii_dni+is_dni ))
1841 gs_dns = max( dt*pac(i_ngacns2ng,k,i,j) , min(0.0_rp, -rhoq2(i_ns,k,i,j)+0.50_rp*ii_dni+is_dni-rs_dns ))
1842 ss_dns = max( dt*pac(i_nsacns2ns,k,i,j) , min(0.0_rp, -rhoq2(i_ns,k,i,j)+0.50_rp*ii_dni+is_dni-rs_dns-gs_dns ))
1844 gg_dng = max( dt*pac(i_ngacng2ng,k,i,j) , min(0.0_rp, -rhoq2(i_ng,k,i,j) ))
1850 clp_dqr = (-rg_dqg-rs_dqs-ri_dqi) * (1.0_rp-sw)
1852 clp_dqs = -sc_dqc-ii_dqi-is_dqi
1853 clp_dqg = -gc_dqc -gs_dqs + (-rg_dqr-rs_dqr-rs_dqs-ri_dqr-ri_dqi) * sw
1858 clp_dns = -ii_dni*0.5_rp
1859 clp_dng = (-rs_dnr-ri_dnr) * sw
1862 clm_dqc = gc_dqc+sc_dqc+ic_dqc
1863 clm_dqr = (rg_dqr+rs_dqr+ri_dqr) * sw
1864 clm_dqi = ri_dqi+ii_dqi+is_dqi
1865 clm_dqs = rs_dqs+gs_dqs
1866 clm_dqg = rg_dqg * (1.0_rp-sw)
1868 clm_dnc = gc_dnc+sc_dnc+ic_dnc
1869 clm_dnr = (rg_dnr+rs_dnr+ri_dnr) * sw
1870 clm_dni = ri_dni+ii_dni+is_dni
1871 clm_dns = rs_dns+ss_dns+gs_dns
1872 clm_dng = gg_dng + rg_dng * (1.0_rp-sw)
1876 pco_dqi = max( dt*pq(i_licon,k,i,j), -clp_dqi )
1877 pco_dqs = max( dt*pq(i_lscon,k,i,j), -clp_dqs )
1878 pco_dqg = -pco_dqi-pco_dqs
1880 pco_dni = max( dt*pq(i_nicon,k,i,j), -clp_dni )
1881 pco_dns = max( dt*pq(i_nscon,k,i,j), -clp_dns )
1882 pco_dng = -pco_dni-pco_dns
1885 eml_dqi = max( dt*pq(i_liacm,k,i,j), min(0.0_rp, -rhoq2(i_qi,k,i,j)-(clp_dqi+clm_dqi)-pco_dqi ))
1886 eml_dqs = max( dt*pq(i_lsacm,k,i,j), min(0.0_rp, -rhoq2(i_qs,k,i,j)-(clp_dqs+clm_dqs)-pco_dqs ))
1887 eml_dqg = max( dt*(pq(i_lgacm,k,i,j)+pq(i_lgarm,k,i,j)+pq(i_lsarm,k,i,j)+pq(i_liarm,k,i,j)), &
1888 min(0.0_rp, -rhoq2(i_qg,k,i,j)-(clp_dqg+clm_dqg)-pco_dqg ))
1890 eml_dqr = -eml_dqs-eml_dqg
1892 eml_dni = max( dt*pq(i_niacm,k,i,j), min(0.0_rp, -rhoq2(i_ni,k,i,j)-(clp_dni+clm_dni)-pco_dni ))
1893 eml_dns = max( dt*pq(i_nsacm,k,i,j), min(0.0_rp, -rhoq2(i_ns,k,i,j)-(clp_dns+clm_dns)-pco_dns ))
1894 eml_dng = max( dt*(pq(i_ngacm,k,i,j)+pq(i_ngarm,k,i,j)+pq(i_nsarm,k,i,j)+pq(i_niarm,k,i,j)), &
1895 min(0.0_rp, -rhoq2(i_ng,k,i,j)-(clp_dng+clm_dng)-pco_dng ))
1897 eml_dnr = -eml_dns-eml_dng
1900 spl_dqg = max( dt*pq(i_lgspl,k,i,j), min(0.0_rp, -rhoq2(i_qg,k,i,j)-(clp_dqg+clm_dqg)-pco_dqg-eml_dqg ))
1901 spl_dqs = max( dt*pq(i_lsspl,k,i,j), min(0.0_rp, -rhoq2(i_qs,k,i,j)-(clp_dqs+clm_dqs)-pco_dqs-eml_dqs ))
1902 spl_dqi = -spl_dqg-spl_dqs
1903 fac9 = (spl_dqg-eps)/(dt*pq(i_lgspl,k,i,j)-eps)
1904 fac10 = (spl_dqs-eps)/(dt*pq(i_lsspl,k,i,j)-eps)
1905 spl_dni = dt*pq(i_nispl,k,i,j)*fac9*fac10
1908 drhogqc = (wrm_dqc + clp_dqc + clm_dqc + eml_dqc )
1909 drhognc = (wrm_dnc + clp_dnc + clm_dnc + eml_dnc )
1911 drhogqr = (wrm_dqr + clp_dqr + clm_dqr + eml_dqr )
1912 drhognr = (wrm_dnr + clp_dnr + clm_dnr + eml_dnr )
1914 drhogqi = ( clp_dqi + clm_dqi + pco_dqi + eml_dqi + spl_dqi)
1915 drhogni = ( clp_dni + clm_dni + pco_dni + eml_dni + spl_dni)
1917 drhogqs = ( clp_dqs + clm_dqs + pco_dqs + eml_dqs + spl_dqs)
1918 drhogns = ( clp_dns + clm_dns + pco_dns + eml_dns )
1920 drhogqg = ( clp_dqg + clm_dqg + pco_dqg + eml_dqg + spl_dqg)
1921 drhogng = ( clp_dng + clm_dng + pco_dng + eml_dng )
1925 rhoq(i_qc,k,i,j) = max(0.0_rp, rhoq(i_qc,k,i,j) + drhogqc )
1926 rhoq(i_nc,k,i,j) = max(0.0_rp, rhoq(i_nc,k,i,j) + drhognc )
1927 rhoq(i_qr,k,i,j) = max(0.0_rp, rhoq(i_qr,k,i,j) + drhogqr )
1928 rhoq(i_nr,k,i,j) = max(0.0_rp, rhoq(i_nr,k,i,j) + drhognr )
1929 rhoq(i_qi,k,i,j) = max(0.0_rp, rhoq(i_qi,k,i,j) + drhogqi )
1930 rhoq(i_ni,k,i,j) = max(0.0_rp, rhoq(i_ni,k,i,j) + drhogni )
1931 rhoq(i_qs,k,i,j) = max(0.0_rp, rhoq(i_qs,k,i,j) + drhogqs )
1932 rhoq(i_ns,k,i,j) = max(0.0_rp, rhoq(i_ns,k,i,j) + drhogns )
1933 rhoq(i_qg,k,i,j) = max(0.0_rp, rhoq(i_qg,k,i,j) + drhogqg )
1934 rhoq(i_ng,k,i,j) = max(0.0_rp, rhoq(i_ng,k,i,j) + drhogng )
1938 rhoe(k,i,j) = rhoe(k,i,j) + lhf * ( drhogqi + drhogqs + drhogqg )
1942 profile_stop(
"sn14_update_rhoq")
1953 qtrc(k,i,j,iq) = rhoq(iq,k,i,j) * rrho(k,i,j)
1956 calc_qdry( qdry(k,i,j), qtrc, k, i, j, iq )
1957 calc_cv( cva(k,i,j), qdry(k,i,j), qtrc, k, i, j, iq, cvdry,
aq_cv )
1958 calc_r( rmoist, qtrc(k,i,j,i_qv), qdry(k,i,j), rdry, rvap )
1959 cpa(k,i,j) = cva(k,i,j) + rmoist
1960 temp(k,i,j) = rhoe(k,i,j) / ( dens(k,i,j) * cva(k,i,j) )
1961 pres(k,i,j) = dens(k,i,j) * rmoist * temp(k,i,j)
1962 rhot(k,i,j) = temp(k,i,j) * ( p00 / pres(k,i,j) )**(rmoist/cpa(k,i,j)) &
1969 if( opt_debug_tem )
call debug_tem_kij( 4, temp(:,:,:), dens(:,:,:), pres(:,:,:), qtrc(:,:,:,i_qv) )
1975 qtrc(k,i,j,iq) = rhoq(iq,k,i,j) * rrho(k,i,j)
1998 if ( mp_doprecipitation )
then 2003 flx_rain(k,i,j) = 0.0_rp
2004 flx_snow(k,i,j) = 0.0_rp
2009 velw(:,:,:,:) = 0.0_rp
2011 do step = 1, mp_nstep_sedimentation
2013 call mp_terminal_velocity( velw(:,:,:,:), &
2019 call mp_precipitation( wflux_rain(:,:,:), &
2020 wflux_snow(:,:,:), &
2029 mp_dtsec_sedimentation )
2034 flx_rain(k,i,j) = flx_rain(k,i,j) + wflux_rain(k,i,j) * mp_rnstep_sedimentation
2035 flx_snow(k,i,j) = flx_snow(k,i,j) + wflux_snow(k,i,j) * mp_rnstep_sedimentation
2046 sflx_rain(i,j) = flx_rain(
ks-1,i,j)
2047 sflx_snow(i,j) = flx_snow(
ks-1,i,j)
2054 end subroutine mp_sn14
2067 integer,
intent(in) :: point
2068 real(RP),
intent(in) :: tem(
ka,
ia,
ja)
2069 real(RP),
intent(in) :: rho(
ka,
ia,
ja)
2070 real(RP),
intent(in) :: pre(
ka,
ia,
ja)
2071 real(RP),
intent(in) :: qv (
ka,
ia,
ja)
2079 if ( tem(k,i,j) < tem_min &
2080 .OR. rho(k,i,j) < rho_min &
2081 .OR. pre(k,i,j) < 1.0_rp )
then 2084 "*** point: ", point,
" low tem,rho,pre:", tem(k,i,j), rho(k,i,j), pre(k,i,j), qv(k,i,j), k, i, j,
prc_myrank 2106 moist_psat_liq => atmos_saturation_psat_liq, &
2107 moist_psat_ice => atmos_saturation_psat_ice, &
2108 moist_pres2qsat_liq => atmos_saturation_pres2qsat_liq, &
2109 moist_pres2qsat_ice => atmos_saturation_pres2qsat_ice, &
2113 real(RP),
intent(in) :: z(
ka)
2114 real(RP),
intent(in) :: velz(
ka,
ia,
ja)
2115 real(RP),
intent(in) :: rho(
ka,
ia,
ja)
2116 real(RP),
intent(in) :: tem(
ka,
ia,
ja)
2117 real(RP),
intent(in) :: pre(
ka,
ia,
ja)
2119 real(RP),
intent(in) :: rhoq(
qa,
ka,
ia,
ja)
2120 real(RP),
intent(out) :: PQ(pq_max,
ka,
ia,
ja)
2122 real(RP),
intent(in) :: cpa(
ka,
ia,
ja)
2123 real(RP),
intent(in) :: dTdt_rad(
ka,
ia,
ja)
2124 real(RP),
intent(in) :: qke(
ka,
ia,
ja)
2125 real(DP),
intent(in) :: dt
2126 real(RP),
intent(in) :: CCN(
ka,
ia,
ja)
2131 real(RP),
parameter :: c_ccn_ocean= 1.00e+8_rp
2132 real(RP),
parameter :: c_ccn_land = 1.26e+9_rp
2133 real(RP),
save :: c_ccn = 1.00e+8_rp
2135 real(RP),
parameter :: kappa_ocean= 0.462_rp
2136 real(RP),
parameter :: kappa_land = 0.308_rp
2137 real(RP),
save :: kappa = 0.462_rp
2138 real(RP),
save :: c_in = 1.0_rp
2140 real(RP),
save :: nm_M92 = 1.e+3_rp
2141 real(RP),
save :: am_M92 = -0.639_rp
2142 real(RP),
save :: bm_M92 = 12.96_rp
2144 real(RP),
save :: in_max = 1000.e+3_rp
2145 real(RP),
save :: ssi_max= 0.60_rp
2146 real(RP),
save :: ssw_max= 1.1_rp
2148 logical,
save :: flag_first = .true.
2149 real(RP),
save :: qke_min = 0.03_rp
2150 real(RP),
save :: tem_ccn_low=233.150_rp
2151 real(RP),
save :: tem_in_low =173.150_rp
2152 logical,
save :: nucl_twomey = .false.
2153 logical,
save :: inucl_w = .false.
2155 namelist /nm_mp_sn14_nucleation/ &
2158 nm_m92, am_m92, bm_m92, &
2163 nucl_twomey, inucl_w
2168 real(RP) :: esw(
ka,
ia,
ja)
2169 real(RP) :: esi(
ka,
ia,
ja)
2170 real(RP) :: ssw(
ka,
ia,
ja)
2171 real(RP) :: ssi(
ka,
ia,
ja)
2173 real(RP) :: w_dssidz(
ka,
ia,
ja)
2175 real(RP) :: ssi_below(
ka,
ia,
ja)
2176 real(RP) :: z_below(
ka,
ia,
ja)
2180 real(RP) :: qsw(
ka,
ia,
ja)
2181 real(RP) :: qsi(
ka,
ia,
ja)
2182 real(RP) :: dqsidtem_rho(
ka,
ia,
ja)
2183 real(RP) :: dssidt_rad(
ka,
ia,
ja)
2185 real(RP) :: wssi, wdssi
2191 real(RP) :: sigma_w(
ka,
ia,
ja)
2192 real(RP) :: weff(
ka,
ia,
ja)
2193 real(RP) :: weff_max(
ka,
ia,
ja)
2195 real(RP) :: coef_ccn(
ia,
ja)
2196 real(RP) :: slope_ccn(
ia,
ja)
2197 real(RP) :: nc_new(
ka,
ia,
ja)
2198 real(RP) :: nc_new_below(
ka,
ia,
ja)
2200 real(RP) :: nc_new_max
2203 logical :: flag_nucleation(
ka,
ia,
ja)
2205 real(RP) :: r_gravity
2206 real(RP),
parameter :: r_sqrt3=0.577350269_rp
2207 real(RP),
parameter :: eps=1.e-30_rp
2210 real(RP) :: dlcdt_max, dli_max
2211 real(RP) :: dncdt_max, dni_max
2216 if( flag_first )
then 2218 read(
io_fid_conf, nml=nm_mp_sn14_nucleation, end=100)
2221 if( mp_couple_aerosol .AND. nucl_twomey )
then 2222 write(
io_fid_log,*)
"nucl_twomey should be false when MP_couple_aerosol is true, stop" 2234 nc_uplim_d(1,i,j) = c_ccn*1.5_rp
2239 r_gravity = 1.0_rp/grav
2241 call moist_psat_liq ( esw, tem )
2242 call moist_psat_ice ( esi, tem )
2243 call moist_pres2qsat_liq( qsw, tem, pre )
2244 call moist_pres2qsat_ice( qsi, tem, pre )
2245 call moist_dqsi_dtem_rho( dqsidtem_rho, tem, rho )
2248 a_max = 1.e+6_rp*0.1_rp*(1.e-6_rp)**1.27_rp
2256 pv = rhoq(i_qv,k,i,j)*rvap*tem(k,i,j)
2257 ssw(k,i,j) = min( mp_ssw_lim, ( pv/esw(k,i,j)-1.0_rp ) )*100.0_rp
2258 ssi(k,i,j) = (pv/esi(k,i,j) - 1.00_rp)
2260 ssi_below(k+1,i,j) = ssi(k,i,j)
2261 z_below(k+1,i,j) = z(k)
2264 ssi_below(
ks,i,j) = ssi(
ks,i,j)
2265 z_below(
ks,i,j) = z(
ks-1)
2270 coef_ccn(i,j) = 1.e+6_rp*0.88_rp*(c_ccn*1.e-6_rp)**(2.0_rp/(kappa + 2.0_rp)) &
2272 * (70.0_rp)**(kappa/(kappa + 2.0_rp))
2274 slope_ccn(i,j) = 1.5_rp*kappa/(kappa + 2.0_rp)
2277 sigma_w(k,i,j) = r_sqrt3*sqrt(max(qke(k,i,j),qke_min))
2279 sigma_w(
ks-1,i,j) = sigma_w(
ks,i,j)
2280 sigma_w(
ke+1,i,j) = sigma_w(
ke,i,j)
2283 weff(k,i,j) = 0.5_rp*(velz(k,i,j) + velz(k+1,i,j)) - cpa(k,i,j)*r_gravity*dtdt_rad(k,i,j)
2285 weff(
ks-1,i,j) = weff(
ks,i,j)
2286 weff(
ke,i,j) = weff(
ke-1,i,j)
2291 if( mp_couple_aerosol )
then 2296 if( ssw(k,i,j) > 1.e-10_rp .AND. pre(k,i,j) > 300.e+2_rp )
then 2297 nc_new(k,i,j) = max( ccn(k,i,j), c_ccn )
2299 nc_new(k,i,j) = 0.0_rp
2307 if( nucl_twomey )
then 2314 weff_max(k,i,j) = weff(k,i,j) + sigma_w(k,i,j)
2316 if( (weff(k,i,j) > 1.e-8_rp) .AND. (ssw(k,i,j) > 1.e-10_rp) .AND. pre(k,i,j) > 300.e+2_rp )
then 2318 nc_new_max = coef_ccn(i,j)*weff_max(k,i,j)**slope_ccn(i,j)
2319 nc_new(k,i,j) = a_max*nc_new_max**b_max
2321 nc_new(k,i,j) = 0.0_rp
2331 if( ssw(k,i,j) > 1.e-10_rp .AND. pre(k,i,j) > 300.e+2_rp )
then 2332 nc_new(k,i,j) = c_ccn*ssw(k,i,j)**kappa
2334 nc_new(k,i,j) = 0.0_rp
2347 if( nc_new(k,i,j) > nc_uplim_d(1,i,j) )
then 2348 flag_nucleation(k,i,j) = .false.
2349 nc_new_below(k+1,i,j) = 1.e+30_rp
2350 else if( nc_new(k,i,j) > eps )
then 2351 flag_nucleation(k,i,j) = .true.
2352 nc_new_below(k+1,i,j) = nc_new(k,i,j)
2354 flag_nucleation(k,i,j) = .false.
2355 nc_new_below(k+1,i,j) = 0.0_rp
2358 nc_new_below(
ks,i,j) = 0.0_rp
2371 if( mp_couple_aerosol )
then 2379 if ( flag_nucleation(k,i,j) .AND. &
2380 tem(k,i,j) > tem_ccn_low )
then 2381 dlcdt_max = (rhoq(i_qv,k,i,j) - esw(k,i,j)/(rvap*tem(k,i,j)))*rdt
2382 dncdt_max = dlcdt_max/xc_min
2384 dnc_new = nc_new(k,i,j)
2385 pq(i_ncccn,k,i,j) = min( dncdt_max, dnc_new*rdt )
2386 pq(i_lcccn,k,i,j) = min( dlcdt_max, xc_min*pq(i_ncccn,k,i,j) )
2388 pq(i_ncccn,k,i,j) = 0.0_rp
2389 pq(i_lcccn,k,i,j) = 0.0_rp
2397 if( nucl_twomey )
then 2404 if ( flag_nucleation(k,i,j) .AND. &
2405 tem(k,i,j) > tem_ccn_low .AND. &
2406 nc_new(k,i,j) > rhoq(i_nc,k,i,j) )
then 2407 dlcdt_max = (rhoq(i_qv,k,i,j) - esw(k,i,j)/(rvap*tem(k,i,j)))*rdt
2408 dncdt_max = dlcdt_max/xc_min
2409 dnc_new = nc_new(k,i,j)-rhoq(i_nc,k,i,j)
2410 pq(i_ncccn,k,i,j) = min( dncdt_max, dnc_new*rdt )
2411 pq(i_lcccn,k,i,j) = min( dlcdt_max, xc_min*pq(i_ncccn,k,i,j) )
2413 pq(i_ncccn,k,i,j) = 0.0_rp
2414 pq(i_lcccn,k,i,j) = 0.0_rp
2424 if( tem(k,i,j) > tem_ccn_low .AND. &
2425 nc_new(k,i,j) > rhoq(i_nc,k,i,j) )
then 2426 dlcdt_max = (rhoq(i_qv,k,i,j) - esw(k,i,j)/(rvap*tem(k,i,j)))*rdt
2427 dncdt_max = dlcdt_max/xc_min
2428 dnc_new = nc_new(k,i,j)-rhoq(i_nc,k,i,j)
2429 pq(i_ncccn,k,i,j) = min( dncdt_max, dnc_new*rdt )
2430 pq(i_lcccn,k,i,j) = min( dlcdt_max, xc_min*pq(i_ncccn,k,i,j) )
2432 pq(i_ncccn,k,i,j) = 0.0_rp
2433 pq(i_lcccn,k,i,j) = 0.0_rp
2452 dz = z(k) - z_below(k,i,j)
2453 w_dssidz(k,i,j) = velz(k,i,j)*(ssi(k,i,j) - ssi_below(k,i,j))/dz
2454 dssidt_rad(k,i,j) = -rhoq(i_qv,k,i,j)/(rho(k,i,j)*qsi(k,i,j)*qsi(k,i,j))*dqsidtem_rho(k,i,j)*dtdt_rad(k,i,j)
2455 dli_max = (rhoq(i_qv,k,i,j) - esi(k,i,j)/(rvap*tem(k,i,j)))*rdt
2456 dni_max = min( dli_max/xi_ccn, (in_max-rhoq(i_ni,k,i,j))*rdt )
2457 wdssi = min( w_dssidz(k,i,j)+dssidt_rad(k,i,j), 0.01_rp)
2458 wssi = min( ssi(k,i,j), ssi_max)
2460 if( ( wdssi > eps ) .AND. &
2461 (tem(k,i,j) < 273.15_rp ) .AND. &
2462 (rhoq(i_ni,k,i,j) < in_max ) .AND. &
2463 (wssi >= eps ) )
then 2466 pq(i_niccn,k,i,j) = min(dni_max, c_in*bm_m92*nm_m92*0.3_rp*exp(0.3_rp*bm_m92*(wssi-0.1_rp))*wdssi)
2468 pq(i_niccn,k,i,j) = min(dni_max, max(c_in*nm_m92*exp(0.3_rp*bm_m92*(wssi-0.1_rp) )-rhoq(i_ni,k,i,j),0.0_rp )*rdt )
2470 pq(i_liccn,k,i,j) = min(dli_max, pq(i_niccn,k,i,j)*xi_ccn )
2474 pq(i_niccn,k,i,j) = 0.0_rp
2475 pq(i_liccn,k,i,j) = 0.0_rp
2494 real(RP),
intent(out):: PQ(pq_max,
ka,
ia,
ja)
2496 real(RP),
intent(in) :: Pac(pac_max,
ka,
ia,
ja)
2497 real(RP),
intent(in) :: tem(
ka,
ia,
ja)
2498 real(RP),
intent(in) :: rhoq(
qa,
ka,
ia,
ja)
2499 real(RP),
intent(in) :: xq(5,
ka,
ia,
ja)
2501 logical,
save :: flag_first = .true.
2503 real(RP),
parameter :: pice = 350.0e+6_rp
2505 real(RP),
parameter :: pnc = 250.0_rp
2506 real(RP),
parameter :: rc_cr= 12.e-6_rp
2510 real(RP),
save :: xc_cr
2511 real(RP),
save :: alpha
2512 real(RP),
save :: gm, lgm
2516 real(RP) :: a0,a1,a2,a3,a4,a5
2517 real(RP) :: a6,a7,a8,a9,a10
2518 real(RP) :: an1,an2,b0,b1,b2,c0,c1,c2
2519 real(RP) :: d0,d1,d2,e1,e2,h0,h1,h2
2520 real(RP),
parameter :: eps=1.0e-30_rp
2524 real(RP) :: wn, wni, wns, wng
2527 if( flag_first )
then 2528 flag_first = .false.
2530 xc_cr = (2.0_rp*rc_cr/a_m(i_qc))**(1.0_rp/b_m(i_qc))
2531 alpha = (nu(i_qc)+1.0_rp)/mu(i_qc)
2532 gm = gammafunc(alpha)
2542 if (tem(k,i,j) > 270.16_rp)
then 2544 else if(tem(k,i,j) >= 268.16_rp)
then 2545 fp = (270.16_rp-tem(k,i,j))*0.5_rp
2546 else if(tem(k,i,j) >= 265.16_rp)
then 2547 fp = (tem(k,i,j)-265.16_rp)*0.333333333_rp
2555 x = coef_lambda(i_qc)*(xc_cr/xq(i_c,k,i,j))**mu(i_qc)
2557 if(x<1.e-2_rp*alpha)
then 2559 else if(x<alpha+1.0_rp)
then 2562 a1 = a0*x/(alpha+1.0_rp)
2563 a2 = a1*x/(alpha+2.0_rp)
2564 a3 = a2*x/(alpha+3.0_rp)
2565 a4 = a3*x/(alpha+4.0_rp)
2566 a5 = a4*x/(alpha+5.0_rp)
2567 a6 = a5*x/(alpha+6.0_rp)
2568 a7 = a6*x/(alpha+7.0_rp)
2569 a8 = a7*x/(alpha+8.0_rp)
2570 a9 = a8*x/(alpha+9.0_rp)
2571 a10 = a9*x/(alpha+10.0_rp)
2572 igm = (a0+a1+a2+a3+a4+a5+a6+a7+a8+a9+a10)*exp( -x + alpha*
log(x) - lgm )
2573 else if(x<alpha*1.d2)
then 2581 an1 = -(1.0_rp-alpha)
2583 d1 = 1.0_rp/(an1*d0+b1)
2588 an2 = -2.0_rp*(2.0_rp-alpha)
2590 d2 = 1.0_rp/(an2*d1+b2)
2595 igm = 1.0_rp - exp( -x + alpha*
log(x) - lgm )*h2
2600 n12 = rhoq(i_nc,k,i,j)*(1.0_rp-igm)
2602 wn = (pice + n12/((rhoq(i_qc,k,i,j)+xc_min)*pnc) )*fp
2603 wni = wn*(-pac(i_liaclc2li,k,i,j) )
2604 wns = wn*(-pac(i_lsaclc2ls,k,i,j) )
2605 wng = wn*(-pac(i_lgaclc2lg,k,i,j) )
2606 pq(i_nispl,k,i,j) = wni+wns+wng
2608 pq(i_lsspl,k,i,j) = - wns*xq(i_i,k,i,j)
2609 pq(i_lgspl,k,i,j) = - wng*xq(i_i,k,i,j)
2619 ! collection process
2622 xq, dq_xave, vt_xave )
2625 moist_psat_ice => atmos_saturation_psat_ice
2631 real(RP),
intent(out):: Pac(pac_max,
ka,
ia,
ja)
2633 real(RP),
intent(out):: PQ(pq_max,
ka,
ia,
ja)
2635 real(RP),
intent(in) :: wtem(
ka,
ia,
ja)
2637 real(RP),
intent(in) :: rhoq(
qa,
ka,
ia,
ja)
2639 real(RP),
intent(in) :: xq(5,
ka,
ia,
ja)
2641 real(RP),
intent(in) :: dq_xave(5,
ka,
ia,
ja)
2643 real(RP),
intent(in) :: vt_xave(5,2,
ka,
ia,
ja)
2650 real(RP),
save :: dc0 = 15.0e-6_rp
2651 real(RP),
save :: dc1 = 40.0e-6_rp
2652 real(RP),
save :: di0 = 150.0e-6_rp
2653 real(RP),
save :: ds0 = 150.0e-6_rp
2654 real(RP),
save :: dg0 = 150.0e-6_rp
2656 real(RP),
save :: sigma_c=0.00_rp
2657 real(RP),
save :: sigma_r=0.00_rp
2658 real(RP),
save :: sigma_i=0.2_rp
2659 real(RP),
save :: sigma_s=0.2_rp
2660 real(RP),
save :: sigma_g=0.00_rp
2662 real(RP),
save :: E_im = 0.80_rp
2663 real(RP),
save :: E_sm = 0.80_rp
2664 real(RP),
save :: E_gm = 1.00_rp
2666 real(RP),
save :: E_ir=1.0_rp
2667 real(RP),
save :: E_sr=1.0_rp
2668 real(RP),
save :: E_gr=1.0_rp
2669 real(RP),
save :: E_ii=1.0_rp
2670 real(RP),
save :: E_si=1.0_rp
2671 real(RP),
save :: E_gi=1.0_rp
2672 real(RP),
save :: E_ss=1.0_rp
2673 real(RP),
save :: E_gs=1.0_rp
2674 real(RP),
save :: E_gg=1.0_rp
2677 integer,
save :: i_iconv2g=1
2678 integer,
save :: i_sconv2g=1
2680 real(RP),
save :: rho_g = 900.0_rp
2682 real(RP),
save :: cfill_i = 0.68_rp
2683 real(RP),
save :: cfill_s = 0.01_rp
2685 real(RP),
save :: di_cri = 500.e-6_rp
2687 logical,
save :: opt_stick_KS96=.false.
2688 logical,
save :: opt_stick_CO86=.false.
2689 real(RP),
parameter :: a_dec = 0.883_rp
2690 real(RP),
parameter :: b_dec = 0.093_rp
2691 real(RP),
parameter :: c_dec = 0.00348_rp
2692 real(RP),
parameter :: d_dec = 4.5185e-5_rp
2694 logical,
save :: flag_first = .true.
2695 namelist /nm_mp_sn14_collection/ &
2696 dc0, dc1, di0, ds0, dg0, &
2697 sigma_c, sigma_r, sigma_i, sigma_s, sigma_g, &
2701 e_ir, e_sr, e_gr, e_ii, e_si, e_gi, e_ss, e_gs, e_gg, &
2702 i_iconv2g, i_sconv2g, rho_g, cfill_i, cfill_s, di_cri
2704 real(RP) :: tem(
ka,
ia,
ja)
2707 real(RP) :: E_c, E_r, E_i, E_s, E_g
2708 real(RP) :: E_ic, E_sc, E_gc
2710 real(RP) :: E_stick(
ka,
ia,
ja)
2712 real(RP) :: temc, temc2, temc3
2715 real(RP) :: esi(
ka,
ia,
ja)
2717 real(RP) :: temc_p, temc_m
2729 real(RP) :: coef_acc_LCI, coef_acc_NCI
2730 real(RP) :: coef_acc_LCS, coef_acc_NCS
2732 real(RP) :: coef_acc_LCG, coef_acc_NCG
2733 real(RP) :: coef_acc_LRI_I, coef_acc_NRI_I
2734 real(RP) :: coef_acc_LRI_R, coef_acc_NRI_R
2735 real(RP) :: coef_acc_LRS_S, coef_acc_NRS_S
2736 real(RP) :: coef_acc_LRS_R, coef_acc_NRS_R
2737 real(RP) :: coef_acc_LRG, coef_acc_NRG
2738 real(RP) :: coef_acc_LII, coef_acc_NII
2739 real(RP) :: coef_acc_LIS, coef_acc_NIS
2740 real(RP) :: coef_acc_NSS
2741 real(RP) :: coef_acc_NGG
2742 real(RP) :: coef_acc_LSG, coef_acc_NSG
2744 real(RP) :: dcdc, dcdi, dcds, dcdg
2745 real(RP) :: drdr, drdi, drds, drdg
2746 real(RP) :: didi, dids, didg
2747 real(RP) :: dsds, dsdg
2750 real(RP) :: vcvc, vcvi, vcvs, vcvg
2751 real(RP) :: vrvr, vrvi, vrvs, vrvg
2752 real(RP) :: vivi, vivs, vivg
2753 real(RP) :: vsvs, vsvg
2756 real(RP) :: wx_cri, wx_crs
2757 real(RP) :: coef_emelt
2764 if( flag_first )
then 2766 read(
io_fid_conf, nml=nm_mp_sn14_collection, end=100 )
2768 flag_first = .false.
2775 tem(k,i,j) = max( wtem(k,i,j), tem_min )
2780 call moist_psat_ice( esi, tem )
2782 if( opt_stick_ks96 )
then 2787 temc = tem(k,i,j) - t00
2790 e_dec = max(0.0_rp, a_dec + b_dec*temc + c_dec*temc2 + d_dec*temc3 )
2791 esi_rat = rhoq(i_qv,k,i,j)*rvap*tem(k,i,j)/esi(k,i,j)
2792 e_stick(k,i,j) = min(1.0_rp, e_dec*esi_rat)
2796 else if( opt_stick_co86 )
then 2801 temc = min(tem(k,i,j) - t00,0.0_rp)
2802 w1 = 0.035_rp*temc-0.7_rp
2803 e_stick(k,i,j) = 10._rp**w1
2812 temc_m = min(tem(k,i,j) - t00,0.0_rp)
2813 e_stick(k,i,j) = exp(0.09_rp*temc_m)
2819 profile_start(
"sn14_collection")
2826 temc_p = max(tem(k,i,j) - t00,0.0_rp)
2828 ave_dc = coef_d(i_qc)*xq(i_c,k,i,j)**b_m(i_qc)
2829 ave_di = coef_d(i_qi)*xq(i_i,k,i,j)**b_m(i_qi)
2830 ave_ds = coef_d(i_qs)*xq(i_s,k,i,j)**b_m(i_qs)
2831 ave_dg = coef_d(i_qg)*xq(i_g,k,i,j)**b_m(i_qg)
2834 e_c = max(0.0_rp, min(1.0_rp, (ave_dc-dc0)/(dc1-dc0) ))
2835 sw = 0.5_rp - sign(0.5_rp, di0-ave_di)
2837 sw = 0.5_rp - sign(0.5_rp, ds0-ave_ds)
2839 sw = 0.5_rp - sign(0.5_rp, dg0-ave_dg)
2846 dcdc = dq_xave(i_c,k,i,j) * dq_xave(i_c,k,i,j)
2847 drdr = dq_xave(i_r,k,i,j) * dq_xave(i_r,k,i,j)
2848 didi = dq_xave(i_i,k,i,j) * dq_xave(i_i,k,i,j)
2849 dsds = dq_xave(i_s,k,i,j) * dq_xave(i_s,k,i,j)
2850 dgdg = dq_xave(i_g,k,i,j) * dq_xave(i_g,k,i,j)
2851 dcdi = dq_xave(i_c,k,i,j) * dq_xave(i_i,k,i,j)
2852 dcds = dq_xave(i_c,k,i,j) * dq_xave(i_s,k,i,j)
2853 dcdg = dq_xave(i_c,k,i,j) * dq_xave(i_g,k,i,j)
2854 drdi = dq_xave(i_r,k,i,j) * dq_xave(i_i,k,i,j)
2855 drds = dq_xave(i_r,k,i,j) * dq_xave(i_s,k,i,j)
2856 drdg = dq_xave(i_r,k,i,j) * dq_xave(i_g,k,i,j)
2857 dids = dq_xave(i_i,k,i,j) * dq_xave(i_s,k,i,j)
2859 dsdg = dq_xave(i_s,k,i,j) * dq_xave(i_g,k,i,j)
2861 vcvc = vt_xave(i_c,2,k,i,j)* vt_xave(i_c,2,k,i,j)
2862 vrvr = vt_xave(i_r,2,k,i,j)* vt_xave(i_r,2,k,i,j)
2863 vivi = vt_xave(i_i,2,k,i,j)* vt_xave(i_i,2,k,i,j)
2864 vsvs = vt_xave(i_s,2,k,i,j)* vt_xave(i_s,2,k,i,j)
2865 vgvg = vt_xave(i_g,2,k,i,j)* vt_xave(i_g,2,k,i,j)
2866 vcvi = vt_xave(i_c,2,k,i,j)* vt_xave(i_i,2,k,i,j)
2867 vcvs = vt_xave(i_c,2,k,i,j)* vt_xave(i_s,2,k,i,j)
2868 vcvg = vt_xave(i_c,2,k,i,j)* vt_xave(i_g,2,k,i,j)
2869 vrvi = vt_xave(i_r,2,k,i,j)* vt_xave(i_i,2,k,i,j)
2870 vrvs = vt_xave(i_r,2,k,i,j)* vt_xave(i_s,2,k,i,j)
2871 vrvg = vt_xave(i_r,2,k,i,j)* vt_xave(i_g,2,k,i,j)
2872 vivs = vt_xave(i_i,2,k,i,j)* vt_xave(i_s,2,k,i,j)
2874 vsvg = vt_xave(i_s,2,k,i,j)* vt_xave(i_g,2,k,i,j)
2883 ( delta_b1(i_qc)*dcdc + delta_ab1(i_qi,i_qc)*dcdi + delta_b0(i_qi)*didi ) &
2884 * ( theta_b1(i_qc)*vcvc - theta_ab1(i_qi,i_qc)*vcvi + theta_b0(i_qi)*vivi &
2885 + sigma_i + sigma_c )**0.5_rp
2887 ( delta_b0(i_qc)*dcdc + delta_ab0(i_qi,i_qc)*dcdi + delta_b0(i_qi)*didi ) &
2888 * ( theta_b0(i_qc)*vcvc - theta_ab0(i_qi,i_qc)*vcvi + theta_b0(i_qi)*vivi &
2889 + sigma_i + sigma_c )**0.5_rp
2890 pac(i_liaclc2li,k,i,j)= -0.25_rp*pi*e_ic*rhoq(i_ni,k,i,j)*rhoq(i_qc,k,i,j)*coef_acc_lci
2891 pac(i_niacnc2ni,k,i,j)= -0.25_rp*pi*e_ic*rhoq(i_ni,k,i,j)*rhoq(i_nc,k,i,j)*coef_acc_nci
2895 ( delta_b1(i_qc)*dcdc + delta_ab1(i_qs,i_qc)*dcds + delta_b0(i_qs)*dsds ) &
2896 * ( theta_b1(i_qc)*vcvc - theta_ab1(i_qs,i_qc)*vcvs + theta_b0(i_qs)*vsvs &
2897 + sigma_s + sigma_c )**0.5_rp
2899 ( delta_b0(i_qc)*dcdc + delta_ab0(i_qs,i_qc)*dcds + delta_b0(i_qs)*dsds ) &
2900 * ( theta_b0(i_qc)*vcvc - theta_ab0(i_qs,i_qc)*vcvs + theta_b0(i_qs)*vsvs &
2901 + sigma_s + sigma_c )**0.5_rp
2902 pac(i_lsaclc2ls,k,i,j)= -0.25_rp*pi*e_sc*rhoq(i_ns,k,i,j)*rhoq(i_qc,k,i,j)*coef_acc_lcs
2903 pac(i_nsacnc2ns,k,i,j)= -0.25_rp*pi*e_sc*rhoq(i_ns,k,i,j)*rhoq(i_nc,k,i,j)*coef_acc_ncs
2907 ( delta_b1(i_qc)*dcdc + delta_ab1(i_qg,i_qc)*dcdg + delta_b0(i_qg)*dgdg ) &
2908 * ( theta_b1(i_qc)*vcvc - theta_ab1(i_qg,i_qc)*vcvg + theta_b0(i_qg)*vgvg &
2909 + sigma_g + sigma_c )**0.5_rp
2911 ( delta_b0(i_qc)*dcdc + delta_ab0(i_qg,i_qc)*dcdg + delta_b0(i_qg)*dgdg ) &
2912 * ( theta_b0(i_qc)*vcvc - theta_ab0(i_qg,i_qc)*vcvg + theta_b0(i_qg)*vgvg &
2913 + sigma_g + sigma_c )**0.5_rp
2914 pac(i_lgaclc2lg,k,i,j)= -0.25_rp*pi*e_gc*rhoq(i_ng,k,i,j)*rhoq(i_qc,k,i,j)*coef_acc_lcg
2915 pac(i_ngacnc2ng,k,i,j)= -0.25_rp*pi*e_gc*rhoq(i_ng,k,i,j)*rhoq(i_nc,k,i,j)*coef_acc_ncg
2918 ( delta_b1(i_qs)*dsds + delta_ab1(i_qg,i_qs)*dsdg + delta_b0(i_qg)*dgdg ) &
2919 * ( theta_b1(i_qs)*vsvs - theta_ab1(i_qg,i_qs)*vsvg + theta_b0(i_qg)*vgvg &
2920 + sigma_g + sigma_s )**0.5_rp
2922 ( delta_b0(i_qs)*dsds + delta_ab0(i_qg,i_qs)*dsdg + delta_b0(i_qg)*dgdg ) &
2924 * ( theta_b0(i_qs)*vsvs - theta_ab0(i_qg,i_qs)*vsvg + theta_b0(i_qg)*vgvg &
2925 + sigma_g + sigma_s )**0.5_rp
2926 pac(i_lgacls2lg,k,i,j)= -0.25_rp*pi*e_stick(k,i,j)*e_gs*rhoq(i_ng,k,i,j)*rhoq(i_qs,k,i,j)*coef_acc_lsg
2927 pac(i_ngacns2ng,k,i,j)= -0.25_rp*pi*e_stick(k,i,j)*e_gs*rhoq(i_ng,k,i,j)*rhoq(i_ns,k,i,j)*coef_acc_nsg
2932 ( delta_b1(i_qi)*didi + delta_ab1(i_qs,i_qi)*dids + delta_b0(i_qs)*dsds ) &
2933 * ( theta_b1(i_qi)*vivi - theta_ab1(i_qs,i_qi)*vivs + theta_b0(i_qs)*vsvs &
2934 + sigma_i + sigma_s )**0.5_rp
2936 ( delta_b0(i_qi)*didi + delta_ab0(i_qs,i_qi)*dids + delta_b0(i_qs)*dsds ) &
2937 * ( theta_b0(i_qi)*vivi - theta_ab0(i_qs,i_qi)*vivs + theta_b0(i_qs)*vsvs &
2938 + sigma_i + sigma_s )**0.5_rp
2939 pac(i_liacls2ls,k,i,j)= -0.25_rp*pi*e_stick(k,i,j)*e_si*rhoq(i_ns,k,i,j)*rhoq(i_qi,k,i,j)*coef_acc_lis
2940 pac(i_niacns2ns,k,i,j)= -0.25_rp*pi*e_stick(k,i,j)*e_si*rhoq(i_ns,k,i,j)*rhoq(i_ni,k,i,j)*coef_acc_nis
2942 sw = sign(0.5_rp, t00-tem(k,i,j)) + 0.5_rp
2952 ( ( delta_b1(i_qr)*drdr + delta_ab1(i_qg,i_qr)*drdg + delta_b0(i_qg)*dgdg ) * sw &
2953 + ( delta_b1(i_qg)*dgdg + delta_ab1(i_qr,i_qg)*drdg + delta_b0(i_qr)*drdr ) * (1.0_rp-sw) ) &
2954 * sqrt( ( theta_b1(i_qr)*vrvr - theta_ab1(i_qg,i_qr)*vrvg + theta_b0(i_qg)*vgvg ) * sw &
2955 + ( theta_b1(i_qg)*vgvg - theta_ab1(i_qr,i_qg)*vrvg + theta_b0(i_qr)*vrvr ) * (1.0_rp-sw) &
2956 + sigma_r + sigma_g )
2957 pac(i_lraclg2lg,k,i,j) = -0.25_rp*pi*e_gr*coef_acc_lrg &
2958 * ( rhoq(i_ng,k,i,j)*rhoq(i_qr,k,i,j) * sw &
2959 + rhoq(i_nr,k,i,j)*rhoq(i_qg,k,i,j) * (1.0_rp-sw) )
2961 ( delta_b0(i_qr)*drdr + delta_ab0(i_qg,i_qr)*drdg + delta_b0(i_qg)*dgdg ) &
2962 * ( theta_b0(i_qr)*vrvr - theta_ab0(i_qg,i_qr)*vrvg + theta_b0(i_qg)*vgvg &
2963 + sigma_r + sigma_g )**0.5_rp
2964 pac(i_nracng2ng,k,i,j) = -0.25_rp*pi*e_gr*rhoq(i_ng,k,i,j)*rhoq(i_nr,k,i,j)*coef_acc_nrg
2974 ( delta_b1(i_qi)*didi + delta_ab1(i_qr,i_qi)*drdi + delta_b0(i_qr)*drdr ) &
2975 * ( theta_b1(i_qi)*vivi - theta_ab1(i_qr,i_qi)*vrvi + theta_b0(i_qr)*vrvr &
2976 + sigma_r + sigma_i )**0.5_rp
2978 ( delta_b0(i_qi)*didi + delta_ab0(i_qr,i_qi)*drdi + delta_b0(i_qr)*drdr ) &
2979 * ( theta_b0(i_qi)*vivi - theta_ab0(i_qr,i_qi)*vrvi + theta_b0(i_qr)*vrvr &
2980 + sigma_r + sigma_i )**0.5_rp
2981 pac(i_lracli2lg_i,k,i,j)= -0.25_rp*pi*e_ir*rhoq(i_nr,k,i,j)*rhoq(i_qi,k,i,j)*coef_acc_lri_i
2982 pac(i_nracni2ng_i,k,i,j)= -0.25_rp*pi*e_ir*rhoq(i_nr,k,i,j)*rhoq(i_ni,k,i,j)*coef_acc_nri_i
2985 ( delta_b1(i_qr)*drdr + delta_ab1(i_qi,i_qr)*drdi + delta_b0(i_qi)*didi ) &
2986 * ( theta_b1(i_qr)*vrvr - theta_ab1(i_qi,i_qr)*vrvi + theta_b0(i_qi)*vivi &
2987 + sigma_r + sigma_i )**0.5_rp
2989 ( delta_b0(i_qr)*drdr + delta_ab0(i_qi,i_qr)*drdi + delta_b0(i_qi)*didi ) &
2990 * ( theta_b0(i_qr)*vrvr - theta_ab0(i_qi,i_qr)*vrvi + theta_b0(i_qi)*vivi &
2991 + sigma_r + sigma_i )**0.5_rp
2992 pac(i_lracli2lg_r,k,i,j)= -0.25_rp*pi*e_ir*rhoq(i_ni,k,i,j)*rhoq(i_qr,k,i,j)*coef_acc_lri_r
2993 pac(i_nracni2ng_r,k,i,j)= -0.25_rp*pi*e_ir*rhoq(i_ni,k,i,j)*rhoq(i_nr,k,i,j)*coef_acc_nri_r
2997 ( delta_b1(i_qs)*dsds + delta_ab1(i_qr,i_qs)*drds + delta_b0(i_qr)*drdr ) &
2998 * ( theta_b1(i_qs)*vsvs - theta_ab1(i_qr,i_qs)*vrvs + theta_b0(i_qr)*vrvr &
2999 + sigma_r + sigma_s )**0.5_rp
3001 ( delta_b0(i_qs)*dsds + delta_ab0(i_qr,i_qs)*drds + delta_b0(i_qr)*drdr ) &
3002 * ( theta_b0(i_qs)*vsvs - theta_ab0(i_qr,i_qs)*vrvs + theta_b0(i_qr)*vrvr &
3003 + sigma_r + sigma_s )**0.5_rp
3004 pac(i_lracls2lg_s,k,i,j)= -0.25_rp*pi*e_sr*rhoq(i_nr,k,i,j)*rhoq(i_qs,k,i,j)*coef_acc_lrs_s
3005 pac(i_nracns2ng_s,k,i,j)= -0.25_rp*pi*e_sr*rhoq(i_nr,k,i,j)*rhoq(i_ns,k,i,j)*coef_acc_nrs_s
3008 ( delta_b1(i_qr)*drdr + delta_ab1(i_qs,i_qr)*drds + delta_b0(i_qs)*dsds ) &
3009 * ( theta_b1(i_qr)*vrvr - theta_ab1(i_qs,i_qr)*vrvs + theta_b0(i_qs)*vsvs &
3010 + sigma_r + sigma_s )**0.5_rp
3012 ( delta_b0(i_qr)*drdr + delta_ab0(i_qs,i_qr)*drds + delta_b0(i_qs)*dsds ) &
3013 * ( theta_b0(i_qr)*vrvr - theta_ab0(i_qs,i_qr)*vrvs + theta_b0(i_qs)*vsvs &
3014 + sigma_r + sigma_s )**0.5_rp
3015 pac(i_lracls2lg_r,k,i,j)= -0.25_rp*pi*e_sr*rhoq(i_ns,k,i,j)*rhoq(i_qr,k,i,j)*coef_acc_lrs_r
3016 pac(i_nracns2ng_r,k,i,j)= -0.25_rp*pi*e_sr*rhoq(i_ns,k,i,j)*rhoq(i_nr,k,i,j)*coef_acc_nrs_r
3024 ( delta_b0(i_qi)*didi + delta_ab1(i_qi,i_qi)*didi + delta_b1(i_qi)*didi ) &
3025 * ( theta_b0(i_qi)*vivi - theta_ab1(i_qi,i_qi)*vivi + theta_b1(i_qi)*vivi &
3026 + sigma_i + sigma_i )**0.5_rp
3028 ( delta_b0(i_qi)*didi + delta_ab0(i_qi,i_qi)*didi + delta_b0(i_qi)*didi ) &
3029 * ( theta_b0(i_qi)*vivi - theta_ab0(i_qi,i_qi)*vivi + theta_b0(i_qi)*vivi &
3030 + sigma_i + sigma_i )**0.5_rp
3031 pac(i_liacli2ls,k,i,j)= -0.25_rp*pi*e_stick(k,i,j)*e_ii*rhoq(i_ni,k,i,j)*rhoq(i_qi,k,i,j)*coef_acc_lii
3032 pac(i_niacni2ns,k,i,j)= -0.25_rp*pi*e_stick(k,i,j)*e_ii*rhoq(i_ni,k,i,j)*rhoq(i_ni,k,i,j)*coef_acc_nii
3044 ( delta_b0(i_qs)*dsds + delta_ab0(i_qs,i_qs)*dsds + delta_b0(i_qs)*dsds ) &
3045 * ( theta_b0(i_qs)*vsvs - theta_ab0(i_qs,i_qs)*vsvs + theta_b0(i_qs)*vsvs &
3046 + sigma_s + sigma_s )**0.5_rp
3047 pac(i_nsacns2ns,k,i,j)= -0.125_rp*pi*e_stick(k,i,j)*e_ss*rhoq(i_ns,k,i,j)*rhoq(i_ns,k,i,j)*coef_acc_nss
3051 ( delta_b0(i_qg)*dgdg + delta_ab0(i_qg,i_qg)*dgdg + delta_b0(i_qg)*dgdg ) &
3052 * ( theta_b0(i_qg)*vgvg - theta_ab0(i_qg,i_qg)*vgvg + theta_b0(i_qg)*vgvg &
3053 + sigma_g + sigma_g )**0.5_rp
3054 pac(i_ngacng2ng,k,i,j)= -0.125_rp*pi*e_stick(k,i,j)*e_gg*rhoq(i_ng,k,i,j)*rhoq(i_ng,k,i,j)*coef_acc_ngg
3061 sw = 0.5_rp - sign(0.5_rp,di_cri-ave_di)
3062 wx_cri = cfill_i*dwatr/rho_g*( pi/6.0_rp*rho_g*ave_di*ave_di*ave_di/xq(i_i,k,i,j) - 1.0_rp ) * sw
3063 pq(i_licon,k,i,j) = i_iconv2g * pac(i_liaclc2li,k,i,j)/max(1.0_rp, wx_cri) * sw
3064 pq(i_nicon,k,i,j) = i_iconv2g * pq(i_licon,k,i,j)/xq(i_i,k,i,j) * sw
3067 wx_crs = cfill_s*dwatr/rho_g*( pi/6.0_rp*rho_g*ave_ds*ave_ds*ave_ds/xq(i_s,k,i,j) - 1.0_rp )
3068 pq(i_lscon,k,i,j) = i_sconv2g * (pac(i_lsaclc2ls,k,i,j))/max(1.0_rp, wx_crs)
3069 pq(i_nscon,k,i,j) = i_sconv2g * pq(i_lscon,k,i,j)/xq(i_s,k,i,j)
3078 coef_emelt = cl/lhf0*temc_p
3080 pq(i_lgacm,k,i,j) = coef_emelt*pac(i_lgaclc2lg,k,i,j)
3081 pq(i_ngacm,k,i,j) = pq(i_lgacm,k,i,j)/xq(i_g,k,i,j)
3083 pq(i_lgarm,k,i,j) = coef_emelt*pac(i_lraclg2lg,k,i,j)
3084 pq(i_ngarm,k,i,j) = pq(i_lgarm,k,i,j)/xq(i_g,k,i,j)
3086 pq(i_lsacm,k,i,j) = coef_emelt*(pac(i_lsaclc2ls,k,i,j))
3087 pq(i_nsacm,k,i,j) = pq(i_lsacm,k,i,j)/xq(i_s,k,i,j)
3089 pq(i_lsarm,k,i,j) = coef_emelt*(pac(i_lracls2lg_r,k,i,j)+pac(i_lracls2lg_s,k,i,j))
3090 pq(i_nsarm,k,i,j) = pq(i_lsarm,k,i,j)/xq(i_g,k,i,j)
3092 pq(i_liacm,k,i,j) = coef_emelt*pac(i_liaclc2li,k,i,j)
3093 pq(i_niacm,k,i,j) = pq(i_liacm,k,i,j)/xq(i_i,k,i,j)
3095 pq(i_liarm,k,i,j) = coef_emelt*(pac(i_lracli2lg_r,k,i,j)+pac(i_lracli2lg_i,k,i,j))
3096 pq(i_niarm,k,i,j) = pq(i_liarm,k,i,j)/xq(i_g,k,i,j)
3100 profile_stop(
"sn14_collection")
3109 rhoq, xq, dq_xave, &
3113 real(RP),
intent(out) :: PQ(pq_max,
ka,
ia,
ja)
3115 real(RP),
intent(in) :: rhoq(
qa,
ka,
ia,
ja)
3116 real(RP),
intent(in) :: xq(5,
ka,
ia,
ja)
3117 real(RP),
intent(in) :: dq_xave(5,
ka,
ia,
ja)
3118 real(RP),
intent(in) :: rho(
ka,
ia,
ja)
3121 real(RP),
parameter :: kcc = 4.44e+9_rp
3122 real(RP),
parameter :: tau_min = 1.e-20_rp
3123 real(RP),
parameter :: rx_sep = 1.0_rp/x_sep
3126 real(RP),
parameter :: kcr = 5.8_rp
3127 real(RP),
parameter :: thr_acc = 5.e-5_rp
3130 real(RP),
parameter :: krr = 4.33_rp
3131 real(RP),
parameter :: kaprr = 60.7_rp
3132 real(RP),
parameter :: kbr = 1000._rp
3133 real(RP),
parameter :: kapbr = 2.3e+3_rp
3134 real(RP),
parameter :: dr_min = 0.35e-3_rp
3137 real(RP) :: coef_nuc0
3138 real(RP) :: coef_nuc1
3139 real(RP) :: coef_aut0
3140 real(RP) :: coef_aut1
3151 coef_nuc0 = (nu(i_qc)+2.0_rp)/(nu(i_qc)+1.0_rp)
3152 coef_nuc1 = (nu(i_qc)+2.0_rp)*(nu(i_qc)+4.0_rp)/(nu(i_qc)+1.0_rp)/(nu(i_qc)+1.0_rp)
3153 coef_aut0 = -kcc*coef_nuc0
3154 coef_aut1 = -kcc/x_sep/20._rp*coef_nuc1
3159 lwc = rhoq(i_qr,k,i,j)+rhoq(i_qc,k,i,j)
3160 if( lwc > xc_min )
then 3161 tau = max(tau_min, rhoq(i_qr,k,i,j)/lwc)
3165 rho_fac = sqrt(rho_0/max(rho(k,i,j),rho_min))
3168 psi_aut = 400._rp*(tau**0.7_rp)*(1.0_rp - (tau**0.7_rp))**3
3169 pq(i_ncaut,k,i,j) = coef_aut0*rhoq(i_qc,k,i,j)*rhoq(i_qc,k,i,j)*rho_fac*rho_fac
3171 pq(i_lcaut,k,i,j) = coef_aut1*lwc*lwc*xq(i_c,k,i,j)*xq(i_c,k,i,j) &
3172 *((1.0_rp-tau)*(1.0_rp-tau) + psi_aut)*rho_fac*rho_fac
3173 pq(i_nraut,k,i,j) = -rx_sep*pq(i_lcaut,k,i,j)
3176 psi_acc =(tau/(tau+thr_acc))**4
3177 pq(i_lcacc,k,i,j) = -kcr*rhoq(i_qc,k,i,j)*rhoq(i_qr,k,i,j)*rho_fac*psi_acc
3178 pq(i_ncacc,k,i,j) = -kcr*rhoq(i_nc,k,i,j)*rhoq(i_qr,k,i,j)*rho_fac*psi_acc
3181 pq(i_nrslc,k,i,j) = -krr*rhoq(i_nr,k,i,j)*rhoq(i_qr,k,i,j)*rho_fac
3184 ddr = min(1.e-3_rp, dq_xave(i_r,k,i,j) - dr_eq )
3185 if (dq_xave(i_r,k,i,j) < dr_min )
then 3187 pq(i_nrbrk,k,i,j) = 0.0_rp
3188 else if (dq_xave(i_r,k,i,j) <= dr_eq )
then 3189 psi_brk = kbr*ddr + 1.0_rp
3190 pq(i_nrbrk,k,i,j) = - (psi_brk + 1.0_rp)*pq(i_nrslc,k,i,j)
3192 psi_brk = 2.0_rp*exp(kapbr*ddr) - 1.0_rp
3193 pq(i_nrbrk,k,i,j) = - (psi_brk + 1.0_rp)*pq(i_nrslc,k,i,j)
3203 subroutine dep_vapor_melt_ice_kij( &
3205 rho, tem, pre, qd, & ! in
3208 xq, vt_xave, dq_xave )
3214 real(RP),
intent(out) :: PQ(pq_max,
ka,
ia,
ja)
3216 real(RP),
intent(in) :: rho(
ka,
ia,
ja)
3217 real(RP),
intent(in) :: tem(
ka,
ia,
ja)
3218 real(RP),
intent(in) :: pre(
ka,
ia,
ja)
3219 real(RP),
intent(in) :: qd(
ka,
ia,
ja)
3220 real(RP),
intent(in) :: esw(
ka,
ia,
ja)
3221 real(RP),
intent(in) :: esi(
ka,
ia,
ja)
3222 real(RP),
intent(in) :: rhoq(
qa,
ka,
ia,
ja)
3223 real(RP),
intent(in) :: xq(5,
ka,
ia,
ja)
3227 real(RP),
intent(in) :: vt_xave(5,2,
ka,
ia,
ja)
3229 real(RP),
intent(in) :: dq_xave(5,
ka,
ia,
ja)
3232 real(RP) :: temc_lim
3239 real(RP) :: nua, r_nua
3245 real(RP) :: Gwr, Gii, Gis, Gig
3250 real(RP) :: Nrers_r2, Nreis_r2
3251 real(RP) :: Nress_r2, Nregs_r2
3253 real(RP) :: Nrerl_r2, Nreil_r2
3254 real(RP) :: Nresl_r2, Nregl_r2
3255 real(RP) :: NscNrer_s, NscNrer_l
3256 real(RP) :: NscNrei_s, NscNrei_l
3257 real(RP) :: NscNres_s, NscNres_l
3258 real(RP) :: NscNreg_s, NscNreg_l
3259 real(RP) :: ventLR_s, ventLR_l
3260 real(RP) :: ventNI_s, ventNI_l, ventLI_s, ventLI_l
3261 real(RP) :: ventNS_s, ventNS_l, ventLS_s, ventLS_l
3262 real(RP) :: ventNG_s, ventNG_l, ventLG_s, ventLG_l
3264 real(RP) :: wtr, wti, wts, wtg
3265 real(RP),
parameter :: r_14=1.0_rp/1.4_rp
3266 real(RP),
parameter :: r_15=1.0_rp/1.5_rp
3269 real(RP) :: ventNI, ventLI
3270 real(RP) :: ventNS, ventLS
3271 real(RP) :: ventNG, ventLG
3273 real(RP),
parameter :: Re_max=1.e+3_rp
3274 real(RP),
parameter :: Re_min=1.e-4_rp
3286 profile_start(
"sn14_dep_vapor")
3290 temc = tem(k,i,j) - t00
3291 temc_lim= max(temc, -40._rp )
3292 rho_lim = max(rho(k,i,j),rho_min)
3293 qv = rhoq(i_qv,k,i,j)/rho_lim
3294 pre_lim = rho_lim*(qd(k,i,j)*rdry + qv*rvap)*(temc_lim+t00)
3302 dw = 0.211e-4_rp* (((temc_lim+t00)/t00)**1.94_rp) *(p00/pre_lim)
3303 kalfa = ka0 + temc_lim*dka_dt
3304 mua = mua0 + temc_lim*dmua_dt
3307 gw = (lhv0/kalfa/tem(k,i,j))*(lhv0/rvap/tem(k,i,j)-1.0_rp)+(rvap*tem(k,i,j)/dw/esw(k,i,j))
3308 gi = (lhs0/kalfa/tem(k,i,j))*(lhs0/rvap/tem(k,i,j)-1.0_rp)+(rvap*tem(k,i,j)/dw/esi(k,i,j))
3310 gwr = 4.0_rp*pi/cap(i_qr)/gw
3311 gii = 4.0_rp*pi/cap(i_qi)/gi
3312 gis = 4.0_rp*pi/cap(i_qs)/gi
3313 gig = 4.0_rp*pi/cap(i_qg)/gi
3316 nsc_r3 = (nua/dw)**(0.33333333_rp)
3319 nrers_r2 = sqrt(max(re_min,min(re_max,vt_xave(i_r,1,k,i,j)*dq_xave(i_r,k,i,j)*r_nua)))
3320 nreis_r2 = sqrt(max(re_min,min(re_max,vt_xave(i_i,1,k,i,j)*dq_xave(i_i,k,i,j)*r_nua)))
3321 nress_r2 = sqrt(max(re_min,min(re_max,vt_xave(i_s,1,k,i,j)*dq_xave(i_s,k,i,j)*r_nua)))
3322 nregs_r2 = sqrt(max(re_min,min(re_max,vt_xave(i_g,1,k,i,j)*dq_xave(i_g,k,i,j)*r_nua)))
3325 nrerl_r2 = sqrt(max(re_min,min(re_max,vt_xave(i_r,2,k,i,j)*dq_xave(i_r,k,i,j)*r_nua)))
3326 nreil_r2 = sqrt(max(re_min,min(re_max,vt_xave(i_i,2,k,i,j)*dq_xave(i_i,k,i,j)*r_nua)))
3327 nresl_r2 = sqrt(max(re_min,min(re_max,vt_xave(i_s,2,k,i,j)*dq_xave(i_s,k,i,j)*r_nua)))
3328 nregl_r2 = sqrt(max(re_min,min(re_max,vt_xave(i_g,2,k,i,j)*dq_xave(i_g,k,i,j)*r_nua)))
3329 nscnrer_s=nsc_r3*nrers_r2
3330 nscnrer_l=nsc_r3*nrerl_r2
3332 nscnrei_s=nsc_r3*nreis_r2
3333 nscnrei_l=nsc_r3*nreil_r2
3335 nscnres_s=nsc_r3*nress_r2
3336 nscnres_l=nsc_r3*nresl_r2
3338 nscnreg_s=nsc_r3*nregs_r2
3339 nscnreg_l=nsc_r3*nregl_r2
3341 ventlr_s = ah_vent1(i_qr,1) + bh_vent1(i_qr,1)*nscnrer_s
3342 ventlr_l = ah_vent1(i_qr,2) + bh_vent1(i_qr,2)*nscnrer_l
3344 ventni_s = ah_vent0(i_qi,1) + bh_vent0(i_qi,1)*nscnrei_s
3345 ventni_l = ah_vent0(i_qi,2) + bh_vent0(i_qi,2)*nscnrei_l
3346 ventli_s = ah_vent1(i_qi,1) + bh_vent1(i_qi,1)*nscnrei_s
3347 ventli_l = ah_vent1(i_qi,2) + bh_vent1(i_qi,2)*nscnrei_l
3349 ventns_s = ah_vent0(i_qs,1) + bh_vent0(i_qs,1)*nscnres_s
3350 ventns_l = ah_vent0(i_qs,2) + bh_vent0(i_qs,2)*nscnres_l
3351 ventls_s = ah_vent1(i_qs,1) + bh_vent1(i_qs,1)*nscnres_s
3352 ventls_l = ah_vent1(i_qs,2) + bh_vent1(i_qs,2)*nscnres_l
3354 ventng_s = ah_vent0(i_qg,1) + bh_vent0(i_qg,1)*nscnreg_s
3355 ventng_l = ah_vent0(i_qg,2) + bh_vent0(i_qg,2)*nscnreg_l
3356 ventlg_s = ah_vent1(i_qg,1) + bh_vent1(i_qg,1)*nscnreg_s
3357 ventlg_l = ah_vent1(i_qg,2) + bh_vent1(i_qg,2)*nscnreg_l
3361 wtr = ( min(max( nscnrer_s*r_14, 0.5_rp), 2.0_rp) -0.5_rp )*r_15
3362 wti = ( min(max( nscnrei_s , 0.5_rp), 2.0_rp) -0.5_rp )*r_15
3363 wts = ( min(max( nscnres_s*r_14, 0.5_rp), 2.0_rp) -0.5_rp )*r_15
3364 wtg = ( min(max( nscnreg_s*r_14, 0.5_rp), 2.0_rp) -0.5_rp )*r_15
3366 ventni = (1.0_rp-wti)*ventni_s + wti*ventni_l
3367 ventns = (1.0_rp-wts)*ventns_s + wts*ventns_l
3368 ventng = (1.0_rp-wtg)*ventng_s + wtg*ventng_l
3370 ventlr = (1.0_rp-wtr)*ventlr_s + wtr*ventlr_l
3371 ventli = (1.0_rp-wti)*ventli_s + wti*ventli_l
3372 ventls = (1.0_rp-wts)*ventls_s + wts*ventls_l
3373 ventlg = (1.0_rp-wtg)*ventlg_s + wtg*ventlg_l
3392 pq(i_lcdep,k,i,j) = gwr*rhoq(i_nc,k,i,j)*dq_xave(i_c,k,i,j)*coef_deplc
3393 pq(i_lrdep,k,i,j) = gwr*rhoq(i_nr,k,i,j)*dq_xave(i_r,k,i,j)*ventlr
3394 pq(i_lidep,k,i,j) = gii*rhoq(i_ni,k,i,j)*dq_xave(i_i,k,i,j)*ventli
3395 pq(i_lsdep,k,i,j) = gis*rhoq(i_ns,k,i,j)*dq_xave(i_s,k,i,j)*ventls
3396 pq(i_lgdep,k,i,j) = gig*rhoq(i_ng,k,i,j)*dq_xave(i_g,k,i,j)*ventlg
3397 pq(i_nrdep,k,i,j) = pq(i_lrdep,k,i,j)/xq(i_r,k,i,j)
3398 pq(i_nidep,k,i,j) = 0.0_rp
3399 pq(i_nsdep,k,i,j) = pq(i_lsdep,k,i,j)/xq(i_s,k,i,j)
3400 pq(i_ngdep,k,i,j) = pq(i_lgdep,k,i,j)/xq(i_g,k,i,j)
3408 dt = kalfa/(cpvap*rho_0)
3414 gm = 2.0_rp*pi/emelt&
3415 * ( (kalfa*dt/dw)*(temc) + (dw*lhs0/rvap)*(esi(k,i,j)/tem(k,i,j)-psat0/t00) )
3420 sw = ( sign(0.5_rp,temc) + 0.5_rp ) * ( sign(0.5_rp,gm-eps) + 0.5_rp )
3424 pq(i_limlt,k,i,j) = - gm * rhoq(i_qi,k,i,j)*dq_xave(i_i,k,i,j)*ventli/xq(i_i,k,i,j) * sw
3426 pq(i_nimlt,k,i,j) = - gm * rhoq(i_ni,k,i,j)*dq_xave(i_i,k,i,j)*ventni/xq(i_i,k,i,j) * sw
3427 pq(i_lsmlt,k,i,j) = - gm * rhoq(i_qs,k,i,j)*dq_xave(i_s,k,i,j)*ventls/xq(i_s,k,i,j) * sw
3429 pq(i_nsmlt,k,i,j) = - gm * rhoq(i_ns,k,i,j)*dq_xave(i_s,k,i,j)*ventns/xq(i_s,k,i,j) * sw
3430 pq(i_lgmlt,k,i,j) = - gm * rhoq(i_qg,k,i,j)*dq_xave(i_g,k,i,j)*ventlg/xq(i_g,k,i,j) * sw
3432 pq(i_ngmlt,k,i,j) = - gm * rhoq(i_ng,k,i,j)*dq_xave(i_g,k,i,j)*ventng/xq(i_g,k,i,j) * sw
3437 profile_stop(
"sn14_dep_vapor")
3440 end subroutine dep_vapor_melt_ice_kij
3451 real(DP),
intent(in) :: dt
3452 real(RP),
intent(out):: PQ(pq_max,
ka,
ia,
ja)
3454 real(RP),
intent(in) :: tem(
ka,
ia,
ja)
3456 real(RP),
intent(in) :: rhoq(
qa,
ka,
ia,
ja)
3457 real(RP),
intent(in) :: xq(5,
ka,
ia,
ja)
3459 real(RP),
parameter :: temc_min = -65.0_rp
3460 real(RP),
parameter :: a_het = 0.2_rp
3461 real(RP),
parameter :: b_het = 0.65_rp
3463 real(RP) :: coef_m2_c
3464 real(RP) :: coef_m2_r
3466 real(RP) :: temc, temc2, temc3, temc4
3468 real(RP) :: Jhom, Jhet
3475 coef_m2_c = coef_m2(i_qc)
3476 coef_m2_r = coef_m2(i_qr)
3478 profile_start(
"sn14_freezing")
3482 temc = max( tem(k,i,j) - t00, temc_min )
3485 jhet = a_het*exp( -b_het*temc - 1.0_rp )
3488 if( temc < -65.0_rp )
then 3489 jhom = 10.0_rp**(24.37236_rp)*1.e+3_rp
3490 jhet = a_het*exp( 65.0_rp*b_het - 1.0_rp )
3491 else if( temc < -30.0_rp )
then 3496 - 243.40_rp - 14.75_rp*temc - 0.307_rp*temc2 &
3497 - 0.00287_rp*temc3 - 0.0000102_rp*temc4 ) *1.e+3_rp
3498 else if( temc < 0.0_rp)
then 3499 jhom = 10._rp**(-7.63_rp-2.996_rp*(temc+30.0_rp))*1.e+3_rp
3511 pq(i_lchom,k,i,j) = 0.0_rp
3512 pq(i_nchom,k,i,j) = 0.0_rp
3514 pq(i_lchet,k,i,j) = -rdt*rhoq(i_qc,k,i,j)*( 1.0_rp - exp( -coef_m2_c*xq(i_c,k,i,j)*(jhet+jhom)*dt ) )
3515 pq(i_nchet,k,i,j) = -rdt*rhoq(i_nc,k,i,j)*( 1.0_rp - exp( - xq(i_c,k,i,j)*(jhet+jhom)*dt ) )
3516 pq(i_lrhet,k,i,j) = -rdt*rhoq(i_qr,k,i,j)*( 1.0_rp - exp( -coef_m2_r*xq(i_r,k,i,j)*(jhet+jhom)*dt ) )
3517 pq(i_nrhet,k,i,j) = -rdt*rhoq(i_nr,k,i,j)*( 1.0_rp - exp( - xq(i_r,k,i,j)*(jhet+jhom)*dt ) )
3521 profile_stop(
"sn14_freezing")
3526 subroutine mp_terminal_velocity( &
3536 real(RP),
intent(out) :: velw(
ka,
ia,
ja,
qa)
3537 real(RP),
intent(in) :: rhoq(
qa,
ka,
ia,
ja)
3538 real(RP),
intent(in) :: DENS(
ka,
ia,
ja)
3539 real(RP),
intent(in) :: temp(
ka,
ia,
ja)
3540 real(RP),
intent(in) :: pres(
ka,
ia,
ja)
3545 real(RP) :: rhofac_q(5)
3547 real(RP) :: rlambdar
3557 integer :: k, i, j, iq
3560 profile_start(
"sn14_terminal_vel")
3562 mud_r = 3.0_rp * nu(i_qr) + 2.0_rp
3576 rhofac = rho_0 / max( dens(k,i,j), rho_min )
3579 rhofac_q(i_c) = rhofac ** gamma_v(i_qc)
3580 xq = max( xqmin(i_qc), min( xqmax(i_qc), rhoq(i_qc,k,i,j) / ( rhoq(i_nc,k,i,j) + nqmin(i_qc) ) ) )
3582 velw(k,i,j,i_qc) = -rhofac_q(i_c) * coef_vt1(i_qc,1) * xq**beta_v(i_qc,1)
3584 velw(k,i,j,i_nc) = -rhofac_q(i_c) * coef_vt0(i_qc,1) * xq**beta_vn(i_qc,1)
3587 rhofac_q(i_r) = rhofac ** gamma_v(i_qr)
3588 xq = max( xqmin(i_qr), min( xqmax(i_qr), rhoq(i_qr,k,i,j) / ( rhoq(i_nr,k,i,j) + nqmin(i_qr) ) ) )
3590 rlambdar = a_m(i_qr) * xq**b_m(i_qr) &
3591 * ( (mud_r+3.0_rp) * (mud_r+2.0_rp) * (mud_r+1.0_rp) )**(-0.333333333_rp)
3592 dq = ( 4.0_rp + mud_r ) * rlambdar
3594 weight = min( 1.0_rp, max( 0.0_rp, 0.5_rp * ( 1.0_rp + tanh( pi *
log( dq/d_vtr_branch ) ) ) ) )
3596 velq_s = coef_vtr_ar2 * dq &
3597 * ( 1.0_rp - ( 1.0_rp + coef_vtr_br2*rlambdar )**(-5.0_rp-mud_r) )
3598 velq_l = coef_vtr_ar1 - coef_vtr_br1 &
3599 * ( 1.0_rp + coef_vtr_cr1*rlambdar )**(-4.0_rp-mud_r)
3600 velw(k,i,j,i_qr) = -rhofac_q(i_r) &
3601 * ( velq_l * ( weight ) &
3602 + velq_s * ( 1.0_rp - weight ) )
3604 dq = ( 1.0_rp + mud_r ) * rlambdar
3605 weight = min( 1.0_rp, max( 0.0_rp, 0.5_rp * ( 1.0_rp + tanh( pi *
log( dq/d_vtr_branch ) ) ) ) )
3607 velq_s = coef_vtr_ar2 * dql &
3608 * ( 1.0_rp - ( 1.0_rp + coef_vtr_br2*rlambdar )**(-2.0_rp-mud_r) )
3609 velq_l = coef_vtr_ar1 - coef_vtr_br1 &
3610 * ( 1.0_rp + coef_vtr_cr1*rlambdar )**(-1.0_rp-mud_r)
3611 velw(k,i,j,i_nr) = -rhofac_q(i_r) &
3612 * ( velq_l * ( weight ) &
3613 + velq_s * ( 1.0_rp - weight ) )
3616 rhofac_q(i_i) = ( pres(k,i,j)/pre0_vt )**a_pre0_vt * ( temp(k,i,j)/tem0_vt )**a_tem0_vt
3617 xq = max( xqmin(i_qi), min( xqmax(i_qi), rhoq(i_qi,k,i,j) / ( rhoq(i_ni,k,i,j) + nqmin(i_qi) ) ) )
3619 tmp = a_m(i_qi) * xq**b_m(i_qi)
3620 dq = coef_dave_l(i_qi) * tmp
3621 weight = min( 1.0_rp, max( 0.0_rp, 0.5_rp * ( 1.0_rp +
log( dq/d0_li ) ) ) )
3623 velq_s = coef_vt1(i_qi,1) * xq**beta_v(i_qi,1)
3624 velq_l = coef_vt1(i_qi,2) * xq**beta_v(i_qi,2)
3625 velw(k,i,j,i_qi) = -rhofac_q(i_i) &
3626 * ( velq_l * ( weight ) &
3627 + velq_s * ( 1.0_rp - weight ) )
3629 dq = coef_dave_n(i_qi) * tmp
3630 weight = min( 1.0_rp, max( 0.0_rp, 0.5_rp * ( 1.0_rp +
log( dq/d0_ni ) ) ) )
3632 velq_s = coef_vt0(i_qi,1) * xq**beta_vn(i_qi,1)
3633 velq_l = coef_vt0(i_qi,2) * xq**beta_vn(i_qi,2)
3634 velw(k,i,j,i_ni) = -rhofac_q(i_i) &
3635 * ( velq_l * ( weight ) &
3636 + velq_s * ( 1.0_rp - weight ) )
3639 rhofac_q(i_s) = rhofac_q(i_i)
3640 xq = max( xqmin(i_qs), min( xqmax(i_qs), rhoq(i_qs,k,i,j) / ( rhoq(i_ns,k,i,j) + nqmin(i_qs) ) ) )
3642 tmp = a_m(i_qs) * xq**b_m(i_qs)
3643 dq = coef_dave_l(i_qs) * tmp
3644 weight = min( 1.0_rp, max( 0.0_rp, 0.5_rp * ( 1.0_rp +
log( dq/d0_ls ) ) ) )
3646 velq_s = coef_vt1(i_qs,1) * xq**beta_v(i_qs,1)
3647 velq_l = coef_vt1(i_qs,2) * xq**beta_v(i_qs,2)
3648 velw(k,i,j,i_qs) = -rhofac_q(i_s) &
3649 * ( velq_l * ( weight ) &
3650 + velq_s * ( 1.0_rp - weight ) )
3652 dq = coef_dave_n(i_qs) * tmp
3653 weight = min( 1.0_rp, max( 0.0_rp, 0.5_rp * ( 1.0_rp +
log( dq/d0_ns ) ) ) )
3655 velq_s = coef_vt0(i_qs,1) * xq**beta_vn(i_qs,1)
3656 velq_l = coef_vt0(i_qs,2) * xq**beta_vn(i_qs,2)
3657 velw(k,i,j,i_ns) = -rhofac_q(i_s) &
3658 * ( velq_l * ( weight ) &
3659 + velq_s * ( 1.0_rp - weight ) )
3662 rhofac_q(i_g) = rhofac_q(i_i)
3663 xq = max( xqmin(i_qg), min( xqmax(i_qg), rhoq(i_qg,k,i,j) / ( rhoq(i_ng,k,i,j) + nqmin(i_qg) ) ) )
3665 tmp = a_m(i_qg) * xq**b_m(i_qg)
3666 dq = coef_dave_l(i_qg) * tmp
3667 weight = min( 1.0_rp, max( 0.0_rp, 0.5_rp * ( 1.0_rp +
log( dq/d0_lg ) ) ) )
3669 velq_s = coef_vt1(i_qg,1) * xq**beta_v(i_qg,1)
3670 velq_l = coef_vt1(i_qg,2) * xq**beta_v(i_qg,2)
3671 velw(k,i,j,i_qg) = -rhofac_q(i_g) &
3672 * ( velq_l * ( weight ) &
3673 + velq_s * ( 1.0_rp - weight ) )
3675 dq = coef_dave_n(i_qg) * tmp
3676 weight = min( 1.0_rp, max( 0.0_rp, 0.5_rp * ( 1.0_rp +
log( dq/d0_ng ) ) ) )
3678 velq_s = coef_vt0(i_qg,1) * xq**beta_vn(i_qg,1)
3679 velq_l = coef_vt0(i_qg,2) * xq**beta_vn(i_qg,2)
3680 velw(k,i,j,i_ng) = -rhofac_q(i_g) &
3681 * ( velq_l * ( weight ) &
3682 + velq_s * ( 1.0_rp - weight ) )
3691 velw(
ks-1,i,j,iq) = velw(
ks,i,j,iq)
3697 profile_stop(
"sn14_terminal_vel")
3700 end subroutine mp_terminal_velocity
3703 ntdiv, ntmax, & ! in [Add] 10/08/03
3715 esw, esi, rhoq2, & ! in
3717 qc_evaporate, & ! in
3719 sl_PLRdep, sl_PNRdep )
3724 moist_pres2qsat_liq => atmos_saturation_pres2qsat_liq, &
3725 moist_pres2qsat_ice => atmos_saturation_pres2qsat_ice, &
3732 integer,
intent(in) :: ntdiv
3733 integer,
intent(in) :: ntmax
3735 real(DP),
intent(in) :: dt
3736 real(RP),
intent(in) :: gsgam2(
ka,
ia,
ja)
3737 real(RP),
intent(in) :: z(
ka)
3738 real(RP),
intent(in) :: dz(
ka)
3739 real(RP),
intent(in) :: velz(
ka,
ia,
ja)
3740 real(RP),
intent(in) :: dTdt_rad(
ka,
ia,
ja)
3741 real(RP),
intent(in) :: rho(
ka,
ia,
ja)
3742 real(RP),
intent(inout) :: rhoe(
ka,
ia,
ja)
3743 real(RP),
intent(inout) :: rhoq(
qa,
ka,
ia,
ja)
3744 real(RP),
intent(inout) :: q(
ka,
ia,
ja,
qa)
3745 real(RP),
intent(inout) :: tem(
ka,
ia,
ja)
3746 real(RP),
intent(inout) :: pre(
ka,
ia,
ja)
3747 real(RP),
intent(out) :: cva(
ka,
ia,
ja)
3748 real(RP),
intent(in) :: esw(
ka,
ia,
ja)
3749 real(RP),
intent(in) :: esi(
ka,
ia,
ja)
3750 real(RP),
intent(in) :: rhoq2(
qa,
ka,
ia,
ja)
3752 real(RP),
intent(inout) :: PQ(pq_max,
ka,
ia,
ja)
3753 real(RP),
intent(out) :: qc_evaporate(
ka,
ia,
ja)
3755 real(RP),
intent(inout) :: sl_PLCdep(
ia,
ja)
3756 real(RP),
intent(inout) :: sl_PLRdep(
ia,
ja), sl_PNRdep(
ia,
ja)
3762 real(RP) :: wtem(
ka,
ia,
ja)
3767 real(RP) :: qsw(
ka,
ia,
ja)
3768 real(RP) :: qsi(
ka,
ia,
ja)
3769 real(RP) :: dqswdtem_rho(
ka,
ia,
ja)
3770 real(RP) :: dqsidtem_rho(
ka,
ia,
ja)
3771 real(RP) :: dqswdtem_pre(
ka,
ia,
ja)
3772 real(RP) :: dqsidtem_pre(
ka,
ia,
ja)
3773 real(RP) :: dqswdpre_tem(
ka,
ia,
ja)
3774 real(RP) :: dqsidpre_tem(
ka,
ia,
ja)
3779 real(RP) :: aliqliq, asolliq
3780 real(RP) :: aliqsol, asolsol
3785 real(RP) :: taucnd, r_taucnd
3786 real(RP) :: taudep, r_taudep
3787 real(RP) :: taucnd_c(
ka,
ia,
ja), r_taucnd_c
3788 real(RP) :: taucnd_r(
ka,
ia,
ja), r_taucnd_r
3789 real(RP) :: taudep_i(
ka,
ia,
ja), r_taudep_i
3790 real(RP) :: taudep_s(
ka,
ia,
ja), r_taudep_s
3791 real(RP) :: taudep_g(
ka,
ia,
ja), r_taudep_g
3794 real(RP) :: PLR2NR, PLI2NI, PLS2NS, PLG2NG
3795 real(RP) :: coef_a_cnd, coef_b_cnd
3796 real(RP) :: coef_a_dep, coef_b_dep
3818 real(RP) :: r_xc_ccn, r_xi_ccn
3821 real(RP) :: drhoqc, drhoqr, drhoqi, drhoqs, drhoqg
3822 real(RP) :: drhonc, drhonr, drhoni, drhons, drhong
3824 real(RP) :: fac1, fac2, fac3, fac4, fac5, fac6
3825 real(RP) :: r_rvaptem
3827 real(RP) :: lvsw, lvsi
3828 real(RP) :: dlvsw, dlvsi
3830 real(RP) :: dcnd, ddep
3831 real(RP) :: uplim_cnd
3832 real(RP) :: lowlim_cnd
3834 real(RP) :: uplim_dep
3835 real(RP) :: lowlim_dep
3836 real(RP) :: ssw, ssi
3837 real(RP) :: r_esw, r_esi
3838 real(RP) :: r_lvsw, r_lvsi
3840 real(RP) :: ssw_o, ssi_o
3846 real(RP),
save :: fac_cndc = 1.0_rp
3847 logical,
save :: opt_fix_taucnd_c=.false.
3848 logical,
save :: flag_first =.true.
3850 namelist /nm_mp_sn14_condensation/ &
3851 opt_fix_taucnd_c, fac_cndc
3853 real(RP) :: fac_cndc_wrk
3855 real(RP),
parameter :: tau100day = 1.e+7_rp
3856 real(RP),
parameter :: r_tau100day = 1.e-7_rp
3857 real(RP),
parameter :: eps=1.e-30_rp
3859 integer :: i,j,k,iqw
3864 if( flag_first )
then 3865 flag_first = .false.
3867 read (
io_fid_conf,nml=nm_mp_sn14_condensation, end=100)
3876 r_xc_ccn=1.0_rp/xc_ccn
3879 if( opt_fix_taucnd_c )
then 3880 fac_cndc_wrk = fac_cndc**(1.0_rp-b_m(i_qc))
3884 pq(i_lcdep,k,i,j) = pq(i_lcdep,k,i,j)*fac_cndc_wrk
3888 if(
io_l )
write(
io_fid_log,*)
"taucnd:fac_cndc_wrk=",fac_cndc_wrk
3897 wtem(k,i,j) = max( tem(k,i,j), tem_min )
3902 call moist_pres2qsat_liq ( qsw, wtem, pre )
3903 call moist_pres2qsat_ice ( qsi, wtem, pre )
3904 call moist_dqsw_dtem_rho ( dqswdtem_rho, wtem, rho )
3905 call moist_dqsi_dtem_rho ( dqsidtem_rho, wtem, rho )
3906 call moist_dqsw_dtem_dpre( dqswdtem_pre, dqswdpre_tem, wtem, pre )
3907 call moist_dqsi_dtem_dpre( dqsidtem_pre, dqsidpre_tem, wtem, pre )
3909 profile_start(
"sn14_update")
3913 if( z(k) <= 25000.0_rp )
then 3914 w = 0.5_rp*(velz(k,i,j) + velz(k+1,i,j))
3918 if( pre(k,i,j) < esw(k,i,j)+1.e-10_rp )
then 3920 dqswdtem_rho(k,i,j) = 0.0_rp
3921 dqswdtem_pre(k,i,j) = 0.0_rp
3922 dqswdpre_tem(k,i,j) = 0.0_rp
3924 if( pre(k,i,j) < esi(k,i,j)+1.e-10_rp )
then 3926 dqsidtem_rho(k,i,j) = 0.0_rp
3927 dqsidtem_pre(k,i,j) = 0.0_rp
3928 dqsidpre_tem(k,i,j) = 0.0_rp
3931 r_rvaptem = 1.0_rp/(rvap*wtem(k,i,j))
3932 lvsw = esw(k,i,j)*r_rvaptem
3933 lvsi = esi(k,i,j)*r_rvaptem
3934 pv = rhoq2(i_qv,k,i,j)*rvap*tem(k,i,j)
3935 r_esw = 1.0_rp/esw(k,i,j)
3936 r_esi = 1.0_rp/esi(k,i,j)
3937 ssw = min( mp_ssw_lim, ( pv*r_esw-1.0_rp ) )
3938 ssi = pv*r_esi - 1.0_rp
3939 r_lvsw = 1.0_rp/lvsw
3940 r_lvsi = 1.0_rp/lvsi
3941 r_taucnd_c = pq(i_lcdep,k,i,j)*r_lvsw
3942 r_taucnd_r = pq(i_lrdep,k,i,j)*r_lvsw
3943 r_taudep_i = pq(i_lidep,k,i,j)*r_lvsi
3944 r_taudep_s = pq(i_lsdep,k,i,j)*r_lvsi
3945 r_taudep_g = pq(i_lgdep,k,i,j)*r_lvsi
3952 calc_qdry( qdry, q, k, i, j, iqw )
3953 calc_cv( cva(k,i,j), qdry, q, k, i, j, iqw, cvdry,
aq_cv )
3954 calc_r( rmoist, q(k,i,j,i_qv), qdry, rdry, rvap )
3955 r_cva = 1.0_rp / cva(k,i,j)
3956 r_cpa = 1.0_rp / (cva(k,i,j) + rmoist)
3960 + r_cva*( lhv00 + (cvvap-cl)*tem(k,i,j) )*dqswdtem_rho(k,i,j)
3963 + r_cva*( lhv00 + lhf00 + (cvvap-ci)*tem(k,i,j) )*dqswdtem_rho(k,i,j)
3966 + r_cva*( lhv00 + (cvvap-cl)*tem(k,i,j) )*dqsidtem_rho(k,i,j)
3969 + r_cva*( lhv00 + lhf00 + (cvvap-ci)*tem(k,i,j) )*dqsidtem_rho(k,i,j)
3970 pdynliq = w * grav * ( r_cpa*dqswdtem_pre(k,i,j) + rho(k,i,j)*dqswdpre_tem(k,i,j) )
3971 pdynsol = w * grav * ( r_cpa*dqsidtem_pre(k,i,j) + rho(k,i,j)*dqsidpre_tem(k,i,j) )
3972 pradliq = -dtdt_rad(k,i,j) * dqswdtem_rho(k,i,j)
3973 pradsol = -dtdt_rad(k,i,j) * dqsidtem_rho(k,i,j)
3980 acnd = pdynliq + pradliq &
3981 - ( r_taudep_i+r_taudep_s+r_taudep_g ) * ( qsw(k,i,j) - qsi(k,i,j) )
3982 adep = pdynsol + pradsol &
3983 + ( r_taucnd_c+r_taucnd_r ) * ( qsw(k,i,j) - qsi(k,i,j) )
3985 + aliqliq*( r_taucnd_c+r_taucnd_r ) &
3986 + asolliq*( r_taudep_i+r_taudep_s+r_taudep_g )
3988 + aliqsol*( r_taucnd_c+r_taucnd_r )&
3989 + asolsol*( r_taudep_i+r_taudep_s+r_taudep_g )
3991 uplim_cnd = max( rho(k,i,j)*ssw_o*qsw(k,i,j)*r_dt, 0.0_rp )
3992 lowlim_cnd = min( rho(k,i,j)*ssw_o*qsw(k,i,j)*r_dt, 0.0_rp )
3993 if( r_taucnd < r_tau100day )
then 3995 pq(i_lcdep,k,i,j) = max(lowlim_cnd, min(uplim_cnd, pq(i_lcdep,k,i,j)*ssw_o ))
3996 pq(i_lrdep,k,i,j) = max(lowlim_cnd, min(uplim_cnd, pq(i_lrdep,k,i,j)*ssw_o ))
3997 pq(i_nrdep,k,i,j) = min(0.0_rp, pq(i_nrdep,k,i,j)*ssw_o )
4000 taucnd = 1.0_rp/r_taucnd
4002 coef_a_cnd = rho(k,i,j)*acnd*taucnd
4003 coef_b_cnd = rho(k,i,j)*taucnd*r_dt*(ssw_o*qsw(k,i,j)-acnd*taucnd) * ( exp(-dt*r_taucnd) - 1.0_rp )
4004 pq(i_lcdep,k,i,j) = coef_a_cnd*r_taucnd_c - coef_b_cnd*r_taucnd_c
4005 plr2nr = pq(i_nrdep,k,i,j)/(pq(i_lrdep,k,i,j)+1.e-30_rp)
4006 pq(i_lrdep,k,i,j) = coef_a_cnd*r_taucnd_r - coef_b_cnd*r_taucnd_r
4007 pq(i_nrdep,k,i,j) = min(0.0_rp, pq(i_lrdep,k,i,j)*plr2nr )
4010 uplim_dep = max( rho(k,i,j)*ssi_o*qsi(k,i,j)*r_dt, 0.0_rp )
4011 lowlim_dep = min( rho(k,i,j)*ssi_o*qsi(k,i,j)*r_dt, 0.0_rp )
4012 if( r_taudep < r_tau100day )
then 4014 pq(i_lidep,k,i,j) = max(lowlim_dep, min(uplim_dep, pq(i_lidep,k,i,j)*ssi_o ))
4015 pq(i_lsdep,k,i,j) = max(lowlim_dep, min(uplim_dep, pq(i_lsdep,k,i,j)*ssi_o ))
4016 pq(i_lgdep,k,i,j) = max(lowlim_dep, min(uplim_dep, pq(i_lgdep,k,i,j)*ssi_o ))
4017 pq(i_nidep,k,i,j) = min(0.0_rp, pq(i_nidep,k,i,j)*ssi_o )
4018 pq(i_nsdep,k,i,j) = min(0.0_rp, pq(i_nsdep,k,i,j)*ssi_o )
4019 pq(i_ngdep,k,i,j) = min(0.0_rp, pq(i_ngdep,k,i,j)*ssi_o )
4021 taudep = 1.0_rp/r_taudep
4023 coef_a_dep = rho(k,i,j)*adep*taudep
4024 coef_b_dep = rho(k,i,j)*taudep*r_dt*(ssi_o*qsi(k,i,j)-adep*taudep) * ( exp(-dt*r_taudep) - 1.0_rp )
4025 pli2ni = pq(i_nidep,k,i,j)/max(pq(i_lidep,k,i,j),1.e-30_rp)
4026 pls2ns = pq(i_nsdep,k,i,j)/max(pq(i_lsdep,k,i,j),1.e-30_rp)
4027 plg2ng = pq(i_ngdep,k,i,j)/max(pq(i_lgdep,k,i,j),1.e-30_rp)
4028 pq(i_lidep,k,i,j) = coef_a_dep*r_taudep_i - coef_b_dep*r_taudep_i
4029 pq(i_lsdep,k,i,j) = coef_a_dep*r_taudep_s - coef_b_dep*r_taudep_s
4030 pq(i_lgdep,k,i,j) = coef_a_dep*r_taudep_g - coef_b_dep*r_taudep_g
4031 pq(i_nidep,k,i,j) = min(0.0_rp, pq(i_lidep,k,i,j)*pli2ni )
4032 pq(i_nsdep,k,i,j) = min(0.0_rp, pq(i_lsdep,k,i,j)*pls2ns )
4033 pq(i_ngdep,k,i,j) = min(0.0_rp, pq(i_lgdep,k,i,j)*plg2ng )
4036 sw = 0.5_rp - sign(0.5_rp, pq(i_lcdep,k,i,j)+eps)
4037 pncdep = min(0.0_rp, ((rhoq2(i_qc,k,i,j)+pq(i_lcdep,k,i,j)*dt)*r_xc_ccn - rhoq2(i_nc,k,i,j))*r_dt ) * sw
4050 r_rvaptem = 1.0_rp/(rvap*wtem(k,i,j))
4051 lvsw = esw(k,i,j)*r_rvaptem
4052 dlvsw = rhoq2(i_qv,k,i,j)-lvsw
4053 dcnd = dt*(pq(i_lcdep,k,i,j)+pq(i_lrdep,k,i,j))
4055 sw = ( sign(0.5_rp,dcnd) + sign(0.5_rp,dlvsw) ) &
4056 * ( 0.5_rp + sign(0.5_rp,abs(dcnd)-eps) )
4060 fac1 = min(dlvsw*sw,dcnd*sw)*sw / (abs(sw)-1.0_rp+dcnd) &
4062 dep_dqc = max( dt*pq(i_lcdep,k,i,j)*fac1, &
4063 -rhoq2(i_qc,k,i,j) - 1e30_rp*(sw+1.0_rp) )*abs(sw)
4064 dep_dqr = max( dt*pq(i_lrdep,k,i,j)*fac1, &
4065 -rhoq2(i_qr,k,i,j) - 1e30_rp*(sw+1.0_rp) )*abs(sw)
4084 dep_dnc = max( dt*pncdep*fac1, -rhoq2(i_nc,k,i,j) )
4085 dep_dnr = max( dt*pq(i_nrdep,k,i,j)*fac1, -rhoq2(i_nr,k,i,j) )
4087 qc_evaporate(k,i,j) = - dep_dnc
4090 lvsi = esi(k,i,j)*r_rvaptem
4091 ddep = dt*(pq(i_lidep,k,i,j)+pq(i_lsdep,k,i,j)+pq(i_lgdep,k,i,j))
4092 dlvsi = rhoq2(i_qv,k,i,j)-lvsi
4094 sw = ( sign(0.5_rp,ddep) + sign(0.5_rp,dlvsi) ) &
4095 * ( 0.5_rp + sign(0.5_rp,abs(ddep)-eps) )
4099 fac2 = min(dlvsi*sw,ddep*sw)*sw / (abs(sw)-1.0_rp+ddep) &
4101 dep_dqi = max( dt*pq(i_lidep,k,i,j) &
4102 * ( 1.0_rp-abs(sw) + fac2*abs(sw) ), &
4103 -rhoq2(i_qi,k,i,j) - 1e30_rp*(sw+1.0_rp) )
4104 dep_dqs = max( dt*pq(i_lsdep,k,i,j) &
4105 * ( 1.0_rp-abs(sw) + fac2*abs(sw) ), &
4106 -rhoq2(i_qs,k,i,j) - 1e30_rp*(sw+1.0_rp) )
4107 dep_dqg = max( dt*pq(i_lgdep,k,i,j) &
4108 * ( 1.0_rp-abs(sw) + fac2*abs(sw) ), &
4109 -rhoq2(i_qg,k,i,j) - 1e30_rp*(sw+1.0_rp) )
4131 dep_dni = max( dt*pq(i_nidep,k,i,j)*fac2, -rhoq2(i_ni,k,i,j) )
4132 dep_dns = max( dt*pq(i_nsdep,k,i,j)*fac2, -rhoq2(i_ns,k,i,j) )
4133 dep_dng = max( dt*pq(i_ngdep,k,i,j)*fac2, -rhoq2(i_ng,k,i,j) )
4136 frz_dqc = max( dt*(pq(i_lchom,k,i,j)+pq(i_lchet,k,i,j)), -rhoq2(i_qc,k,i,j)-dep_dqc )
4137 frz_dnc = max( dt*(pq(i_nchom,k,i,j)+pq(i_nchet,k,i,j)), -rhoq2(i_nc,k,i,j)-dep_dnc )
4138 fac3 = ( frz_dqc-eps )/( dt*(pq(i_lchom,k,i,j)+pq(i_lchet,k,i,j))-eps )
4139 fac4 = ( frz_dnc-eps )/( dt*(pq(i_nchom,k,i,j)+pq(i_nchet,k,i,j))-eps )
4140 pq(i_lchom,k,i,j) = fac3*pq(i_lchom,k,i,j)
4141 pq(i_lchet,k,i,j) = fac3*pq(i_lchet,k,i,j)
4142 pq(i_nchom,k,i,j) = fac4*pq(i_nchom,k,i,j)
4143 pq(i_nchet,k,i,j) = fac4*pq(i_nchet,k,i,j)
4147 mlt_dqi = max( dt*pq(i_limlt,k,i,j), -rhoq2(i_qi,k,i,j)-dep_dqi )
4148 mlt_dni = max( dt*pq(i_nimlt,k,i,j), -rhoq2(i_ni,k,i,j)-dep_dni )
4150 mlt_dqs = max( dt*pq(i_lsmlt,k,i,j), -rhoq2(i_qs,k,i,j)-dep_dqs )
4151 mlt_dns = max( dt*pq(i_nsmlt,k,i,j), -rhoq2(i_ns,k,i,j)-dep_dns )
4153 mlt_dqg = max( dt*pq(i_lgmlt,k,i,j), -rhoq2(i_qg,k,i,j)-dep_dqg )
4154 mlt_dng = max( dt*pq(i_ngmlt,k,i,j), -rhoq2(i_ng,k,i,j)-dep_dng )
4157 frz_dqr = max( dt*(pq(i_lrhet,k,i,j)), min(0.0_rp, -rhoq2(i_qr,k,i,j)-dep_dqr) )
4158 frz_dnr = max( dt*(pq(i_nrhet,k,i,j)), min(0.0_rp, -rhoq2(i_nr,k,i,j)-dep_dnr) )
4160 fac5 = ( frz_dqr-eps )/( dt*pq(i_lrhet,k,i,j)-eps )
4161 pq(i_lrhet,k,i,j) = fac5*pq(i_lrhet,k,i,j)
4162 fac6 = ( frz_dnr-eps )/( dt*pq(i_nrhet,k,i,j)-eps )
4163 pq(i_nrhet,k,i,j) = fac6*pq(i_nrhet,k,i,j)
4166 drhoqv = -(dep_dqc+dep_dqi+dep_dqs+dep_dqg+dep_dqr)
4168 rhoq(i_qv,k,i,j) = max(0.0_rp, rhoq(i_qv,k,i,j) + drhoqv )
4170 rhoe(k,i,j) = rhoe(k,i,j) - lhv * drhoqv
4172 xi = min(xi_max, max(xi_min, rhoq2(i_qi,k,i,j)/(rhoq2(i_ni,k,i,j)+ni_min) ))
4173 sw = 0.5_rp + sign(0.5_rp,xi-x_sep)
4177 drhoqc = ( frz_dqc - mlt_dqi*(1.0_rp-sw) + dep_dqc )
4178 drhonc = ( frz_dnc - mlt_dni*(1.0_rp-sw) + dep_dnc )
4180 drhoqr = ( frz_dqr - mlt_dqg - mlt_dqs - mlt_dqi*sw + dep_dqr )
4181 drhonr = ( frz_dnr - mlt_dng - mlt_dns - mlt_dni*sw + dep_dnr )
4183 rhoq(i_qc,k,i,j) = max(0.0_rp, rhoq(i_qc,k,i,j) + drhoqc )
4184 rhoq(i_nc,k,i,j) = max(0.0_rp, rhoq(i_nc,k,i,j) + drhonc )
4185 rhoq(i_qr,k,i,j) = max(0.0_rp, rhoq(i_qr,k,i,j) + drhoqr )
4186 rhoq(i_nr,k,i,j) = max(0.0_rp, rhoq(i_nr,k,i,j) + drhonr )
4189 drhoqi = (-frz_dqc + mlt_dqi + dep_dqi )
4190 drhoni = (-frz_dnc + mlt_dni + dep_dni )
4192 rhoq(i_qi,k,i,j) = max(0.0_rp, rhoq(i_qi,k,i,j) + drhoqi )
4193 rhoq(i_ni,k,i,j) = max(0.0_rp, rhoq(i_ni,k,i,j) + drhoni )
4195 rhoe(k,i,j) = rhoe(k,i,j) + lhf * drhoqi
4198 drhoqs = ( mlt_dqs + dep_dqs )
4199 drhons = ( mlt_dns + dep_dns )
4201 rhoq(i_qs,k,i,j) = max(0.0_rp, rhoq(i_qs,k,i,j) + drhoqs )
4202 rhoq(i_ns,k,i,j) = max(0.0_rp, rhoq(i_ns,k,i,j) + drhons )
4204 rhoe(k,i,j) = rhoe(k,i,j) + lhf * drhoqs
4207 drhoqg = (-frz_dqr + mlt_dqg + dep_dqg )
4208 drhong = (-frz_dnr + mlt_dng + dep_dng )
4210 rhoq(i_qg,k,i,j) = max(0.0_rp, rhoq(i_qg,k,i,j) + drhoqg )
4211 rhoq(i_ng,k,i,j) = max(0.0_rp, rhoq(i_ng,k,i,j) + drhong )
4213 rhoe(k,i,j) = rhoe(k,i,j) + lhf * drhoqg
4216 rrho = 1.0_rp/rho(k,i,j)
4218 q(k,i,j,i_qv) = rhoq(i_qv,k,i,j) * rrho
4219 q(k,i,j,i_qc) = rhoq(i_qc,k,i,j) * rrho
4220 q(k,i,j,i_qr) = rhoq(i_qr,k,i,j) * rrho
4221 q(k,i,j,i_qi) = rhoq(i_qi,k,i,j) * rrho
4222 q(k,i,j,i_qs) = rhoq(i_qs,k,i,j) * rrho
4223 q(k,i,j,i_qg) = rhoq(i_qg,k,i,j) * rrho
4224 q(k,i,j,i_nc) = rhoq(i_nc,k,i,j) * rrho
4225 q(k,i,j,i_nr) = rhoq(i_nr,k,i,j) * rrho
4226 q(k,i,j,i_ni) = rhoq(i_ni,k,i,j) * rrho
4227 q(k,i,j,i_ns) = rhoq(i_ns,k,i,j) * rrho
4228 q(k,i,j,i_ng) = rhoq(i_ng,k,i,j) * rrho
4230 calc_qdry( qdry, q, k, i, j, iqw )
4231 calc_cv( cva(k,i,j), qdry, q, k, i, j, iqw, cvdry,
aq_cv )
4232 calc_r( rmoist, q(k,i,j,i_qv), qdry, rdry, rvap )
4233 tem(k,i,j) = rhoe(k,i,j) / ( rho(k,i,j) * cva(k,i,j) )
4234 pre(k,i,j) = rho(k,i,j) * rmoist * tem(k,i,j)
4236 sl_plcdep(i,j) = sl_plcdep(i,j) + dep_dqc*dz(k)*gsgam2(k,i,j)
4237 sl_plrdep(i,j) = sl_plrdep(i,j) + dep_dqr*dz(k)*gsgam2(k,i,j)
4238 sl_pnrdep(i,j) = sl_pnrdep(i,j) + dep_dnr*dz(k)*gsgam2(k,i,j)
4242 profile_stop(
"sn14_update")
4251 real(RP),
intent(inout) :: DENS(
ka,
ia,
ja)
4252 real(RP),
intent(inout) :: QTRC(
ka,
ia,
ja,
qa)
4254 real(RP) :: diffq(
ka,
ia,
ja)
4257 integer :: k, i, j, iq
4262 r_xmin = 1.0_rp / xmin_filter
4269 diffq(k,i,j) = qtrc(k,i,j,i_qv) &
4270 + qtrc(k,i,j,i_qc) &
4271 + qtrc(k,i,j,i_qr) &
4272 + qtrc(k,i,j,i_qi) &
4273 + qtrc(k,i,j,i_qs) &
4280 qtrc(k,i,j,iq) = max(0.0_rp, qtrc(k,i,j,iq))
4287 dens(k,i,j) = dens(k,i,j) &
4289 + qtrc(k,i,j,i_qv) &
4290 + qtrc(k,i,j,i_qc) &
4291 + qtrc(k,i,j,i_qr) &
4292 + qtrc(k,i,j,i_qi) &
4293 + qtrc(k,i,j,i_qs) &
4294 + qtrc(k,i,j,i_qg) &
4302 if ( qtrc(k,i,j,i_nc) > qtrc(k,i,j,i_qc)*r_xmin )
then 4303 qtrc(k,i,j,i_nc) = qtrc(k,i,j,i_qc)*r_xmin
4307 if ( qtrc(k,i,j,i_nr) > qtrc(k,i,j,i_qr)*r_xmin )
then 4308 qtrc(k,i,j,i_nr) = qtrc(k,i,j,i_qr)*r_xmin
4312 if ( qtrc(k,i,j,i_ni) > qtrc(k,i,j,i_qi)*r_xmin )
then 4313 qtrc(k,i,j,i_ni) = qtrc(k,i,j,i_qi)*r_xmin
4317 if ( qtrc(k,i,j,i_ns) > qtrc(k,i,j,i_qs)*r_xmin )
then 4318 qtrc(k,i,j,i_ns) = qtrc(k,i,j,i_qs)*r_xmin
4322 if ( qtrc(k,i,j,i_ng) > qtrc(k,i,j,i_qg)*r_xmin )
then 4323 qtrc(k,i,j,i_ng) = qtrc(k,i,j,i_qg)*r_xmin
4347 real(RP),
intent(out) :: cldfrac(
ka,
ia,
ja)
4348 real(RP),
intent(in) :: QTRC (
ka,
ia,
ja,qad)
4349 real(RP),
intent(in) :: mask_criterion
4352 integer :: k, i, j, iq
4360 qhydro = qhydro + qtrc(k,i,j,i_mp2all(iq))
4362 cldfrac(k,i,j) = 0.5_rp + sign(0.5_rp,qhydro-mask_criterion)
4383 real(RP),
intent(out) :: Re (
ka,
ia,
ja,mp_qad)
4384 real(RP),
intent(in) :: QTRC0(
ka,
ia,
ja,qad)
4385 real(RP),
intent(in) :: DENS0(
ka,
ia,
ja)
4386 real(RP),
intent(in) :: TEMP0(
ka,
ia,
ja)
4395 real(RP) :: dc_ave(
ka,
ia,
ja)
4396 real(RP) :: dr_ave(
ka,
ia,
ja)
4404 real(RP) :: coef_Fuetal1998
4406 real(RP),
parameter :: r2m_min=1.e-12_rp
4407 real(RP),
parameter :: um2cm = 100.0_rp
4409 real(RP) :: limitsw, zerosw
4417 xc(k,i,j) = min( xc_max, max( xc_min, dens0(k,i,j)*qtrc0(k,i,j,i_qc)/(qtrc0(k,i,j,i_nc)+nc_min) ) )
4418 xr(k,i,j) = min( xr_max, max( xr_min, dens0(k,i,j)*qtrc0(k,i,j,i_qr)/(qtrc0(k,i,j,i_nr)+nr_min) ) )
4419 xi(k,i,j) = min( xi_max, max( xi_min, dens0(k,i,j)*qtrc0(k,i,j,i_qi)/(qtrc0(k,i,j,i_ni)+ni_min) ) )
4420 xs(k,i,j) = min( xs_max, max( xs_min, dens0(k,i,j)*qtrc0(k,i,j,i_qs)/(qtrc0(k,i,j,i_ns)+ns_min) ) )
4421 xg(k,i,j) = min( xg_max, max( xg_min, dens0(k,i,j)*qtrc0(k,i,j,i_qg)/(qtrc0(k,i,j,i_ng)+ng_min) ) )
4430 dc_ave(k,i,j) = a_m(i_qc) * xc(k,i,j)**b_m(i_qc)
4431 dr_ave(k,i,j) = a_m(i_qr) * xr(k,i,j)**b_m(i_qr)
4440 rc = 0.5_rp * dc_ave(k,i,j)
4441 limitsw = 0.5_rp + sign(0.5_rp, rc-rmin_re )
4442 re(k,i,j,i_mp_qc) = coef_re(i_qc) * rc * limitsw * um2cm
4451 rr = 0.5_rp * dr_ave(k,i,j)
4452 limitsw = 0.5_rp + sign(0.5_rp, rr-rmin_re )
4453 re(k,i,j,i_mp_qr) = coef_re(i_qr) * rr * limitsw * um2cm
4461 ri2m(k,i,j) = pi * coef_rea2(i_qi) * qtrc0(k,i,j,i_ni) * a_rea2(i_qi) * xi(k,i,j)**b_rea2(i_qi)
4462 rs2m(k,i,j) = pi * coef_rea2(i_qs) * qtrc0(k,i,j,i_ns) * a_rea2(i_qs) * xs(k,i,j)**b_rea2(i_qs)
4463 rg2m(k,i,j) = pi * coef_rea2(i_qg) * qtrc0(k,i,j,i_ng) * a_rea2(i_qg) * xg(k,i,j)**b_rea2(i_qg)
4469 coef_fuetal1998 = 3.0_rp / (4.0_rp*rhoi)
4473 ri3m(k,i,j) = coef_fuetal1998 * qtrc0(k,i,j,i_ni) * xi(k,i,j)
4474 rs3m(k,i,j) = coef_fuetal1998 * qtrc0(k,i,j,i_ns) * xs(k,i,j)
4475 rg3m(k,i,j) = coef_fuetal1998 * qtrc0(k,i,j,i_ng) * xg(k,i,j)
4484 zerosw = 0.5_rp - sign(0.5_rp, ri2m(k,i,j) - r2m_min )
4485 re(k,i,j,i_mp_qi) = ri3m(k,i,j) / ( ri2m(k,i,j) + zerosw ) * ( 1.0_rp - zerosw ) * um2cm
4494 zerosw = 0.5_rp - sign(0.5_rp, rs2m(k,i,j) - r2m_min )
4495 re(k,i,j,i_mp_qs) = rs3m(k,i,j) / ( rs2m(k,i,j) + zerosw ) * ( 1.0_rp - zerosw ) * um2cm
4504 zerosw = 0.5_rp - sign(0.5_rp, rg2m(k,i,j) - r2m_min )
4505 re(k,i,j,i_mp_qg) = rg3m(k,i,j) / ( rg2m(k,i,j) + zerosw ) * ( 1.0_rp - zerosw ) * um2cm
4523 real(RP),
intent(out) :: Qe (
ka,
ia,
ja,mp_qad)
4524 real(RP),
intent(in) :: QTRC0(
ka,
ia,
ja,qad)
4529 do ihydro = 1,
mp_qa 4530 qe(:,:,:,ihydro) = qtrc0(:,:,:,i_mp2all(ihydro))
integer, public is
start point of inner domain: x, local
subroutine nucleation_kij(z, velz, rho, tem, pre, rhoq, PQ, cpa, dTdt_rad, qke, CCN, dt)
subroutine, public atmos_phy_mp_sn14_effectiveradius(Re, QTRC0, DENS0, TEMP0)
Calculate Effective Radius.
real(rp), public const_cvdry
specific heat (dry air,constant volume) [J/kg/K]
real(rp), parameter, public const_psat0
saturate pressure of water vapor at 0C [Pa]
integer, public je
end point of inner domain: y, local
real(rp), public const_cpdry
specific heat (dry air,constant pressure) [J/kg/K]
module ATMOSPHERE / Saturation adjustment
subroutine, public prc_mpistop
Abort MPI.
module ATMOSPHERE / Physics Cloud Microphysics
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_ci
specific heat (ice) [J/kg/K]
real(rp), parameter, public const_dwatr
density of water [kg/m3]
real(rp), dimension(:), allocatable, public aq_cp
CP for each hydrometeors [J/kg/K].
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), dimension(:), allocatable, public grid_cz
center coordinate [m]: z, local=global
real(rp), parameter, public const_cl
specific heat (liquid water) [J/kg/K]
subroutine freezing_water_kij(dt, PQ, rhoq, xq, tem)
integer, public ke
end point of inner domain: z, local
subroutine ice_multiplication_kij(PQ, Pac, tem, rhoq, xq)
real(rp), parameter, public const_tem00
temperature reference (0C) [K]
real(rp), public const_cvvap
specific heat (water vapor, constant volume) [J/kg/K]
real(rp), public const_lhf0
latent heat of fusion at 0C [J/kg]
real(rp), parameter, public const_dice
density of ice [kg/m3]
subroutine, public atmos_saturation_dqsw_dtem_rho(dqsdtem, temp, dens)
subroutine, public atmos_saturation_dqsw_dtem_dpre(dqsdtem, dqsdpre, temp, pres)
real(rp), public dz
length in the main region [m]: z
real(rp), public const_rdry
specific gas constant (dry air) [J/kg/K]
real(rp), public const_undef
subroutine mixed_phase_collection_kij(Pac, PQ, wtem, rhoq, xq, dq_xave, vt_xave)
real(rp), parameter, public const_lhs0
latent heat of sublimation at 0C [J/kg]
subroutine, public atmos_phy_mp_sn14_cloudfraction(cldfrac, QTRC, mask_criterion)
Calculate Cloud Fraction.
module ATMOSPHERE / Physics Cloud Microphysics - Common
subroutine, public atmos_saturation_dqsi_dtem_rho(dqsdtem, temp, dens)
subroutine debug_tem_kij(point, tem, rho, pre, qv)
integer, public ia
of x whole cells (local, with HALO)
integer, public ka
of z whole cells (local, with HALO)
real(rp), parameter, public const_lhv0
latent heat of vaporizaion at 0C [J/kg]
real(rp), public const_pre00
pressure reference [Pa]
real(rp), public const_lhf00
latent heat of fusion at 0K [J/kg]
real(rp), public const_grav
standard acceleration of gravity [m/s2]
integer, public js
start point of inner domain: y, local
subroutine update_by_phase_change_kij(ntdiv, ntmax, dt, gsgam2, z, dz, velz, dTdt_rad, rho, rhoe, rhoq, q, tem, pre, cva, esw, esi, rhoq2, PQ, qc_evaporate, sl_PLCdep, sl_PLRdep, sl_PNRdep)
real(rp), public const_lhv00
latent heat of vaporizaion at 0K [J/kg]
subroutine, public log(type, message)
real(rp), parameter, public const_rvap
specific gas constant (water vapor) [J/kg/K]
subroutine, public atmos_saturation_dqsi_dtem_dpre(dqsdtem, dqsdpre, temp, pres)
real(rp), dimension(:), allocatable, public aq_cv
CV for each hydrometeors [J/kg/K].
integer, public ks
start point of inner domain: z, local
real(rp), parameter, public const_emelt
integer, public prc_myrank
process num in local communicator
subroutine, public prof_rapstart(rapname_base, level)
Start raptime.
real(dp), parameter, public const_undef8
undefined value (REAL8)
subroutine, public atmos_phy_mp_sn14_mixingratio(Qe, QTRC0)
Calculate mixing ratio of each category.
subroutine, public atmos_phy_mp_sn14(DENS, MOMZ, MOMX, MOMY, RHOT, QTRC, CCN, EVAPORATE, SFLX_rain, SFLX_snow)
Cloud Microphysics.
subroutine aut_acc_slc_brk_kij(PQ, rhoq, xq, dq_xave, rho)
integer, public ie
end point of inner domain: x, local
real(rp), public const_eps
small number
module ATMOSPHERE / Thermodynamics
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), dimension(mp_qa), target, public atmos_phy_mp_dens
real(rp), public const_pi
pi
integer, public io_fid_conf
Config file ID.
integer, public io_fid_log
Log file ID.
subroutine, public atmos_phy_mp_sn14_setup(MP_TYPE)
Setup Cloud Microphysics.
real(rp), parameter, public const_cpvap
specific heat (water vapor, constant pressure) [J/kg/K]
subroutine, public prof_rapend(rapname_base, level)
Save raptime.
integer, parameter, public rp
subroutine mp_negativefilter(DENS, QTRC)
integer, public ja
of y whole cells (local, with HALO)