write Submodule

This submodule is for writing HDF5 data via child submodules


Uses

    • hdf5
    • H5LT
  • module~~write~~UsesGraph module~write write module~h5fortran h5fortran module~write->module~h5fortran H5LT H5LT module~write->H5LT hdf5 hdf5 module~write->hdf5 module~h5fortran->hdf5 iso_c_binding iso_c_binding module~h5fortran->iso_c_binding h5lt h5lt module~h5fortran->h5lt iso_fortran_env iso_fortran_env module~h5fortran->iso_fortran_env

Used by

  • module~~write~~UsedByGraph module~write write module~writer_lt writer_lt module~writer_lt->module~write module~writer_nd writer_ND module~writer_nd->module~write module~writer writer module~writer->module~write

Contents


Subroutines

subroutine set_deflate(self, dims, pid, ierr, chunk_size)

guess chunk size, keeping in mind 1 Megabyte recommended maximum chunk size

Arguments

Type IntentOptional AttributesName
class(hdf5_file), intent(inout) :: self
integer(kind=HSIZE_T), intent(in) :: dims(:)
integer(kind=HID_T), intent(out) :: pid
integer, intent(out) :: ierr
integer, intent(in), optional :: chunk_size(:)

subroutine guess_chunk_size(dims, chunk_size)

based on https://github.com/h5py/h5py/blob/master/h5py/_hl/filters.py refer to https://support.hdfgroup.org/HDF5/Tutor/layout.html Repeatedly loop over the axes, dividing them by 2. Stop when: 1a. We're smaller than the target chunk size, OR 1b. We're within 50% of the target chunk size, AND 2. The chunk is smaller than the maximum chunk size

Read more…

Arguments

Type IntentOptional AttributesName
integer(kind=HSIZE_T), intent(in) :: dims(:)
integer(kind=HSIZE_T), intent(out) :: chunk_size(:)

Module Procedures

module procedure hdf_create module subroutine hdf_create(self, dname, dtype, dims, sid, did, chunk_size, istart, iend, stride, compact)

h5lexists_f can false error with groups--just use h5ltpath_valid

Read more…

Arguments

Type IntentOptional AttributesName
class(hdf5_file), intent(inout) :: self
character(len=*), intent(in) :: dname
integer(kind=HID_T), intent(in) :: dtype
integer(kind=HSIZE_T), intent(in) :: dims(:)
integer(kind=HID_T), intent(out), optional :: sid
integer(kind=HID_T), intent(out), optional :: did
integer, intent(in), optional :: chunk_size(:)
integer, intent(in), optional :: istart(:)
integer, intent(in), optional :: iend(:)
integer, intent(in), optional :: stride(:)
logical, intent(in), optional :: compact

keep istart, iend, stride for future slice shape check

module procedure create_softlink module subroutine create_softlink(self, target, link)

HDF5 soft link -- to variables in same file target need not exist (dangling link) linking to external files requires an external link (different function required)

Arguments

Type IntentOptional AttributesName
class(hdf5_file), intent(inout) :: self
character(len=*), intent(in) :: target
character(len=*), intent(in) :: link

module procedure hdf_open_group module subroutine hdf_open_group(self, gname, ierr)

Arguments

Type IntentOptional AttributesName
class(hdf5_file), intent(inout) :: self
character(len=*), intent(in) :: gname
integer, intent(out), optional :: ierr

module procedure hdf_close_group module subroutine hdf_close_group(self, ierr)

Arguments

Type IntentOptional AttributesName
class(hdf5_file), intent(inout) :: self
integer, intent(out), optional :: ierr