MPI-AMRVAC  3.1
The MPI - Adaptive Mesh Refinement - Versatile Advection Code (development version)
Functions/Subroutines | Variables
mod_input_output Module Reference

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)
 
logical function snapshot_exists (ix)
 
integer function get_snapshot_index (filename)
 
subroutine, public 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...
 
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, 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'
 

Detailed Description

Module for reading input and writing output.

Function/Subroutine Documentation

◆ get_fields_string()

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.

Parameters
[in]lineThe line from which we want to read
[in]delimsA string with delimiters. For example delims = " ,'"""//char(9)
[in]n_maxMaximum number of entries to read in
[in,out]n_foundNumber of entries found
[in,out]fieldsFields in the strings

Definition at line 1672 of file mod_input_output.t.

◆ get_global_maxima()

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.

Parameters
[out]wmaxThe global maxima

Definition at line 2786 of file mod_input_output.t.

◆ get_global_minima()

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.

Parameters
[out]wminThe global maxima

Definition at line 2813 of file mod_input_output.t.

◆ get_snapshot_index()

integer function mod_input_output::get_snapshot_index ( character(len=*), intent(in)  filename)

Definition at line 1785 of file mod_input_output.t.

◆ get_volume_average()

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.

Parameters
[in]powerWhich mode to compute
[out]modeThe computed mode
[out]volumeThe total grid volume

Definition at line 2679 of file mod_input_output.t.

◆ get_volume_average_func()

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.

Parameters
[out]f_avgThe volume average of func
[out]volumeThe total grid volume

Definition at line 2743 of file mod_input_output.t.

◆ get_volume_coverage()

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 2717 of file mod_input_output.t.

◆ printlog_default()

subroutine mod_input_output::printlog_default

Write volume-averaged values and other information to the log file.

Definition at line 2507 of file mod_input_output.t.

Here is the call graph for this function:

◆ printlog_regression_test()

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 2638 of file mod_input_output.t.

Here is the call graph for this function:

◆ read_arguments()

subroutine mod_input_output::read_arguments

Read the command line arguments passed to amrvac.

Definition at line 36 of file mod_input_output.t.

Here is the call graph for this function:

◆ read_par_files()

subroutine mod_input_output::read_par_files

Read in the user-supplied parameter-file.

How to apply dimensional splitting to the source terms, see Discretization

Which flux scheme of spatial discretization to use (per grid level)

Which type of the maximal bound speed of Riemann fan to use

Which time stepper to use

Which time integrator to use

type of curl operator

Limiter used for prolongation to refined grids and ghost cells

How to compute the CFL-limited time step. Options are 'maxsum': max(sum(c/dx)); 'summax': sum(max(c/dx)) and 'minimum: max(c/dx), where the summations loop over the grid dimensions and c is the velocity. The default 'maxsum' is the conventiontal way of computing CFL-limited time steps.

Definition at line 175 of file mod_input_output.t.

Here is the call graph for this function:

◆ read_snapshot()

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 2160 of file mod_input_output.t.

Here is the call graph for this function:

◆ read_snapshot_old()

subroutine mod_input_output::read_snapshot_old

Definition at line 2366 of file mod_input_output.t.

Here is the call graph for this function:

◆ saveamrfile()

subroutine mod_input_output::saveamrfile ( integer  ifile)

Definition at line 1720 of file mod_input_output.t.

Here is the call graph for this function:

◆ snapshot_exists()

logical function mod_input_output::snapshot_exists ( integer, intent(in)  ix)
Parameters
[in]ixIndex of snapshot

Definition at line 1776 of file mod_input_output.t.

◆ snapshot_read_header()

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

Parameters
[in]fhFile handle
[out]offset_treeOffset of tree info
[out]offset_blockOffset of block data

Definition at line 1816 of file mod_input_output.t.

Here is the call graph for this function:

◆ snapshot_write_header()

subroutine, public 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

Parameters
[in]fhFile handle
[in]offset_treeOffset of tree info
[in]offset_blockOffset of block data

Definition at line 1800 of file mod_input_output.t.

Here is the call graph for this function:

◆ write_snapshot()

subroutine mod_input_output::write_snapshot

Definition at line 1987 of file mod_input_output.t.

Here is the call graph for this function:

Variable Documentation

◆ compatible_versions

integer, dimension(3), parameter mod_input_output::compatible_versions = [3, 4, 5]

List of compatible versions.

Definition at line 10 of file mod_input_output.t.

◆ fmt_i

character(len=*), parameter mod_input_output::fmt_i = 'i8'

Definition at line 28 of file mod_input_output.t.

◆ fmt_r

character(len=*), parameter mod_input_output::fmt_r = 'es16.8'

Definition at line 26 of file mod_input_output.t.

◆ fmt_r2

character(len=*), parameter mod_input_output::fmt_r2 = 'es10.2'

Definition at line 27 of file mod_input_output.t.

◆ nw_found

integer mod_input_output::nw_found

number of w found in dat files

Definition at line 13 of file mod_input_output.t.