HDF5Controller Derived Type

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

  • interface

    private pure module function isDefinedObject(this) result(defined)

    Getter for userDefined

    Arguments

    Type IntentOptional Attributes Name
    class(Object), intent(in) :: this

    Return Value logical

procedure, public :: makeDefined => makeDefinedObject

  • interface

    private pure module subroutine makeDefinedObject(this)

    Set userDefined to .true.

    Arguments

    Type IntentOptional Attributes Name
    class(Object), intent(inout) :: this

procedure, public :: makeUndefined => makeUndefinedObject

  • interface

    private pure module subroutine makeUndefinedObject(this)

    Set userDefined to .false.

    Arguments

    Type IntentOptional Attributes Name
    class(Object), intent(inout) :: this

procedure, public :: outputVarsSerial

  • 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

procedure, public :: loadVarsSerial

  • 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

procedure, public :: outputGridDataSerial

  • 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

procedure, public :: dumpRestartFiles

  • 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

procedure, public :: loadRestartFiles

  • 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

procedure, public :: init => initHDF5Controller

  • 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