lib_hdf_write_m Module

Write library for writing hdf5 files use by components


Uses

  • module~~lib_hdf_write_m~~UsesGraph module~lib_hdf_write_m lib_hdf_write_m h5ds h5ds module~lib_hdf_write_m->h5ds h5lt h5lt module~lib_hdf_write_m->h5lt hdf5 hdf5 module~lib_hdf_write_m->hdf5 iso_c_binding iso_c_binding module~lib_hdf_write_m->iso_c_binding module~krn_global_tools_m krn_global_tools_m module~lib_hdf_write_m->module~krn_global_tools_m module~lib_input_m lib_input_m module~lib_hdf_write_m->module~lib_input_m module~krn_global_tools_m->iso_c_binding ieee_arithmetic ieee_arithmetic module~krn_global_tools_m->ieee_arithmetic iso_fortran_env iso_fortran_env module~krn_global_tools_m->iso_fortran_env module~lib_input_m->h5lt module~lib_input_m->hdf5 module~lib_input_m->module~krn_global_tools_m fortran_yaml_c fortran_yaml_c module~lib_input_m->fortran_yaml_c

Used by

  • module~~lib_hdf_write_m~~UsedByGraph module~lib_hdf_write_m lib_hdf_write_m module~cmp_channel_init_m cmp_channel_init_m module~cmp_channel_init_m->module~lib_hdf_write_m module~krn_simulation_m krn_simulation_m module~cmp_channel_init_m->module~krn_simulation_m module~lib_he_thermo_m lib_He_thermo_m module~cmp_channel_init_m->module~lib_he_thermo_m module~cmp_solid_init_m cmp_solid_init_m module~cmp_solid_init_m->module~lib_hdf_write_m module~cmp_solid_init_m->module~krn_simulation_m module~cmp_strand_init_m cmp_strand_init_m module~cmp_strand_init_m->module~lib_hdf_write_m module~cmp_strand_init_m->module~krn_simulation_m module~krn_simulation_m->module~lib_hdf_write_m module~cmp_boundary_init_m cmp_boundary_init_m module~cmp_boundary_init_m->module~krn_simulation_m module~cmp_boundary_init_m->module~lib_he_thermo_m module~cmp_channel_calc_m cmp_channel_calc_m module~cmp_channel_calc_m->module~cmp_channel_init_m module~cmp_channel_calc_m->module~krn_simulation_m module~cmp_channel_source_terms_m cmp_channel_source_terms_m module~cmp_channel_calc_m->module~cmp_channel_source_terms_m module~cmp_channel_flux_m cmp_channel_flux_m module~cmp_channel_flux_m->module~cmp_channel_init_m module~cmp_channel_flux_m->module~lib_he_thermo_m module~cmp_channel_source_terms_m->module~cmp_channel_init_m module~cmp_channel_source_terms_m->module~lib_he_thermo_m module~cmp_circulator_init_m cmp_circulator_init_m module~cmp_circulator_init_m->module~krn_simulation_m module~cmp_circulator_init_m->module~lib_he_thermo_m module~cmp_ffsrclink_init_m cmp_FFsrcLink_init_m module~cmp_ffsrclink_init_m->module~krn_simulation_m module~cmp_junction_init_m cmp_junction_init_m module~cmp_junction_init_m->module~krn_simulation_m module~cmp_junction_init_m->module~lib_he_thermo_m module~cmp_mesh2d_calc_m cmp_mesh2D_calc_m module~cmp_mesh2d_calc_m->module~krn_simulation_m module~cmp_mesh2d_init_m cmp_mesh2D_init_m module~cmp_mesh2d_calc_m->module~cmp_mesh2d_init_m module~cmp_mesh2d_init_m->module~krn_simulation_m module~cmp_solid_calc_m cmp_solid_calc_m module~cmp_solid_calc_m->module~cmp_solid_init_m module~cmp_solid_calc_m->module~krn_simulation_m module~cmp_solid_flux_m cmp_solid_flux_m module~cmp_solid_flux_m->module~cmp_solid_init_m module~cmp_strand_calc_m cmp_strand_calc_m module~cmp_strand_calc_m->module~cmp_strand_init_m module~cmp_strand_source_terms_m cmp_strand_source_terms_m module~cmp_strand_calc_m->module~cmp_strand_source_terms_m module~cmp_strand_flux_m cmp_strand_flux_m module~cmp_strand_flux_m->module~cmp_strand_init_m module~cmp_strand_source_terms_m->module~cmp_strand_init_m module~krn_linear_system_m krn_linear_system_m module~krn_linear_system_m->module~krn_simulation_m module~lib_he_thermo_m->module~krn_simulation_m program~reims_p reims_p program~reims_p->module~krn_simulation_m program~reims_p->module~cmp_channel_calc_m program~reims_p->module~cmp_channel_flux_m program~reims_p->module~cmp_mesh2d_calc_m program~reims_p->module~cmp_solid_calc_m program~reims_p->module~cmp_solid_flux_m program~reims_p->module~cmp_strand_calc_m program~reims_p->module~cmp_strand_flux_m program~reims_p->module~krn_linear_system_m module~cmp_boundary_calc_m cmp_boundary_calc_m program~reims_p->module~cmp_boundary_calc_m module~cmp_circulator_calc_m cmp_circulator_calc_m program~reims_p->module~cmp_circulator_calc_m module~cmp_ffsrclink_calc_m cmp_FFsrcLink_calc_m program~reims_p->module~cmp_ffsrclink_calc_m module~cmp_junction_calc_m cmp_junction_calc_m program~reims_p->module~cmp_junction_calc_m module~cmp_mesh2d_flux_m cmp_mesh2D_flux_m program~reims_p->module~cmp_mesh2d_flux_m module~cmp_mesh2d_hdf5_write_m cmp_mesh2D_hdf5_write_m program~reims_p->module~cmp_mesh2d_hdf5_write_m module~cmp_boundary_calc_m->module~cmp_boundary_init_m module~cmp_boundary_calc_m->module~lib_he_thermo_m module~cmp_circulator_calc_m->module~cmp_circulator_init_m module~cmp_ffsrclink_calc_m->module~cmp_ffsrclink_init_m module~cmp_ffsrclink_calc_m->module~lib_he_thermo_m module~cmp_junction_calc_m->module~cmp_junction_init_m module~cmp_junction_calc_m->module~lib_he_thermo_m module~cmp_mesh2d_flux_m->module~cmp_mesh2d_init_m module~cmp_mesh2d_hdf5_write_m->module~cmp_mesh2d_init_m

Variables

Type Visibility Attributes Name Initial
real(kind=dp), public, parameter :: sim_delta = 1.0e-10_dp

Minimum value for criteria calculation


Interfaces

interface

  • private function H5Fstart_swmr_write(f_id) bind(C,name='H5Fstart_swmr_write')

    Arguments

    Type IntentOptional Attributes Name
    integer(kind=hid_t), value :: f_id

    Return Value integer

interface

  • private function H5Dflush(dset_id) bind(C,name='H5Dflush')

    Arguments

    Type IntentOptional Attributes Name
    integer(kind=hid_t), intent(in), value :: dset_id

    Return Value integer


Derived Types

type, public ::  hdf_desc_t

Components

Type Visibility Attributes Name Initial
character(len=:), public, allocatable :: name

name that will appear in HDF5 file

real(kind=dp), public, allocatable :: node_x(:)

spacial axes (scale) of 1d element

real(kind=dp), public, pointer :: data(:,:)

data to write into hdf5 data table

type, private ::  hdf_desc_p_t

Components

Type Visibility Attributes Name Initial
type(hdf_desc_t), public, pointer :: p

type, private ::  tbl_dsc_t

Components

Type Visibility Attributes Name Initial
character(len=:), public, allocatable :: name
character(len=:), public, allocatable :: vars(:)
type(hdf_desc_p_t), public, allocatable :: comps(:)

type, private ::  growing_h5_tbl_t

Components

Type Visibility Attributes Name Initial
integer(kind=hid_t), public :: dset

Dataset is kept open

integer, public :: rank
integer(kind=hsize_t), public :: dims(8) = 0

Value 3 should be enough

real(kind=dp), public, allocatable :: data(:,:)

type, public ::  hdf5_t

Components

Type Visibility Attributes Name Initial
logical, public :: write_results

from cfg: write result to file active

real(kind=dp), public :: min_save_time

from cfg: minimum time before saving

real(kind=dp), public :: last_saved_time = 0

updated when data is saved

integer, public :: steps_to_revert = 0

nb of HDF5 entries to revert after rollback (persistent across rejected steps)

logical, public :: write_results2D

from cfg: write 2D results to specific files

real(kind=dp), public :: time_btw_2D_writes

from cfg: physical time between 2D writes

integer(kind=hid_t), public :: file_id
type(tbl_dsc_t), public, allocatable :: tbl_dsc(:)
type(growing_h5_tbl_t), public, allocatable :: tables(:)
type(growing_h5_tbl_t), public :: time

growing tables

type(growing_h5_tbl_t), public :: global

growing tables

Type-Bound Procedures

procedure, public :: add_table => hdf5_add_table
procedure, public :: add_to_table => hdf5_add_to_table
procedure, public :: prepare_data => hdf5_prepare_data
procedure, public :: init => hdf5_init
procedure, public :: close => hdf5_close
procedure, public :: write => hdf5_write

Subroutines

private subroutine hdf5_add_table(me, table, variables)

Arguments

Type IntentOptional Attributes Name
class(hdf5_t), intent(inout) :: me
character(len=*), intent(in) :: table
character(len=*), intent(in) :: variables(:)

private subroutine hdf5_add_to_table(me, desc, tbl_name)

Arguments

Type IntentOptional Attributes Name
class(hdf5_t), intent(inout) :: me
type(hdf_desc_t), intent(inout), target :: desc
character(len=*), intent(in) :: tbl_name

private subroutine hdf5_prepare_data(me)

Arguments

Type IntentOptional Attributes Name
class(hdf5_t), intent(inout), target :: me

private subroutine hdf5_init(me, cfg)

Arguments

Type IntentOptional Attributes Name
class(hdf5_t), intent(inout) :: me
class(input_t), intent(in) :: cfg

private subroutine hdf5_data_create(tbl, group_id, time_id, name, vars, comps)

Arguments

Type IntentOptional Attributes Name
type(growing_h5_tbl_t), intent(inout) :: tbl
integer(kind=hid_t), intent(in) :: group_id
integer(kind=hid_t), intent(in) :: time_id
character(len=*), intent(in) :: name
character(len=*), intent(in) :: vars(:)
type(hdf_desc_p_t), intent(inout) :: comps(:)

private subroutine hdf5_write(me, t, dt, t_final)

Arguments

Type IntentOptional Attributes Name
class(hdf5_t), intent(inout) :: me
real(kind=dp), intent(in) :: t
real(kind=dp), intent(in) :: dt
real(kind=dp), intent(in) :: t_final

private subroutine hdf5_close(me)

Arguments

Type IntentOptional Attributes Name
class(hdf5_t), intent(inout) :: me

private subroutine write_atribute_int(location, attribute_name, attribute_value)

Arguments

Type IntentOptional Attributes Name
integer(kind=hid_t), intent(in) :: location

hdf5 file or group id

character(len=*), intent(in) :: attribute_name
integer, intent(in) :: attribute_value(..)

from scalar up to rank 3

private subroutine tbl_h5_revert_dbl(me, n_steps_back)

Arguments

Type IntentOptional Attributes Name
class(growing_h5_tbl_t), intent(inout) :: me
integer, intent(in) :: n_steps_back

private subroutine tbl_h5_create_dbl(me, location, name, datas)

Arguments

Type IntentOptional Attributes Name
class(growing_h5_tbl_t), intent(inout) :: me
integer(kind=hid_t), intent(in) :: location
character(len=*), intent(in) :: name
real(kind=dp), intent(in) :: datas(..)

private subroutine tbl_h5_append_dbl(me, datas)

Arguments

Type IntentOptional Attributes Name
class(growing_h5_tbl_t), intent(inout) :: me
real(kind=dp), intent(in), target :: datas(..)

private subroutine write_vstr1d(location, dset_name, value, length, id_out)

Write 1d variable string array to hdf5 file

Arguments

Type IntentOptional Attributes Name
integer(kind=hid_t), intent(in) :: location

hdf5 file or group id

character(len=*), intent(in) :: dset_name
character(len=*), intent(in) :: value(:)

from scalar up to rank 3

integer(kind=size_t), intent(in) :: length(:)
integer(kind=hid_t), intent(out), optional :: id_out

private subroutine write_attribute_vstr1d(location, attribute_name, value_in, length)

BROKEN: (not variable) Write 1d atribute variable string array to hdf5 file

Arguments

Type IntentOptional Attributes Name
integer(kind=hid_t), intent(in) :: location

hdf5 file or group id

character(len=*), intent(in) :: attribute_name
character(len=*), intent(in) :: value_in(:)

from scalar up to rank 3

integer(kind=size_t), intent(in) :: length(:)

private subroutine write_str_arr(location, dset_name, value, id_out)

Arguments

Type IntentOptional Attributes Name
integer(kind=hid_t), intent(in) :: location

hdf5 file or group id

character(len=*), intent(in) :: dset_name
character(len=*), intent(in) :: value(..)

from rank 1 up to rank 3

integer(kind=hid_t), intent(out), optional :: id_out

private subroutine attach_scale(scale_id, data_id, axies, name, label)

Arguments

Type IntentOptional Attributes Name
integer(kind=hid_t), intent(in) :: scale_id
integer(kind=hid_t), intent(in) :: data_id
integer, intent(in) :: axies
character(len=*), intent(in) :: name
character(len=*), intent(in), optional :: label