PartMC
2.6.1
|
The bin_grid_t structure and associated subroutines. More...
Data Types | |
type | bin_grid_t |
1D grid, either logarithmic or linear. More... | |
Functions/Subroutines | |
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. More... | |
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. More... | |
subroutine | bin_grid_make (bin_grid, type, n_bin, min, max) |
Generates the bin grid given the range and number of bins. More... | |
integer function | bin_grid_find (bin_grid, val) |
Find the bin number that contains a given value. More... | |
real(kind=dp) function, dimension(bin_grid_size(x_bin_grid)) | bin_grid_histogram_1d (x_bin_grid, x_data, weight_data) |
Make a histogram with of the given weighted data, scaled by the bin sizes. More... | |
real(kind=dp) function, dimension(bin_grid_size(x_bin_grid), bin_grid_size(y_bin_grid)) | bin_grid_histogram_2d (x_bin_grid, x_data, y_bin_grid, y_data, weight_data) |
Make a 2D histogram with of the given weighted data, scaled by the bin sizes. More... | |
integer function | pmc_mpi_pack_size_bin_grid (val) |
Determines the number of bytes required to pack the given value. More... | |
subroutine | pmc_mpi_pack_bin_grid (buffer, position, val) |
Packs the given value into the buffer, advancing position. More... | |
subroutine | pmc_mpi_unpack_bin_grid (buffer, position, val) |
Unpacks the given value from the buffer, advancing position. More... | |
logical function | pmc_mpi_allequal_bin_grid (val) |
Check whether all processors have the same value. More... | |
subroutine | bin_grid_netcdf_dim (bin_grid, ncid, dim_name, unit, dimid, long_name, scale) |
Write a bin grid dimension to the given NetCDF file if it is not already present and in any case return the associated dimid. More... | |
subroutine | bin_grid_output_netcdf (bin_grid, ncid, dim_name, unit, long_name, scale) |
Write a bin grid to the given NetCDF file. More... | |
subroutine | bin_grid_input_netcdf (bin_grid, ncid, dim_name, scale) |
Read full state. More... | |
Variables | |
integer, parameter | bin_grid_type_invalid = 0 |
Invalid type of bin grid. More... | |
integer, parameter | bin_grid_type_log = 1 |
Logarithmically spaced bin grid. More... | |
integer, parameter | bin_grid_type_linear = 2 |
Linearly spaced bin grid. More... | |
The bin_grid_t structure and associated subroutines.
integer function pmc_bin_grid::bin_grid_find | ( | type(bin_grid_t), intent(in) | bin_grid, |
real(kind=dp), intent(in) | val | ||
) |
Find the bin number that contains a given value.
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 bin_grid_size(bin_grid) + 1
.
[in] | bin_grid | Bin_grid. |
[in] | val | Value to locate bin for. |
Definition at line 143 of file bin_grid.F90.
real(kind=dp) function, dimension(bin_grid_size(x_bin_grid)) 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 | ||
) |
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. |
Definition at line 173 of file bin_grid.F90.
real(kind=dp) function, dimension(bin_grid_size(x_bin_grid), bin_grid_size(y_bin_grid)) pmc_bin_grid::bin_grid_histogram_2d | ( | type(bin_grid_t), intent(in) | x_bin_grid, |
real(kind=dp), dimension(:), intent(in) | x_data, | ||
type(bin_grid_t), intent(in) | y_bin_grid, | ||
real(kind=dp), dimension(size(x_data)), intent(in) | y_data, | ||
real(kind=dp), dimension(size(x_data)), intent(in) | weight_data | ||
) |
Make a 2D 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] | y_bin_grid | y-axis bin grid. |
[in] | y_data | Data values on the y-axis. |
[in] | weight_data | Data value weights. |
Definition at line 202 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, | ||
character(len=*), intent(in) | dim_name, | ||
real(kind=dp), intent(in), optional | scale | ||
) |
Read full state.
[in,out] | bin_grid | bin_grid to read. |
[in] | ncid | NetCDF file ID, in data mode. |
[in] | dim_name | Dimension name. |
[in] | scale | Factor to scale grid by after input. |
Definition at line 523 of file bin_grid.F90.
subroutine pmc_bin_grid::bin_grid_make | ( | type(bin_grid_t), intent(inout) | bin_grid, |
integer, intent(in) | type, | ||
integer, intent(in) | n_bin, | ||
real(kind=dp), intent(in) | min, | ||
real(kind=dp), intent(in) | max | ||
) |
Generates the bin grid given the range and number of bins.
[in,out] | bin_grid | New bin grid. |
[in] | type | Type of bin grid. |
[in] | n_bin | Number of bins. |
[in] | min | Minimum edge value. |
[in] | max | Minimum edge value. |
Definition at line 83 of file bin_grid.F90.
subroutine pmc_bin_grid::bin_grid_netcdf_dim | ( | type(bin_grid_t), intent(in) | bin_grid, |
integer, intent(in) | ncid, | ||
character(len=*), intent(in) | dim_name, | ||
character(len=*), intent(in) | unit, | ||
integer, intent(out) | dimid, | ||
character(len=*), intent(in), optional | long_name, | ||
real(kind=dp), intent(in), optional | scale | ||
) |
Write a bin grid 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. |
[in] | dim_name | Dimension name. |
[in] | unit | Units for the grid. |
[out] | dimid | Dimid of the grid dimension. |
[in] | long_name | Long dimension name to use. |
[in] | scale | Factor to scale grid by before output. |
Definition at line 386 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, | ||
character(len=*), intent(in) | dim_name, | ||
character(len=*), intent(in) | unit, | ||
character(len=*), intent(in), optional | long_name, | ||
real(kind=dp), intent(in), optional | scale | ||
) |
Write a bin grid to the given NetCDF file.
[in] | bin_grid | Bin_grid structure. |
[in] | ncid | NetCDF file ID, in data mode. |
[in] | dim_name | Dimension name. |
[in] | unit | Units for the grid. |
[in] | long_name | Long dimension name to use. |
[in] | scale | Factor to scale grid by before output. |
Definition at line 497 of file bin_grid.F90.
elemental integer function pmc_bin_grid::bin_grid_size | ( | type(bin_grid_t), intent(in) | bin_grid | ) |
Return the number of bins in the grid, or -1 if the bin grid is not allocated.
[in] | bin_grid | Bin grid structure. |
Definition at line 50 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 349 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 297 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 281 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 323 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 67 of file bin_grid.F90.
integer, parameter pmc_bin_grid::bin_grid_type_invalid = 0 |
Invalid type of bin grid.
Definition at line 21 of file bin_grid.F90.
integer, parameter pmc_bin_grid::bin_grid_type_linear = 2 |
Linearly spaced bin grid.
Definition at line 25 of file bin_grid.F90.
integer, parameter pmc_bin_grid::bin_grid_type_log = 1 |
Logarithmically spaced bin grid.
Definition at line 23 of file bin_grid.F90.