leapIO_hdf5 Module

Read/write data in the HDF5 format


Uses

  • module~~leapio_hdf5~~UsesGraph module~leapio_hdf5 leapIO_hdf5 hdf5 hdf5 module~leapio_hdf5->hdf5 module~leapkinds leapKinds module~leapio_hdf5->module~leapkinds module~leapparallel leapParallel module~leapio_hdf5->module~leapparallel module~leaputils leapUtils module~leapio_hdf5->module~leaputils iso_fortran_env iso_fortran_env module~leapkinds->iso_fortran_env module~leapparallel->module~leapkinds module~leapparser leapParser module~leapparallel->module~leapparser mpi_f08 mpi_f08 module~leapparallel->mpi_f08 module~leaputils->module~leapkinds module~leaputils->mpi_f08 module~leapparser->module~leapkinds module~leapcli leapCli module~leapparser->module~leapcli module~leapcli->module~leapkinds

Used by

  • module~~leapio_hdf5~~UsedByGraph module~leapio_hdf5 leapIO_hdf5 module~leapio leapIO module~leapio->module~leapio_hdf5 proc~block_obj_read block_obj%block_obj_Read proc~block_obj_read->module~leapio_hdf5 proc~block_obj_write block_obj%block_obj_Write proc~block_obj_write->module~leapio_hdf5 module~immersed_boundaries_markers immersed_boundaries_markers module~immersed_boundaries_markers->module~leapio module~leapeulerian leapEulerian module~immersed_boundaries_markers->module~leapeulerian module~leaplagrangian leapLagrangian module~immersed_boundaries_markers->module~leaplagrangian module~leapdiffop leapDiffOp module~immersed_boundaries_markers->module~leapdiffop module~leaphypre leapHypre module~immersed_boundaries_markers->module~leaphypre module~immersed_boundaries_solids immersed_boundaries_solids module~immersed_boundaries_solids->module~leapio module~immersed_boundaries_solids->module~immersed_boundaries_markers module~immersed_boundaries_solids->module~leapeulerian module~immersed_boundaries_solids->module~leaplagrangian module~leapeulerian->module~leapio module~leaplagrangian->module~leapio module~particles_point particles_point module~particles_point->module~leapio module~particles_point->module~leapeulerian module~particles_point->module~leaplagrangian module~particles_resolved particles_resolved module~particles_resolved->module~leapio module~particles_resolved->module~leapeulerian module~particles_resolved->module~leaplagrangian module~immersed_boundaries immersed_boundaries module~particles_resolved->module~immersed_boundaries module~particles_resolved->module~leapdiffop proc~bc_set_read bc_set%bc_set_Read proc~bc_set_read->module~leapio proc~bc_set_write bc_set%bc_set_Write proc~bc_set_write->module~leapio module~cdifs cdifs module~cdifs->module~leapeulerian module~cdifs->module~particles_resolved module~cdifs_cases cdifs_cases module~cdifs->module~cdifs_cases module~cdifs->module~immersed_boundaries module~leapbc leapBC module~cdifs->module~leapbc module~cdifs->module~leapdiffop module~cdifs->module~leaphypre module~cdifs_cases->module~leapeulerian module~grans grans module~grans->module~leapeulerian module~grans->module~particles_point module~grans->module~particles_resolved module~grans_cases grans_cases module~grans->module~grans_cases module~grans->module~immersed_boundaries module~grans->module~leaphypre module~grans_cases->module~leapeulerian module~grans_cases->module~particles_point module~grans_cases->module~particles_resolved module~grans_cases->module~immersed_boundaries module~immersed_boundaries->module~immersed_boundaries_markers module~immersed_boundaries->module~immersed_boundaries_solids module~leapbc->module~leapeulerian module~leapdiffop->module~leapeulerian module~leapdiffop->module~leapbc module~leaphypre->module~leapeulerian module~nga_smod nga_smod module~nga_smod->module~particles_point proc~add_markers add_markers proc~add_markers->module~particles_resolved proc~add_markers->module~immersed_boundaries proc~add_markers~2 add_markers proc~add_markers~2->module~particles_resolved proc~add_markers~2->module~immersed_boundaries proc~bc_set_buildmask bc_set%bc_set_BuildMask proc~bc_set_buildmask->module~leapeulerian proc~cdifs_rebound_respart cdifs_rebound_ResPart proc~cdifs_rebound_respart->module~particles_resolved proc~cdifs_settling_sphere_respart cdifs_settling_sphere_ResPart proc~cdifs_settling_sphere_respart->module~particles_resolved module~cavity_smod cavity_smod module~cavity_smod->module~cdifs_cases module~cdifs_advancesolution_smod cdifs_AdvanceSolution_smod module~cdifs_advancesolution_smod->module~cdifs module~cdifs_monitor_smod cdifs_Monitor_smod module~cdifs_monitor_smod->module~cdifs module~cdifs_preparesolver_smod cdifs_PrepareSolver_smod module~cdifs_preparesolver_smod->module~cdifs module~cdifs_writeoutputdata_smod cdifs_WriteOutputData_smod module~cdifs_writeoutputdata_smod->module~cdifs module~cdifs_writerestartdata_smod cdifs_WriteRestartData_smod module~cdifs_writerestartdata_smod->module~cdifs module~channel_flow_smod channel_flow_smod module~channel_flow_smod->module~cdifs_cases module~cylinder_smod cylinder_smod module~cylinder_smod->module~cdifs_cases module~grans_advancesolution_smod grans_AdvanceSolution_smod module~grans_advancesolution_smod->module~grans module~grans_module_smod grans_module_smod module~grans_module_smod->module~grans module~grans_preparesolver_smod grans_PrepareSolver_smod module~grans_preparesolver_smod->module~grans module~grans_writeoutputdata_smod grans_WriteOutputData_smod module~grans_writeoutputdata_smod->module~grans module~grans_writerestartdata_smod grans_WriteRestartData_smod module~grans_writerestartdata_smod->module~grans module~headon_collision_smod headon_collision_smod module~headon_collision_smod->module~grans_cases module~homogeneous_cooling_smod homogeneous_cooling_smod module~homogeneous_cooling_smod->module~grans_cases module~lamb_oseen_smod lamb_oseen_smod module~lamb_oseen_smod->module~cdifs_cases module~rebound_smod rebound_smod module~rebound_smod->module~cdifs_cases module~rotating_drum_smod rotating_drum_smod module~rotating_drum_smod->module~grans_cases module~settling_sphere_smod settling_sphere_smod module~settling_sphere_smod->module~cdifs_cases module~taylor_green_smod taylor_green_smod module~taylor_green_smod->module~cdifs_cases module~vortex_dipole_smod vortex_dipole_smod module~vortex_dipole_smod->module~cdifs_cases module~vortex_impingement_smod vortex_impingement_smod module~vortex_impingement_smod->module~cdifs_cases proc~cdifs_channel_flow_bcs cdifs_channel_flow_bcs proc~cdifs_channel_flow_bcs->module~leapbc proc~cdifs_cylinder_bcs cdifs_cylinder_bcs proc~cdifs_cylinder_bcs->module~leapbc proc~cdifs_cylinder_ib cdifs_cylinder_IB proc~cdifs_cylinder_ib->module~immersed_boundaries proc~cdifs_lamb_oseen_bcs cdifs_lamb_oseen_bcs proc~cdifs_lamb_oseen_bcs->module~leapbc proc~cdifs_lid_driven_cavity_bcs cdifs_lid_driven_cavity_bcs proc~cdifs_lid_driven_cavity_bcs->module~leapbc proc~cdifs_obj_preparesolveroperators cdifs_obj_PrepareSolverOperators proc~cdifs_obj_preparesolveroperators->module~leapbc proc~cdifs_obj_preparesolveroperatorsdiv cdifs_obj_PrepareSolverOperatorsDIV proc~cdifs_obj_preparesolveroperatorsdiv->module~leapbc proc~cdifs_obj_preparesolveroperatorspgrad cdifs_obj_PrepareSolverOperatorsPGRAD proc~cdifs_obj_preparesolveroperatorspgrad->module~leapbc proc~cdifs_obj_preparesolveroperatorsvlap cdifs_obj_PrepareSolverOperatorsVLAP proc~cdifs_obj_preparesolveroperatorsvlap->module~leapbc proc~cdifs_rebound_bcs cdifs_rebound_bcs proc~cdifs_rebound_bcs->module~leapbc proc~cdifs_rebound_ib cdifs_rebound_IB proc~cdifs_rebound_ib->module~immersed_boundaries proc~cdifs_settling_sphere_bcs cdifs_settling_sphere_bcs proc~cdifs_settling_sphere_bcs->module~leapbc proc~cdifs_settling_sphere_ib cdifs_settling_sphere_IB proc~cdifs_settling_sphere_ib->module~immersed_boundaries proc~cdifs_taylor_green_bcs cdifs_taylor_green_bcs proc~cdifs_taylor_green_bcs->module~leapbc proc~cdifs_vortex_dipole_bcs cdifs_vortex_dipole_bcs proc~cdifs_vortex_dipole_bcs->module~leapbc proc~cdifs_vortex_impingement_bcs cdifs_vortex_impingement_bcs proc~cdifs_vortex_impingement_bcs->module~leapbc proc~grans_obj_preparesolver_operators grans_obj_PrepareSolver_operators proc~grans_obj_preparesolver_operators->module~leapdiffop proc~marker_set_computesolidvolfrac marker_set%marker_set_ComputeSolidVolFrac proc~marker_set_computesolidvolfrac->module~leapdiffop proc~op_obj_applylaplaciandc op_obj%op_obj_ApplyLaplacianDC proc~op_obj_applylaplaciandc->module~leapbc program~main main program~main->module~cdifs program~main->module~grans

Variables

Type Visibility Attributes Name Initial
integer, private, parameter :: HDF5_SET_HTBL_SIZE = 20

Derived Types

type, public ::  hdf5_obj

A utility to read/write files in HDF5

Components

Type Visibility Attributes Name Initial
integer(kind=HID_T), public :: fid

File identifier

character(len=:), public, allocatable :: filename

file to read/write

integer(kind=HID_T), public, allocatable :: gid(:)

Group identifier

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

Associated parallel structure

integer, private :: group_count = 0

Number of groups

type(hashtbl_obj), private :: tbl

Hash table

Type-Bound Procedures

procedure, public :: Close => hdf5_obj_Close
procedure, public :: CloseGroup => hdf5_obj_CloseGroup
procedure, public :: CreateGroup => hdf5_obj_CreateGroup
procedure, public :: Finalize => hdf5_obj_Final
procedure, public :: Initialize => hdf5_obj_Init
procedure, public :: Open => hdf5_obj_Open
procedure, public :: OpenGroup => hdf5_obj_OpenGroup
generic, public :: Read => hdf5_obj_Read3D, hdf5_obj_Read1D
generic, public :: ReadAttributes => hdf5_obj_ReadAttributes0D, hdf5_obj_ReadAttributes1D
procedure, public :: ReadCoord => hdf5_obj_ReadCoord
procedure, public :: ReadGroupNames => hdf5_obj_ReadGroupNames
generic, public :: Write => hdf5_obj_Write3D, hdf5_obj_Write1D
generic, public :: WriteAttributes => hdf5_obj_WriteAttributes0D, hdf5_obj_WriteAttributes1D
procedure, public :: WriteCoord => hdf5_obj_WriteCoord
procedure, private, nopass :: FixGroupName => hdf5_obj_FixGroupName
procedure, private :: GetGroupIndex => hdf5_obj_GetGroupIndex
procedure, private :: GetGroupObject => hdf5_obj_GetGroupObject
procedure, private :: hdf5_obj_Read1D
procedure, private :: hdf5_obj_Read3D
procedure, private :: hdf5_obj_ReadAttributes0D
procedure, private :: hdf5_obj_ReadAttributes1D
procedure, private :: hdf5_obj_Write1D
procedure, private :: hdf5_obj_Write3D
procedure, private :: hdf5_obj_WriteAttributes0D
procedure, private :: hdf5_obj_WriteAttributes1D

Functions

private pure function hdf5_obj_FixGroupName(groupname) result(val)

Function that will append and prepend '/' if missing

Arguments

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

Return Value character(len=:), allocatable

private pure function hdf5_obj_GetGroupIndex(this, name) result(val)

Returns the index of a group

Arguments

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

A HDF5 object

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

Name of region

Return Value integer

private impure function hdf5_obj_GetGroupObject(this, name) result(val)

Returns the HDF5 object id of the group

Arguments

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

A HDF5 object

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

Name of region

Return Value integer(kind=HID_T)


Subroutines

private impure subroutine hdf5_obj_Close(this)

Close hdf5 file

Arguments

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

A HDF5 object

private impure subroutine hdf5_obj_CloseGroup(this, groupname)

Close an HDF5 group

Arguments

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

A HDF5 object

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

Group to close

private impure subroutine hdf5_obj_CreateGroup(this, groupname)

Create a group (analogous to directory) in an HDF5 file and update hash table

Arguments

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

A HDF5 object

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

File to read/write

private impure subroutine hdf5_obj_Final(this)

Finalize the hdf5 object

Arguments

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

A HDF5 object

private impure subroutine hdf5_obj_Init(this, filename, access_flag, parallel)

Initialize the hdf5 object

Arguments

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

A HDF5 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 from main program

private impure subroutine hdf5_obj_Open(this, flag)

Open a hdf5 file

Arguments

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

A HDF5 object

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

Access mode

private impure subroutine hdf5_obj_OpenGroup(this, groupname)

Open a group (analogous to directory) in an HDF5 file and updates hash table

Arguments

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

A HDF5 object

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

File to read/write

private impure subroutine hdf5_obj_Read1D(this, basegroup, name, array)

Read a 1D dataset located under basegroup and given by name

Arguments

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

A HDF5 object

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

Parent group containing the dataset

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

Dataset name

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

Data array

private impure subroutine hdf5_obj_Read3D(this, basegroup, name, array, lo, hi)

Read a 3D dataset located under basegroup and given by name

Arguments

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

A HDF5 object

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

Parent group containing the dataset

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

Dataset name

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

Data array

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

Low bounds

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

High bounds

private impure subroutine hdf5_obj_ReadAttributes0D(this, groupname, label, val)

Read a scalar attribute under a given group

Arguments

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

A HDF5 object

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

Groupname

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

Attribute label

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

Attribute value

private impure subroutine hdf5_obj_ReadAttributes1D(this, groupname, label, val)

Read a 1-D array of attributes under a given group

Arguments

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

A HDF5 object

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

Groupname

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

Attribute label

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

Attribute values

private impure subroutine hdf5_obj_ReadCoord(this, groupname, name, Coord)

Read coordinates from HDF5 file. Only the root MPI rank does the reading, and then broadcasts to other MPI ranks.

Arguments

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

A HDF5 object

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

Groupname

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

Variable name

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

1-D Coordinates

private impure subroutine hdf5_obj_ReadGroupNames(this, basegroup, names)

Read the groups (i.e., directories) under a given base group in an HDF5 file.

Arguments

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

A HDF5 object

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

Base group to explore

character(len=str64), intent(out), allocatable :: names(:)

Names of groups under the base group

private impure subroutine hdf5_obj_Write1D(this, groupname, name, array)

Write an array/1D data to a HDF5 file.

Arguments

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

A HDF5 object

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

Groupname

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

Variable name

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

1-D data array

private impure subroutine hdf5_obj_Write3D(this, groupname, name, array, lo, hi)

Write Eulerian/3D data to a HDF5 file

Arguments

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

A HDF5 object

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

Groupname

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

private impure subroutine hdf5_obj_WriteAttributes0D(this, groupname, label, val)

Write a scalar attribute

Arguments

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

A HDF5 object

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

Groupname

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

attribute label

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

private impure subroutine hdf5_obj_WriteAttributes1D(this, groupname, label, val)

Write an array of attributes

Arguments

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

A HDF5 object

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

Groupname

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

attribute label

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

private impure subroutine hdf5_obj_WriteCoord(this, groupname, name, Coord)

Write coordinates to HDF5 file. Only the root MPI rank does the writing.

Arguments

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

A HDF5 object

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

Groupname

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

Variable name

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

1-D Coordinates