PartMC  2.6.1
coag_kernel.F90
Go to the documentation of this file.
1 ! Copyright (C) 2005-2012 Nicole Riemer and Matthew West
2 ! Licensed under the GNU General Public License version 2 or (at your
3 ! option) any later version. See the file COPYING for details.
4 
5 !> \file
6 !> The pmc_coag_kernel module.
7 
8 !> Generic coagulation kernel.
10 
11  use pmc_env_state
12  use pmc_bin_grid
14  use pmc_aero_data
15  use pmc_aero_weight
24 
25  !> Maximum length of a mode type.
26  integer, parameter :: coag_kernel_type_len = 20
27 
28  !> Type code for an undefined or invalid kernel.
29  integer, parameter :: coag_kernel_type_invalid = 0
30  !> Type code for a sedimentation kernel.
31  integer, parameter :: coag_kernel_type_sedi = 1
32  !> Type code for an additive kernel.
33  integer, parameter :: coag_kernel_type_additive = 2
34  !> Type code for a constant kernel.
35  integer, parameter :: coag_kernel_type_constant = 3
36  !> Type code for a Brownian kernel.
37  integer, parameter :: coag_kernel_type_brown = 4
38  !> Type code for a zero kernel.
39  integer, parameter :: coag_kernel_type_zero = 5
40  !> Type code for a Brownian kernel in free molecular regime from Vemury
41  !> and Pratsinis [1995].
42  integer, parameter :: coag_kernel_type_brown_free = 6
43  !> Type code for a Brownian kernel in continuum regime from Vemury and
44  !> Pratsinis [1995].
45  integer, parameter :: coag_kernel_type_brown_cont = 7
46 
47 contains
48 
49 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
50 
51  !> Return a string representation of a kernel type.
52  character(len=COAG_KERNEL_TYPE_LEN) function coag_kernel_type_to_string( &
53  coag_kernel_type)
54 
55  !> Coagulation kernel type.
56  integer, intent(in) :: coag_kernel_type
57 
58  if (coag_kernel_type == coag_kernel_type_invalid) then
59  coag_kernel_type_to_string = "invalid"
60  elseif (coag_kernel_type == coag_kernel_type_sedi) then
62  elseif (coag_kernel_type == coag_kernel_type_additive) then
63  coag_kernel_type_to_string = "additive"
64  elseif (coag_kernel_type == coag_kernel_type_constant) then
65  coag_kernel_type_to_string = "constant"
66  elseif (coag_kernel_type == coag_kernel_type_brown) then
68  elseif (coag_kernel_type == coag_kernel_type_zero) then
70  elseif (coag_kernel_type == coag_kernel_type_brown_free) then
71  coag_kernel_type_to_string = "brown_free"
72  elseif (coag_kernel_type == coag_kernel_type_brown_cont) then
73  coag_kernel_type_to_string = "brown_cont"
74  else
75  coag_kernel_type_to_string = "unknown"
76  end if
77 
78  end function coag_kernel_type_to_string
79 
80 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
81 
82  !> Evalulate a coagulation kernel function.
83  subroutine kernel(coag_kernel_type, aero_particle_1, aero_particle_2, &
84  aero_data, env_state, k)
85 
86  !> Coagulation kernel type.
87  integer, intent(in) :: coag_kernel_type
88  !> First particle.
89  type(aero_particle_t), intent(in) :: aero_particle_1
90  !> Second particle.
91  type(aero_particle_t), intent(in) :: aero_particle_2
92  !> Aerosol data.
93  type(aero_data_t), intent(in) :: aero_data
94  !> Environment state.
95  type(env_state_t), intent(in) :: env_state
96  !> Kernel k(a,b) (m^3/s).
97  real(kind=dp), intent(out) :: k
98 
99  if (coag_kernel_type == coag_kernel_type_sedi) then
100  call kernel_sedi(aero_particle_1, aero_particle_2, &
101  aero_data, env_state, k)
102  elseif (coag_kernel_type == coag_kernel_type_additive) then
103  call kernel_additive(aero_particle_1, aero_particle_2, &
104  aero_data, env_state, k)
105  elseif (coag_kernel_type == coag_kernel_type_constant) then
106  call kernel_constant(aero_particle_1, aero_particle_2, &
107  aero_data, env_state, k)
108  elseif (coag_kernel_type == coag_kernel_type_brown) then
109  call kernel_brown(aero_particle_1, aero_particle_2, &
110  aero_data, env_state, k)
111  elseif (coag_kernel_type == coag_kernel_type_zero) then
112  call kernel_zero(aero_particle_1, aero_particle_2, &
113  aero_data, env_state, k)
114  elseif (coag_kernel_type == coag_kernel_type_brown_free) then
115  call kernel_brown_free(aero_particle_1, aero_particle_2, &
116  aero_data, env_state, k)
117  elseif (coag_kernel_type == coag_kernel_type_brown_cont) then
118  call kernel_brown_cont(aero_particle_1, aero_particle_2, &
119  aero_data, env_state, k)
120  else
121  call die_msg(200724934, "Unknown kernel type: " &
122  // trim(integer_to_string(coag_kernel_type)))
123  end if
124 
125  end subroutine kernel
126 
127 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
128 
129  !> Compute the minimum and maximum coagulation kernel.
130  subroutine kernel_minmax(coag_kernel_type, v1, v2, aero_data, env_state, &
131  k_min, k_max)
132 
133  !> Coagulation kernel type.
134  integer, intent(in) :: coag_kernel_type
135  !> Volume of first particle (m^3).
136  real(kind=dp), intent(in) :: v1
137  !> Volume of second particle (m^3).
138  real(kind=dp), intent(in) :: v2
139  !> Aerosol data.
140  type(aero_data_t), intent(in) :: aero_data
141  !> Environment state.
142  type(env_state_t), intent(in) :: env_state
143  !> Minimum kernel value (m^3/s).
144  real(kind=dp), intent(out) :: k_min
145  !> Maximum kernel value (m^3/s).
146  real(kind=dp), intent(out) :: k_max
147 
148  if (coag_kernel_type == coag_kernel_type_sedi) then
149  call kernel_sedi_minmax(v1, v2, aero_data, env_state, k_min, k_max)
150  elseif (coag_kernel_type == coag_kernel_type_additive) then
151  call kernel_additive_minmax(v1, v2, aero_data, env_state, k_min, k_max)
152  elseif (coag_kernel_type == coag_kernel_type_constant) then
153  call kernel_constant_minmax(v1, v2, aero_data, env_state, k_min, k_max)
154  elseif (coag_kernel_type == coag_kernel_type_brown) then
155  call kernel_brown_minmax(v1, v2, aero_data, env_state, k_min, k_max)
156  elseif (coag_kernel_type == coag_kernel_type_zero) then
157  call kernel_zero_minmax(v1, v2, aero_data, env_state, k_min, k_max)
158  elseif (coag_kernel_type == coag_kernel_type_brown_free) then
159  call kernel_brown_free_minmax(v1, v2, aero_data, env_state, &
160  k_min, k_max)
161  elseif (coag_kernel_type == coag_kernel_type_brown_cont) then
162  call kernel_brown_cont_minmax(v1, v2, aero_data, env_state, &
163  k_min, k_max)
164  else
165  call die_msg(330498208, "Unknown kernel type: " &
166  // trim(integer_to_string(coag_kernel_type)))
167  end if
168 
169  end subroutine kernel_minmax
170 
171 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
172 
173  !> Compute the kernel value with the given number concentration
174  !> weighting.
175  subroutine num_conc_weighted_kernel(coag_kernel_type, aero_particle_1, &
176  aero_particle_2, i_class, j_class, ij_class, aero_data, &
177  aero_weight_array, env_state, k)
178 
179  !> Coagulation kernel type.
180  integer, intent(in) :: coag_kernel_type
181  !> First particle.
182  type(aero_particle_t), intent(in) :: aero_particle_1
183  !> Second particle.
184  type(aero_particle_t), intent(in) :: aero_particle_2
185  !> Weight class of first particle.
186  integer, intent(in) :: i_class
187  !> Weight class of second particle.
188  integer, intent(in) :: j_class
189  !> Weight class of combined particle.
190  integer, intent(in) :: ij_class
191  !> Aerosol data.
192  type(aero_data_t), intent(in) :: aero_data
193  !> Aerosol weight array.
194  type(aero_weight_array_t), intent(in) :: aero_weight_array
195  !> Environment state.
196  type(env_state_t), intent(in) :: env_state
197  !> Coagulation kernel.
198  real(kind=dp), intent(out) :: k
199 
200  real(kind=dp) :: unweighted_k, i_r, j_r
201 
202  call kernel(coag_kernel_type, aero_particle_1, aero_particle_2, &
203  aero_data, env_state, unweighted_k)
204  i_r = aero_particle_radius(aero_particle_1, aero_data)
205  j_r = aero_particle_radius(aero_particle_2, aero_data)
206  k = unweighted_k * coag_num_conc_factor(aero_weight_array, aero_data, &
207  i_r, j_r, i_class, j_class, ij_class)
208 
209  end subroutine num_conc_weighted_kernel
210 
211 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
212 
213  !> Computes an array of kernel values for each bin pair. k(i,j) is
214  !> the kernel value at the centers of bins i and j. This assumes the
215  !> kernel is only a function of the particle volumes.
216  subroutine bin_kernel(n_bin, bin_r, aero_data, coag_kernel_type, &
217  env_state, k)
218 
219  !> Number of bins.
220  integer, intent(in) :: n_bin
221  !> Radii of particles in bins (m).
222  real(kind=dp), intent(in) :: bin_r(n_bin)
223  !> Aerosol data.
224  type(aero_data_t), intent(in) :: aero_data
225  !> Coagulation kernel type.
226  integer, intent(in) :: coag_kernel_type
227  !> Environment state.
228  type(env_state_t), intent(in) :: env_state
229  !> Kernel values.
230  real(kind=dp), intent(out) :: k(n_bin,n_bin)
231 
232  integer :: i, j
233  type(aero_particle_t) :: aero_particle_1, aero_particle_2
234 
235  do i = 1,n_bin
236  do j = 1,n_bin
237  call aero_particle_zero(aero_particle_1, aero_data)
238  call aero_particle_zero(aero_particle_2, aero_data)
239  aero_particle_1%vol(1) = aero_data_rad2vol(aero_data, bin_r(i))
240  aero_particle_2%vol(1) = aero_data_rad2vol(aero_data, bin_r(j))
241  call kernel(coag_kernel_type, aero_particle_1, aero_particle_2, &
242  aero_data, env_state, k(i,j))
243  end do
244  end do
245 
246  end subroutine bin_kernel
247 
248 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
249 
250  !> Estimate an array of minimum and maximum kernel values. Given
251  !> particles v1 in bin b1 and v2 in bin b2, it is probably true that
252  !> <tt>k_min(b1,b2) <= kernel(v1,v2) <= k_max(b1,b2)</tt>.
253  subroutine est_k_minmax_binned_unweighted(bin_grid, coag_kernel_type, &
254  aero_data, env_state, k_min, k_max)
255 
256  !> Bin_grid.
257  type(bin_grid_t), intent(in) :: bin_grid
258  !> Coagulation kernel type.
259  integer, intent(in) :: coag_kernel_type
260  !> Aerosol data.
261  type(aero_data_t), intent(in) :: aero_data
262  !> Environment state.
263  type(env_state_t), intent(in) :: env_state
264  !> Minimum kernel vals.
265  real(kind=dp), intent(out) :: k_min(bin_grid_size(bin_grid), &
266  bin_grid_size(bin_grid))
267  !> Maximum kernel vals.
268  real(kind=dp), intent(out) :: k_max(bin_grid_size(bin_grid), &
269  bin_grid_size(bin_grid))
270 
271  integer i, j
272 
273  do i = 1,bin_grid_size(bin_grid)
274  do j = 1,bin_grid_size(bin_grid)
275  call est_k_minmax_for_bin_unweighted(bin_grid, coag_kernel_type, &
276  i, j, aero_data, env_state, k_min(i,j), k_max(i,j))
277  end do
278  end do
279 
280  end subroutine est_k_minmax_binned_unweighted
281 
282 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
283 
284  !> Samples within bins b1 and b2 to find the minimum and maximum
285  !> value of the kernel between particles from the two bins.
286  subroutine est_k_minmax_for_bin_unweighted(bin_grid, coag_kernel_type, &
287  b1, b2, aero_data, env_state, k_min, k_max)
288 
289  !> Bin_grid.
290  type(bin_grid_t), intent(in) :: bin_grid
291  !> Coagulation kernel type.
292  integer, intent(in) :: coag_kernel_type
293  !> First bin.
294  integer, intent(in) :: b1
295  !> Second bin.
296  integer, intent(in) :: b2
297  !> Aerosol data.
298  type(aero_data_t), intent(in) :: aero_data
299  !> Environment state.
300  type(env_state_t), intent(in) :: env_state
301  !> Minimum kernel value.
302  real(kind=dp), intent(out) :: k_min
303  !> Maximum kernel value.
304  real(kind=dp), intent(out) :: k_max
305 
306  !> Number of sample points per bin.
307  integer, parameter :: n_sample = 3
308  !> Over-estimation scale factor parameter.
309  real(kind=dp), parameter :: over_scale = 2d0
310 
311  real(kind=dp) :: v1, v2, v1_high, v1_low, v2_high, v2_low
312  real(kind=dp) :: new_k_min, new_k_max
313  integer :: i, j
314 
315  ! v1_low < bin_v(b1) < v1_high
316  v1_low = aero_data_rad2vol(aero_data, bin_grid%edges(b1))
317  v1_high = aero_data_rad2vol(aero_data, bin_grid%edges(b1 + 1))
318 
319  ! v2_low < bin_v(b2) < v2_high
320  v2_low = aero_data_rad2vol(aero_data, bin_grid%edges(b2))
321  v2_high = aero_data_rad2vol(aero_data, bin_grid%edges(b2 + 1))
322 
323  do i = 1,n_sample
324  do j = 1,n_sample
325  v1 = interp_linear_disc(v1_low, v1_high, n_sample, i)
326  v2 = interp_linear_disc(v2_low, v2_high, n_sample, j)
327  call kernel_minmax(coag_kernel_type, v1, v2, aero_data, &
328  env_state, new_k_min, new_k_max)
329  if ((i == 1) .and. (j == 1)) then
330  k_min = new_k_min
331  k_max = new_k_max
332  else
333  k_min = min(k_min, new_k_min)
334  k_max = max(k_max, new_k_max)
335  end if
336  end do
337  end do
338 
339  k_max = k_max * over_scale
340 
341  end subroutine est_k_minmax_for_bin_unweighted
342 
343 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
344 
345  !> Coagulation scale factor due to number concentrations.
346  real(kind=dp) function coag_num_conc_factor(aero_weight_array, aero_data, &
347  i_r, j_r, i_class, j_class, ij_class)
348 
349  !> Aerosol weight array.
350  type(aero_weight_array_t), intent(in) :: aero_weight_array
351  !> Aerosol data.
352  type(aero_data_t), intent(in) :: aero_data
353  !> Radius of first particle.
354  real(kind=dp), intent(in) :: i_r
355  !> Radius of second particle.
356  real(kind=dp), intent(in) :: j_r
357  !> Weight class of first particle.
358  integer, intent(in) :: i_class
359  !> Weight class of second particle.
360  integer, intent(in) :: j_class
361  !> Weight class of combined particle.
362  integer, intent(in) :: ij_class
363 
364  real(kind=dp) :: ij_r, i_nc, j_nc, ij_nc, nc_min
365 
366  ij_r = aero_data_vol2rad(aero_data, aero_data_rad2vol(aero_data, i_r) &
367  + aero_data_rad2vol(aero_data, j_r))
368  i_nc = aero_weight_array_num_conc_at_radius(aero_weight_array, i_class, &
369  i_r)
370  j_nc = aero_weight_array_num_conc_at_radius(aero_weight_array, j_class, &
371  j_r)
372  ij_nc = aero_weight_array_num_conc_at_radius(aero_weight_array, ij_class, &
373  ij_r)
374  nc_min = min(i_nc, j_nc, ij_nc)
375  coag_num_conc_factor = i_nc * j_nc / nc_min
376 
377  end function coag_num_conc_factor
378 
379 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
380 
381  !> Determine the weight class in which coagulated particles will be placed.
382  integer function coag_dest_class(aero_weight_array, aero_data, &
383  bin_grid, i_bin, j_bin, i_class, j_class)
384 
385  !> Aerosol weight array.
386  type(aero_weight_array_t), intent(in) :: aero_weight_array
387  !> Aerosol data.
388  type(aero_data_t), intent(in) :: aero_data
389  !> Bin grid.
390  type(bin_grid_t), intent(in) :: bin_grid
391  !> First bin number.
392  integer, intent(in) :: i_bin
393  !> Second bin number.
394  integer, intent(in) :: j_bin
395  !> Weight class of first particle.
396  integer, intent(in) :: i_class
397  !> Weight class of second particle.
398  integer, intent(in) :: j_class
399 
400  real(kind=dp) :: i_r, j_r, ij_r, ij_nc_i, ij_nc_j
401 
402  i_r = bin_grid%centers(i_bin)
403  j_r = bin_grid%centers(i_bin)
404  ij_r = aero_data_vol2rad(aero_data, aero_data_rad2vol(aero_data, i_r) &
405  + aero_data_rad2vol(aero_data, j_r))
406  ij_nc_i = aero_weight_array_num_conc_at_radius(aero_weight_array, &
407  i_class, ij_r)
408  ij_nc_j = aero_weight_array_num_conc_at_radius(aero_weight_array, &
409  j_class, ij_r)
410  if (ij_nc_i < ij_nc_j) then
411  coag_dest_class = i_class
412  else
413  coag_dest_class = j_class
414  end if
415 
416  end function coag_dest_class
417 
418 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
419 
420  !> Determine the minimum and maximum number concentration factors
421  !> for coagulation.
422  subroutine max_coag_num_conc_factor(aero_weight_array, aero_data, &
423  bin_grid, i_bin, j_bin, i_class, j_class, ij_class, f_max)
424 
425  !> Aerosol weight array.
426  type(aero_weight_array_t), intent(in) :: aero_weight_array
427  !> Aerosol data.
428  type(aero_data_t), intent(in) :: aero_data
429  !> Bin grid.
430  type(bin_grid_t), intent(in) :: bin_grid
431  !> First bin number.
432  integer, intent(in) :: i_bin
433  !> Second bin number.
434  integer, intent(in) :: j_bin
435  !> Weight class of first particle.
436  integer, intent(in) :: i_class
437  !> Weight class of second particle.
438  integer, intent(in) :: j_class
439  !> Weight class of coagulated particle.
440  integer, intent(in) :: ij_class
441  !> Maximum coagulation factor.
442  real(kind=dp), intent(out) :: f_max
443 
444  integer, parameter :: n_sample = 5
445 
446  real(kind=dp) :: i_r_min, i_r_max, j_r_min, j_r_max, i_r, j_r, f
447  integer :: i_sample, j_sample
448 
449  i_r_min = bin_grid%edges(i_bin)
450  i_r_max = bin_grid%edges(i_bin + 1)
451  j_r_min = bin_grid%edges(j_bin)
452  j_r_max = bin_grid%edges(j_bin + 1)
453 
454  f_max = 0d0
455  do i_sample = 1,n_sample
456  do j_sample = 1,n_sample
457  i_r = interp_linear_disc(i_r_min, i_r_max, n_sample, i_sample)
458  j_r = interp_linear_disc(j_r_min, j_r_max, n_sample, j_sample)
459  f = coag_num_conc_factor(aero_weight_array, aero_data, i_r, j_r, &
460  i_class, j_class, ij_class)
461  f_max = max(f_max, f)
462  end do
463  end do
464 
465  end subroutine max_coag_num_conc_factor
466 
467 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
468 
469  !> Read the specification for a kernel type from a spec file and
470  !> generate it.
471  subroutine spec_file_read_coag_kernel_type(file, coag_kernel_type)
472 
473  !> Spec file.
474  type(spec_file_t), intent(inout) :: file
475  !> Kernel type.
476  integer, intent(out) :: coag_kernel_type
477 
478  character(len=SPEC_LINE_MAX_VAR_LEN) :: kernel_name
479 
480  !> \page input_format_coag_kernel Input File Format: Coagulation Kernel
481  !!
482  !! The coagulation kernel is specified by the parameter:
483  !! - \b coag_kernel (string): the type of coagulation kernel ---
484  !! must be one of: \c sedi for the gravitational sedimentation
485  !! kernel; \c additive for the additive kernel; \c constant
486  !! for the constant kernel; \c brown for the Brownian kernel,
487  !! or \c zero for no coagulation
488  !!
489  !! See also:
490  !! - \ref spec_file_format --- the input file text format
491 
492  call spec_file_read_string(file, 'coag_kernel', kernel_name)
493  if (trim(kernel_name) == 'sedi') then
494  coag_kernel_type = coag_kernel_type_sedi
495  elseif (trim(kernel_name) == 'additive') then
496  coag_kernel_type = coag_kernel_type_additive
497  elseif (trim(kernel_name) == 'constant') then
498  coag_kernel_type = coag_kernel_type_constant
499  elseif (trim(kernel_name) == 'brown') then
500  coag_kernel_type = coag_kernel_type_brown
501  elseif (trim(kernel_name) == 'zero') then
502  coag_kernel_type = coag_kernel_type_zero
503  elseif (trim(kernel_name) == 'brown_free') then
504  coag_kernel_type = coag_kernel_type_brown_free
505  elseif (trim(kernel_name) == 'brown_cont') then
506  coag_kernel_type = coag_kernel_type_brown_cont
507  else
508  call spec_file_die_msg(920761229, file, &
509  "Unknown coagulation kernel type: " // trim(kernel_name))
510  end if
511 
512  end subroutine spec_file_read_coag_kernel_type
513 
514 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
515 
516 end module pmc_coag_kernel
pmc_aero_particle::aero_particle_t
Single aerosol particle data structure.
Definition: aero_particle.F90:26
pmc_coag_kernel::coag_kernel_type_brown_cont
integer, parameter coag_kernel_type_brown_cont
Type code for a Brownian kernel in continuum regime from Vemury and Pratsinis [1995].
Definition: coag_kernel.F90:45
pmc_aero_weight
The aero_weight_t structure and associated subroutines.
Definition: aero_weight.F90:9
pmc_coag_kernel_additive
Additive coagulation kernel.
Definition: coag_kernel_additive.F90:9
pmc_coag_kernel_zero::kernel_zero_minmax
subroutine kernel_zero_minmax(v1, v2, aero_data, env_state, k_min, k_max)
Minimum and maximum of the zero coagulation kernel.
Definition: coag_kernel_zero.F90:51
pmc_aero_particle
The aero_particle_t structure and associated subroutines.
Definition: aero_particle.F90:9
pmc_coag_kernel_brown::kernel_brown_minmax
subroutine kernel_brown_minmax(v1, v2, aero_data, env_state, k_min, k_max)
Compute the minimum and maximum Brownian coagulation kernel.
Definition: coag_kernel_brown.F90:59
pmc_coag_kernel_constant
Constant coagulation kernel.
Definition: coag_kernel_constant.F90:9
pmc_coag_kernel_additive::kernel_additive
subroutine kernel_additive(aero_particle_1, aero_particle_2, aero_data, env_state, k)
Additive coagulation kernel.
Definition: coag_kernel_additive.F90:32
pmc_util::die_msg
subroutine die_msg(code, error_msg)
Error immediately.
Definition: util.F90:134
pmc_coag_kernel::coag_kernel_type_len
integer, parameter coag_kernel_type_len
Maximum length of a mode type.
Definition: coag_kernel.F90:26
pmc_constants::dp
integer, parameter dp
Kind of a double precision real number.
Definition: constants.F90:12
pmc_coag_kernel
Generic coagulation kernel.
Definition: coag_kernel.F90:9
pmc_aero_weight_array
The aero_weight_array_t structure and associated subroutines.
Definition: aero_weight_array.F90:10
pmc_bin_grid::bin_grid_size
elemental integer function bin_grid_size(bin_grid)
Return the number of bins in the grid, or -1 if the bin grid is not allocated.
Definition: bin_grid.F90:51
pmc_env_state::env_state_t
Current environment state.
Definition: env_state.F90:29
pmc_coag_kernel_constant::kernel_constant_minmax
subroutine kernel_constant_minmax(v1, v2, aero_data, env_state, k_min, k_max)
Minimum and maximum values of the constant coagulation kernel.
Definition: coag_kernel_constant.F90:51
pmc_aero_weight_array::aero_weight_array_t
An array of aerosol size distribution weighting functions.
Definition: aero_weight_array.F90:35
pmc_util::interp_linear_disc
real(kind=dp) function interp_linear_disc(x_1, x_n, n, i)
Linear interpolation over discrete indices.
Definition: util.F90:663
pmc_coag_kernel::coag_kernel_type_additive
integer, parameter coag_kernel_type_additive
Type code for an additive kernel.
Definition: coag_kernel.F90:33
pmc_spec_file::spec_file_t
An input file with extra data for printing messages.
Definition: spec_file.F90:59
pmc_coag_kernel::kernel
subroutine kernel(coag_kernel_type, aero_particle_1, aero_particle_2, aero_data, env_state, k)
Evalulate a coagulation kernel function.
Definition: coag_kernel.F90:85
pmc_aero_weight_array::aero_weight_array_num_conc_at_radius
real(kind=dp) function aero_weight_array_num_conc_at_radius(aero_weight_array, i_class, radius)
Compute the total number concentration at a given radius (m^3).
Definition: aero_weight_array.F90:234
pmc_util::integer_to_string
character(len=pmc_util_convert_string_len) function integer_to_string(val)
Convert an integer to a string format.
Definition: util.F90:766
pmc_coag_kernel::coag_kernel_type_brown
integer, parameter coag_kernel_type_brown
Type code for a Brownian kernel.
Definition: coag_kernel.F90:37
pmc_coag_kernel::bin_kernel
subroutine bin_kernel(n_bin, bin_r, aero_data, coag_kernel_type, env_state, k)
Computes an array of kernel values for each bin pair. k(i,j) is the kernel value at the centers of bi...
Definition: coag_kernel.F90:218
pmc_coag_kernel::coag_kernel_type_constant
integer, parameter coag_kernel_type_constant
Type code for a constant kernel.
Definition: coag_kernel.F90:35
pmc_coag_kernel::est_k_minmax_for_bin_unweighted
subroutine est_k_minmax_for_bin_unweighted(bin_grid, coag_kernel_type, b1, b2, aero_data, env_state, k_min, k_max)
Samples within bins b1 and b2 to find the minimum and maximum value of the kernel between particles f...
Definition: coag_kernel.F90:288
pmc_coag_kernel_zero
Constant kernel equal to zero.
Definition: coag_kernel_zero.F90:13
pmc_coag_kernel_brown_free::kernel_brown_free
subroutine kernel_brown_free(aero_particle_1, aero_particle_2, aero_data, env_state, k)
Compute the Brownian coagulation kernel in free molecular regime.
Definition: coag_kernel_brown_free.F90:33
pmc_coag_kernel::coag_kernel_type_brown_free
integer, parameter coag_kernel_type_brown_free
Type code for a Brownian kernel in free molecular regime from Vemury and Pratsinis [1995].
Definition: coag_kernel.F90:42
pmc_coag_kernel_brown_free
Brownian coagulation kernel in free molecular regime based on Vemury and Pratsinis [1995].
Definition: coag_kernel_brown_free.F90:16
pmc_coag_kernel_brown_cont::kernel_brown_cont_minmax
subroutine kernel_brown_cont_minmax(v1, v2, aero_data, env_state, k_min, k_max)
Compute the minimum and maximum Brownian coagulation kernel in continuum regime based on Vemury and P...
Definition: coag_kernel_brown_cont.F90:66
pmc_coag_kernel_brown
Brownian coagulation kernel.
Definition: coag_kernel_brown.F90:10
pmc_coag_kernel_constant::kernel_constant
subroutine kernel_constant(aero_particle_1, aero_particle_2, aero_data, env_state, k)
Constant coagulation kernel.
Definition: coag_kernel_constant.F90:31
pmc_coag_kernel::kernel_minmax
subroutine kernel_minmax(coag_kernel_type, v1, v2, aero_data, env_state, k_min, k_max)
Compute the minimum and maximum coagulation kernel.
Definition: coag_kernel.F90:132
pmc_aero_particle::aero_particle_zero
subroutine aero_particle_zero(aero_particle, aero_data)
Resets an aero_particle to be zero.
Definition: aero_particle.F90:98
pmc_coag_kernel::est_k_minmax_binned_unweighted
subroutine est_k_minmax_binned_unweighted(bin_grid, coag_kernel_type, aero_data, env_state, k_min, k_max)
Estimate an array of minimum and maximum kernel values. Given particles v1 in bin b1 and v2 in bin b2...
Definition: coag_kernel.F90:255
pmc_env_state
The env_state_t structure and associated subroutines.
Definition: env_state.F90:9
pmc_aero_data::aero_data_vol2rad
real(kind=dp) elemental function aero_data_vol2rad(aero_data, v)
Convert mass-equivalent volume (m^3) to geometric radius (m).
Definition: aero_data.F90:92
pmc_coag_kernel_sedi
Gravitational sedimentation coagulation kernel.
Definition: coag_kernel_sedi.F90:17
pmc_coag_kernel::coag_kernel_type_sedi
integer, parameter coag_kernel_type_sedi
Type code for a sedimentation kernel.
Definition: coag_kernel.F90:31
pmc_aero_data::aero_data_t
Aerosol material properties and associated data.
Definition: aero_data.F90:49
pmc_coag_kernel::coag_kernel_type_invalid
integer, parameter coag_kernel_type_invalid
Type code for an undefined or invalid kernel.
Definition: coag_kernel.F90:29
pmc_spec_file::spec_file_die_msg
subroutine spec_file_die_msg(code, file, msg)
Exit with an error message containing filename and line number.
Definition: spec_file.F90:74
pmc_coag_kernel::coag_num_conc_factor
real(kind=dp) function coag_num_conc_factor(aero_weight_array, aero_data, i_r, j_r, i_class, j_class, ij_class)
Coagulation scale factor due to number concentrations.
Definition: coag_kernel.F90:348
pmc_coag_kernel_brown_cont
Brownian coagulation kernel in continuum regime based on Vemury and Pratsinis [1995].
Definition: coag_kernel_brown_cont.F90:16
pmc_coag_kernel_brown::kernel_brown
subroutine kernel_brown(aero_particle_1, aero_particle_2, aero_data, env_state, k)
Compute the Brownian coagulation kernel.
Definition: coag_kernel_brown.F90:28
pmc_coag_kernel::coag_kernel_type_to_string
character(len=coag_kernel_type_len) function coag_kernel_type_to_string(coag_kernel_type)
Return a string representation of a kernel type.
Definition: coag_kernel.F90:54
pmc_aero_particle::aero_particle_radius
elemental real(kind=dp) function aero_particle_radius(aero_particle, aero_data)
Total radius of the particle (m).
Definition: aero_particle.F90:339
pmc_spec_file::spec_file_read_string
subroutine spec_file_read_string(file, name, var)
Read a string from a spec file that must have a given name.
Definition: spec_file.F90:605
pmc_coag_kernel::coag_dest_class
integer function coag_dest_class(aero_weight_array, aero_data, bin_grid, i_bin, j_bin, i_class, j_class)
Determine the weight class in which coagulated particles will be placed.
Definition: coag_kernel.F90:384
pmc_coag_kernel_sedi::kernel_sedi
subroutine kernel_sedi(aero_particle_1, aero_particle_2, aero_data, env_state, k)
Sedimentation coagulation kernel.
Definition: coag_kernel_sedi.F90:31
pmc_bin_grid
The bin_grid_t structure and associated subroutines.
Definition: bin_grid.F90:9
pmc_aero_data::aero_data_rad2vol
real(kind=dp) elemental function aero_data_rad2vol(aero_data, r)
Convert geometric radius (m) to mass-equivalent volume (m^3).
Definition: aero_data.F90:122
pmc_aero_data
The aero_data_t structure and associated subroutines.
Definition: aero_data.F90:9
pmc_coag_kernel::coag_kernel_type_zero
integer, parameter coag_kernel_type_zero
Type code for a zero kernel.
Definition: coag_kernel.F90:39
pmc_coag_kernel_brown_free::kernel_brown_free_minmax
subroutine kernel_brown_free_minmax(v1, v2, aero_data, env_state, k_min, k_max)
Compute the minimum and maximum Brownian coagulation kernel in free molecular regime based on Vemury ...
Definition: coag_kernel_brown_free.F90:66
pmc_coag_kernel::max_coag_num_conc_factor
subroutine max_coag_num_conc_factor(aero_weight_array, aero_data, bin_grid, i_bin, j_bin, i_class, j_class, ij_class, f_max)
Determine the minimum and maximum number concentration factors for coagulation.
Definition: coag_kernel.F90:424
pmc_bin_grid::bin_grid_t
1D grid, either logarithmic or linear.
Definition: bin_grid.F90:33
pmc_coag_kernel::num_conc_weighted_kernel
subroutine num_conc_weighted_kernel(coag_kernel_type, aero_particle_1, aero_particle_2, i_class, j_class, ij_class, aero_data, aero_weight_array, env_state, k)
Compute the kernel value with the given number concentration weighting.
Definition: coag_kernel.F90:178
pmc_coag_kernel_zero::kernel_zero
subroutine kernel_zero(aero_particle_1, aero_particle_2, aero_data, env_state, k)
Zero coagulation kernel.
Definition: coag_kernel_zero.F90:31
pmc_coag_kernel_brown_cont::kernel_brown_cont
subroutine kernel_brown_cont(aero_particle_1, aero_particle_2, aero_data, env_state, k)
Compute the Brownian coagulation kernel in continuum regime.
Definition: coag_kernel_brown_cont.F90:33
pmc_coag_kernel_sedi::kernel_sedi_minmax
subroutine kernel_sedi_minmax(v1, v2, aero_data, env_state, k_min, k_max)
Minimum and maximum values of the sedimentation coagulation.
Definition: coag_kernel_sedi.F90:53
pmc_coag_kernel_additive::kernel_additive_minmax
subroutine kernel_additive_minmax(v1, v2, aero_data, env_state, k_min, k_max)
Minimum and maximum values of the additive kernel.
Definition: coag_kernel_additive.F90:53