h5hut_obj Derived Type

type, public :: h5hut_obj

A utility to read/write files in HDF5 using H5hut


Inherits

type~~h5hut_obj~~InheritsGraph type~h5hut_obj h5hut_obj type~hdf5_obj hdf5_obj type~h5hut_obj->type~hdf5_obj hdf5 type~parallel_obj parallel_obj type~h5hut_obj->type~parallel_obj parallel type~hdf5_obj->type~parallel_obj parallel type~hashtbl_obj hashtbl_obj type~hdf5_obj->type~hashtbl_obj tbl MPI_Datatype MPI_Datatype type~parallel_obj->MPI_Datatype REAL_SP, REAL_DP, REAL_WP, COMPLEX_SP, COMPLEX_DP, COMPLEX_WP, INTEGER, INT8, LOGICAL type~communicators communicators type~parallel_obj->type~communicators comm type~patch patch type~parallel_obj->type~patch rank MPI_Comm MPI_Comm type~communicators->MPI_Comm w, g type~sllist_obj sllist_obj type~hashtbl_obj->type~sllist_obj vec type~sllist_obj->type~sllist_obj child

Components

Type Visibility Attributes Name Initial
logical, private :: block_group_exists = .false.

Flag to determine if block group has already been created

character(len=str64), private :: filename

file to read/write

type(hdf5_obj), private :: hdf5

HDF5 object

integer, private :: nsteps

Number of steps in file

type(parallel_obj), private, pointer :: parallel => null()

Associated parallel structure

character(len=str64), private :: step_name

Group name for step being worked on


Type-Bound Procedures

procedure, public :: Finalize => h5hut_obj_Final

  • private impure subroutine h5hut_obj_Final(this)

    Finalizes object and frees memeory.

    Arguments

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

    A H5hut object

procedure, public :: GetNFields => h5hut_obj_GetNFields

  • private impure subroutine h5hut_obj_GetNFields(this, nfields)

    Gets number of fields in step.

    Arguments

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

    A H5hut object

    integer, intent(out) :: nfields

    Number of fields

procedure, public :: GetNPoints => h5hut_obj_GetNPoints

  • private impure subroutine h5hut_obj_GetNPoints(this, npoints)

    Gets number of data points in step. H5HUT assumes that all datasets have the same number of points, thus we return the number of points of the first dataset we find.

    Arguments

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

    A H5hut object

    integer, intent(out) :: npoints

    Number of data points

procedure, public :: GetNSteps => h5hut_obj_GetNSteps

  • private impure function h5hut_obj_GetNSteps(this) result(val)

    Counts and returns number of steps in file.

    Arguments

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

    A H5hut object

    Return Value integer

    Number of steps in file

procedure, public :: Initialize => h5hut_obj_Init

  • private impure subroutine h5hut_obj_Init(this, filename, access_flag, parallel)

    Initializes structure.

    Arguments

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

    A H5hut object

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

    File to read/write

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

    File access mode

    type(parallel_obj), intent(in), target :: parallel

    Parallel structure to link with

procedure, public :: JumpToStep => h5hut_obj_JumpToStep

  • private impure subroutine h5hut_obj_JumpToStep(this, step, iter, time, label_iter, label_time)

    Jumps to a specific step.

    Arguments

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

    A H5hut object

    integer, intent(in) :: step

    Step in H5HUT file

    integer, intent(out) :: iter

    Iteration at this step

    real(kind=wp), intent(out) :: time

    Time at this step

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

    Optional iteration label

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

    Optional time label

procedure, public :: LastTimeStep => h5hut_obj_LastTimeStep

  • private impure subroutine h5hut_obj_LastTimeStep(this, iter, time, label_iter, label_time)

    Gets information about the last step.

    Arguments

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

    A H5hut object

    integer, intent(out) :: iter

    Iteration at last step

    real(kind=WP), intent(out) :: time

    Time at last step

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

    Optional iteration label

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

    Optional time label

procedure, public :: NewTimeStep => h5hut_obj_NewTimeStep

  • private impure subroutine h5hut_obj_NewTimeStep(this, iter, time, label_iter, label_time)

    Creates a new step and updates attributes.

    Arguments

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

    A H5hut object

    integer, intent(in) :: iter

    iteration counter

    real(kind=WP), intent(in) :: time

    Time value

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

    Optional iteration label

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

    Optional time label

generic, public :: Read => h5hut_obj_Read1D, h5hut_obj_Read3D

  • private impure subroutine h5hut_obj_Read1D(this, name, array, offset)

    Reads Lagrangian/1D data fom a h5hut file. If no offset is provided, uses default h5hut file view. Otherwise, sets file view manually.

    Arguments

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

    A H5hut object

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

    Variable name

    class(*), intent(out) :: array(:)

    1-D data array

    integer, intent(in), optional :: offset

    Indicates number of elements to skip before reading

  • private impure subroutine h5hut_obj_Read3D(this, name, array, lo, hi)

    Reads Eulerian/3D data from a h5hut file.

    Arguments

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

    A H5hut object

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

    Variable name

    class(*), intent(out) :: array(:,:,:)

    3-D data array

    integer, intent(in) :: lo(3)

    Low bounds

    integer, intent(in) :: hi(3)

    High bounds

generic, public :: ReadAttributes => h5hut_obj_ReadAttributes0D, h5hut_obj_ReadAttributes1D

  • private impure subroutine h5hut_obj_ReadAttributes0D(this, label, val)

    Reads scalar attributes.

    Arguments

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

    A H5hut object

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

    Attribute label

    class(*), intent(out) :: val

    Value associated with attribute

  • private impure subroutine h5hut_obj_ReadAttributes1D(this, label, val)

    Reads an array of attributes.

    Arguments

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

    A H5hut object

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

    Attribute label

    class(*), intent(out) :: val(:)

    Value associated with attribute

procedure, public :: SetStep => h5hut_obj_SetStep

  • private impure subroutine h5hut_obj_SetStep(this, step)

    Sets the current step in file, and possibly create a new one, if this step does not exist yet.

    Arguments

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

    A H5hut object

    integer, intent(in) :: step

    Step to select

procedure, public :: StepCount => h5hut_obj_StepCount

  • private impure function h5hut_obj_StepCount(this) result(val)

    Returns number of steps.

    Arguments

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

    A H5hut object

    Return Value integer

    Number of steps

generic, public :: Write => h5hut_obj_Write1D, h5hut_obj_Write3D

  • private impure subroutine h5hut_obj_Write1D(this, name, array)

    Writes Lagrangian/1D data to a h5hut file.

    Arguments

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

    A H5hut object

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

    Variable name

    class(*), intent(in) :: array(:)

    1-D data array

  • private impure subroutine h5hut_obj_Write3D(this, name, array, lo, hi)

    Writes Eulerian/3D data to a h5hut file.

    Arguments

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

    A H5hut object

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

    Variable name

    class(*), intent(in) :: array(:,:,:)

    3-D data array

    integer, intent(in) :: lo(3)

    Low bounds

    integer, intent(in) :: hi(3)

    High bounds

generic, public :: WriteAttributes => h5hut_obj_WriteAttributes0D, h5hut_obj_WriteAttributes1D

  • private impure subroutine h5hut_obj_WriteAttributes0D(this, label, val)

    Writes scalar attributes.

    Arguments

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

    A H5hut object

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

    Attribute label

    class(*), intent(in) :: val

    Value associated with attribute

  • private impure subroutine h5hut_obj_WriteAttributes1D(this, label, val)

    Writes an array of attributes.

    Arguments

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

    A H5hut object

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

    attribute label

    class(*), intent(in) :: val(:)

    Value associated with attribute

procedure, public :: WriteGrid => h5hut_obj_WriteGrid

  • private impure subroutine h5hut_obj_WriteGrid(this, name, xlo, dx)

    Writes grid attributes.

    Arguments

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

    A H5hut object

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

    Variable name

    real(kind=wp), intent(in) :: xlo(3)

    Coordinate of the low bound

    real(kind=wp), intent(in) :: dx(3)

    Grid spacing

procedure, private :: h5hut_obj_Read1D

  • private impure subroutine h5hut_obj_Read1D(this, name, array, offset)

    Reads Lagrangian/1D data fom a h5hut file. If no offset is provided, uses default h5hut file view. Otherwise, sets file view manually.

    Arguments

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

    A H5hut object

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

    Variable name

    class(*), intent(out) :: array(:)

    1-D data array

    integer, intent(in), optional :: offset

    Indicates number of elements to skip before reading

procedure, private :: h5hut_obj_Read3D

  • private impure subroutine h5hut_obj_Read3D(this, name, array, lo, hi)

    Reads Eulerian/3D data from a h5hut file.

    Arguments

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

    A H5hut object

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

    Variable name

    class(*), intent(out) :: array(:,:,:)

    3-D data array

    integer, intent(in) :: lo(3)

    Low bounds

    integer, intent(in) :: hi(3)

    High bounds

procedure, private :: h5hut_obj_ReadAttributes0D

  • private impure subroutine h5hut_obj_ReadAttributes0D(this, label, val)

    Reads scalar attributes.

    Arguments

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

    A H5hut object

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

    Attribute label

    class(*), intent(out) :: val

    Value associated with attribute

procedure, private :: h5hut_obj_ReadAttributes1D

  • private impure subroutine h5hut_obj_ReadAttributes1D(this, label, val)

    Reads an array of attributes.

    Arguments

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

    A H5hut object

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

    Attribute label

    class(*), intent(out) :: val(:)

    Value associated with attribute

procedure, private :: h5hut_obj_Write1D

  • private impure subroutine h5hut_obj_Write1D(this, name, array)

    Writes Lagrangian/1D data to a h5hut file.

    Arguments

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

    A H5hut object

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

    Variable name

    class(*), intent(in) :: array(:)

    1-D data array

procedure, private :: h5hut_obj_Write3D

  • private impure subroutine h5hut_obj_Write3D(this, name, array, lo, hi)

    Writes Eulerian/3D data to a h5hut file.

    Arguments

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

    A H5hut object

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

    Variable name

    class(*), intent(in) :: array(:,:,:)

    3-D data array

    integer, intent(in) :: lo(3)

    Low bounds

    integer, intent(in) :: hi(3)

    High bounds

procedure, private :: h5hut_obj_WriteAttributes0D

  • private impure subroutine h5hut_obj_WriteAttributes0D(this, label, val)

    Writes scalar attributes.

    Arguments

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

    A H5hut object

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

    Attribute label

    class(*), intent(in) :: val

    Value associated with attribute

procedure, private :: h5hut_obj_WriteAttributes1D

  • private impure subroutine h5hut_obj_WriteAttributes1D(this, label, val)

    Writes an array of attributes.

    Arguments

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

    A H5hut object

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

    attribute label

    class(*), intent(in) :: val(:)

    Value associated with attribute