Classes | |
struct | bin_grid_t |
1D grid of size bins. More... | |
Functions | |
subroutine | bin_grid_alloc (bin_grid, n_bin) |
Allocates a bin_grid. | |
subroutine | bin_grid_free (bin_grid) |
Frees all memory. | |
subroutine | vol_to_lnr (r, f_vol, f_lnr) |
Convert a density 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, v_min, v_max) |
Generates the bin grid given the range and number of bins. | |
real *8 | bin_grid_edge (bin_grid, i) |
Given a bin_grid (which stores the center points of the bins), find the given edge volume (m^3). | |
integer | bin_grid_particle_in_bin (bin_grid, v) |
Find the bin number that contains a given particle. This assumes logarithmically spaced bins. | |
subroutine | inout_write_bin_grid (file, bin_grid) |
Write full state. | |
subroutine | inout_read_bin_grid (file, bin_grid) |
Read full state. | |
subroutine | spec_read_bin_grid (file, bin_grid) |
Read the specification for a bin_grid from a inout file and generate it. | |
integer | 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. |
subroutine pmc_bin_grid::bin_grid_alloc | ( | type(bin_grid_t),intent(out) | bin_grid, | |
integer,intent(in) | n_bin | |||
) |
Allocates a bin_grid.
bin_grid | Bin grid. |
n_bin | Number of bins. |
real*8 pmc_bin_grid::bin_grid_edge | ( | type(bin_grid_t),intent(in) | bin_grid, | |
integer,intent(in) | i | |||
) |
Given a bin_grid (which stores the center points of the bins), find the given edge volume (m^3).
With n_bin bin centers there are (n_bin + 1) bin edges, so bin center bin_gridv(i) is between bin edges i and (i + 1). This code currently assumes a logarithmically spaced bin grid and returns logarithmically spaced edges.
bin_grid | Bin_grid. |
i | Edge number (1 <= i <= n_bin + 1). |
subroutine pmc_bin_grid::bin_grid_free | ( | type(bin_grid_t),intent(inout) | bin_grid | ) |
Frees all memory.
bin_grid | Bin_grid to free. |
subroutine pmc_bin_grid::bin_grid_make | ( | type(bin_grid_t),intent(out) | bin_grid, | |
integer,intent(in) | n_bin, | |||
real*8,intent(in) | v_min, | |||
real*8,intent(in) | v_max | |||
) |
Generates the bin grid given the range and number of bins.
bin_grid | New bin grid, will be allocated. |
n_bin | Number of bins. |
v_min | Minimum volume (m^3). |
v_max | Minimum volume (m^3). |
integer pmc_bin_grid::bin_grid_particle_in_bin | ( | type(bin_grid_t),intent(in) | bin_grid, | |
real*8,intent(in) | v | |||
) |
Find the bin number that contains a given particle. This assumes logarithmically spaced bins.
bin_grid | Bin_grid. |
v | Volume of particle. |
subroutine pmc_bin_grid::inout_read_bin_grid | ( | type(inout_file_t),intent(inout) | file, | |
type(bin_grid_t),intent(out) | bin_grid | |||
) |
Read full state.
file | File to read from. |
bin_grid | Bin_grid to read. |
subroutine pmc_bin_grid::inout_write_bin_grid | ( | type(inout_file_t),intent(inout) | file, | |
type(bin_grid_t),intent(in) | bin_grid | |||
) |
Write full state.
file | File to write to. |
bin_grid | Bin_grid to write. |
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.
buffer | Memory buffer. |
position | Current buffer position. |
val | Value to pack. |
integer 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.
val | Value to pack. |
subroutine pmc_bin_grid::pmc_mpi_unpack_bin_grid | ( | character,dimension(:),intent(inout) | buffer, | |
integer,intent(inout) | position, | |||
type(bin_grid_t),intent(out) | val | |||
) |
Unpacks the given value from the buffer, advancing position.
buffer | Memory buffer. |
position | Current buffer position. |
val | Value to pack. |
subroutine pmc_bin_grid::spec_read_bin_grid | ( | type(inout_file_t),intent(inout) | file, | |
type(bin_grid_t),intent(out) | bin_grid | |||
) |
Read the specification for a bin_grid from a inout file and generate it.
file | Inout file. |
bin_grid | Bin grid. |
subroutine pmc_bin_grid::vol_to_lnr | ( | real*8,intent(in) | r, | |
real*8,intent(in) | f_vol, | |||
real*8,intent(out) | f_lnr | |||
) |
Convert a density f(vol)d(vol) to f(ln(r))d(ln(r)) where vol = 4/3 pi r^3.
r | Radius (m). |
f_vol | Density as a function of volume. |
f_lnr | Density as a function of ln(r). |