31 subroutine nucleate(nucleate_type, nucleate_source, nucleate_weight_class, &
32 env_state, gas_data, aero_data, aero_state, gas_state, del_t, &
33 allow_doubling, allow_halving)
36 integer,
intent(in) :: nucleate_type
38 integer,
intent(in) :: nucleate_source
40 integer,
intent(in) :: nucleate_weight_class
52 real(kind=
dp),
intent(in) :: del_t
54 logical,
intent(in) :: allow_doubling
56 logical,
intent(in) :: allow_halving
60 env_state, gas_data, aero_data, aero_state, gas_state, del_t, &
61 allow_doubling, allow_halving)
64 "unknown nucleation type: " &
87 env_state, gas_data, aero_data, aero_state, gas_state, del_t, &
88 allow_doubling, allow_halving)
91 integer,
intent(in) :: nucleate_source
93 integer,
intent(in) :: nucleate_weight_class
105 real(kind=
dp),
intent(in) :: del_t
107 logical,
intent(in) :: allow_doubling
109 logical,
intent(in) :: allow_halving
111 real(kind=
dp),
parameter :: nucleate_coeff = 1d-18
112 real(kind=
dp),
parameter :: nucleate_diam = 1d-9
115 integer :: i_gas_h2so4, i_aero_so4, n_samp, i_samp, i_bin, i_group, n_group
116 integer :: i_class, i_source
117 real(kind=
dp) :: sulf_acid_conc, nucleate_rate, n_samp_avg
118 real(kind=
dp) :: total_so4_vol, so4_vol, h2so4_removed_conc
119 type(aero_particle_t) :: aero_particle
124 "nucleate_sulf_acid requires H2SO4 as a gas species")
127 "nucleate_sulf_acid requires SO4 as an aerosol species")
131 gas_state%mix_rat(i_gas_h2so4))
134 nucleate_rate = nucleate_coeff * sulf_acid_conc**2
138 i_source = nucleate_source
142 do i_group = 1,aero_weight_array_n_group(aero_state%awa)
145 aero_state%awa%weight(i_group, i_class),
diam2rad(nucleate_diam))
147 i_group, i_class, n_samp_avg, allow_doubling, allow_halving)
151 aero_state%awa%weight(i_group, i_class),
diam2rad(nucleate_diam))
157 total_so4_vol = total_so4_vol + so4_vol
159 call aero_particle_zero(aero_particle, aero_data)
160 call aero_particle_set_component(aero_particle, i_source, &
161 env_state%elapsed_time)
162 aero_particle%vol(i_aero_so4) = so4_vol
163 call aero_particle_new_id(aero_particle)
164 call aero_particle_set_weight(aero_particle, i_group, i_class)
170 h2so4_removed_conc = &
172 * aero_weight_array_num_conc_at_radius(aero_state%awa, i_class, &
174 * aero_data%density(i_aero_so4) &
175 / aero_data%molec_weight(i_aero_so4) &
177 gas_state%mix_rat(i_gas_h2so4) = gas_state%mix_rat(i_gas_h2so4) &
179 if (gas_state%mix_rat(i_gas_h2so4) < 0d0)
then
180 gas_state%mix_rat(i_gas_h2so4) = 0d0
187 subroutine spec_file_read_nucleate_type(file, aero_data, nucleate_type, &
188 nucleate_source, nucleate_weight_class)
195 integer,
intent(out) :: nucleate_type
197 integer,
intent(out) :: nucleate_source
199 integer,
intent(out) :: nucleate_weight_class
201 character(len=SPEC_LINE_MAX_VAR_LEN) :: nucleate_type_name
215 if (nucleate_type_name ==
'sulf_acid')
then
223 // trim(nucleate_type_name))
226 end subroutine spec_file_read_nucleate_type