PartMC
2.2.0
|
The bin_grid_t structure and associated subroutines. More...
Data Types | |
type | bin_grid_t |
1D grid of size bins. More... | |
Public Member Functions | |
subroutine | bin_grid_allocate (bin_grid) |
Allocates a bin_grid. | |
subroutine | bin_grid_allocate_size (bin_grid, n_bin) |
Allocates a bin_grid of the given size. | |
subroutine | bin_grid_deallocate (bin_grid) |
Frees all memory. | |
subroutine | bin_grid_copy (bin_grid_from, bin_grid_to) |
Copies a bin grid. | |
real(kind=dp) function | bin_grid_bin_size (bin_grid, i_bin) |
Returns the size of a bin in a grid. | |
subroutine | vol_to_lnr (r, f_vol, f_lnr) |
Convert a concentration f(vol)d(vol) to f(ln(r))d(ln(r)) where vol = 4/3 pi r^3. | |
subroutine | bin_grid_make (bin_grid, n_bin, r_min, r_max) |
Generates the bin grid given the range and number of bins. | |
integer function | bin_grid_particle_in_bin (bin_grid, radius) |
Find the bin number that contains a given particle. | |
subroutine | bin_grid_histogram_1d (x_bin_grid, x_data, weight_data, hist) |
Make a histogram with of the given weighted data, scaled by the bin sizes. | |
subroutine | spec_file_read_bin_grid (file, bin_grid) |
Read the specification for a bin_grid from a spec file and generate it. | |
integer function | pmc_mpi_pack_size_bin_grid (val) |
Determines the number of bytes required to pack the given value. | |
subroutine | pmc_mpi_pack_bin_grid (buffer, position, val) |
Packs the given value into the buffer, advancing position. | |
subroutine | pmc_mpi_unpack_bin_grid (buffer, position, val) |
Unpacks the given value from the buffer, advancing position. | |
logical function | pmc_mpi_allequal_bin_grid (val) |
Check whether all processors have the same value. | |
subroutine | bin_grid_netcdf_dim_aero_diam (bin_grid, ncid, dimid_aero_diam) |
Write the aero_diam dimension to the given NetCDF file if it is not already present and in any case return the associated dimid. | |
subroutine | bin_grid_output_netcdf (bin_grid, ncid) |
Write full state. | |
subroutine | bin_grid_input_netcdf (bin_grid, ncid) |
Read full state. |
The bin_grid_t structure and associated subroutines.
Definition at line 9 of file bin_grid.F90.
subroutine pmc_bin_grid::bin_grid_allocate | ( | type(bin_grid_t), intent(out) | bin_grid | ) |
Allocates a bin_grid.
[out] | bin_grid | Bin grid. |
Definition at line 43 of file bin_grid.F90.
subroutine pmc_bin_grid::bin_grid_allocate_size | ( | type(bin_grid_t), intent(out) | bin_grid, |
integer, intent(in) | n_bin | ||
) |
Allocates a bin_grid of the given size.
[out] | bin_grid | Bin grid. |
[in] | n_bin | Number of bins. |
Definition at line 57 of file bin_grid.F90.
real(kind=dp) function pmc_bin_grid::bin_grid_bin_size | ( | type(bin_grid_t), intent(in) | bin_grid, |
integer, intent(in) | i_bin | ||
) |
Returns the size of a bin in a grid.
[in] | bin_grid | Bin grid. |
[in] | i_bin | Bin number to return size of. |
Definition at line 106 of file bin_grid.F90.
subroutine pmc_bin_grid::bin_grid_copy | ( | type(bin_grid_t), intent(in) | bin_grid_from, |
type(bin_grid_t), intent(inout) | bin_grid_to | ||
) |
Copies a bin grid.
[in] | bin_grid_from | Bin_grid to copy from. |
[in,out] | bin_grid_to | Bin_grid to copy to. |
Definition at line 86 of file bin_grid.F90.
subroutine pmc_bin_grid::bin_grid_deallocate | ( | type(bin_grid_t), intent(inout) | bin_grid | ) |
Frees all memory.
[in,out] | bin_grid | Bin_grid to free. |
Definition at line 73 of file bin_grid.F90.
subroutine pmc_bin_grid::bin_grid_histogram_1d | ( | type(bin_grid_t), intent(in) | x_bin_grid, |
real(kind=dp), dimension(:), intent(in) | x_data, | ||
real(kind=dp), dimension(size(x_data)), intent(in) | weight_data, | ||
real(kind=dp), dimension(x_bin_grid%n_bin), intent(out) | hist | ||
) |
Make a histogram with of the given weighted data, scaled by the bin sizes.
[in] | x_bin_grid | x-axis bin grid. |
[in] | x_data | Data values on the x-axis. |
[in] | weight_data | Data value weights. |
[out] | hist | Histogram to compute. |
Definition at line 197 of file bin_grid.F90.
subroutine pmc_bin_grid::bin_grid_input_netcdf | ( | type(bin_grid_t), intent(inout) | bin_grid, |
integer, intent(in) | ncid | ||
) |
Read full state.
[in,out] | bin_grid | bin_grid to read. |
[in] | ncid | NetCDF file ID, in data mode. |
Definition at line 467 of file bin_grid.F90.
subroutine pmc_bin_grid::bin_grid_make | ( | type(bin_grid_t), intent(inout) | bin_grid, |
integer, intent(in) | n_bin, | ||
real(kind=dp), intent(in) | r_min, | ||
real(kind=dp), intent(in) | r_max | ||
) |
Generates the bin grid given the range and number of bins.
[in,out] | bin_grid | New bin grid. |
[in] | n_bin | Number of bins. |
[in] | r_min | Minimum radius (m^3). |
[in] | r_max | Minimum radius (m^3). |
Definition at line 137 of file bin_grid.F90.
subroutine pmc_bin_grid::bin_grid_netcdf_dim_aero_diam | ( | type(bin_grid_t), intent(in) | bin_grid, |
integer, intent(in) | ncid, | ||
integer, intent(out) | dimid_aero_diam | ||
) |
Write the aero_diam dimension to the given NetCDF file if it is not already present and in any case return the associated dimid.
[in] | bin_grid | Bin_grid structure. |
[in] | ncid | NetCDF file ID, in data mode. |
[out] | dimid_aero_diam | Dimid of the aero_diam dimension. |
Definition at line 366 of file bin_grid.F90.
subroutine pmc_bin_grid::bin_grid_output_netcdf | ( | type(bin_grid_t), intent(in) | bin_grid, |
integer, intent(in) | ncid | ||
) |
Write full state.
[in] | bin_grid | bin_grid to write. |
[in] | ncid | NetCDF file ID, in data mode. |
Definition at line 425 of file bin_grid.F90.
integer function pmc_bin_grid::bin_grid_particle_in_bin | ( | type(bin_grid_t), intent(in) | bin_grid, |
real(kind=dp), intent(in) | radius | ||
) |
Find the bin number that contains a given particle.
This assumes logarithmically spaced bins. If a particle is below the smallest bin then its bin number is 0. If a particle is above the largest bin then its bin number is n_bin + 1
.
[in] | bin_grid | Bin_grid. |
[in] | radius | Radius of particle. |
Definition at line 179 of file bin_grid.F90.
logical function pmc_bin_grid::pmc_mpi_allequal_bin_grid | ( | type(bin_grid_t), intent(inout) | val | ) |
Check whether all processors have the same value.
[in,out] | val | Value to compare. |
Definition at line 334 of file bin_grid.F90.
subroutine pmc_bin_grid::pmc_mpi_pack_bin_grid | ( | character, dimension(:), intent(inout) | buffer, |
integer, intent(inout) | position, | ||
type(bin_grid_t), intent(in) | val | ||
) |
Packs the given value into the buffer, advancing position.
[in,out] | buffer | Memory buffer. |
[in,out] | position | Current buffer position. |
[in] | val | Value to pack. |
Definition at line 282 of file bin_grid.F90.
integer function pmc_bin_grid::pmc_mpi_pack_size_bin_grid | ( | type(bin_grid_t), intent(in) | val | ) |
Determines the number of bytes required to pack the given value.
[in] | val | Value to pack. |
Definition at line 266 of file bin_grid.F90.
subroutine pmc_bin_grid::pmc_mpi_unpack_bin_grid | ( | character, dimension(:), intent(inout) | buffer, |
integer, intent(inout) | position, | ||
type(bin_grid_t), intent(inout) | val | ||
) |
Unpacks the given value from the buffer, advancing position.
[in,out] | buffer | Memory buffer. |
[in,out] | position | Current buffer position. |
[in,out] | val | Value to pack. |
Definition at line 308 of file bin_grid.F90.
subroutine pmc_bin_grid::spec_file_read_bin_grid | ( | type(spec_file_t), intent(inout) | file, |
type(bin_grid_t), intent(inout) | bin_grid | ||
) |
Read the specification for a bin_grid from a spec file and generate it.
[in,out] | file | Spec file. |
[in,out] | bin_grid | Bin grid. |
Definition at line 225 of file bin_grid.F90.
subroutine pmc_bin_grid::vol_to_lnr | ( | real(kind=dp), intent(in) | r, |
real(kind=dp), intent(in) | f_vol, | ||
real(kind=dp), intent(out) | f_lnr | ||
) |
Convert a concentration f(vol)d(vol) to f(ln(r))d(ln(r)) where vol = 4/3 pi r^3.
[in] | r | Radius (m). |
[in] | f_vol | Concentration as a function of volume. |
[out] | f_lnr | Concentration as a function of ln(r). |
Definition at line 121 of file bin_grid.F90.