22 mwwat => const_mvap, &
23 dnwat => const_dwatr, &
25 stdatmpa => const_pstd, &
26 stdtemp => const_tem00, &
50 integer,
private :: QA_AE = 0
77 integer,
parameter :: gas_ctg = 2
78 integer,
parameter :: n_atr = 5
80 integer,
parameter :: ic_mix = 1
81 integer,
parameter :: ic_sea = 2
82 integer,
parameter :: ic_dus = 3
84 integer,
parameter :: ig_h2so4 = 1
85 integer,
parameter :: ig_cgas = 2
88 integer,
allocatable :: nkap(:)
89 integer,
allocatable :: nsiz(:)
91 integer :: atmos_phy_ae_kajino13_nbins_out = 1024
101 real(
rp),
parameter :: avo = 6.0221367e23_rp
102 real(
rp),
parameter :: boltz = 1.38048e-23_rp
103 real(
rp),
parameter :: conv_n2m = 1.e6_rp/avo*1.e6_rp &
105 real(
rp),
parameter :: conv_m2n = 1._rp/conv_n2m
106 real(
rp),
parameter :: rhod_ae = 1.83_rp
107 real(
rp),
parameter :: rho_kg = rhod_ae*1.e3_rp
108 real(
rp),
parameter :: grav = 9.80622_rp
109 real(
rp),
parameter :: conv_ms_vl = 1.e-12_rp/rhod_ae
110 real(
rp),
parameter :: conv_vl_ms = rhod_ae/1.e-12_rp
111 real(
rp),
parameter :: mwrat_s6 = 96._rp/98._rp
112 real(
rp),
parameter :: mwrat_s6_i = 1._rp/mwrat_s6
113 real(
rp),
parameter :: diffsulf = 9.36e-6_rp
114 real(
rp),
parameter :: mwh2so4 = 98._rp
119 real(
rp),
parameter :: c1=1.425e-6_rp, c2=0.5039_rp, c3=108.3_rp
124 integer,
parameter :: ia_m0 = 1
125 integer,
parameter :: ia_m2 = 2
126 integer,
parameter :: ia_m3 = 3
127 integer,
parameter :: ia_ms = 4
128 integer,
parameter :: ia_kp = 5
129 integer,
parameter :: ik_out = 1
132 integer,
allocatable :: n_siz(:)
133 real(
rp),
allocatable :: d_min(:)
134 real(
rp),
allocatable :: d_max(:)
135 integer,
allocatable :: n_kap(:)
136 real(
rp),
allocatable :: k_min(:)
137 real(
rp),
allocatable :: k_max(:)
141 real(
rp),
allocatable :: d_lw(:,:), d_ct(:,:), d_up(:,:)
142 real(
rp),
allocatable :: k_lw(:,:), k_ct(:,:), k_up(:,:)
143 real(
rp) :: dlogd, dk
146 integer,
allocatable :: is_i(:), is_j(:), is_k(:)
147 integer,
allocatable :: ik_i(:), ik_j(:), ik_k(:)
148 integer,
allocatable :: ic_i(:), ic_j(:), ic_k(:)
150 integer :: is1, is2, mc, ik, is0, ic, ia0
162 integer,
allocatable :: it_procs2trans(:,:,:,:)
163 integer,
allocatable :: ia_trans2procs(:)
164 integer,
allocatable :: is_trans2procs(:)
165 integer,
allocatable :: ik_trans2procs(:)
166 integer,
allocatable :: ic_trans2procs(:)
167 real(
rp),
allocatable :: rnum_out(:)
169 character(len=H_SHORT),
allocatable :: ctg_name(:)
170 real(
rp),
parameter :: cleannumber = 1.e-3
174 real(
rp),
allocatable :: aerosol_procs(:,:,:,:)
175 real(
rp),
allocatable :: aerosol_activ(:,:,:,:)
176 real(
rp),
allocatable :: emis_procs (:,:,:,:)
177 real(
rp),
allocatable :: emis_gas (:)
187 integer,
intent(out) :: qa_ae
189 integer,
allocatable :: aero_idx(:,:,:,:)
191 integer :: nasiz(3), nakap(3)
192 character(len=H_SHORT) :: attribute, catego, aunit
194 namelist / param_atmos_phy_ae_kajino13_tracer / &
199 integer :: m, ierr, ik, ic, ia0, is0
204 log_info(
"ATMOS_PHY_AE_kajino13_tracer_setup",*)
'Setup'
209 log_warn(
"ATMOS_PHY_AE_kajino13_tracer_setup",*)
'### Kajino13 scheme is still experimental'
211 ncat_max = max( ic_mix, ic_sea, ic_dus )
217 read(
io_fid_conf,nml=param_atmos_phy_ae_kajino13_tracer,iostat=ierr)
220 log_info(
"ATMOS_PHY_AE_kajino13_tracer_setup",*)
'Not found namelist. Default used.'
221 elseif( ierr > 0 )
then
222 log_error(
"ATMOS_PHY_AE_kajino13_tracer_setup",*)
'Not appropriate names in namelist PARAM_ATMOS_PHY_AE_KAJINO13_TRACER, Check!'
226 log_nml(param_atmos_phy_ae_kajino13_tracer)
228 if( ae_ctg > ncat_max )
then
229 log_error(
"ATMOS_PHY_AE_kajino13_tracer_setup",*)
'AE_CTG should be smaller than', ncat_max+1,
'stop'
233 allocate( nsiz(ae_ctg) )
234 allocate( nkap(ae_ctg) )
236 nkap(1:ae_ctg) = nakap(1:ae_ctg)
237 nsiz(1:ae_ctg) = nasiz(1:ae_ctg)
239 if( maxval( nkap ) /= 1 .OR. minval( nkap ) /= 1 )
then
240 log_error(
"ATMOS_PHY_AE_kajino13_tracer_setup",*)
'NKAP(:) /= 1 is not supported now, Stop!'
248 qa_ae = qa_ae + n_atr
252 qa_ae = qa_ae + gas_ctg
261 n_siz_max = max(n_siz_max, nsiz(ic))
262 n_kap_max = max(n_kap_max, nkap(ic))
265 allocate( aero_idx(n_atr,ae_ctg,n_kap_max,n_siz_max) )
273 aero_idx(ia0,ic,ik,is0) = m
284 ic = qa_ae-gas_ctg+ig_h2so4
286 ic = qa_ae-gas_ctg+ig_cgas
311 write(attribute,
'(a)')
"Number"
312 write(aunit,
'(a)')
"num/kg"
313 elseif( ia0 == 2 )
then
314 write(attribute,
'(a)')
"Section"
315 write(aunit,
'(a)')
"m2/kg"
316 elseif( ia0 == 3 )
then
317 write(attribute,
'(a)')
"Volume"
318 write(aunit,
'(a)')
"m3/kg"
319 elseif( ia0 == 4 )
then
320 write(attribute,
'(a)')
"Mass"
321 write(aunit,
'(a)')
"kg/kg"
322 elseif( ia0 == 5 )
then
323 write(attribute,
'(a)')
"kXm"
324 write(aunit,
'(a)')
"kg/kg"
326 if( ic == ic_mix )
then
327 write(catego,
'(a)')
"Sulf_"
328 elseif( ic == ic_sea )
then
329 write(catego,
'(a)')
"Salt_"
330 elseif( ic == ic_dus )
then
331 write(catego,
'(a)')
"Dust_"
335 write(
atmos_phy_ae_kajino13_desc(aero_idx(ia0,ic,ik,is0)),
'(a,a,a,i0)') trim(attribute),
' mixing radio of ', trim(catego), is0
340 ic = qa_ae-gas_ctg+ig_h2so4
342 ic = qa_ae-gas_ctg+ig_cgas
345 ic = qa_ae-gas_ctg+ig_h2so4
347 ic = qa_ae-gas_ctg+ig_cgas
362 real(
rp),
allocatable :: d_min_inp(:)
363 real(
rp),
allocatable :: d_max_inp(:)
364 real(
rp),
allocatable :: k_min_inp(:)
365 real(
rp),
allocatable :: k_max_inp(:)
366 integer ,
allocatable :: n_kap_inp(:)
368 real(
rp),
parameter :: d_min_def = 1.e-9_rp
369 real(
rp),
parameter :: d_max_def = 1.e-5_rp
370 integer ,
parameter :: n_kap_def = 1
371 real(
rp),
parameter :: k_min_def = 0.e0_rp
372 real(
rp),
parameter :: k_max_def = 1.e0_rp
374 namelist / param_atmos_phy_ae_kajino13 / &
392 atmos_phy_ae_kajino13_nbins_out
398 log_info(
"ATMOS_PHY_AE_kajino13_setup",*)
'Setup'
399 log_info(
"ATMOS_PHY_AE_kajino13_setup",*)
'Kajino(2013) scheme'
408 allocate( rnum_out(atmos_phy_ae_kajino13_nbins_out) )
409 allocate( n_siz(n_ctg) )
410 allocate( d_min(n_ctg) )
411 allocate( d_max(n_ctg) )
412 allocate( n_kap(n_ctg) )
413 allocate( k_min(n_ctg) )
414 allocate( k_max(n_ctg) )
415 allocate( d_min_inp(n_ctg) )
416 allocate( d_max_inp(n_ctg) )
417 allocate( n_kap_inp(n_ctg) )
418 allocate( k_min_inp(n_ctg) )
419 allocate( k_max_inp(n_ctg) )
420 allocate( ctg_name(n_ctg) )
422 n_siz(1:n_ctg) = nsiz(1:n_ctg)
423 d_min(1:n_ctg) = d_min_def
424 d_max(1:n_ctg) = d_max_def
425 n_kap(1:n_ctg) = n_kap_def
426 k_min(1:n_ctg) = k_min_def
427 k_max(1:n_ctg) = k_max_def
430 if( n_ctg == 1 )
then
431 write(ctg_name(it),
'(a)')
"Sulfate"
432 elseif( n_ctg == 2 )
then
433 write(ctg_name(it),
'(a)')
"Seasalt"
434 elseif( n_ctg == 3 )
then
435 write(ctg_name(it),
'(a)')
"Dust"
441 read(
io_fid_conf,nml=param_atmos_phy_ae_kajino13,iostat=ierr)
443 log_info(
"ATMOS_PHY_AE_kajino13_setup",*)
'Not found namelist. Default used.'
444 elseif( ierr > 0 )
then
445 log_error(
"ATMOS_PHY_AE_kajino13_setup",*)
'Not appropriate names in namelist PARAM_ATMOS_PHY_AE_KAJINO13. Check!'
448 log_nml(param_atmos_phy_ae_kajino13)
463 n_trans = n_trans + n_siz(ic) * n_kap(ic) * n_atr
464 n_siz_max = max(n_siz_max, n_siz(ic))
465 n_kap_max = max(n_kap_max, n_kap(ic))
469 allocate(d_lw(n_siz_max,n_ctg))
470 allocate(d_ct(n_siz_max,n_ctg))
471 allocate(d_up(n_siz_max,n_ctg))
472 allocate(k_lw(n_kap_max,n_ctg))
473 allocate(k_ct(n_kap_max,n_ctg))
474 allocate(k_up(n_kap_max,n_ctg))
483 dlogd = (log(d_max(ic)) - log(d_min(ic)))/
float(n_siz(ic))
484 do is0 = 1, n_siz(ic)
485 d_lw(is0,ic) = exp(log(d_min(ic))+dlogd*
float(is0-1) )
486 d_ct(is0,ic) = exp(log(d_min(ic))+dlogd*(
float(is0)-0.5_rp))
487 d_up(is0,ic) = exp(log(d_min(ic))+dlogd*
float(is0) )
490 dk = (k_max(ic) - k_min(ic))/
float(n_kap(ic))
492 k_lw(ik,ic) = k_min(ic) + dk *
float(ik-1)
493 k_ct(ik,ic) = k_min(ic) + dk *(
float(ik)-0.5_rp)
494 k_up(ik,ic) = k_min(ic) + dk *
float(ik)
500 do is0 = 1, n_siz(ic_mix)
514 do is2 = 1, n_siz(ic)
515 do is1 = 1, n_siz(ic)
516 if ( d_ct(is2,ic) >= d_ct(is1,ic) )
then
524 allocate(is_i(mcomb))
525 allocate(is_j(mcomb))
526 allocate(is_k(mcomb))
527 allocate(ik_i(mcomb))
528 allocate(ik_j(mcomb))
529 allocate(ik_k(mcomb))
530 allocate(ic_i(mcomb))
531 allocate(ic_j(mcomb))
532 allocate(ic_k(mcomb))
537 do is2 = 1, n_siz(ic)
538 do is1 = 1, n_siz(ic)
539 if ( d_ct(is2,ic) >= d_ct(is1,ic) )
then
560 allocate( it_procs2trans(n_atr,n_siz_max,n_kap_max,n_ctg) )
561 allocate( ia_trans2procs(n_trans) )
562 allocate( is_trans2procs(n_trans) )
563 allocate( ik_trans2procs(n_trans) )
564 allocate( ic_trans2procs(n_trans) )
566 it_procs2trans(:,:,:,:)= -999
567 ia_trans2procs(:) = 0
568 is_trans2procs(:) = 0
569 ik_trans2procs(:) = 0
570 ic_trans2procs(:) = 0
576 do is0 = 1, n_siz(ic)
579 it_procs2trans(ia0,is0,ik,ic)= it
580 ia_trans2procs(it) = ia0
581 is_trans2procs(it) = is0
582 ik_trans2procs(it) = ik
583 ic_trans2procs(it) = ic
589 allocate( aerosol_procs(n_atr,n_siz_max,n_kap_max,n_ctg) )
590 allocate( aerosol_activ(n_atr,n_siz_max,n_kap_max,n_ctg) )
591 allocate( emis_procs(n_atr,n_siz_max,n_kap_max,n_ctg) )
592 allocate( emis_gas(gas_ctg) )
593 aerosol_procs(:,:,:,:) = 0.0_rp
594 aerosol_activ(:,:,:,:) = 0.0_rp
595 emis_procs(:,:,:,:) = 0.0_rp
612 deallocate( rnum_out )
619 deallocate( ctg_name )
638 deallocate( it_procs2trans )
639 deallocate( ia_trans2procs )
640 deallocate( is_trans2procs )
641 deallocate( ik_trans2procs )
642 deallocate( ic_trans2procs )
644 deallocate( aerosol_procs )
645 deallocate( aerosol_activ )
646 deallocate( emis_procs )
647 deallocate( emis_gas )
671 pres2qsat_liq => atmos_saturation_pres2qsat_liq
675 integer,
intent(in) ::
ka,
ks,
ke
676 integer,
intent(in) ::
ia,
is,
ie
677 integer,
intent(in) ::
ja,
js,
je
678 integer,
intent(in) :: qa_ae
679 real(
rp),
intent(in) :: temp(
ka,
ia,
ja)
680 real(
rp),
intent(in) :: pres(
ka,
ia,
ja)
681 real(
rp),
intent(in) :: qdry(
ka,
ia,
ja)
682 real(
rp),
intent(in) :: nreg(
ka,
ia,
ja)
683 real(
rp),
intent(in) :: dens(
ka,
ia,
ja)
684 real(
rp),
intent(in) :: qv (
ka,
ia,
ja)
685 real(
rp),
intent(in) :: qtrc(
ka,
ia,
ja,qa_ae)
686 real(
rp),
intent(in) :: emit(
ka,
ia,
ja,qa_ae)
687 real(
dp),
intent(in) :: dt
689 real(
rp),
intent(out) :: rhoq_t_ae(
ka,
ia,
ja,qa_ae)
690 real(
rp),
intent(out) :: cn(
ka,
ia,
ja)
691 real(
rp),
intent(out) :: ccn(
ka,
ia,
ja)
701 real(
rp) :: m0_reg, m2_reg, m3_reg
703 real(
rp) :: reg_factor_m2,reg_factor_m3
705 real(
rp) :: total_aerosol_mass(
ka,
ia,
ja,n_ctg)
706 real(
rp) :: total_aerosol_number(
ka,
ia,
ja,n_ctg)
707 real(
rp) :: total_emit_aerosol_mass(
ka,
ia,
ja,n_ctg)
708 real(
rp) :: total_emit_aerosol_number(
ka,
ia,
ja,n_ctg)
712 real(
rp) :: conc_gas(gas_ctg)
713 integer :: i, j,
k, iq, it
715 log_progress(*)
'atmosphere / physics / aerosol / kajino13'
717 aerosol_procs(:,:,:,:) = 0.0_rp
718 aerosol_activ(:,:,:,:) = 0.0_rp
719 emis_procs(:,:,:,:) = 0.0_rp
726 qtrc0(
k,i,j,iq) = qtrc(
k,i,j,iq)
741 rrhog(
k,i,j) = 1.0_rp / dens(
k,i,j)
745 call pres2qsat_liq( temp(
k,i,j), pres(
k,i,j), qdry(
k,i,j), &
747 ssliq_ae(
k,i,j) = qv(
k,i,j)/qsat_tmp - 1.0_rp
759 do is0 = 1, n_siz(ic)
760 if (qtrc0(
k,i,j,it_procs2trans(ia_m0,is0,ik,ic))*dens(
k,i,j) < cleannumber)
then
762 qtrc0(
k,i,j,it_procs2trans(ia0,is0,ik,ic)) = 0._rp
776 qtrc1(
k,i,j,iq) = qtrc0(
k,i,j,iq)
792 aerosol_procs(ia_trans2procs(it), &
793 is_trans2procs(it), &
794 ik_trans2procs(it), &
795 ic_trans2procs(it)) = qtrc1(
k,i,j,it)*dens(
k,i,j)
796 emis_procs(ia_trans2procs(it), &
797 is_trans2procs(it), &
798 ik_trans2procs(it), &
799 ic_trans2procs(it)) = emit(
k,i,j,it)*dens(
k,i,j)
802 conc_gas(1:gas_ctg) &
803 = qtrc1(
k,i,j,qa_ae-gas_ctg+1:qa_ae-gas_ctg+gas_ctg)*dens(
k,i,j)*1.e+9_rp
805 emis_gas(1:gas_ctg) = emit(
k,i,j,qa_ae-gas_ctg+ig_h2so4:qa_ae-gas_ctg+ig_cgas)
807 call aerosol_zerochem( &
823 do is0 = 1, n_siz(ic_mix)
825 aerosol_activ(ia0,is0,ik_out,ic_mix) = min(max(0._rp, aerosol_activ(ia0,is0,ik_out,ic_mix)), &
826 aerosol_procs(ia0,is0,ik_out,ic_mix) )
828 aerosol_procs(ia0,is0,ik_out,ic_mix) = &
829 aerosol_procs(ia0,is0,ik_out,ic_mix) - aerosol_activ(ia0,is0,ik_out,ic_mix)
840 m2_reg = m0_reg * reg_factor_m2
841 m3_reg = m0_reg * reg_factor_m3
842 ms_reg = m3_reg * pi6 * conv_vl_ms
843 aerosol_procs(ia_m0,is0_reg,ik_out,ic_mix) = &
844 aerosol_procs(ia_m0,is0_reg,ik_out,ic_mix) + m0_reg
845 aerosol_procs(ia_m2,is0_reg,ik_out,ic_mix) = &
846 aerosol_procs(ia_m2,is0_reg,ik_out,ic_mix) + m2_reg
847 aerosol_procs(ia_m3,is0_reg,ik_out,ic_mix) = &
848 aerosol_procs(ia_m3,is0_reg,ik_out,ic_mix) + m3_reg
849 aerosol_procs(ia_ms,is0_reg,ik_out,ic_mix) = &
850 aerosol_procs(ia_ms,is0_reg,ik_out,ic_mix) + ms_reg
855 do is0 = 1, n_siz(ic_mix)
856 ccn(
k,i,j) = ccn(
k,i,j) + aerosol_activ(ia_m0,is0,ik_out,ic_mix)
857 cn(
k,i,j) = cn(
k,i,j) + aerosol_procs(ia_m0,is0,ik_out,ic_mix)
871 do is0 = 1, n_siz(ic)
873 qtrc1(
k,i,j,it_procs2trans(ia0,is0,ik,ic)) = aerosol_procs(ia0,is0,ik,ic) / dens(
k,i,j)
879 qtrc1(
k,i,j,qa_ae-gas_ctg+1:qa_ae-gas_ctg+gas_ctg) = conc_gas(1:gas_ctg) / dens(
k,i,j)*1.e-9_rp
884 do is0 = 1, n_siz(ic)
885 if (qtrc1(
k,i,j,it_procs2trans(ia_m0,is0,ik,ic))*dens(
k,i,j) < cleannumber)
then
887 qtrc1(
k,i,j,it_procs2trans(ia0,is0,ik,ic)) = 0._rp
895 total_aerosol_mass(
k,i,j,:) = 0.0_rp
896 total_aerosol_number(
k,i,j,:) = 0.0_rp
897 total_emit_aerosol_mass(
k,i,j,:) = 0.0_rp
898 total_emit_aerosol_number(
k,i,j,:) = 0.0_rp
901 do is0 = 1, n_siz(ic)
902 total_aerosol_mass(
k,i,j,ic) = total_aerosol_mass(
k,i,j,ic) &
903 + qtrc1(
k,i,j,it_procs2trans(ia_ms,is0,ik,ic))
904 total_aerosol_number(
k,i,j,ic) = total_aerosol_number(
k,i,j,ic) &
905 + qtrc1(
k,i,j,it_procs2trans(ia_m0,is0,ik,ic))
906 total_emit_aerosol_mass(
k,i,j,ic) = total_emit_aerosol_mass(
k,i,j,ic) &
907 + emit(
k,i,j,it_procs2trans(ia_ms,is0,ik,ic))
908 total_emit_aerosol_number(
k,i,j,ic) = total_emit_aerosol_number(
k,i,j,ic) &
909 + emit(
k,i,j,it_procs2trans(ia_m0,is0,ik,ic))
919 call file_history_in( total_aerosol_mass(:,:,:,ic), trim(ctg_name(ic))//
'_mass',
'Total mass mixing ratio of aerosol',
'kg/kg' )
920 call file_history_in( total_aerosol_number(:,:,:,ic), trim(ctg_name(ic))//
'_number',
'Total number mixing ratio of aerosol',
'num/kg' )
921 call file_history_in( total_emit_aerosol_mass(:,:,:,ic), trim(ctg_name(ic))//
'_mass_emit',
'Total mass mixing ratio of emitted aerosol',
'kg/kg' )
922 call file_history_in( total_emit_aerosol_number(:,:,:,ic), trim(ctg_name(ic))//
'_number_emit',
'Total number mixing ratio of emitted aerosol',
'num/kg' )
925 call file_history_in( emit(:,:,:,qa_ae-gas_ctg+ig_h2so4),
'H2SO4_emit',
'Emission ratio of H2SO4 gas',
'ug/m3/s' )
926 call file_history_in( emit(:,:,:,qa_ae-gas_ctg+ig_cgas),
'CGAS_emit',
'Emission ratio of Condensabule gas',
'ug/m3/s' )
933 rhoq_t_ae(
k,i,j,iq) = ( qtrc1(
k,i,j,iq) - qtrc0(
k,i,j,iq) ) * dens(
k,i,j) / dt
951 integer,
intent(in) ::
ka,
ia,
ja, qa_ae
953 real(
rp),
intent(in) :: qtrc(
ka,
ia,
ja,qa_ae)
954 real(
rp),
intent(in) :: rh (
ka,
ia,
ja)
994 saturation_pres2qsat_liq => atmos_saturation_pres2qsat_liq
997 integer,
intent(in) ::
ka,
ks,
ke
998 integer,
intent(in) ::
ia,
is,
ie
999 integer,
intent(in) ::
ja,
js,
je
1000 integer,
intent(in) :: qa_ae
1002 real(
rp),
intent(in) :: dens(
ka,
ia,
ja)
1003 real(
rp),
intent(in) :: temp(
ka,
ia,
ja)
1004 real(
rp),
intent(in) :: pres(
ka,
ia,
ja)
1005 real(
rp),
intent(in) :: qdry(
ka,
ia,
ja)
1006 real(
rp),
intent(in) :: qv (
ka,
ia,
ja)
1007 real(
rp),
intent(in) :: m0_init
1008 real(
rp),
intent(in) :: dg_init
1009 real(
rp),
intent(in) :: sg_init
1010 real(
rp),
intent(in) :: d_min_inp(3)
1011 real(
rp),
intent(in) :: d_max_inp(3)
1012 real(
rp),
intent(in) :: k_min_inp(3)
1013 real(
rp),
intent(in) :: k_max_inp(3)
1014 integer,
intent(in) :: n_kap_inp(3)
1016 real(
rp),
intent(out) :: qtrc(
ka,
ia,
ja,qa_ae)
1017 real(
rp),
intent(out) :: ccn (
ka,
ia,
ja)
1019 integer,
parameter :: ia_m0 = 1
1020 integer,
parameter :: ia_m2 = 2
1021 integer,
parameter :: ia_m3 = 3
1022 integer,
parameter :: ia_ms = 4
1023 integer,
parameter :: ia_kp = 5
1024 integer,
parameter :: ik_out = 1
1026 real(
rp) :: c_kappa = 0.3_rp
1027 real(
rp),
parameter :: cleannumber = 1.e-3_rp
1029 real(
rp),
parameter :: rhod_ae = 1.83_rp
1030 real(
rp),
parameter :: conv_vl_ms = rhod_ae/1.e-12_rp
1032 real(
rp) :: m0t, dgt, sgt, m2t, m3t, mst
1034 real(
rp) :: conc_gas(gas_ctg)
1036 real(
rp),
allocatable :: d_lw(:,:), d_ct(:,:), d_up(:,:)
1037 real(
rp),
allocatable :: k_lw(:,:), k_ct(:,:), k_up(:,:)
1038 real(
rp) :: dlogd, dk
1039 real(
rp),
allocatable :: d_min(:)
1040 real(
rp),
allocatable :: d_max(:)
1041 integer,
allocatable :: n_kap(:)
1042 real(
rp),
allocatable :: k_min(:)
1043 real(
rp),
allocatable :: k_max(:)
1045 real(
rp) :: qsat_tmp, ssliq
1048 integer :: ia0, ik, is0, ic,
k, i, j, it
1058 allocate( d_min(n_ctg) )
1059 allocate( d_max(n_ctg) )
1060 allocate( n_kap(n_ctg) )
1061 allocate( k_min(n_ctg) )
1062 allocate( k_max(n_ctg) )
1065 d_min(1:n_ctg) = d_min_inp(1:n_ctg)
1066 d_max(1:n_ctg) = d_max_inp(1:n_ctg)
1067 n_kap(1:n_ctg) = n_kap_inp(1:n_ctg)
1068 k_min(1:n_ctg) = k_min_inp(1:n_ctg)
1069 k_max(1:n_ctg) = k_max_inp(1:n_ctg)
1073 allocate(d_lw(n_siz_max,n_ctg))
1074 allocate(d_ct(n_siz_max,n_ctg))
1075 allocate(d_up(n_siz_max,n_ctg))
1076 allocate(k_lw(n_kap_max,n_ctg))
1077 allocate(k_ct(n_kap_max,n_ctg))
1078 allocate(k_up(n_kap_max,n_ctg))
1088 dlogd = (log(d_max(ic)) - log(d_min(ic)))/real(nsiz(ic),kind=
rp)
1090 do is0 = 1, nsiz(ic)
1091 d_lw(is0,ic) = exp(log(d_min(ic))+dlogd* real(is0-1,kind=
rp) )
1092 d_ct(is0,ic) = exp(log(d_min(ic))+dlogd*(real(is0 ,kind=
rp)-0.5_rp))
1093 d_up(is0,ic) = exp(log(d_min(ic))+dlogd* real(is0 ,kind=
rp) )
1095 dk = (k_max(ic) - k_min(ic))/real(n_kap(ic),kind=
rp)
1096 do ik = 1, n_kap(ic)
1097 k_lw(ik,ic) = k_min(ic) + dk * real(ik-1,kind=
rp)
1098 k_ct(ik,ic) = k_min(ic) + dk *(real(ik ,kind=
rp)-0.5_rp)
1099 k_up(ik,ic) = k_min(ic) + dk * real(ik ,kind=
rp)
1109 if ( m0t <= cleannumber )
then
1113 log_warn(
"ATMOS_PHY_AE_kajino13_mkinit",*)
'Initial aerosol number is set as ', cleannumber,
'[#/m3]'
1116 m2t = m0t*dgt**(2.d0) *dexp(2.0d0 *(dlog(real(sgt,kind=
dp))**2.d0))
1117 m3t = m0t*dgt**(3.d0) *dexp(4.5d0 *(dlog(real(sgt,kind=
dp))**2.d0))
1118 mst = m3t*pi6*conv_vl_ms
1122 do ik = 1, n_kap(ic)
1123 do is0 = 1, nsiz(ic)
1124 if (dgt >= d_lw(is0,ic) .and. dgt < d_up(is0,ic))
then
1125 aerosol_procs(ia_m0,is0,ik,ic) = aerosol_procs(ia_m0,is0,ik,ic) + m0t
1126 aerosol_procs(ia_m2,is0,ik,ic) = aerosol_procs(ia_m2,is0,ik,ic) + m2t
1127 aerosol_procs(ia_m3,is0,ik,ic) = aerosol_procs(ia_m3,is0,ik,ic) + m3t
1128 aerosol_procs(ia_ms,is0,ik,ic) = aerosol_procs(ia_ms,is0,ik,ic) + mst*1.e-9_rp
1129 elseif (dgt < d_lw(1,ic))
then
1130 aerosol_procs(ia_m0,1 ,ik,ic) = aerosol_procs(ia_m0,1 ,ik,ic) + m0t
1131 aerosol_procs(ia_m2,1 ,ik,ic) = aerosol_procs(ia_m2,1 ,ik,ic) + m2t
1132 aerosol_procs(ia_m3,1 ,ik,ic) = aerosol_procs(ia_m3,1 ,ik,ic) + m3t
1133 aerosol_procs(ia_ms,1 ,ik,ic) = aerosol_procs(ia_ms,1 ,ik,ic) + mst*1.e-9_rp
1134 elseif (dgt >= d_up(nsiz(ic),ic))
then
1135 aerosol_procs(ia_m0,nsiz(ic),ik,ic) = aerosol_procs(ia_m0,nsiz(ic),ik,ic) + m0t
1136 aerosol_procs(ia_m2,nsiz(ic),ik,ic) = aerosol_procs(ia_m2,nsiz(ic),ik,ic) + m2t
1137 aerosol_procs(ia_m3,nsiz(ic),ik,ic) = aerosol_procs(ia_m3,nsiz(ic),ik,ic) + m3t
1138 aerosol_procs(ia_ms,nsiz(ic),ik,ic) = aerosol_procs(ia_ms,nsiz(ic),ik,ic) + mst*1.e-9_rp
1144 conc_gas(:) = 0.0_rp
1151 do is0 = 1, nsiz(ic)
1153 qtrc(
k,i,j,it) = aerosol_procs(ia0,is0,ik,ic) / dens(
k,i,j)
1161 qtrc(
k,i,j,it) = conc_gas(ic) / dens(
k,i,j) * 1.e-9_rp
1173 call saturation_pres2qsat_liq( temp(
k,i,j), pres(
k,i,j), qdry(
k,i,j), &
1175 ssliq = qv(
k,i,j) / qsat_tmp - 1.0_rp
1177 call aerosol_activation( c_kappa, ssliq, temp(
k,i,j), ia_m0, ia_m2, ia_m3, &
1178 n_atr, n_siz_max, n_kap_max, n_ctg, nsiz, n_kap, &
1179 d_ct, aerosol_procs, aerosol_activ )
1181 do is0 = 1, nsiz(ic_mix)
1182 ccn(
k,i,j) = ccn(
k,i,j) + aerosol_activ(ia_m0,is0,ik_out,ic_mix)
1192 KA, KS, KE, IA, IS, IE, JA, JS, JE, QA_AE, &
1195 integer,
intent(in) ::
ia,
is,
ie
1196 integer,
intent(in) ::
ja,
js,
je
1197 integer,
intent(in) :: qa_ae
1199 real(
rp),
intent(inout) :: qtrc(
ka,
ia,
ja,qa_ae)
1202 integer :: ic, ik, is0
1209 do ik = 1, n_kap(ic)
1210 do is0 = 1, n_siz(ic)
1211 if (qtrc(
k,i,j,it_procs2trans(ia_m0,is0,ik,ic)) < 0.0_rp .or. &
1212 qtrc(
k,i,j,it_procs2trans(ia_m2,is0,ik,ic)) < 0.0_rp .or. &
1213 qtrc(
k,i,j,it_procs2trans(ia_m3,is0,ik,ic)) < 0.0_rp .or. &
1214 qtrc(
k,i,j,it_procs2trans(ia_ms,is0,ik,ic)) < 0.0_rp .or. &
1215 qtrc(
k,i,j,it_procs2trans(ia_kp,is0,ik,ic)) < 0.0_rp )
then
1216 qtrc(
k,i,j,it_procs2trans(1:n_atr,is0,ik,ic)) = 0.0_rp
1233 subroutine aerosol_zerochem ( &
1235 temp_k, pres_pa, super, & !--- in
1236 ! h2so4dt, c_ratio, c_kappa, & !--- in
1237 flag_npf, flag_cond, flag_coag,& !--- in
1238 aerosol_procs, & !--- inout
1239 conc_gas, & !--- inout
1240 emis_procs, & !--- out
1241 emis_gas, & !--- out
1245 real(
dp),
intent(in) :: deltt
1246 real(
rp),
intent(in) :: temp_k
1247 real(
rp),
intent(in) :: pres_pa
1248 real(
rp),
intent(in) :: super
1252 logical,
intent(in) :: flag_npf
1253 logical,
intent(in) :: flag_cond
1254 logical,
intent(in) :: flag_coag
1255 real(
rp),
intent(inout) :: aerosol_procs(n_atr,n_siz_max,n_kap_max,n_ctg)
1256 real(
rp),
intent(inout) :: conc_gas(gas_ctg)
1257 real(
rp),
intent(out) :: aerosol_activ(n_atr,n_siz_max,n_kap_max,n_ctg)
1258 real(
rp),
intent(in) :: emis_procs(n_atr,n_siz_max,n_kap_max,n_ctg)
1259 real(
rp),
intent(in) :: emis_gas(gas_ctg)
1266 real(
rp) :: chem_gas(gas_ctg)
1273 do ik = 1, n_kap(ic)
1274 do is0 = 1, n_siz(ic)
1275 aerosol_procs(ia_ms,is0,ik,ic) = aerosol_procs(ia_ms,is0,ik,ic) * 1.e+9_rp
1282 do ik = 1, n_kap(ic)
1283 do is0 = 1, n_siz(ic)
1285 aerosol_procs(ia0,is0,ik,ic) = aerosol_procs(ia0,is0,ik,ic) &
1286 + emis_procs(ia0,is0,ik,ic) * deltt
1294 do ik = 1, n_kap(ic)
1295 do is0 = 1, n_siz(ic)
1296 if (aerosol_procs(ia_m0,is0,ik,ic) < cleannumber)
then
1298 aerosol_procs(ia0,is0,ik,ic) = 0._rp
1307 conc_gas(ig_h2so4) = conc_gas(ig_h2so4) + chem_gas(ig_h2so4) * deltt
1308 conc_gas(ig_cgas) = conc_gas(ig_cgas) + chem_gas(ig_cgas) * deltt
1310 conc_gas(ig_h2so4) = conc_gas(ig_h2so4) + emis_gas(ig_h2so4) * deltt
1311 conc_gas(ig_cgas) = conc_gas(ig_cgas) + emis_gas(ig_cgas) * deltt
1313 if( chem_gas(ig_h2so4)+emis_gas(ig_h2so4) /= 0.0_rp )
then
1314 c_ratio = ( chem_gas(ig_h2so4)+emis_gas(ig_h2so4)+chem_gas(ig_cgas)+emis_gas(ig_cgas) ) &
1315 / ( chem_gas(ig_h2so4)+emis_gas(ig_h2so4) )
1326 call aerosol_nucleation(conc_gas(ig_h2so4), j_1nm)
1335 call aerosol_condensation(j_1nm, temp_k, pres_pa, deltt, &
1336 ic_nuc, ik_nuc, is_nuc, n_ctg, n_kap, n_siz, n_atr, &
1337 n_siz_max, n_kap_max, ia_m0, ia_m2, ia_m3, ia_ms, &
1340 conc_gas(ig_h2so4), c_ratio, aerosol_procs )
1347 call aerosol_coagulation(deltt, temp_k, pres_pa, &
1348 mcomb,is_i,is_j,is_k,ik_i,ik_j,ik_k,ic_i,ic_j,ic_k, &
1349 n_atr,n_siz_max,n_kap_max,n_ctg,ia_m0,ia_m2,ia_m3,ia_ms, &
1350 n_siz,n_kap,d_lw,d_ct,d_up,aerosol_procs)
1355 super, temp_k, ia_m0, ia_m2, ia_m3, &
1356 n_atr,n_siz_max,n_kap_max,n_ctg,n_siz,n_kap, &
1357 d_ct,aerosol_procs, aerosol_activ)
1363 do ik = 1, n_kap(ic)
1364 do is0 = 1, n_siz(ic)
1365 aerosol_procs(ia_ms,is0,ik,ic) = aerosol_procs(ia_ms,is0,ik,ic) * 1.e-9_rp
1371 end subroutine aerosol_zerochem
1375 subroutine aerosol_nucleation(conc_h2so4, J_1nm)
1378 real(
rp),
intent(in) :: conc_h2so4
1379 real(
rp),
intent(inout) :: j_1nm
1381 real(
rp) :: conc_num_h2so4
1385 conc_num_h2so4 = conc_h2so4 * conv_m2n
1391 end subroutine aerosol_nucleation
1395 subroutine aerosol_condensation(J_1nm, temp_k, pres_pa, deltt, &
1396 ic_nuc, ik_nuc, is_nuc, n_ctg, n_kap, n_siz, n_atr, &
1397 n_siz_max, n_kap_max, ia_m0, ia_m2, ia_m3, ia_ms, &
1398 ! d_lw, d_ct, d_up, k_lw, k_ct, k_up, &
1400 conc_h2so4, c_ratio, aerosol_procs )
1404 real(
rp),
intent(in) :: j_1nm
1405 real(
rp),
intent(in) :: temp_k
1406 real(
rp),
intent(in) :: pres_pa
1407 real(
dp),
intent(in) :: deltt
1408 integer,
intent(in) :: ic_nuc
1409 integer,
intent(in) :: ik_nuc
1410 integer,
intent(in) :: is_nuc
1411 integer,
intent(in) :: n_ctg
1412 integer,
intent(in) :: n_kap(n_ctg)
1413 integer,
intent(in) :: n_siz(n_ctg)
1414 integer,
intent(in) :: n_atr
1415 integer,
intent(in) :: n_siz_max
1416 integer,
intent(in) :: n_kap_max
1417 integer,
intent(in) :: ia_m0
1418 integer,
intent(in) :: ia_m2
1419 integer,
intent(in) :: ia_m3
1420 integer,
intent(in) :: ia_ms
1421 real(
rp),
intent(in) :: c_ratio
1422 real(
rp),
intent(in) :: d_lw(n_siz_max,n_ctg), d_ct(n_siz_max,n_ctg), d_up(n_siz_max,n_ctg)
1424 real(
rp),
intent(inout) :: conc_h2so4
1425 real(
rp),
intent(inout) :: aerosol_procs(n_atr,n_siz_max,n_kap_max,n_ctg)
1427 real(
rp),
parameter :: alpha = 0.1_rp
1428 real(
rp),
parameter :: cour = 0.5_rp
1431 real(
rp) :: sq_cbar_h2so4
1432 real(
rp) :: cbar_h2so4
1433 real(
rp) :: dv_h2so4
1435 real(
rp) :: dm0dt_npf, dm2dt_npf, dm3dt_npf, dmsdt_npf
1436 real(
rp) :: dm0dt_cnd(n_siz_max,n_kap_max,n_ctg)
1437 real(
rp) :: dm2dt_cnd(n_siz_max,n_kap_max,n_ctg)
1438 real(
rp) :: dm3dt_cnd(n_siz_max,n_kap_max,n_ctg)
1439 real(
rp) :: dmsdt_cnd(n_siz_max,n_kap_max,n_ctg)
1440 real(
rp) :: rm0_pls(n_siz_max), rm0_mns(n_siz_max)
1441 real(
rp) :: rm2_pls(n_siz_max), rm2_mns(n_siz_max)
1442 real(
rp) :: rm3_pls(n_siz_max), rm3_mns(n_siz_max)
1443 real(
rp) :: rms_pls(n_siz_max), rms_mns(n_siz_max)
1444 real(
rp) :: m0t,m1t,m2t,m3t,dgt,sgt,dm2
1445 real(
rp) :: gnc2,gnc3,gfm2,gfm3,harm2,harm3
1446 real(
rp) :: lossrate,tmps6
1447 integer :: ic, ik, is0, i, is1, is2
1450 if (conc_h2so4 <= 0.0_rp)
return
1453 drive = conc_h2so4 * mwrat_s6 * conv_ms_vl
1454 sq_cbar_h2so4 = 8.0_rp*rgas*temp_k/(pi*mwh2so4*1.e-3_rp)
1455 cbar_h2so4 = sqrt( sq_cbar_h2so4 )
1456 dv_h2so4 = diffsulf*(stdatmpa/pres_pa)*(temp_k/stdtemp)**1.75_rp
1468 dm0dt_npf = j_1nm * 1.e6_rp
1469 dm2dt_npf = dm0dt_npf * 1.e-18_rp
1470 dm3dt_npf = dm0dt_npf * 1.e-27_rp
1471 dmsdt_npf = dm3dt_npf * pi6 * conv_vl_ms
1475 do ik = 1, n_kap(ic)
1476 do is0 = 1, n_siz(ic)
1478 dm2dt_cnd(is0,ik,ic) = 0._rp
1479 dm3dt_cnd(is0,ik,ic) = 0._rp
1481 if (aerosol_procs(ia_m0,is0,ik,ic) &
1482 *aerosol_procs(ia_m2,is0,ik,ic) &
1483 *aerosol_procs(ia_m3,is0,ik,ic) > 0._rp)
then
1484 m0t = aerosol_procs(ia_m0,is0,ik,ic)
1485 m2t = aerosol_procs(ia_m2,is0,ik,ic)
1486 m3t = aerosol_procs(ia_m3,is0,ik,ic)
1487 call diag_ds(m0t,m2t,m3t,dgt,sgt,dm2)
1488 if (dgt <= 0._rp) dgt = d_ct(is0,ic)
1489 if (sgt <= 0._rp) sgt = 1.3_rp
1490 m1t = m0t*dgt*exp(0.5_rp*(log(sgt)**2._rp))
1492 gnc2 = 8._rp * dv_h2so4 * m0t
1493 gnc3 = 12._rp * dv_h2so4 * m1t
1495 gfm2 = alpha * cbar_h2so4 * m1t
1496 gfm3 = 1.5_rp * alpha * cbar_h2so4 * m2t
1498 harm2 = gnc2 * gfm2 / ( gnc2 + gfm2 )
1499 harm3 = gnc3 * gfm3 / ( gnc3 + gfm3 )
1501 dm2dt_cnd(is0,ik,ic) = harm2*drive
1502 dm3dt_cnd(is0,ik,ic) = harm3*drive
1503 dmsdt_cnd(is0,ik,ic) = dm3dt_cnd(is0,ik,ic)*pi6*conv_vl_ms
1513 lossrate = dmsdt_npf
1516 do ik = 1, n_kap(ic)
1517 do is0 = 1, n_siz(ic)
1518 lossrate = lossrate + dmsdt_cnd(is0,ik,ic)
1523 if (lossrate<=0._rp)
return
1525 isplt = int( (lossrate*deltt) / (cour*conc_h2so4) )+1
1526 dtsplt = deltt/
float(isplt)
1529 loop_split:
do i = 1, isplt
1531 conc_h2so4 = conc_h2so4 - (lossrate * dtsplt) * mwrat_s6_i
1533 if (conc_h2so4 < 0._rp)
then
1534 dtsplt = tmps6 * mwrat_s6 / lossrate
1539 aerosol_procs(ia_m0,is_nuc,ik_nuc,ic_nuc) = &
1540 aerosol_procs(ia_m0,is_nuc,ik_nuc,ic_nuc) + dm0dt_npf * dtsplt
1541 aerosol_procs(ia_m2,is_nuc,ik_nuc,ic_nuc) = &
1542 aerosol_procs(ia_m2,is_nuc,ik_nuc,ic_nuc) + dm2dt_npf * dtsplt
1543 aerosol_procs(ia_m3,is_nuc,ik_nuc,ic_nuc) = &
1544 aerosol_procs(ia_m3,is_nuc,ik_nuc,ic_nuc) + dm3dt_npf * dtsplt
1545 aerosol_procs(ia_ms,is_nuc,ik_nuc,ic_nuc) = &
1546 aerosol_procs(ia_ms,is_nuc,ik_nuc,ic_nuc) + dmsdt_npf * dtsplt
1550 do ik = 1, n_kap(ic)
1551 do is0 = 1, n_siz(ic)
1553 aerosol_procs(ia_m2,is0,ik,ic) = &
1554 aerosol_procs(ia_m2,is0,ik,ic) + dm2dt_cnd(is0,ik,ic) * dtsplt &
1556 aerosol_procs(ia_m3,is0,ik,ic) = &
1557 aerosol_procs(ia_m3,is0,ik,ic) + dm3dt_cnd(is0,ik,ic) * dtsplt &
1559 aerosol_procs(ia_ms,is0,ik,ic) = &
1560 aerosol_procs(ia_ms,is0,ik,ic) + dmsdt_cnd(is0,ik,ic) * dtsplt &
1568 if (conc_h2so4 <= 0.0_rp)
exit loop_split
1574 conc_h2so4 = max(conc_h2so4, 0._rp)
1578 do ik = 1, n_kap(ic)
1589 do is1 = 1, n_siz(ic)
1591 if (aerosol_procs(ia_m0,is1,ik,ic) &
1592 *aerosol_procs(ia_m2,is1,ik,ic) &
1593 *aerosol_procs(ia_m3,is1,ik,ic) > 0._rp)
then
1594 m0t = aerosol_procs(ia_m0,is1,ik,ic)
1595 m2t = aerosol_procs(ia_m2,is1,ik,ic)
1596 m3t = aerosol_procs(ia_m3,is1,ik,ic)
1597 call diag_ds(m0t,m2t,m3t,dgt,sgt,dm2)
1598 if (dgt <= 0._rp) dgt = d_ct(is1,ic)
1599 if (sgt <= 0._rp) sgt = 1.3_rp
1601 do is2 = 1, n_siz(ic)
1602 if (dgt >= d_lw(is2,ic) .AND. dgt < d_up(is2,ic))
then
1603 rm0_pls(is2) = rm0_pls(is2) + aerosol_procs(ia_m0,is1,ik,ic)
1604 rm0_mns(is1) = aerosol_procs(ia_m0,is1,ik,ic)
1605 rm2_pls(is2) = rm2_pls(is2) + aerosol_procs(ia_m2,is1,ik,ic)
1606 rm2_mns(is1) = aerosol_procs(ia_m2,is1,ik,ic)
1607 rm3_pls(is2) = rm3_pls(is2) + aerosol_procs(ia_m3,is1,ik,ic)
1608 rm3_mns(is1) = aerosol_procs(ia_m3,is1,ik,ic)
1609 rms_pls(is2) = rms_pls(is2) + aerosol_procs(ia_ms,is1,ik,ic)
1610 rms_mns(is1) = aerosol_procs(ia_ms,is1,ik,ic)
1619 do is0 = 1, n_siz(ic)
1620 aerosol_procs(ia_m0,is0,ik,ic) = aerosol_procs(ia_m0,is0,ik,ic) &
1621 + rm0_pls(is0) - rm0_mns(is0)
1622 aerosol_procs(ia_m2,is0,ik,ic) = aerosol_procs(ia_m2,is0,ik,ic) &
1623 + rm2_pls(is0) - rm2_mns(is0)
1624 aerosol_procs(ia_m3,is0,ik,ic) = aerosol_procs(ia_m3,is0,ik,ic) &
1625 + rm3_pls(is0) - rm3_mns(is0)
1626 aerosol_procs(ia_ms,is0,ik,ic) = aerosol_procs(ia_ms,is0,ik,ic) &
1627 + rms_pls(is0) - rms_mns(is0)
1634 end subroutine aerosol_condensation
1638 subroutine aerosol_coagulation(deltt, temp_k, pres_pa, &
1639 mcomb,is_i,is_j,is_k,ik_i,ik_j,ik_k,ic_i,ic_j,ic_k, &
1640 n_atr,n_siz_max,n_kap_max,n_ctg,ia_m0,ia_m2,ia_m3,ia_ms, &
1641 n_siz,n_kap,d_lw,d_ct,d_up,aerosol_procs)
1644 real(
dp),
intent(in) :: deltt
1645 real(
rp),
intent(in) :: temp_k
1646 real(
rp),
intent(in) :: pres_pa
1647 integer,
intent(in) :: mcomb
1648 integer,
intent(in) :: is_i(mcomb), is_j(mcomb), is_k(mcomb)
1649 integer,
intent(in) :: ik_i(mcomb), ik_j(mcomb), ik_k(mcomb)
1650 integer,
intent(in) :: ic_i(mcomb), ic_j(mcomb), ic_k(mcomb)
1651 integer,
intent(in) :: n_ctg
1652 integer,
intent(in) :: n_atr
1653 integer,
intent(in) :: n_siz_max
1654 integer,
intent(in) :: n_kap_max
1655 integer,
intent(in) :: ia_m0
1656 integer,
intent(in) :: ia_m2
1657 integer,
intent(in) :: ia_m3
1658 integer,
intent(in) :: ia_ms
1659 integer,
intent(in) :: n_siz(n_ctg)
1660 integer,
intent(in) :: n_kap(n_ctg)
1661 real(
rp),
intent(in):: d_lw(n_siz_max,n_ctg), d_ct(n_siz_max,n_ctg), d_up(n_siz_max,n_ctg)
1662 real(
rp),
intent(inout) :: aerosol_procs(n_atr,n_siz_max,n_kap_max,n_ctg)
1664 real(
rp) :: dt_m0(n_siz_max,n_kap_max,n_ctg)
1665 real(
rp) :: dt_m3(n_siz_max,n_kap_max,n_ctg)
1666 real(
rp) :: dt_m6(n_siz_max,n_kap_max,n_ctg)
1667 real(
rp) :: dt_ms(n_siz_max,n_kap_max,n_ctg)
1668 real(
rp) :: sixth(n_siz_max,n_kap_max,n_ctg)
1669 real(
rp) :: rm0_pls(n_siz_max), rm0_mns(n_siz_max)
1670 real(
rp) :: rm2_pls(n_siz_max), rm2_mns(n_siz_max)
1671 real(
rp) :: rm3_pls(n_siz_max), rm3_mns(n_siz_max)
1672 real(
rp) :: rms_pls(n_siz_max), rms_mns(n_siz_max)
1675 real(
rp) :: rkfm,rknc
1676 real(
rp) :: m0i,m0j,m2i,m2j,m3i,m3j,msi,msj,dgi,dgj,sgi,sgj,dm2,m6i,m6j
1677 real(
rp) :: dm0i,dm0j,dm0k,dm3i,dm3j,dm3k,dm6i,dm6j,dm6k,dmsi,dmsj,dmsk
1678 real(
rp) :: m0t,m3t,m6t,dgt,sgt,m2t
1679 integer :: mc, ic, ik, is0, is1, is2
1681 dt_m0(:,:,:) = 0._rp
1682 dt_m3(:,:,:) = 0._rp
1683 dt_m6(:,:,:) = 0._rp
1684 dt_ms(:,:,:) = 0._rp
1685 sixth(:,:,:) = 0._rp
1687 visair=c1*temp_k**c2/(1._rp+c3/temp_k)
1688 rkfm=(3._rp*boltz*temp_k /rho_kg)**0.5_rp
1689 rknc= 2._rp*boltz*temp_k /(3._rp*visair)
1690 c4 = pi*boltz*temp_k/(8._rp*mwair/avo*1.e-3_rp)
1691 lambda = visair/(0.499_rp*pres_pa)*c4**0.5_rp*1.e2_rp
1696 m0i = aerosol_procs(ia_m0,is_i(mc),ik_i(mc),ic_i(mc))
1697 m0j = aerosol_procs(ia_m0,is_j(mc),ik_j(mc),ic_j(mc))
1698 m2i = aerosol_procs(ia_m2,is_i(mc),ik_i(mc),ic_i(mc))
1699 m2j = aerosol_procs(ia_m2,is_j(mc),ik_j(mc),ic_j(mc))
1700 m3i = aerosol_procs(ia_m3,is_i(mc),ik_i(mc),ic_i(mc))
1701 m3j = aerosol_procs(ia_m3,is_j(mc),ik_j(mc),ic_j(mc))
1702 msi = aerosol_procs(ia_ms,is_i(mc),ik_i(mc),ic_i(mc))
1703 msj = aerosol_procs(ia_ms,is_j(mc),ik_j(mc),ic_j(mc))
1705 if (m0i*m2i*m3i <= 0._rp .OR. m0j*m2j*m3j <= 0._rp) cycle
1707 call diag_ds(m0i,m2i,m3i,dgi,sgi,dm2)
1708 if (dgi <= 0._rp) dgi = d_ct(is_i(mc),ic_i(mc))
1709 if (sgi <= 0._rp) sgi = 1.3_rp
1710 call diag_ds(m0j,m2j,m3j,dgj,sgj,dm2)
1711 if (dgj <= 0._rp) dgj = d_ct(is_j(mc),ic_j(mc))
1712 if (sgj <= 0._rp) sgj = 1.3_rp
1714 m6i = m0i*dgi**6._rp*exp(18._rp*(log(sgi)**2._rp))
1715 m6j = m0j*dgj**6._rp*exp(18._rp*(log(sgj)**2._rp))
1716 sixth(is_i(mc),ik_i(mc),ic_i(mc)) = m6i
1717 sixth(is_j(mc),ik_j(mc),ic_j(mc)) = m6j
1720 if ( is_i(mc) == is_j(mc) .AND. &
1721 ik_i(mc) == ik_j(mc) .AND. &
1722 ic_i(mc) == ic_j(mc) )
then
1723 call aero_intra(m0i, m3i, &
1724 dm0i, dm3i, dm6i, dmsi, &
1737 call aero_inter(m0i ,m3i ,m6i , &
1739 dm0i,dm3i,dm6i,dmsi, &
1740 dm0j,dm3j,dm6j,dmsj, &
1741 dm0k,dm3k,dm6k,dmsk, &
1742 dgi ,sgi, rhod_ae, &
1743 dgj ,sgj, rhod_ae, &
1744 rknc, rkfm, lambda, &
1748 dt_m0(is_i(mc),ik_i(mc),ic_i(mc)) = dt_m0(is_i(mc),ik_i(mc),ic_i(mc)) + dm0i
1749 dt_m0(is_j(mc),ik_j(mc),ic_j(mc)) = dt_m0(is_j(mc),ik_j(mc),ic_j(mc)) + dm0j
1750 dt_m0(is_k(mc),ik_k(mc),ic_k(mc)) = dt_m0(is_k(mc),ik_k(mc),ic_k(mc)) + dm0k
1751 dt_m3(is_i(mc),ik_i(mc),ic_i(mc)) = dt_m3(is_i(mc),ik_i(mc),ic_i(mc)) + dm3i
1752 dt_m3(is_j(mc),ik_j(mc),ic_j(mc)) = dt_m3(is_j(mc),ik_j(mc),ic_j(mc)) + dm3j
1753 dt_m3(is_k(mc),ik_k(mc),ic_k(mc)) = dt_m3(is_k(mc),ik_k(mc),ic_k(mc)) + dm3k
1754 dt_m6(is_i(mc),ik_i(mc),ic_i(mc)) = dt_m6(is_i(mc),ik_i(mc),ic_i(mc)) + dm6i
1755 dt_m6(is_j(mc),ik_j(mc),ic_j(mc)) = dt_m6(is_j(mc),ik_j(mc),ic_j(mc)) + dm6j
1756 dt_m6(is_k(mc),ik_k(mc),ic_k(mc)) = dt_m6(is_k(mc),ik_k(mc),ic_k(mc)) + dm6k
1757 dt_ms(is_i(mc),ik_i(mc),ic_i(mc)) = dt_ms(is_i(mc),ik_i(mc),ic_i(mc)) + dmsi
1758 dt_ms(is_j(mc),ik_j(mc),ic_j(mc)) = dt_ms(is_j(mc),ik_j(mc),ic_j(mc)) + dmsj
1759 dt_ms(is_k(mc),ik_k(mc),ic_k(mc)) = dt_ms(is_k(mc),ik_k(mc),ic_k(mc)) + dmsk
1766 do ik = 1, n_kap(ic)
1767 do is0 = 1, n_siz(ic)
1768 if (aerosol_procs(ia_m0,is0,ik,ic) > 0._rp .AND. &
1769 dt_m0(is0,ik,ic)/aerosol_procs(ia_m0,is0,ik,ic) < 1._rp )
then
1770 aerosol_procs(ia_m0,is0,ik,ic)=aerosol_procs(ia_m0,is0,ik,ic) &
1771 *exp( dt_m0(is0,ik,ic)/aerosol_procs(ia_m0,is0,ik,ic) )
1773 aerosol_procs(ia_m0,is0,ik,ic)=aerosol_procs(ia_m0,is0,ik,ic) + dt_m0(is0,ik,ic)
1775 if (aerosol_procs(ia_m3,is0,ik,ic) > 0._rp .AND. &
1776 dt_m3(is0,ik,ic)/aerosol_procs(ia_m3,is0,ik,ic) < 1._rp )
then
1777 aerosol_procs(ia_m3,is0,ik,ic)=aerosol_procs(ia_m3,is0,ik,ic) &
1778 *exp( dt_m3(is0,ik,ic)/aerosol_procs(ia_m3,is0,ik,ic) )
1780 aerosol_procs(ia_m3,is0,ik,ic)=aerosol_procs(ia_m3,is0,ik,ic) + dt_m3(is0,ik,ic)
1782 if (sixth(is0,ik,ic) > 0._rp .AND. &
1783 dt_m6(is0,ik,ic)/sixth(is0,ik,ic) < 1._rp )
then
1784 sixth(is0,ik,ic) =sixth(is0,ik,ic) &
1785 *exp( dt_m6(is0,ik,ic)/sixth(is0,ik,ic) )
1787 sixth(is0,ik,ic) =sixth(is0,ik,ic) + dt_m6(is0,ik,ic)
1789 if (aerosol_procs(ia_ms,is0,ik,ic) > 0._rp .AND. &
1790 dt_ms(is0,ik,ic)/aerosol_procs(ia_ms,is0,ik,ic) < 1._rp )
then
1791 aerosol_procs(ia_ms,is0,ik,ic)=aerosol_procs(ia_ms,is0,ik,ic) &
1792 *exp( dt_ms(is0,ik,ic)/aerosol_procs(ia_ms,is0,ik,ic) )
1794 aerosol_procs(ia_ms,is0,ik,ic)=aerosol_procs(ia_ms,is0,ik,ic) + dt_ms(is0,ik,ic)
1796 m0t = aerosol_procs(ia_m0,is0,ik,ic)
1797 m3t = aerosol_procs(ia_m3,is0,ik,ic)
1798 m6t = sixth(is0,ik,ic)
1799 call diag_ds6(m0t,m3t,m6t, &
1801 if (dgt <= 0._rp) dgt = d_ct(is0,ic)
1802 if (sgt <= 0._rp) sgt = 1.3_rp
1803 if (m3t == 0._rp) aerosol_procs(ia_ms,is0,ik,ic)=0._rp
1804 aerosol_procs(ia_m2,is0,ik,ic)=m2t
1806 aerosol_procs(ia_m0,is0,ik,ic)=m0t
1807 aerosol_procs(ia_m3,is0,ik,ic)=m3t
1814 do ik = 1, n_kap(ic)
1825 do is1 = 1, n_siz(ic)
1827 if (aerosol_procs(ia_m0,is1,ik,ic) &
1828 *aerosol_procs(ia_m2,is1,ik,ic) &
1829 *aerosol_procs(ia_m3,is1,ik,ic) > 0._rp)
then
1830 m0t = aerosol_procs(ia_m0,is1,ik,ic)
1831 m2t = aerosol_procs(ia_m2,is1,ik,ic)
1832 m3t = aerosol_procs(ia_m3,is1,ik,ic)
1833 call diag_ds(m0t,m2t,m3t,dgt,sgt,dm2)
1834 if (dgt <= 0._rp) dgt = d_ct(is1,ic)
1835 if (sgt <= 0._rp) sgt = 1.3_rp
1837 do is2 = 1, n_siz(ic)
1838 if (dgt >= d_lw(is2,ic) .AND. dgt < d_up(is2,ic))
then
1839 rm0_pls(is2) = rm0_pls(is2) + aerosol_procs(ia_m0,is1,ik,ic)
1840 rm0_mns(is1) = aerosol_procs(ia_m0,is1,ik,ic)
1841 rm2_pls(is2) = rm2_pls(is2) + aerosol_procs(ia_m2,is1,ik,ic)
1842 rm2_mns(is1) = aerosol_procs(ia_m2,is1,ik,ic)
1843 rm3_pls(is2) = rm3_pls(is2) + aerosol_procs(ia_m3,is1,ik,ic)
1844 rm3_mns(is1) = aerosol_procs(ia_m3,is1,ik,ic)
1845 rms_pls(is2) = rms_pls(is2) + aerosol_procs(ia_ms,is1,ik,ic)
1846 rms_mns(is1) = aerosol_procs(ia_ms,is1,ik,ic)
1855 do is0 = 1, n_siz(ic)
1856 aerosol_procs(ia_m0,is0,ik,ic) = aerosol_procs(ia_m0,is0,ik,ic) &
1857 + rm0_pls(is0) - rm0_mns(is0)
1858 aerosol_procs(ia_m2,is0,ik,ic) = aerosol_procs(ia_m2,is0,ik,ic) &
1859 + rm2_pls(is0) - rm2_mns(is0)
1860 aerosol_procs(ia_m3,is0,ik,ic) = aerosol_procs(ia_m3,is0,ik,ic) &
1861 + rm3_pls(is0) - rm3_mns(is0)
1862 aerosol_procs(ia_ms,is0,ik,ic) = aerosol_procs(ia_ms,is0,ik,ic) &
1863 + rms_pls(is0) - rms_mns(is0)
1871 end subroutine aerosol_coagulation
1877 subroutine aerosol_activation(c_kappa, super, temp_k, ia_m0, ia_m2, ia_m3, &
1878 n_atr,n_siz_max,n_kap_max,n_ctg,n_siz,n_kap, &
1879 d_ct, aerosol_procs, aerosol_activ)
1883 real(
rp),
intent(in) :: super
1884 real(
rp),
intent(in) :: c_kappa
1885 real(
rp),
intent(in) :: temp_k
1886 integer,
intent(in) :: ia_m0, ia_m2, ia_m3
1887 integer,
intent(in) :: n_atr
1888 integer,
intent(in) :: n_siz_max
1889 integer,
intent(in) :: n_kap_max
1890 integer,
intent(in) :: n_ctg
1891 integer,
intent(in) :: n_siz(n_ctg), n_kap(n_ctg)
1892 real(
rp),
intent(in) :: d_ct(n_siz_max,n_ctg)
1893 real(
rp),
intent(in) :: aerosol_procs(n_atr,n_siz_max,n_kap_max,n_ctg)
1895 real(
rp),
intent(out) :: aerosol_activ(n_atr,n_siz_max,n_kap_max,n_ctg)
1898 real(
rp),
parameter :: two3 = 2._rp/3._rp
1899 real(
rp),
parameter :: rt2 = sqrt(2._rp)
1900 real(
rp),
parameter :: twort2 = rt2
1901 real(
rp),
parameter :: thrrt2 = 3._rp/rt2
1902 real(
rp) :: smax_inv
1903 real(
rp) :: am,scrit_am,aa,tc,st,bb,ac
1904 real(
rp) :: m0t,m2t,m3t,dgt,sgt,dm2
1906 real(
rp) :: tmp1, tmp2, tmp3
1907 real(
rp) :: ccn_frc,cca_frc,ccv_frc
1908 integer :: is0, ik, ic
1910 aerosol_activ(:,:,:,:) = 0._rp
1912 if (super<=0._rp)
return
1914 smax_inv = 1._rp / super
1917 tc = temp_k - stdtemp
1918 if (tc >= 0._rp )
then
1919 st = 75.94_rp-0.1365_rp*tc-0.3827e-3_rp*tc**2._rp
1921 st = 75.93_rp +0.115_rp*tc &
1922 + 6.818e-2_rp*tc**2._rp+6.511e-3_rp*tc**3._rp &
1923 + 2.933e-4_rp*tc**4._rp+6.283e-6_rp*tc**5._rp &
1924 + 5.285e-8_rp*tc**6._rp
1930 aa = 2._rp * st * mwwat * 1.e-3_rp / (dnwat * rgas * temp_k )
1933 do ik = 1, n_kap(ic)
1934 do is0 = 1, n_siz(ic)
1935 m0t = aerosol_procs(ia_m0,is0,ik,ic)
1936 m2t = aerosol_procs(ia_m2,is0,ik,ic)
1937 m3t = aerosol_procs(ia_m3,is0,ik,ic)
1938 call diag_ds(m0t,m2t,m3t,dgt,sgt,dm2)
1939 if (dgt <= 0._rp) dgt = d_ct(is0,ic)
1940 if (sgt <= 0._rp) sgt = 1.3_rp
1943 if (bb > 0._rp .AND. am > 0._rp )
then
1944 scrit_am = 2._rp/sqrt(bb)*(aa/(3._rp*am))**1.5_rp
1948 ac = am * (scrit_am * smax_inv)**two3
1950 tmp1 = log(d_crit) - log(dgt)
1951 tmp2 = 1._rp/(rt2*log(sgt))
1953 ccn_frc= 0.5_rp*(1._rp-erf(tmp1*tmp2))
1954 cca_frc= 0.5_rp*(1._rp-erf(tmp1*tmp2-twort2*tmp3))
1955 ccv_frc= 0.5_rp*(1._rp-erf(tmp1*tmp2-thrrt2*tmp3))
1956 ccn_frc=min(max(ccn_frc,0.0_rp),1.0_rp)
1957 cca_frc=min(max(cca_frc,0.0_rp),1.0_rp)
1958 ccv_frc=min(max(ccv_frc,0.0_rp),1.0_rp)
1959 aerosol_activ(ia_m0,is0,ik,ic) = ccn_frc * aerosol_procs(ia_m0,is0,ik,ic)
1960 aerosol_activ(ia_m2,is0,ik,ic) = cca_frc * aerosol_procs(ia_m2,is0,ik,ic)
1961 aerosol_activ(ia_m3,is0,ik,ic) = ccv_frc * aerosol_procs(ia_m3,is0,ik,ic)
1962 aerosol_activ(ia_ms,is0,ik,ic) = ccv_frc * aerosol_procs(ia_ms,is0,ik,ic)
1968 end subroutine aerosol_activation
1972 subroutine diag_ds(m0,m2,m3, & !i
1975 real(
rp) :: m0,m2,m3,dg,sg,m3_bar,m2_bar
1976 real(
rp) :: m2_new,m2_old,dm2
1977 real(
rp),
parameter :: sgmax=2.5_rp
1978 real(
rp),
parameter :: rk1=2._rp
1979 real(
rp),
parameter :: rk2=3._rp
1980 real(
rp),
parameter :: ratio =rk1/rk2
1981 real(
rp),
parameter :: rk1_hat=1._rp/(ratio*(rk2-rk1))
1982 real(
rp),
parameter :: rk2_hat=ratio/(rk1-rk2)
1983 real(
dp),
parameter :: tiny=1.e-50_dp
1987 if (m0 <= tiny .OR. m2 <= tiny .OR. m3 <= tiny)
then
1999 dg = m2_bar**rk1_hat*m3_bar**rk2_hat
2001 if (m2_bar/m3_bar**ratio < 1._rp)
then
2002 sg = exp(sqrt(2._rp/(rk1*(rk1-rk2)) &
2003 * log(m2_bar/m3_bar**ratio) ))
2006 if (sg > sgmax)
then
2009 call diag_d2(m0,m3,sg, &
2014 if (m2_bar/m3_bar**ratio >= 1._rp)
then
2016 call diag_d2(m0,m3,sg, &
2022 dm2 = m2_old - m2_new
2025 end subroutine diag_ds
2029 subroutine diag_d2(m0,m3,sg, & !i
2032 real(
rp) :: dg,sg,m0,m2,m3,aaa
2033 real(
rp),
parameter :: one3=1._rp/3._rp
2034 aaa = m0 * exp( 4.5_rp * (log(sg)**2._rp) )
2036 m2 = m0 * dg ** 2._rp * exp( 2.0_rp * (log(sg)**2._rp) )
2039 end subroutine diag_d2
2043 subroutine aero_intra(m0, m3, & !input
2044 dm0,dm3,dm6,dmi, & !output
2045 dg, sg, lambda, & !input
2052 real(
rp),
intent(in) :: m0
2053 real(
rp),
intent(in) :: m3
2055 real(
rp),
intent(out) :: dm0
2056 real(
rp),
intent(out) :: dm3
2057 real(
rp),
intent(out) :: dm6
2058 real(
rp),
intent(out) :: dmi
2059 real(
rp),
intent(in) :: dg
2060 real(
rp),
intent(in) :: sg
2061 real(
rp),
intent(in) :: lambda
2062 real(
rp),
intent(in) :: rknc, rkfm
2063 real(
dp),
intent(in) :: dt
2066 real(
rp) :: mm2,mm1,m1,m4,m2,mm1p5,mm0p5,m0p5,m3p5,m1p5,m5,m2p5
2067 real(
rp) :: dm0dt,dm6dt,dm0dt_nc,dm6dt_nc,dm0dt_fm,dm6dt_fm,bbb
2070 real(
rp),
parameter :: rk1=3._rp
2071 real(
rp),
parameter :: rk2=6._rp
2072 real(
rp),
parameter :: ratio=rk1/rk2
2073 real(
rp),
parameter :: rk1_hat=1._rp/(ratio*(rk2-rk1))
2074 real(
rp),
parameter :: rk2_hat=ratio/(rk1-rk2)
2085 mm2 =m0*dg**(-2._rp) *exp(2.0_rp *(log(sg)**2._rp))
2086 mm1 =m0*dg**(-1._rp) *exp(0.5_rp *(log(sg)**2._rp))
2087 m1 =m0*dg** 1._rp *exp(0.5_rp *(log(sg)**2._rp))
2088 m2 =m0*dg** 2._rp *exp(2.0_rp *(log(sg)**2._rp))
2089 m4 =m0*dg** 4._rp *exp(8.0_rp *(log(sg)**2._rp))
2092 dm0dt_nc=-1._rp*rknc*(m0*m0+m1*mm1+2.492e-2_rp*lambda*(m0*mm1+m1*mm2))
2093 dm6dt_nc= 2._rp*rknc*(m3*m3+m4*m2 +2.492e-2_rp*lambda*(m3*m2 +m4*m1 ))
2097 mm1p5=m0*dg**(-1.5_rp)*exp(1.125_rp*(log(sg)**2._rp))
2098 mm0p5=m0*dg**(-0.5_rp)*exp(0.125_rp*(log(sg)**2._rp))
2099 m0p5 =m0*dg** 0.5_rp *exp(0.125_rp*(log(sg)**2._rp))
2100 m3p5 =m0*dg**( 3.5_rp)*exp(6.125_rp*(log(sg)**2._rp))
2101 m1p5 =m0*dg**( 1.5_rp)*exp(1.125_rp*(log(sg)**2._rp))
2102 m5 =m0*dg** 5._rp *exp(12.50_rp*(log(sg)**2._rp))
2103 m2p5 =m0*dg** 2.5_rp *exp(3.125_rp*(log(sg)**2._rp))
2105 bbb =1._rp+1.2_rp *exp(-2._rp*sg)-0.646_rp*exp(-0.35_rp*sg**2._rp)
2107 dm0dt_fm= -1._rp*bbb*rkfm*(m0*m0p5+m2*mm1p5+2._rp*m1*mm0p5)
2108 dm6dt_fm= 2._rp*bbb*rkfm*(m3p5*m3+m1p5*m5 +2._rp*m2p5*m4 )
2111 if (dm0dt_fm+dm0dt_nc /= 0._rp) dm0dt = dm0dt_fm*dm0dt_nc/(dm0dt_fm+dm0dt_nc)
2112 if (dm6dt_fm+dm6dt_nc /= 0._rp) dm6dt = dm6dt_fm*dm6dt_nc/(dm6dt_fm+dm6dt_nc)
2121 end subroutine aero_intra
2125 subroutine aero_inter(m0i ,m3i ,m6i , & !input unchanged
2126 m0j ,m3j ,m6j , & !input unchanged
2127 dm0i,dm3i,dm6i,dmsi, & !output
2128 dm0j,dm3j,dm6j,dmsj, & !output
2129 dm0k,dm3k,dm6k,dmsk, & !output
2130 dgi ,sgi, rhoi, & !input unchanged
2131 dgj ,sgj, rhoj, & !input unchanged
2132 rknc, rkfm, lambda, & !input unchanged
2139 real(
rp),
intent(in) :: m0i,m0j
2140 real(
rp),
intent(in) :: m3i,m3j
2141 real(
rp),
intent(in) :: m6i,m6j
2142 real(
rp),
intent(out) :: dm0i,dm0j,dm0k
2143 real(
rp),
intent(out) :: dm3i,dm3j,dm3k
2144 real(
rp),
intent(out) :: dm6i,dm6j,dm6k
2145 real(
rp),
intent(out) :: dmsi,dmsj,dmsk
2146 real(
rp),
intent(in) :: dgi,sgi,rhoi
2147 real(
rp),
intent(in) :: dgj,sgj,rhoj
2148 real(
rp),
intent(in) :: rknc, rkfm
2149 real(
rp),
intent(in) :: lambda
2153 real(
rp) :: dm0dt_i,dm3dt_i,dm6dt_i
2154 real(
rp) :: dm0dt_j,dm3dt_j,dm6dt_j
2155 real(
rp) :: dm0dt_k,dm3dt_k,dm6dt_k
2156 real(
rp) :: mm2i,mm1i,m1i,m2i,m4i,m5i,m7i,m8i
2157 real(
rp) :: mm2j,mm1j,m1j,m2j,m4j,m5j,m7j,m8j
2158 real(
rp) :: mm1p5i,mm0p5i,m0p5i,m1p5i,m2p5i,m3p5i,m4p5i,m5p5i,m6p5i
2159 real(
rp) :: mm1p5j,mm0p5j,m0p5j,m1p5j,m2p5j,m3p5j,m4p5j,m5p5j,m6p5j
2160 real(
rp) :: dm6dt_nc_i,dm3dt_nc_i,dm0dt_nc_i
2161 real(
rp) :: dm6dt_nc_j,dm3dt_nc_j,dm0dt_nc_j
2162 real(
rp) :: dm6dt_nc_k,dm3dt_nc_k,dm0dt_nc_k
2163 real(
rp) :: dm6dt_fm_i,dm3dt_fm_i,dm0dt_fm_i
2164 real(
rp) :: dm6dt_fm_j,dm3dt_fm_j,dm0dt_fm_j
2165 real(
rp) :: dm6dt_fm_k,dm3dt_fm_k,dm0dt_fm_k
2166 real(
rp) :: bbb,gamma1,gamma2,alpha,beta
2193 mm2i=m0i*dgi**(-2._rp)*exp( 2.0_rp*(log(sgi)**2._rp))
2194 mm1i=m0i*dgi**(-1._rp)*exp( 0.5_rp*(log(sgi)**2._rp))
2195 m1i =m0i*dgi** 1._rp *exp( 0.5_rp*(log(sgi)**2._rp))
2196 m2i =m0i*dgi** 2._rp *exp( 2.0_rp*(log(sgi)**2._rp))
2198 m4i =m0i*dgi** 4._rp *exp( 8.0_rp*(log(sgi)**2._rp))
2199 m5i =m0i*dgi** 5._rp *exp(12.5_rp*(log(sgi)**2._rp))
2201 m7i =m0i*dgi** 7._rp *exp(24.5_rp*(log(sgi)**2._rp))
2203 mm2j=m0j*dgj**(-2._rp)*exp( 2.0_rp*(log(sgj)**2._rp))
2204 mm1j=m0j*dgj**(-1._rp)*exp( 0.5_rp*(log(sgj)**2._rp))
2205 m1j =m0j*dgj** 1._rp *exp( 0.5_rp*(log(sgj)**2._rp))
2206 m2j =m0j*dgj** 2._rp *exp( 2.0_rp*(log(sgj)**2._rp))
2208 m4j =m0j*dgj** 4._rp *exp( 8.0_rp*(log(sgj)**2._rp))
2209 m5j =m0j*dgj** 5._rp *exp(12.5_rp*(log(sgj)**2._rp))
2211 m7j =m0j*dgj** 7._rp *exp(24.5_rp*(log(sgj)**2._rp))
2213 dm0dt_nc_i = -rknc*(2._rp*m0i*m0j+ mm1i*m1j &
2215 +2.492e-2_rp*lambda*(m0i *mm1j+m1i*mm2j &
2216 + m0j *mm1i+m1j*mm2i) )
2217 dm3dt_nc_i = -rknc*(2._rp*m3i*m0j+ m2i *m1j &
2219 +2.492e-2_rp*lambda*(m3i *mm1j+m4i*mm2j &
2220 + m0j *m2i +m1j*m1i ) )
2221 dm6dt_nc_i = -rknc*(2._rp*m6i*m0j+ m5i *m1j &
2223 +2.492e-2_rp*lambda*(m6i *mm1j+m7i*mm2j &
2224 + m0j *m5i +m1j*m4i ) )
2225 dm0dt_nc_j = -rknc*(2._rp*m0i*m0j+ mm1i*m1j &
2227 +2.492e-2_rp*lambda*(m0i *mm1j+m1i*mm2j &
2228 + m0j *mm1i+m1j*mm2i) )
2229 dm3dt_nc_j = -rknc*(2._rp*m0i*m3j+ mm1i*m4j &
2231 +2.492e-2_rp*lambda*(m0i *m2j +m1i*m1j &
2232 + m3j *mm1i+m4j*mm2i) )
2233 dm6dt_nc_j = -rknc*(2._rp*m0i*m6j+ mm1i*m7j &
2235 +2.492e-2_rp*lambda*(m0i *m5j +m1i*m4j &
2236 + m6j *mm1i+m7j*mm2i) )
2237 dm0dt_nc_k = -dm0dt_nc_i
2238 dm3dt_nc_k = -dm3dt_nc_i-dm3dt_nc_j
2239 dm6dt_nc_k = -dm6dt_nc_i-dm6dt_nc_j &
2240 +2._rp*rknc*(2._rp*m3i*m3j+ m2i *m4j &
2242 +2.492e-2_rp*lambda*(m3i *m2j +m4i*m1j &
2243 + m3j *m2i +m4j*m1i) )
2247 mm1p5i=m0i*dgi**(-1.5_rp)*exp( 1.125_rp*(log(sgi)**2._rp) )
2248 mm0p5i=m0i*dgi**(-0.5_rp)*exp( 0.125_rp*(log(sgi)**2._rp) )
2249 m0p5i =m0i*dgi** 0.5_rp *exp( 0.125_rp*(log(sgi)**2._rp) )
2250 m1p5i =m0i*dgi** 1.5_rp *exp( 1.125_rp*(log(sgi)**2._rp) )
2251 m2p5i =m0i*dgi** 2.5_rp *exp( 3.125_rp*(log(sgi)**2._rp) )
2252 m3p5i =m0i*dgi** 3.5_rp *exp( 6.125_rp*(log(sgi)**2._rp) )
2253 m4p5i =m0i*dgi** 4.5_rp *exp(10.125_rp*(log(sgi)**2._rp) )
2254 m5p5i =m0i*dgi** 5.5_rp *exp(15.125_rp*(log(sgi)**2._rp) )
2255 m6p5i =m0i*dgi** 6.5_rp *exp(21.125_rp*(log(sgi)**2._rp) )
2256 m8i =m0i*dgi** 8._rp *exp(32.000_rp*(log(sgi)**2._rp) )
2259 mm1p5j=m0j*dgj**(-1.5_rp)*exp( 1.125_rp*(log(sgj)**2._rp) )
2260 mm0p5j=m0j*dgj**(-0.5_rp)*exp( 0.125_rp*(log(sgj)**2._rp) )
2261 m0p5j =m0j*dgj** 0.5_rp *exp( 0.125_rp*(log(sgj)**2._rp) )
2262 m1p5j =m0j*dgj** 1.5_rp *exp( 1.125_rp*(log(sgj)**2._rp) )
2263 m2p5j =m0j*dgj** 2.5_rp *exp( 3.125_rp*(log(sgj)**2._rp) )
2264 m3p5j =m0j*dgj** 3.5_rp *exp( 6.125_rp*(log(sgj)**2._rp) )
2265 m4p5j =m0j*dgj** 4.5_rp *exp(10.125_rp*(log(sgj)**2._rp) )
2266 m5p5j =m0j*dgj** 5.5_rp *exp(15.125_rp*(log(sgj)**2._rp) )
2267 m6p5j =m0j*dgj** 6.5_rp *exp(21.125_rp*(log(sgj)**2._rp) )
2268 m8j =m0j*dgj** 8._rp *exp(32.000_rp*(log(sgj)**2._rp) )
2272 beta =(1._rp-(sqrt(1._rp+alpha**3._rp)/(1._rp+sqrt(alpha**3._rp))))/(1._rp-1._rp/sqrt(2._rp))
2273 gamma1 =(sgi +alpha*sgj )/(1._rp+alpha)
2274 gamma2 =(sgi**2._rp +alpha*sgj**2._rp)/(1._rp+alpha)
2275 bbb = 1._rp+1.2_rp*beta*dexp(real(-2._rp*gamma1,kind=
dp))-0.646_rp*beta*dexp(real(-0.35_rp*gamma2,kind=
dp))
2277 dm0dt_fm_i=-bbb*rkfm*( &
2278 m0i *m0p5j +m2i *mm1p5j +2._rp*m1i *mm0p5j &
2279 + m0j *m0p5i +m2j *mm1p5i +2._rp*m1j *mm0p5i )
2280 dm3dt_fm_i=-bbb*rkfm*( &
2281 m3i *m0p5j +m5i *mm1p5j +2._rp*m4i *mm0p5j &
2282 + m0j *m3p5i +m2j *m1p5i +2._rp*m1j *m2p5i )
2283 dm6dt_fm_i=-bbb*rkfm*( &
2284 m6i *m0p5j +m8i *mm1p5j +2._rp*m7i *mm0p5j &
2285 + m0j *m6p5i +m2j *m4p5i +2._rp*m1j *m5p5i )
2286 dm0dt_fm_j= dm0dt_fm_i
2287 dm3dt_fm_j=-bbb*rkfm*( &
2288 m0i *m3p5j +m2i *m1p5j +2._rp*m1i *m2p5j &
2289 + m3j *m0p5i +m5j *mm1p5i +2._rp*m4j *mm0p5i )
2290 dm6dt_fm_j=-bbb*rkfm*( &
2291 m0i *m6p5j +m2i *m4p5j +2._rp*m1i *m5p5j &
2292 + m6j *m0p5i +m8j *mm1p5i +2._rp*m7j *mm0p5i )
2293 dm0dt_fm_k=-dm0dt_fm_i
2294 dm3dt_fm_k=-dm3dt_fm_i-dm3dt_fm_j
2295 dm6dt_fm_k=-dm6dt_fm_i-dm6dt_fm_j &
2296 +2._rp * bbb*rkfm*( &
2297 m3i *m3p5j +m5i *m1p5j +2._rp*m4i *m2p5j &
2298 + m3j *m3p5i +m5j *m1p5i +2._rp*m4j *m2p5i )
2301 if (dm0dt_fm_i+dm0dt_nc_i/=0._rp) &
2302 dm0dt_i = dm0dt_fm_i*dm0dt_nc_i/(dm0dt_fm_i+dm0dt_nc_i)
2303 if (dm3dt_fm_i+dm3dt_nc_i/=0._rp) &
2304 dm3dt_i = dm3dt_fm_i*dm3dt_nc_i/(dm3dt_fm_i+dm3dt_nc_i)
2305 if (dm6dt_fm_i+dm6dt_nc_i/=0._rp) &
2306 dm6dt_i = dm6dt_fm_i*dm6dt_nc_i/(dm6dt_fm_i+dm6dt_nc_i)
2307 if (dm0dt_fm_j+dm0dt_nc_j/=0._rp) &
2308 dm0dt_j = dm0dt_fm_j*dm0dt_nc_j/(dm0dt_fm_j+dm0dt_nc_j)
2309 if (dm3dt_fm_j+dm3dt_nc_j/=0._rp) &
2310 dm3dt_j = dm3dt_fm_j*dm3dt_nc_j/(dm3dt_fm_j+dm3dt_nc_j)
2311 if (dm6dt_fm_j+dm6dt_nc_j/=0._rp) &
2312 dm6dt_j = dm6dt_fm_j*dm6dt_nc_j/(dm6dt_fm_j+dm6dt_nc_j)
2313 if (dm0dt_fm_k+dm0dt_nc_k/=0._rp) &
2314 dm0dt_k = dm0dt_fm_k*dm0dt_nc_k/(dm0dt_fm_k+dm0dt_nc_k)
2317 if (dm6dt_fm_k+dm6dt_nc_k/=0._rp) &
2318 dm6dt_k = dm6dt_fm_k*dm6dt_nc_k/(dm6dt_fm_k+dm6dt_nc_k)
2320 dm0i = dm0dt_i * dtrest
2321 dm3i = dm3dt_i * dtrest
2322 dm6i = dm6dt_i * dtrest
2323 dmsi = dm3i * rhoi *pi6*1.e12_rp
2324 dm0j = dm0dt_j * dtrest
2325 dm3j = dm3dt_j * dtrest
2326 dm6j = dm6dt_j * dtrest
2327 dmsj = dm3j * rhoj *pi6*1.e12_rp
2328 dm0k = dm0dt_k * dtrest
2330 dm6k = dm6dt_k * dtrest
2335 end subroutine aero_inter
2339 subroutine diag_ds6(m0,m3,m6,m2,dg,sg,dm2)
2341 real(
rp) :: m0,m2,m3,m6,dg,sg,m3_bar,m6_bar
2342 real(
rp) :: m2_new,m2_old,dm2
2343 real(
rp),
parameter :: sgmax=2.5_rp
2344 real(
rp),
parameter :: rk1=3._rp
2345 real(
rp),
parameter :: rk2=6._rp
2346 real(
rp),
parameter :: ratio =rk1/rk2
2347 real(
rp),
parameter :: rk1_hat=1._rp/(ratio*(rk2-rk1))
2348 real(
rp),
parameter :: rk2_hat=ratio/(rk1-rk2)
2349 real(
dp),
parameter :: tiny=1.e-50_dp
2352 if (m0 <= tiny .OR. m3 <= tiny .OR. m6 <= tiny)
then
2364 dg = m3_bar**rk1_hat*m6_bar**rk2_hat
2366 if (m3_bar/m6_bar**ratio < 1._rp)
then
2367 sg = exp(dsqrt(real(2._rp/(rk1*(rk1-rk2)) &
2368 * log(m3_bar/m6_bar**ratio), kind=
dp )))
2369 m2 = m0*dg**2._rp*exp(2._rp*(log(sg)**2._rp))
2373 if (sg > sgmax)
then
2376 call diag_d2(m0,m3,sg, &
2381 if (m3_bar/m6_bar**ratio >= 1._rp)
then
2383 call diag_d2(m0,m3,sg, &
2389 dm2 = m2_old - m2_new
2393 end subroutine diag_ds6
2395 subroutine trans_ccn(aerosol_procs, aerosol_activ, t_ccn, t_cn, &
2396 n_ctg, n_kap_max, n_siz_max, n_atr, &
2397 ic_out, ia_m0, ia_m2, ia_m3, ik_out, n_siz, &
2398 ! rnum_out, nbins_out, dlog10d_out)
2399 rnum_out, nbins_out)
2403 integer,
intent(in) :: n_ctg, n_kap_max, n_siz_max, n_atr
2404 integer,
intent(in) :: ic_out, ik_out
2405 integer,
intent(in) :: ia_m0, ia_m2, ia_m3
2406 integer,
intent(in) :: n_siz(n_ctg)
2407 real(
rp),
intent(in) :: aerosol_procs(n_atr,n_siz_max,n_kap_max,n_ctg)
2408 real(
rp),
intent(in) :: aerosol_activ(n_atr,n_siz_max,n_kap_max,n_ctg)
2409 integer,
intent(in) :: nbins_out
2410 real(
rp),
intent(out):: rnum_out(nbins_out)
2412 real(
rp),
intent(out):: t_ccn
2413 real(
rp),
intent(out):: t_cn
2435 do is0 = 1, n_siz(ic_out)
2457 t_ccn = t_ccn + aerosol_activ(ia_m0,is0,ik_out,ic_out)
2458 t_cn = t_cn + aerosol_procs(ia_m0,is0,ik_out,ic_out)
2463 end subroutine trans_ccn