MPI-AMRVAC
2.2
The MPI - Adaptive Mesh Refinement - Versatile Advection Code
|
Module for reading input and writing output. More...
Functions/Subroutines | |
subroutine | read_arguments () |
Read the command line arguments passed to amrvac. More... | |
subroutine | read_par_files () |
Read in the user-supplied parameter-file. More... | |
subroutine | get_fields_string (line, delims, n_max, fields, n_found, fully_read) |
Routine to find entries in a string. More... | |
subroutine | saveamrfile (ifile) |
subroutine | create_output_file (fh, ix, extension, suffix) |
Standard method for creating a new output file. More... | |
logical function | snapshot_exists (ix) |
integer function | get_snapshot_index (filename) |
subroutine | snapshot_write_header (fh, offset_tree, offset_block) |
Write header for a snapshot. More... | |
subroutine | snapshot_read_header (fh, offset_tree, offset_block) |
Read header for a snapshot. More... | |
pure integer function | count_ix (ixOL) |
Compute number of elements in index range. More... | |
subroutine | block_shape_io (igrid, n_ghost, ixOL, n_values) |
Determine the shape of a block for output (whether to include ghost cells, and on which sides) More... | |
subroutine | write_snapshot |
subroutine | read_snapshot |
Routine to read in snapshots (.dat files). When it cannot recognize the file version, it will automatically try the 'old' reader. More... | |
subroutine | read_snapshot_old () |
subroutine | printlog_default |
Write volume-averaged values and other information to the log file. More... | |
subroutine | printlog_regression_test () |
Print a log that can be used to check whether the code still produces the same output (regression test) More... | |
subroutine | get_volume_average (power, mode, volume) |
Compute mean(w**power) over the leaves of the grid. The first mode (power=1) corresponds to the mean, the second to the mean squared values and so on. More... | |
subroutine | get_volume_coverage (vol_cov) |
Compute how much of the domain is covered by each grid level. This routine does not take a non-Cartesian geometry into account. More... | |
subroutine | get_volume_average_func (func, f_avg, volume) |
Compute the volume average of func(w) over the leaves of the grid. More... | |
subroutine | get_global_maxima (wmax) |
Compute global maxima of iw variables over the leaves of the grid. More... | |
subroutine | get_global_minima (wmin) |
Compute global minima of iw variables over the leaves of the grid. More... | |
Variables | |
integer, parameter | version_number = 5 |
Version number of the .dat file output. More... | |
integer, dimension(3), parameter | compatible_versions = [3, 4, 5] |
List of compatible versions. More... | |
integer | nw_found |
number of w found in dat files More... | |
character(len= *), parameter | fmt_r = 'es16.8' |
character(len= *), parameter | fmt_r2 = 'es10.2' |
character(len= *), parameter | fmt_i = 'i8' |
Module for reading input and writing output.
subroutine mod_input_output::block_shape_io | ( | integer, intent(in) | igrid, |
integer, dimension(2*ndim), intent(out) | n_ghost, | ||
integer, intent(out) | ixO, | ||
integer, intent(out) | L, | ||
integer, intent(out) | n_values | ||
) |
Determine the shape of a block for output (whether to include ghost cells, and on which sides)
[out] | n_ghost | nghost(1:ndim) contains the number of ghost cells on the block's minimum boundaries, and nghost(ndim+1:2*ndim) on the block's maximum boundaries |
[out] | ixo | Index range on output block |
[out] | l | Index range on output block |
[out] | n_values | Number of cells/values in output |
Definition at line 1819 of file mod_input_output.t.
pure integer function mod_input_output::count_ix | ( | integer, intent(in) | ixO, |
integer, intent(in) | L | ||
) |
Compute number of elements in index range.
Definition at line 1811 of file mod_input_output.t.
subroutine mod_input_output::create_output_file | ( | integer, intent(out) | fh, |
integer, intent(in) | ix, | ||
character(len=*), intent(in) | extension, | ||
character(len=*), intent(in), optional | suffix | ||
) |
Standard method for creating a new output file.
[out] | fh | File handle |
[in] | ix | Index of file |
[in] | extension | Extension of file |
[in] | suffix | Optional suffix |
Definition at line 1508 of file mod_input_output.t.
subroutine mod_input_output::get_fields_string | ( | character(len=*), intent(in) | line, |
character(len=*), intent(in) | delims, | ||
integer, intent(in) | n_max, | ||
character(len=*), dimension(n_max), intent(inout) | fields, | ||
integer, intent(inout) | n_found, | ||
logical, intent(out), optional | fully_read | ||
) |
Routine to find entries in a string.
[in] | line | The line from which we want to read |
[in] | delims | A string with delimiters. For example delims = " ,'"""//char(9) |
[in] | n_max | Maximum number of entries to read in |
[in,out] | n_found | Number of entries found |
[in,out] | fields | Fields in the strings |
Definition at line 1406 of file mod_input_output.t.
subroutine mod_input_output::get_global_maxima | ( | double precision, dimension(nw), intent(out) | wmax | ) |
Compute global maxima of iw variables over the leaves of the grid.
[out] | wmax | The global maxima |
Definition at line 2641 of file mod_input_output.t.
subroutine mod_input_output::get_global_minima | ( | double precision, dimension(nw), intent(out) | wmin | ) |
Compute global minima of iw variables over the leaves of the grid.
[out] | wmin | The global maxima |
Definition at line 2668 of file mod_input_output.t.
integer function mod_input_output::get_snapshot_index | ( | character(len=*), intent(in) | filename | ) |
Definition at line 1553 of file mod_input_output.t.
subroutine mod_input_output::get_volume_average | ( | integer, intent(in) | power, |
double precision, dimension(nw), intent(out) | mode, | ||
double precision, intent(out) | volume | ||
) |
Compute mean(w**power) over the leaves of the grid. The first mode (power=1) corresponds to the mean, the second to the mean squared values and so on.
[in] | power | Which mode to compute |
[out] | mode | The computed mode |
[out] | volume | The total grid volume |
Definition at line 2534 of file mod_input_output.t.
subroutine mod_input_output::get_volume_average_func | ( | func, | |
double precision, intent(out) | f_avg, | ||
double precision, intent(out) | volume | ||
) |
Compute the volume average of func(w) over the leaves of the grid.
[out] | f_avg | The volume average of func |
[out] | volume | The total grid volume |
Definition at line 2598 of file mod_input_output.t.
subroutine mod_input_output::get_volume_coverage | ( | double precision, dimension(1:refine_max_level), intent(out) | vol_cov | ) |
Compute how much of the domain is covered by each grid level. This routine does not take a non-Cartesian geometry into account.
Definition at line 2572 of file mod_input_output.t.
subroutine mod_input_output::printlog_default | ( | ) |
Write volume-averaged values and other information to the log file.
Definition at line 2373 of file mod_input_output.t.
subroutine mod_input_output::printlog_regression_test | ( | ) |
Print a log that can be used to check whether the code still produces the same output (regression test)
Definition at line 2504 of file mod_input_output.t.
subroutine mod_input_output::read_arguments | ( | ) |
Read the command line arguments passed to amrvac.
Definition at line 28 of file mod_input_output.t.
subroutine mod_input_output::read_par_files | ( | ) |
Read in the user-supplied parameter-file.
Definition at line 167 of file mod_input_output.t.
subroutine mod_input_output::read_snapshot | ( | ) |
Routine to read in snapshots (.dat files). When it cannot recognize the file version, it will automatically try the 'old' reader.
Definition at line 2034 of file mod_input_output.t.
subroutine mod_input_output::read_snapshot_old | ( | ) |
subroutine mod_input_output::saveamrfile | ( | integer | ifile | ) |
logical function mod_input_output::snapshot_exists | ( | integer, intent(in) | ix | ) |
[in] | ix | Index of snapshot |
Definition at line 1544 of file mod_input_output.t.
subroutine mod_input_output::snapshot_read_header | ( | integer, intent(in) | fh, |
integer(mpi_offset_kind), intent(out) | offset_tree, | ||
integer(mpi_offset_kind), intent(out) | offset_block | ||
) |
Read header for a snapshot.
If you edit the header, don't forget to update: snapshot_write_header(), snapshot_read_header(), doc/fileformat.md, tools/python/dat_reader.py
[in] | fh | File handle |
[out] | offset_tree | Offset of tree info |
[out] | offset_block | Offset of block data |
Definition at line 1639 of file mod_input_output.t.
subroutine mod_input_output::snapshot_write_header | ( | integer, intent(in) | fh, |
integer(kind=mpi_offset_kind), intent(in) | offset_tree, | ||
integer(kind=mpi_offset_kind), intent(in) | offset_block | ||
) |
Write header for a snapshot.
If you edit the header, don't forget to update: snapshot_write_header(), snapshot_read_header(), doc/fileformat.md, tools/python/dat_reader.py
[in] | fh | File handle |
[in] | offset_tree | Offset of tree info |
[in] | offset_block | Offset of block data |
Definition at line 1566 of file mod_input_output.t.
subroutine mod_input_output::write_snapshot | ( | ) |
integer, dimension(3), parameter mod_input_output::compatible_versions = [3, 4, 5] |
List of compatible versions.
Definition at line 11 of file mod_input_output.t.
character(len=*), parameter mod_input_output::fmt_i = 'i8' |
Definition at line 22 of file mod_input_output.t.
character(len=*), parameter mod_input_output::fmt_r = 'es16.8' |
Definition at line 20 of file mod_input_output.t.
character(len=*), parameter mod_input_output::fmt_r2 = 'es10.2' |
Definition at line 21 of file mod_input_output.t.
integer mod_input_output::nw_found |
number of w found in dat files
Definition at line 14 of file mod_input_output.t.
integer, parameter mod_input_output::version_number = 5 |
Version number of the .dat file output.
Definition at line 8 of file mod_input_output.t.