fileio_base_mod Module Reference

Generic file I/O module. More...

Data Types

type  fileio_base
 FileIO class. More...
 
interface  Finalize
 
type  output_typ
 
type  tsoutput_typ
 output-pointer for time step scalar data (gnuplot) More...
 
type  valptr_typ
 output-pointer for array data (binary,gnuplot,vtk) More...
 
interface  WriteDataset
 
interface  WriteHeader
 

Functions/Subroutines

subroutine initfileio (this, Mesh, Physics, Timedisc, Sources, config, IO, fmtname, fext)
 Generic constructor for file I/O. More...
 
pure subroutine inctime (this)
 Increments the counter for timesteps and sets the time for next output. More...
 
pure subroutine adjusttimestep (this, time, dt, dtcause)
 Adjust the current timestep. More...
 
character(len=fmltlen) function makemultstr (this, fn)
 Get a file label (multiples files in parallel mode) without filenumber => use GetRank; with filenumber < 0 => empty label. More...
 
character(len=256) function getbasename (this, fn)
 Get the current file name without path e.g. important for vtk (pvts files) More...
 
character(len=256) function getfilename (this, fn)
 Get the current file name. More...
 
subroutine finalize_base (this)
 Generic deconstructor of the file I/O. More...
 

Variables

integer, parameter, public binary = 1
 
integer, parameter, public gnuplot = 2
 
integer, parameter, public vtk = 4
 
integer, parameter, public xdmf = 7
 
integer, save lastunit = 10
 

Private Attributes

file name and extension lengths

integer, parameter fextlen = 4
 file name extension length More...
 
integer, parameter fmltlen = 5
 length of multi process string (parallel mode only) More...
 
integer, parameter fcyclen = 5
 length of timestep string More...
 
integer, parameter fnamlen = 256
 file name length (without any extension) More...
 
integer, parameter fpatlen = 1024
 file path length (without file name) More...
 

handling multiple files in parallel mode

character(len=fmltlen), save fmextstr = ""
 multi process string, overwritten below More...
 
integer, parameter maxmltfiles = 1000
 max. number files per time step (parallel mode with one file per node) More...
 

handling multiple data files with time step in their names

integer, parameter maxcycles = 10000
 max. number of data files (not counting multiple files per time step in parallel mode) More...
 
character(len=32), save cycfmt
 format string for cycles More...
 

Public Attributes

file status and access modes

integer, parameter, public readonly = 1
 readonly access More...
 
integer, parameter, public readend = 2
 readonly access at end More...
 
integer, parameter, public replace = 3
 read/write access replacing file More...
 
integer, parameter, public append = 4
 read/write access at end More...
 

file formats

character(len=9), parameter ascii = "formatted"
 for ASCII data More...
 
character(len=11), parameter bin = "unformatted"
 for BINARY data More...
 

Detailed Description

Generic file I/O module.

Author
Tobias Illenseer
Björn Sperling
Manuel Jung
Jannes Klee

This module provides the generic interface routines to all file I/O modules.

Function/Subroutine Documentation

◆ adjusttimestep()

pure subroutine fileio_base_mod::adjusttimestep ( class(fileio_base), intent(in)  this,
real, intent(inout)  time,
real, intent(inout)  dt,
integer, intent(inout)  dtcause 
)

Adjust the current timestep.

Last timestep before output must fit to desired time for output.

Parameters
[in]this[in] this fileio type
time[in,out] time
dt[in,out] dt timestep
dtcause[in,out] dtcause cause of smallest dt

Definition at line 426 of file fileio_base.f90.

◆ finalize_base()

subroutine fileio_base_mod::finalize_base ( class(fileio_base), intent(inout)  this)

Generic deconstructor of the file I/O.

Parameters
[in,out]this[in,out] this fileio type

Definition at line 519 of file fileio_base.f90.

◆ getbasename()

character(len=256) function fileio_base_mod::getbasename ( class(fileio_base), intent(in)  this,
integer, intent(in), optional  fn 
)

Get the current file name without path e.g. important for vtk (pvts files)

Returns
current file name
Parameters
[in]this[in] this fileio type
[in]fn[in] fn number of file

Definition at line 484 of file fileio_base.f90.

◆ getfilename()

character(len=256) function fileio_base_mod::getfilename ( class(fileio_base), intent(in)  this,
integer, intent(in), optional  fn 
)

Get the current file name.

Returns
current file name
Parameters
[in]this[in] this fileio type
[in]fn[in] fn number of file

Definition at line 507 of file fileio_base.f90.

◆ inctime()

pure subroutine fileio_base_mod::inctime ( class(fileio_base), intent(inout)  this)

Increments the counter for timesteps and sets the time for next output.

Parameters
[in,out]this[in,out] this fileio type

Definition at line 413 of file fileio_base.f90.

◆ initfileio()

subroutine fileio_base_mod::initfileio ( class(fileio_base), intent(inout)  this,
class(mesh_base), intent(in)  Mesh,
class(physics_base), intent(in)  Physics,
class(timedisc_base), intent(in)  Timedisc,
class(sources_base), intent(in), pointer  Sources,
type(dict_typ), intent(in), pointer  config,
type(dict_typ), intent(in), pointer  IO,
character(len=*), intent(in)  fmtname,
character(len=*), intent(in)  fext 
)

Generic constructor for file I/O.

Parameters
[in,out]this[in,out] this fileio type
[in]mesh[in] Mesh mesh type
[in]physics[in] Physics physics type
[in]timedisc[in] Timedisc timedisc type
[in]sources[in] Sources sources type
[in]config[in] config dict with I/O configuration
[in]io[in] IO dict with pointers to I/O arrays
[in]fmtnameformat name
[in]fextfext file name extension

Definition at line 295 of file fileio_base.f90.

◆ makemultstr()

character(len=fmltlen) function fileio_base_mod::makemultstr ( class(fileio_base), intent(in)  this,
integer, intent(in), optional  fn 
)

Get a file label (multiples files in parallel mode) without filenumber => use GetRank; with filenumber < 0 => empty label.

Returns
file label
Parameters
[in]this[in,out] this fileio type
[in]fn[in] fn number of file

Definition at line 449 of file fileio_base.f90.

Variable Documentation

◆ append

integer, parameter, public fileio_base_mod::append = 4

read/write access at end

Definition at line 257 of file fileio_base.f90.

◆ ascii

character(len=9), parameter fileio_base_mod::ascii = "formatted"
private

for ASCII data

Definition at line 260 of file fileio_base.f90.

◆ bin

character(len=11), parameter fileio_base_mod::bin = "unformatted"
private

for BINARY data

Definition at line 261 of file fileio_base.f90.

◆ binary

integer, parameter, public fileio_base_mod::binary = 1

Definition at line 265 of file fileio_base.f90.

◆ cycfmt

character(len=32), save fileio_base_mod::cycfmt
private

format string for cycles

Definition at line 95 of file fileio_base.f90.

◆ fcyclen

integer, parameter fileio_base_mod::fcyclen = 5
private

length of timestep string

Definition at line 81 of file fileio_base.f90.

◆ fextlen

integer, parameter fileio_base_mod::fextlen = 4
private

file name extension length

Definition at line 79 of file fileio_base.f90.

◆ fmextstr

character(len=fmltlen), save fileio_base_mod::fmextstr = ""
private

multi process string, overwritten below

Definition at line 87 of file fileio_base.f90.

◆ fmltlen

integer, parameter fileio_base_mod::fmltlen = 5
private

length of multi process string (parallel mode only)

Definition at line 80 of file fileio_base.f90.

◆ fnamlen

integer, parameter fileio_base_mod::fnamlen = 256
private

file name length (without any extension)

Definition at line 82 of file fileio_base.f90.

◆ fpatlen

integer, parameter fileio_base_mod::fpatlen = 1024
private

file path length (without file name)

Definition at line 83 of file fileio_base.f90.

◆ gnuplot

integer, parameter, public fileio_base_mod::gnuplot = 2

Definition at line 266 of file fileio_base.f90.

◆ lastunit

integer, save fileio_base_mod::lastunit = 10
private

Definition at line 272 of file fileio_base.f90.

◆ maxcycles

integer, parameter fileio_base_mod::maxcycles = 10000
private

max. number of data files (not counting multiple files per time step in parallel mode)

Definition at line 93 of file fileio_base.f90.

◆ maxmltfiles

integer, parameter fileio_base_mod::maxmltfiles = 1000
private

max. number files per time step (parallel mode with one file per node)

Definition at line 89 of file fileio_base.f90.

◆ readend

integer, parameter, public fileio_base_mod::readend = 2

readonly access at end

Definition at line 255 of file fileio_base.f90.

◆ readonly

integer, parameter, public fileio_base_mod::readonly = 1

readonly access

Definition at line 254 of file fileio_base.f90.

◆ replace

integer, parameter, public fileio_base_mod::replace = 3

read/write access replacing file

Definition at line 256 of file fileio_base.f90.

◆ vtk

integer, parameter, public fileio_base_mod::vtk = 4

Definition at line 267 of file fileio_base.f90.

◆ xdmf

integer, parameter, public fileio_base_mod::xdmf = 7

Definition at line 270 of file fileio_base.f90.