PartMC  2.6.1
Data Types | Functions/Subroutines
pmc_aero_weight_array Module Reference

The aero_weight_array_t structure and associated subroutines. More...

Data Types

type  aero_weight_array_t
 An array of aerosol size distribution weighting functions. More...
 

Functions/Subroutines

subroutine aero_weight_array_set_sizes (aero_weight_array, n_group, n_class)
 Sets the number of weight groups and classes. More...
 
subroutine aero_weight_array_set_flat (aero_weight_array, n_class)
 Allocates an aero_weight_array as flat weightings. More...
 
subroutine aero_weight_array_set_power (aero_weight_array, n_class, exponent)
 Allocates an aero_weight_array as power weightings. More...
 
subroutine aero_weight_array_set_nummass (aero_weight_array, n_class)
 Allocates an aero_weight_array as joint flat/power-3 weightings.. More...
 
elemental subroutine aero_weight_array_normalize (aero_weight_array)
 Normalizes the aero_weight_array to a non-zero value. More...
 
integer function aero_weight_array_n_group (aero_weight_array)
 Return the number of weight groups. More...
 
integer function aero_weight_array_n_class (aero_weight_array)
 Return the number of weight classes. More...
 
subroutine aero_weight_array_scale (aero_weight_array, factor)
 Scale the weights by the given factor, so new_weight = old_weight * factor. More...
 
subroutine aero_weight_array_combine (aero_weight_array, aero_weight_array_delta)
 Combine aero_weight_array_delta into aero_weight_array with a harmonic mean. More...
 
subroutine aero_weight_array_shift (aero_weight_array_from, aero_weight_array_to, sample_prop, overwrite_to)
 Adjust source and destination weights to reflect moving sample_prop proportion of particles from aero_weight_array_from to aero_weight_array_to. More...
 
real(kind=dp) function aero_weight_array_single_num_conc (aero_weight_array, aero_particle, aero_data)
 Compute the number concentration for a particle (m^{-3}). More...
 
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). More...
 
real(kind=dp) function aero_weight_array_num_conc (aero_weight_array, aero_particle, aero_data)
 Compute the number concentration for a particle (m^{-3}). More...
 
logical function aero_weight_array_check_flat (aero_weight_array)
 Check whether a given aero_weight array is flat in total. More...
 
subroutine aero_weight_array_check_monotonicity (aero_weight_array, monotone_increasing, monotone_decreasing)
 Determine whether all weight functions in an array are monotone increasing, monotone decreasing, or neither. More...
 
subroutine aero_weight_array_minmax_num_conc (aero_weight_array, i_class, radius_1, radius_2, num_conc_min, num_conc_max)
 Compute the maximum and minimum number concentrations between the given radii. More...
 
integer function aero_weight_array_rand_group (aero_weight_array, i_class, radius)
 Choose a random group at the given radius, with probability inversely proportional to group weight at that radius. More...
 
subroutine spec_file_read_aero_weight_array (file, aero_weight_array)
 Read an aero_weight_array from a spec file. More...
 
integer function pmc_mpi_pack_size_aero_weight_array (val)
 Determines the number of bytes required to pack the given value. More...
 
subroutine pmc_mpi_pack_aero_weight_array (buffer, position, val)
 Packs the given value into the buffer, advancing position. More...
 
subroutine pmc_mpi_unpack_aero_weight_array (buffer, position, val)
 Unpacks the given value from the buffer, advancing position. More...
 
subroutine aero_weight_netcdf_dim_aero_weight_group (aero_weight_array, ncid, dimid_aero_weight_group)
 Write the aero_weight_group dimension to the given NetCDF file if it is not already present and in any case return the associated dimid. More...
 
subroutine aero_weight_netcdf_dim_aero_weight_class (aero_weight_array, ncid, dimid_aero_weight_class)
 Write the aero_weight_class dimension to the given NetCDF file if it is not already present and in any case return the associated dimid. More...
 
subroutine aero_weight_array_input_netcdf (aero_weight_array, ncid)
 Read full aero_weight_array. More...
 

Detailed Description

The aero_weight_array_t structure and associated subroutines.

Function/Subroutine Documentation

◆ aero_weight_array_check_flat()

logical function pmc_aero_weight_array::aero_weight_array_check_flat ( type(aero_weight_array_t), intent(in)  aero_weight_array)

Check whether a given aero_weight array is flat in total.

Parameters
[in]aero_weight_arrayAerosol weight array.

Definition at line 276 of file aero_weight_array.F90.

◆ aero_weight_array_check_monotonicity()

subroutine pmc_aero_weight_array::aero_weight_array_check_monotonicity ( type(aero_weight_array_t), intent(in)  aero_weight_array,
logical, intent(out)  monotone_increasing,
logical, intent(out)  monotone_decreasing 
)

Determine whether all weight functions in an array are monotone increasing, monotone decreasing, or neither.

Parameters
[in]aero_weight_arrayAerosol weight array.
[out]monotone_increasingWhether all weights are monotone increasing.
[out]monotone_decreasingWhether all weights are monotone decreasing.

Definition at line 304 of file aero_weight_array.F90.

◆ aero_weight_array_combine()

subroutine pmc_aero_weight_array::aero_weight_array_combine ( type(aero_weight_array_t), intent(inout)  aero_weight_array,
type(aero_weight_array_t), intent(in)  aero_weight_array_delta 
)

Combine aero_weight_array_delta into aero_weight_array with a harmonic mean.

Parameters
[in,out]aero_weight_arrayAerosol weight array to combine into.
[in]aero_weight_array_deltaAerosol weight array to combine from.

Definition at line 175 of file aero_weight_array.F90.

◆ aero_weight_array_input_netcdf()

subroutine pmc_aero_weight_array::aero_weight_array_input_netcdf ( type(aero_weight_array_t), intent(inout)  aero_weight_array,
integer, intent(in)  ncid 
)

Read full aero_weight_array.

Parameters
[in,out]aero_weight_arrayAero weight array to read.
[in]ncidNetCDF file ID, in data mode.

Definition at line 670 of file aero_weight_array.F90.

◆ aero_weight_array_minmax_num_conc()

subroutine pmc_aero_weight_array::aero_weight_array_minmax_num_conc ( type(aero_weight_array_t), intent(in)  aero_weight_array,
integer, intent(in)  i_class,
real(kind=dp), intent(in)  radius_1,
real(kind=dp), intent(in)  radius_2,
real(kind=dp), intent(out)  num_conc_min,
real(kind=dp), intent(out)  num_conc_max 
)

Compute the maximum and minimum number concentrations between the given radii.

Parameters
[in]aero_weight_arrayAerosol weight array.
[in]i_classWeight class.
[in]radius_1First radius.
[in]radius_2Second radius.
[out]num_conc_minMinimum number concentration.
[out]num_conc_maxMaximum number concentration.

Definition at line 338 of file aero_weight_array.F90.

◆ aero_weight_array_n_class()

integer function pmc_aero_weight_array::aero_weight_array_n_class ( type(aero_weight_array_t), intent(in)  aero_weight_array)

Return the number of weight classes.

Parameters
[in]aero_weight_arrayAerosol weight array.

Definition at line 147 of file aero_weight_array.F90.

◆ aero_weight_array_n_group()

integer function pmc_aero_weight_array::aero_weight_array_n_group ( type(aero_weight_array_t), intent(in)  aero_weight_array)

Return the number of weight groups.

Parameters
[in]aero_weight_arrayAerosol weight array.

Definition at line 135 of file aero_weight_array.F90.

◆ aero_weight_array_normalize()

elemental subroutine pmc_aero_weight_array::aero_weight_array_normalize ( type(aero_weight_array_t), intent(inout)  aero_weight_array)

Normalizes the aero_weight_array to a non-zero value.

Parameters
[in,out]aero_weight_arrayAerosol weight array.

Definition at line 123 of file aero_weight_array.F90.

◆ aero_weight_array_num_conc()

real(kind=dp) function pmc_aero_weight_array::aero_weight_array_num_conc ( type(aero_weight_array_t), intent(in)  aero_weight_array,
type(aero_particle_t), intent(in)  aero_particle,
type(aero_data_t), intent(in)  aero_data 
)

Compute the number concentration for a particle (m^{-3}).

Parameters
[in]aero_weight_arrayAerosol weight array.
[in]aero_particleAerosol particle to compute number concentration for.
[in]aero_dataAerosol data.

Definition at line 257 of file aero_weight_array.F90.

◆ aero_weight_array_num_conc_at_radius()

real(kind=dp) function pmc_aero_weight_array::aero_weight_array_num_conc_at_radius ( type(aero_weight_array_t), intent(in)  aero_weight_array,
integer, intent(in)  i_class,
real(kind=dp), intent(in)  radius 
)

Compute the total number concentration at a given radius (m^3).

Parameters
[in]aero_weight_arrayAerosol weight array.
[in]i_classWeight class number.
[in]radiusRadius to compute number concentration at (m).

Definition at line 232 of file aero_weight_array.F90.

◆ aero_weight_array_rand_group()

integer function pmc_aero_weight_array::aero_weight_array_rand_group ( type(aero_weight_array_t), intent(in)  aero_weight_array,
integer, intent(in)  i_class,
real(kind=dp), intent(in)  radius 
)

Choose a random group at the given radius, with probability inversely proportional to group weight at that radius.

Parameters
[in]aero_weight_arrayAerosol weight array.
[in]i_classWeight class to select from.
[in]radiusRadius to sample group at (m).

Definition at line 374 of file aero_weight_array.F90.

◆ aero_weight_array_scale()

subroutine pmc_aero_weight_array::aero_weight_array_scale ( type(aero_weight_array_t), intent(inout)  aero_weight_array,
real(kind=dp), intent(in)  factor 
)

Scale the weights by the given factor, so new_weight = old_weight * factor.

Parameters
[in,out]aero_weight_arrayAerosol weight array to scale.
[in]factorFactor to scale by.

Definition at line 160 of file aero_weight_array.F90.

◆ aero_weight_array_set_flat()

subroutine pmc_aero_weight_array::aero_weight_array_set_flat ( type(aero_weight_array_t), intent(out)  aero_weight_array,
integer, intent(in)  n_class 
)

Allocates an aero_weight_array as flat weightings.

Parameters
[out]aero_weight_arrayAerosol weight array.
[in]n_classNumber of weight classes.

Definition at line 66 of file aero_weight_array.F90.

◆ aero_weight_array_set_nummass()

subroutine pmc_aero_weight_array::aero_weight_array_set_nummass ( type(aero_weight_array_t), intent(out)  aero_weight_array,
integer, intent(in)  n_class 
)

Allocates an aero_weight_array as joint flat/power-3 weightings..

Parameters
[out]aero_weight_arrayAerosol weight array.
[in]n_classNumber of weight classes.

Definition at line 103 of file aero_weight_array.F90.

◆ aero_weight_array_set_power()

subroutine pmc_aero_weight_array::aero_weight_array_set_power ( type(aero_weight_array_t), intent(out)  aero_weight_array,
integer, intent(in)  n_class,
real(kind=dp), intent(in)  exponent 
)

Allocates an aero_weight_array as power weightings.

Parameters
[out]aero_weight_arrayAerosol weight array.
[in]n_classNumber of weight classes.
[in]exponentExponent for power-law.

Definition at line 83 of file aero_weight_array.F90.

◆ aero_weight_array_set_sizes()

subroutine pmc_aero_weight_array::aero_weight_array_set_sizes ( type(aero_weight_array_t), intent(inout)  aero_weight_array,
integer, intent(in)  n_group,
integer, intent(in)  n_class 
)

Sets the number of weight groups and classes.

Parameters
[in,out]aero_weight_arrayAerosol weight array.
[in]n_groupNumber of weight groups.
[in]n_classNumber of weight classes.

Definition at line 46 of file aero_weight_array.F90.

◆ aero_weight_array_shift()

subroutine pmc_aero_weight_array::aero_weight_array_shift ( type(aero_weight_array_t), intent(inout)  aero_weight_array_from,
type(aero_weight_array_t), intent(inout)  aero_weight_array_to,
real(kind=dp), intent(in)  sample_prop,
logical, intent(in), optional  overwrite_to 
)

Adjust source and destination weights to reflect moving sample_prop proportion of particles from aero_weight_array_from to aero_weight_array_to.

Parameters
[in,out]aero_weight_array_fromAerosol weight array to shift from.
[in,out]aero_weight_array_toAerosol weight array to shift to.
[in]sample_propProportion of particles being transfered.
[in]overwrite_toWhether to overwrite the destination weight (default: no).

Definition at line 193 of file aero_weight_array.F90.

◆ aero_weight_array_single_num_conc()

real(kind=dp) function pmc_aero_weight_array::aero_weight_array_single_num_conc ( type(aero_weight_array_t), intent(in)  aero_weight_array,
type(aero_particle_t), intent(in)  aero_particle,
type(aero_data_t), intent(in)  aero_data 
)

Compute the number concentration for a particle (m^{-3}).

Parameters
[in]aero_weight_arrayAerosol weight array.
[in]aero_particleAerosol particle to compute number concentration for.
[in]aero_dataAerosol data.

Definition at line 213 of file aero_weight_array.F90.

◆ aero_weight_netcdf_dim_aero_weight_class()

subroutine pmc_aero_weight_array::aero_weight_netcdf_dim_aero_weight_class ( type(aero_weight_array_t), intent(in)  aero_weight_array,
integer, intent(in)  ncid,
integer, intent(out)  dimid_aero_weight_class 
)

Write the aero_weight_class dimension to the given NetCDF file if it is not already present and in any case return the associated dimid.

Parameters
[in]aero_weight_arrayAero_weight structure array.
[in]ncidNetCDF file ID, in data mode.
[out]dimid_aero_weight_classDimid of the species dimension.

Definition at line 570 of file aero_weight_array.F90.

◆ aero_weight_netcdf_dim_aero_weight_group()

subroutine pmc_aero_weight_array::aero_weight_netcdf_dim_aero_weight_group ( type(aero_weight_array_t), intent(in)  aero_weight_array,
integer, intent(in)  ncid,
integer, intent(out)  dimid_aero_weight_group 
)

Write the aero_weight_group dimension to the given NetCDF file if it is not already present and in any case return the associated dimid.

Parameters
[in]aero_weight_arrayAero_weight structure array.
[in]ncidNetCDF file ID, in data mode.
[out]dimid_aero_weight_groupDimid of the species dimension.

Definition at line 524 of file aero_weight_array.F90.

◆ pmc_mpi_pack_aero_weight_array()

subroutine pmc_aero_weight_array::pmc_mpi_pack_aero_weight_array ( character, dimension(:), intent(inout)  buffer,
integer, intent(inout)  position,
type(aero_weight_array_t), intent(in)  val 
)

Packs the given value into the buffer, advancing position.

Parameters
[in,out]bufferMemory buffer.
[in,out]positionCurrent buffer position.
[in]valValue to pack.

Definition at line 448 of file aero_weight_array.F90.

◆ pmc_mpi_pack_size_aero_weight_array()

integer function pmc_aero_weight_array::pmc_mpi_pack_size_aero_weight_array ( type(aero_weight_array_t), intent(in)  val)

Determines the number of bytes required to pack the given value.

Parameters
[in]valValue to pack.

Definition at line 419 of file aero_weight_array.F90.

◆ pmc_mpi_unpack_aero_weight_array()

subroutine pmc_aero_weight_array::pmc_mpi_unpack_aero_weight_array ( character, dimension(:), intent(inout)  buffer,
integer, intent(inout)  position,
type(aero_weight_array_t), intent(inout)  val 
)

Unpacks the given value from the buffer, advancing position.

Parameters
[in,out]bufferMemory buffer.
[in,out]positionCurrent buffer position.
[in,out]valValue to pack.

Definition at line 483 of file aero_weight_array.F90.

◆ spec_file_read_aero_weight_array()

subroutine pmc_aero_weight_array::spec_file_read_aero_weight_array ( type(spec_file_t), intent(inout)  file,
type(aero_weight_array_t), intent(inout)  aero_weight_array 
)

Read an aero_weight_array from a spec file.

Parameters
[in,out]fileSpec file.
[in,out]aero_weight_arrayAerosol weight array.

Definition at line 398 of file aero_weight_array.F90.