io Submodule

This submodule contains the implementation of the methods of TYPE sph_particles that handle I/O (input/output)

FT 5.11.2021



Uses

  • module~~io~~UsesGraph module~io io constants constants module~io->constants module~sph_particles sph_particles module~io->module~sph_particles module~utility utility module~io->module~utility module~sph_particles->module~utility module~id_base id_base module~sph_particles->module~id_base timing timing module~sph_particles->timing module~utility->constants matrix matrix module~utility->matrix module~id_base->module~utility module~id_base->timing

Contents


Module Procedures

module procedure analyze_hydro module subroutine analyze_hydro(this, namefile)

Export the points where some of the hydro fields are negative to a formatted file

Read more…

Arguments

Type IntentOptional Attributes Name
class(particles), intent(inout) :: this

particles object which this PROCEDURE is a member of

character(len=*), intent(inout), optional :: namefile

Name of the formatted file where the particle positions at which some of the hydro fields are negative or zero are printed to

module procedure print_formatted_id_particles module subroutine print_formatted_id_particles(this, namefile)

Print the \(\mathrm{SPH}\) \(\mathrm{ID}\) on the particles in a formatted file

Read more…

Arguments

Type IntentOptional Attributes Name
class(particles), intent(inout) :: this

particles object which this PROCEDURE is a member of

character(len=*), intent(inout), optional :: namefile

Name of the formatted output file

module procedure print_summary module subroutine print_summary(this)

Prints a summary of the properties of the \(\mathrm{SPH}\) particle distribution, optionally, to a formatted file whose name is given as the optional argument filename

Read more…

Arguments

Type IntentOptional Attributes Name
class(particles), intent(inout) :: this

Name of the formatted file to print the summary to

module procedure read_particles_formatted_file module subroutine read_particles_formatted_file(this, parts_pos_unit, nline_in, nline_fin, xmin, xmax, ymin, ymax, zmin, zmax, pos, pvol, nu, h)

Read particle positions and nu from a formatted file with the following format:

Read more…

Arguments

Type IntentOptional Attributes Name
class(particles), intent(inout) :: this

particles object which this PROCEDURE is a member of

Read more…
integer :: parts_pos_unit

Unit number of the formatted file containing the particle positions and, optionally, nu

integer :: nline_in

First line containing the relevant data

integer :: nline_fin

Last line containing the relevant data

double precision, intent(in) :: xmin

Left boundary of the lattice

double precision, intent(in) :: xmax

Right boundary of the lattice

double precision, intent(in) :: ymin

Left boundary of the lattice

double precision, intent(in) :: ymax

Right boundary of the lattice

double precision, intent(in) :: zmin

Left boundary of the lattice

double precision, intent(in) :: zmax

Right boundary of the lattice

double precision, intent(inout), DIMENSION(:,:), ALLOCATABLE :: pos
double precision, intent(inout), DIMENSION(:), ALLOCATABLE :: pvol

Array storing the particle positions Array storing the particle volumes

double precision, intent(inout), DIMENSION(:), ALLOCATABLE :: nu

Array storing the particle baryon masses

double precision, intent(inout), DIMENSION(:), ALLOCATABLE :: h

Array storing the initial guess for the particle smoothing lengths

module procedure read_sphincs_dump_print_formatted module subroutine read_sphincs_dump_print_formatted(this, namefile_bin, namefile, save_data)

Read the \(\mathrm{SPH}\) \(\mathrm{ID}\) from the binary file output by write_SPHINCS_dump, and print it to a formatted file

Read more…

Arguments

Type IntentOptional Attributes Name
class(particles), intent(inout) :: this

particles object which this PROCEDURE is a member of

character(len=*), intent(inout), optional :: namefile_bin

Name of the binary file to be read

character(len=*), intent(inout), optional :: namefile

Name of the formatted file to be printed

logical, intent(in), optional :: save_data

If .TRUE., saves the read data into the TYPE member variables