hdf5_controller_class Module

Contains serial hdf5 routines for creating files containing variable and grid data as well as parallel restart dump routines


Used by


Interfaces

interface

  • public module subroutine initHDF5Controller(this, varCont, varNames, filepath)

    HDF5 controller initialization routine - determines variables this controller is responsible for and the output path. The default path is "./", corresponding to the executable location in the build tree.

    Arguments

    Type IntentOptional Attributes Name
    class(HDF5Controller), intent(inout) :: this
    type(VariableContainer), intent(in) :: varCont

    Reference variable container

    type(StringArray), intent(in), dimension(:) :: varNames

    Names of variables this controller is responsible for

    character(len=*), intent(in), optional :: filepath

    Filepath this controller will use

interface

  • public module subroutine outputVarsSerial(this, mpiCont, varCont, filename, IDNum)

    Gather and output variables this controller is responsible for. Default filename is "ReMKiT1DVarOutput". If IDnum is present it is appended to the filename. The output is serial from processor 0.

    Arguments

    Type IntentOptional Attributes Name
    class(HDF5Controller), intent(inout) :: this
    type(MPIController), intent(inout) :: mpiCont

    MPIController used by the HDF5 controller for communication

    type(VariableContainer), intent(in) :: varCont

    Variable container used for output

    character(len=*), intent(in), optional :: filename

    Name of output file

    integer(kind=ik), intent(in), optional :: IDNum

    IDNum to be appended to filename

interface

  • public module subroutine loadVarsSerial(this, mpiCont, varCont, filename)

    Load and scatter variables this controller is responsible for. Default filename is "ReMKiT1DVarInput". If a variable is not found in the file it is set to 0.

    Arguments

    Type IntentOptional Attributes Name
    class(HDF5Controller), intent(inout) :: this
    type(MPIController), intent(inout) :: mpiCont

    MPIController used by the HDF5 controller for communication

    type(VariableContainer), intent(inout) :: varCont

    Variable container to be loaded into

    character(len=*), intent(in), optional :: filename

    Name of input file

interface

  • public module subroutine outputGridDataSerial(this, mpiCont, gridObj, filename)

    Gather and output grid data. Default filename is "ReMKiT1DGridOutput". The output is serial from processor 0.

    Arguments

    Type IntentOptional Attributes Name
    class(HDF5Controller), intent(inout) :: this
    type(MPIController), intent(inout) :: mpiCont

    MPIController used by the HDF5 controller for communication

    type(Grid), intent(in) :: gridObj

    Output grid object

    character(len=*), intent(in), optional :: filename

    Name of output file

interface

  • public module subroutine dumpRestartFiles(this, mpiCont, varCont, filename)

    Each processor dumps all of its variables into separate files. Default filename "restart", appended with processor rank.

    Arguments

    Type IntentOptional Attributes Name
    class(HDF5Controller), intent(inout) :: this
    type(MPIController), intent(inout) :: mpiCont

    MPIController used by the HDF5 controller for communication

    type(VariableContainer), intent(in) :: varCont

    Variable container used for output

    character(len=*), intent(in), optional :: filename

    Name of output file

interface

  • public module subroutine loadRestartFiles(this, mpiCont, varCont, filename)

    Each processor loads all of its variables from files of the form filename_rank.h5. It is assumed that the files exist and that they are compatible with the variable container

    Arguments

    Type IntentOptional Attributes Name
    class(HDF5Controller), intent(inout) :: this
    type(MPIController), intent(inout) :: mpiCont

    MPIController used by the HDF5 controller for communication

    type(VariableContainer), intent(inout) :: varCont

    Variable container used for output

    character(len=*), intent(in), optional :: filename

    Name of output file


Derived Types

type, public, extends(Object) ::  HDF5Controller

Controller object responsible for HDF5 IO

Components

Type Visibility Attributes Name Initial
logical, public :: userDefined = .false.

True only if user explicitly sets it to true

type(StringArray), private, allocatable, dimension(:) :: IOVarNames

Variable names this controller is responsible for

integer(kind=ik), private, allocatable, dimension(:) :: IOVarIndices

Indices of variables this controller is responsible for

character(len=:), private, allocatable :: filepath

IO filepath

type(RealArray), private, allocatable, dimension(:) :: IOBuffer

Buffer used in HDF5 IO

Type-Bound Procedures

procedure, public :: isDefined => isDefinedObject
procedure, public :: makeDefined => makeDefinedObject
procedure, public :: makeUndefined => makeUndefinedObject
procedure, public :: outputVarsSerial
procedure, public :: loadVarsSerial
procedure, public :: outputGridDataSerial
procedure, public :: dumpRestartFiles
procedure, public :: loadRestartFiles
procedure, public :: init => initHDF5Controller