mod_input_output Module

Module for reading input and writing output


Uses

  • module~~mod_input_output~~UsesGraph module~mod_input_output mod_input_output module~mod_comm_lib mod_comm_lib module~mod_input_output->module~mod_comm_lib module~mod_mpi_wrapper mod_mpi_wrapper module~mod_input_output->module~mod_mpi_wrapper mpi mpi module~mod_mpi_wrapper->mpi

Used by

  • module~~mod_input_output~~UsedByGraph module~mod_input_output mod_input_output proc~initialize_amrvac initialize_amrvac proc~initialize_amrvac->module~mod_input_output proc~main main proc~main->module~mod_input_output proc~timeintegration timeintegration proc~timeintegration->module~mod_input_output

Variables

Type Visibility Attributes Name Initial
integer, public, parameter :: compatible_versions(3) = [3, 4, 5]

List of compatible versions

character(len=*), public, parameter :: fmt_i = 'i8'
character(len=*), public, parameter :: fmt_r = 'es16.8'
character(len=*), public, parameter :: fmt_r2 = 'es10.2'
integer, public :: nw_found

number of w found in dat files

integer, private :: itag

tag for MPI message

double precision, private :: rk2_alfa

coefficient for rk2_alfa

logical, private :: stagger_mark_dat = .false.

whether staggered field is in dat


Functions

public function get_snapshot_index(filename)

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: filename

Return Value integer

public function snapshot_exists(ix)

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: ix

Index of snapshot

Return Value logical


Subroutines

public subroutine get_fields_string(line, delims, n_max, fields, n_found, fully_read)

Routine to find entries in a string

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: line

The line from which we want to read

character(len=*), intent(in) :: delims

A string with delimiters. For example delims = " ,'"""//char(9)

integer, intent(in) :: n_max

Maximum number of entries to read in

character(len=*), intent(inout) :: fields(n_max)

Fields in the strings

integer, intent(inout) :: n_found

Number of entries found

logical, intent(out), optional :: fully_read

public subroutine get_global_maxima(wmax)

Compute global maxima of iw variables over the leaves of the grid.

Arguments

Type IntentOptional Attributes Name
double precision, intent(out) :: wmax(nw)

The global maxima

public subroutine get_global_minima(wmin)

Compute global minima of iw variables over the leaves of the grid.

Arguments

Type IntentOptional Attributes Name
double precision, intent(out) :: wmin(nw)

The global maxima

public 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.

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: power

Which mode to compute

double precision, intent(out) :: mode(nw)

The computed mode

double precision, intent(out) :: volume

The total grid volume

public subroutine get_volume_average_func(func, f_avg, volume)

Compute the volume average of func(w) over the leaves of the grid.

Arguments

Type IntentOptional Attributes Name
public pure function func(w_vec, w_size) result(val)
Arguments
Type IntentOptional Attributes Name
double precision, intent(in) :: w_vec(w_size)
integer, intent(in) :: w_size
Return Value double precision
double precision, intent(out) :: f_avg

The volume average of func

double precision, intent(out) :: volume

The total grid volume

public 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.

Arguments

Type IntentOptional Attributes Name
double precision, intent(out) :: vol_cov(1:refine_max_level)

public subroutine printlog_default()

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

Arguments

None

public subroutine printlog_regression_test()

Print a log that can be used to check whether the code still produces the same output (regression test)

Arguments

None

public subroutine read_arguments()

Read the command line arguments passed to agile

Arguments

None

public subroutine read_par_files()

Read in the user-supplied parameter-file

Arguments

None

public subroutine read_snapshot()

Routine to read in snapshots (.dat files). When it cannot recognize the file version, it will automatically try the 'old' reader.

Arguments

None

public subroutine read_snapshot_old()

Arguments

None

public subroutine saveamrfile(ifile)

Arguments

Type IntentOptional Attributes Name
integer :: ifile

public subroutine snapshot_read_header(fh, offset_tree, offset_block)

Read header for a snapshot

Read more…

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: fh

File handle

integer(kind=MPI_OFFSET_KIND), intent(out) :: offset_tree

Offset of tree info

integer(kind=MPI_OFFSET_KIND), intent(out) :: offset_block

Offset of block data

public subroutine snapshot_write_header(fh, offset_tree, offset_block)

Write header for a snapshot

Read more…

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: fh

File handle

integer(kind=MPI_OFFSET_KIND), intent(in) :: offset_tree

Offset of tree info

integer(kind=MPI_OFFSET_KIND), intent(in) :: offset_block

Offset of block data

public subroutine write_snapshot()

Arguments

None