30 aero_data, env_state, k)
41 real(kind=dp),
intent(out) :: k
53 real(kind=dp),
intent(in) :: v1
55 real(kind=dp),
intent(in) :: v2
61 real(kind=dp),
intent(out) :: k_min
63 real(kind=dp),
intent(out) :: k_max
105 subroutine soln_zero(bin_grid, aero_data, time, aero_dist_init, &
106 scenario, env_state, loss_function_type, aero_binned)
113 real(kind=dp),
intent(in) :: time
121 integer,
intent(in) :: loss_function_type
126 real(kind=dp) :: emission_rate_scale, dilution_rate, p
127 real(kind=dp),
allocatable :: loss_array(:)
131 logical,
save :: already_warned_water = .false.
139 scenario%aero_emission_time, scenario%aero_emission_rate_scale, &
140 env_state%elapsed_time, emissions, emission_rate_scale)
142 scenario%aero_dilution_time, scenario%aero_dilution_rate, 0d0, &
143 background, dilution_rate)
147 if (dilution_rate == 0d0 .and. &
148 loss_function_type == scenario_loss_function_invalid)
then
153 emission_rate_scale * time / env_state%height)
155 allocate(loss_array(bin_grid%n_bin))
157 if ((loss_function_type /= scenario_loss_function_zero) .or. &
158 (loss_function_type /= scenario_loss_function_invalid))
then
159 if (aero_data%name(1) /=
"H2O")
then
161 "exact solution assumes composition is water", &
162 already_warned_water)
166 do i = 1, bin_grid%n_bin
168 loss_function_type,
rad2vol(bin_grid%centers(i)), &
169 const%water_density, aero_data, env_state)
170 call
assert_msg(181676342, loss_array(i) > 0, &
171 "non-positive loss rate")
172 loss_array(i) = 1d0 / loss_array(i)
179 aero_data, emissions)
181 emission_rate_scale / env_state%height)
186 do i = 1, bin_grid%n_bin
187 loss_array(i) = exp(-time / loss_array(i))
subroutine aero_binned_allocate_size(aero_binned, n_bin, n_spec)
Allocate an aero_binned_t of the given size.
The scenario_t structure and associated subroutines.
The aero_data_t structure and associated subroutines.
subroutine aero_dist_interp_1d(aero_dist_list, time_list, rate_list, time, aero_dist, rate)
Determine the current aero_dist and rate by interpolating at the current time with the lists of aero_...
real(kind=dp) elemental function rad2vol(r)
Convert radius (m) to volume (m^3).
The aero_dist_t structure and associated subroutines.
subroutine aero_binned_sub(aero_binned, aero_binned_delta)
Subtract one aero_binned_t structure from another.
The aero_particle_t structure and associated subroutines.
The env_state_t structure and associated subroutines.
real(kind=dp) function scenario_loss_rate(loss_function_type, vol, density, aero_data, env_state)
Evaluate a loss rate function.
subroutine aero_binned_deallocate(aero_binned)
Free internal memory in an aero_binned_t structure.
subroutine soln_zero(bin_grid, aero_data, time, aero_dist_init, scenario, env_state, loss_function_type, aero_binned)
Exact solution with the zero coagulation kernel. Only useful for testing emissions and background dil...
subroutine assert_msg(code, condition_ok, error_msg)
Errors unless condition_ok is true.
subroutine aero_dist_deallocate(aero_dist)
Free all storage.
subroutine kernel_zero_minmax(v1, v2, aero_data, env_state, k_min, k_max)
Minimum and maximum of the zero coagulation kernel.
A complete aerosol distribution, consisting of several modes.
Common utility subroutines.
subroutine aero_binned_add(aero_binned, aero_binned_delta)
Add two aero_binned_t structures together.
Current environment state.
subroutine aero_binned_scale(aero_binned, alpha)
Scale an aero_binned_t by a real number.
Single aerosol particle data structure.
1D grid, either logarithmic or linear.
The bin_grid_t structure and associated subroutines.
The aero_binned_t structure and associated subroutines.
subroutine warn_msg(code, warning_msg, already_warned)
Prints a warning message.
subroutine kernel_zero(aero_particle_1, aero_particle_2, aero_data, env_state, k)
Zero coagulation kernel.
subroutine aero_binned_scale_by_array(aero_binned, alpha_array)
Scales an aero_binned_t element-wise by an array of reals.
Constant kernel equal to zero.
subroutine aero_binned_zero(aero_binned)
Set all internal data in an aero_binned_t structure to zero.
subroutine aero_binned_add_aero_dist(aero_binned, bin_grid, aero_data, aero_dist)
Add an aero_dist_t to an aero_binned_t.
Aerosol material properties and associated data.
subroutine aero_dist_allocate(aero_dist)
Allocates an aero_dist.
Aerosol number and volume distributions stored per bin.