Skip to content

vtk_fortran_hdf5 ​

Minimal HDF5 bindings (C API) used by the VTKHDF format: files, groups, links, attributes, datasets (fixed or appendable, optionally deflated, or written by blocks), and their reading back.

The HDF5 C API is bound with iso_c_binding, not through the HDF5 Fortran module: no hdf5.mod (specific to the compiler and to the HDF5 build) is needed, only the C library (-lhdf5, plus the MPI libraries when HDF5 is a parallel build). The predefined types are the C globals behind the HDF5 macros (H5T_NATIVE_DOUBLE is H5T_NATIVE_DOUBLE_g), valid after H5open. Checked with HDF5 1.10.11 and 2.3.0.

The module is always compiled: without VTKFORTRAN_USE_HDF5 the procedures are stubs returning an error, and is_hdf5_enabled is .false..

Datasets are written by the procedure of their kind (h5_dataset_write_R8P, ...), read through the generic h5_dataset_read. Dimensions are given in the Fortran order (the first one varies fastest) and reversed for HDF5 (C order): the array x(nc, ni, nj, nk) is the HDF5 dataset [nk, nj, ni, nc]. An appendable dataset grows along its last Fortran dimension (the first HDF5 one). A dataset written by blocks (h5_dataset_slab_<kind>: in a parallel file, each rank its block of a grid) is created with its whole shape, then each block written where it goes; with append (a time series of a grid) it grows along its last dimension, each block written in the new rows. An appendable or deflated dataset is chunked by whole rows (its last Fortran dimension): as many as fit in the optional chunk_bytes of h5_dataset_write_<kind> (default DEFAULT_CHUNK_BYTES, 1 MiB), at least one, at most the rows written when it is created; h5_dataset_chunk reads the chunk shape back.

Source: src/lib/vtk_fortran_hdf5.F90

Dependencies

Contents ​

Variables ​

NameTypeAttributesDescription
hid_kindintegerparameterKind of the HDF5 identifiers (hid_t, 64-bit since HDF5 1.10).
is_hdf5_enabledlogicalparameterThe library is built with HDF5 (VTKFORTRAN_USE_HDF5).
is_mpi_enabledlogicalparameterThe library is built with MPI (VTKFORTRAN_USE_MPI): parallel HDF5 files.
H5P_DEFAULTinteger(kind=c_int64_t)parameterDefault property list.
H5S_ALLinteger(kind=c_int64_t)parameterThe whole dataspace.
H5E_DEFAULTinteger(kind=c_int64_t)parameterDefault error stack.
H5F_ACC_RDONLYinteger(kind=c_int)parameterOpen read-only.
H5F_ACC_RDWRinteger(kind=c_int)parameterOpen for reading and writing.
H5F_ACC_TRUNCinteger(kind=c_int)parameterCreate, overwriting an existing file.
H5F_SCOPE_LOCALinteger(kind=c_int)parameterFlush scope: this file.
H5S_SCALARinteger(kind=c_int)parameterScalar dataspace class.
H5S_SELECT_SETinteger(kind=c_int)parameterHyperslab selection: replace.
H5T_STR_NULLPADinteger(kind=c_int)parameterFixed-length string padded with NULs.
H5Z_FILTER_DEFLATEinteger(kind=c_int)parameterThe deflate (zlib) filter.
H5P_CRT_ORDER_TRACKEDinteger(kind=c_int)parameterTrack the creation order of links.
H5P_CRT_ORDER_INDEXEDinteger(kind=c_int)parameterIndex the creation order of links.
H5S_UNLIMITEDinteger(kind=c_long_long)parameterUnlimited dimension ((hsize_t)-1).
DEFAULT_CHUNK_BYTESinteger(kind=I8P)parameterBytes of a chunk at most (but one row), default.

Interfaces ​

h5_attribute_write ​

Write an attribute: a string, or a rank-1 array of I4P, I8P or R8P values.

Module procedures: h5_attribute_write_string, h5_attribute_write_I4P, h5_attribute_write_I8P, h5_attribute_write_R8P

h5_attribute_read ​

Read an attribute: a string, or a rank-1 array of I8P or R8P values (converted from the stored type).

Module procedures: h5_attribute_read_string, h5_attribute_read_I8P, h5_attribute_read_R8P

h5_dataset_read ​

Read the values of a dataset, converted to the kind of the output.

Module procedures: h5_dataset_read_R8P, h5_dataset_read_R4P, h5_dataset_read_I8P, h5_dataset_read_I4P, h5_dataset_read_I2P, h5_dataset_read_I1P

Functions ​

h5_initialize ​

Initialize HDF5 (the predefined types) and silence its automatic error printing: the procedures return errors.

Returns: integer(kind=I4P)

fortran
function h5_initialize() result(error)

Call graph

h5_file_create ​

Create a file (an existing one is overwritten); with comm (a Fortran MPI communicator) a parallel file, created by every rank of it (the library built with MPI, VTKFORTRAN_USE_MPI, and a parallel HDF5).

Returns: integer(kind=I4P)

fortran
function h5_file_create(filename, file_id, comm) result(error)

Arguments

NameTypeIntentAttributesDescription
filenamecharacter(len=*)inFile name.
file_idinteger(kind=hid_kind)outFile identifier.
comminteger(kind=I4P)inoptionalMPI communicator (Fortran handle, MPI_Comm%MPI_VAL).

Call graph

h5_mpi_sum ​

The sum of n over the ranks of comm (a Fortran MPI communicator); n without MPI.

Returns: integer(kind=I8P)

fortran
function h5_mpi_sum(comm, n) result(total)

Arguments

NameTypeIntentAttributesDescription
comminteger(kind=I4P)inMPI communicator (Fortran handle).
ninteger(kind=I8P)inValue of the rank.

Call graph

h5_file_open ​

Open an existing file, read-only or (readwrite=.true.) for reading and writing; with comm (a Fortran MPI communicator) as a parallel file, opened by every rank of it (as h5_file_create).

Returns: integer(kind=I4P)

fortran
function h5_file_open(filename, file_id, readwrite, comm) result(error)

Arguments

NameTypeIntentAttributesDescription
filenamecharacter(len=*)inFile name.
file_idinteger(kind=hid_kind)outFile identifier.
readwritelogicalinoptionalOpen for writing too.
comminteger(kind=I4P)inoptionalMPI communicator (Fortran handle).

Call graph

h5_file_flush ​

Flush the file to disk.

Returns: integer(kind=I4P)

fortran
function h5_file_flush(file_id) result(error)

Arguments

NameTypeIntentAttributesDescription
file_idinteger(kind=hid_kind)inFile identifier.

Call graph

h5_file_close ​

Close a file.

Returns: integer(kind=I4P)

fortran
function h5_file_close(file_id) result(error)

Arguments

NameTypeIntentAttributesDescription
file_idinteger(kind=hid_kind)inoutFile identifier, -1 once closed.

Call graph

h5_group_create ​

Create a group; with track_order=.true. the creation order of its links is tracked and indexed (VTKHDF assemblies).

Returns: integer(kind=I4P)

fortran
function h5_group_create(loc_id, name, group_id, track_order) result(error)

Arguments

NameTypeIntentAttributesDescription
loc_idinteger(kind=hid_kind)inParent (file or group).
namecharacter(len=*)inGroup name.
group_idinteger(kind=hid_kind)outGroup identifier.
track_orderlogicalinoptionalTrack the creation order of the links.

Call graph

h5_group_open ​

Open a group.

Returns: integer(kind=I4P)

fortran
function h5_group_open(loc_id, name, group_id) result(error)

Arguments

NameTypeIntentAttributesDescription
loc_idinteger(kind=hid_kind)inParent (file or group).
namecharacter(len=*)inGroup name (or path).
group_idinteger(kind=hid_kind)outGroup identifier.

Call graph

h5_group_close ​

Close a group.

Returns: integer(kind=I4P)

fortran
function h5_group_close(group_id) result(error)

Arguments

NameTypeIntentAttributesDescription
group_idinteger(kind=hid_kind)inoutGroup identifier, -1 once closed.

Call graph

Return true if the link (group or dataset) name exists in loc_id.

Returns: logical

fortran
function h5_link_exists(loc_id, name) result(exists)

Arguments

NameTypeIntentAttributesDescription
loc_idinteger(kind=hid_kind)inParent (file or group).
namecharacter(len=*)inLink name (one level).

Call graph

Create the soft (symbolic) link name in loc_id, pointing to the path target.

Returns: integer(kind=I4P)

fortran
function h5_link_soft(target, loc_id, name) result(error)

Arguments

NameTypeIntentAttributesDescription
targetcharacter(len=*)inPath of the linked object.
loc_idinteger(kind=hid_kind)inGroup of the link.
namecharacter(len=*)inLink name.

Call graph

Return the path a soft (symbolic) link name of loc_id points to; an error (target empty) for a hard link (a group or dataset) or a missing one.

Returns: integer(kind=I4P)

fortran
function h5_link_target(loc_id, name, target) result(error)

Arguments

NameTypeIntentAttributesDescription
loc_idinteger(kind=hid_kind)inGroup of the link.
namecharacter(len=*)inLink name.
targetcharacter(len=:)outallocatablePath of the linked object.

Call graph

h5_object_copy ​

Copy the object (group or dataset, with all it holds) src_name of src_loc to dst_name of dst_loc, in the same or another file.

Returns: integer(kind=I4P)

fortran
function h5_object_copy(src_loc, src_name, dst_loc, dst_name) result(error)

Arguments

NameTypeIntentAttributesDescription
src_locinteger(kind=hid_kind)inSource file or group.
src_namecharacter(len=*)inSource object.
dst_locinteger(kind=hid_kind)inDestination file or group.
dst_namecharacter(len=*)inDestination name.

Call graph

h5_group_names ​

Return the names of the members (links) of the group group of loc_id, in their creation order when the group tracks it (the groups VTKFortran and VTK write), otherwise in the order of their names; each one followed by a NUL character (achar(0)); empty if the group has none.

Returns: integer(kind=I4P)

fortran
function h5_group_names(loc_id, group, names) result(error)

Arguments

NameTypeIntentAttributesDescription
loc_idinteger(kind=hid_kind)inParent (file or group).
groupcharacter(len=*)inGroup name (or path).
namescharacter(len=:)outallocatableNames, each followed by NUL.

Call graph

h5_attribute_exists ​

Return true if the attribute name of the object loc_id exists.

Returns: logical

fortran
function h5_attribute_exists(loc_id, name) result(exists)

Arguments

NameTypeIntentAttributesDescription
loc_idinteger(kind=hid_kind)inObject (file, group or dataset).
namecharacter(len=*)inAttribute name.

Call graph

h5_attribute_write_string ​

Write a string attribute: fixed length, the length of the value, padded with NULs, as VTK writes Type; or, with variable_length, a variable-length string (as h5py writes a str).

Returns: integer(kind=I4P)

fortran
function h5_attribute_write_string(loc_id, name, value, variable_length) result(error)

Arguments

NameTypeIntentAttributesDescription
loc_idinteger(kind=hid_kind)inObject (file, group or dataset).
namecharacter(len=*)inAttribute name.
valuecharacter(len=*)inAttribute value.
variable_lengthlogicalinoptionalA variable-length string (default false).

h5_attribute_write_I4P ​

Write a rank-1 attribute of I4P values (HDF5 native int32).

Returns: integer(kind=I4P)

fortran
function h5_attribute_write_I4P(loc_id, name, value) result(error)

Arguments

NameTypeIntentAttributesDescription
loc_idinteger(kind=hid_kind)inObject (file, group or dataset).
namecharacter(len=*)inAttribute name.
valueinteger(kind=I4P)intargetAttribute values.

h5_attribute_write_I8P ​

Write a rank-1 attribute of I8P values (HDF5 native int64).

Returns: integer(kind=I4P)

fortran
function h5_attribute_write_I8P(loc_id, name, value) result(error)

Arguments

NameTypeIntentAttributesDescription
loc_idinteger(kind=hid_kind)inObject (file, group or dataset).
namecharacter(len=*)inAttribute name.
valueinteger(kind=I8P)intargetAttribute values.

h5_attribute_write_R8P ​

Write a rank-1 attribute of R8P values (HDF5 native double).

Returns: integer(kind=I4P)

fortran
function h5_attribute_write_R8P(loc_id, name, value) result(error)

Arguments

NameTypeIntentAttributesDescription
loc_idinteger(kind=hid_kind)inObject (file, group or dataset).
namecharacter(len=*)inAttribute name.
valuereal(kind=R8P)intargetAttribute values.

h5_attribute_read_string ​

Read a string attribute: fixed length (trailing NULs dropped) or variable length (as h5py writes a str; the first string of an array of them), ASCII or UTF-8.

Returns: integer(kind=I4P)

fortran
function h5_attribute_read_string(loc_id, name, value) result(error)

Arguments

NameTypeIntentAttributesDescription
loc_idinteger(kind=hid_kind)inObject (file, group or dataset).
namecharacter(len=*)inAttribute name.
valuecharacter(len=:)outallocatableAttribute value.

h5_attribute_read_I8P ​

Read a numeric attribute as I8P values.

Returns: integer(kind=I4P)

fortran
function h5_attribute_read_I8P(loc_id, name, value) result(error)

Arguments

NameTypeIntentAttributesDescription
loc_idinteger(kind=hid_kind)inObject (file, group or dataset).
namecharacter(len=*)inAttribute name.
valueinteger(kind=I8P)outallocatableAttribute values.

h5_attribute_read_R8P ​

Read a numeric attribute as R8P values.

Returns: integer(kind=I4P)

fortran
function h5_attribute_read_R8P(loc_id, name, value) result(error)

Arguments

NameTypeIntentAttributesDescription
loc_idinteger(kind=hid_kind)inObject (file, group or dataset).
namecharacter(len=*)inAttribute name.
valuereal(kind=R8P)outallocatableAttribute values.

h5_deflate_available ​

Return true if HDF5 has the deflate (zlib) filter.

Returns: logical

fortran
function h5_deflate_available() result(available)

Call graph

h5_parallel_filters_available ​

Return true if the ranks of a communicator can write deflated datasets: the library built with MPI, an HDF5 with the deflate filter and parallel filtered writes (HDF5 1.10.2 or later; the writes are then collective).

Returns: logical

fortran
function h5_parallel_filters_available() result(available)

Call graph

h5_dataset_open ​

Open a dataset (e.g. to write attributes on it).

Returns: integer(kind=I4P)

fortran
function h5_dataset_open(loc_id, name, dset_id) result(error)

Arguments

NameTypeIntentAttributesDescription
loc_idinteger(kind=hid_kind)inParent (file or group).
namecharacter(len=*)inDataset name (or path).
dset_idinteger(kind=hid_kind)outDataset identifier.

Call graph

h5_dataset_close ​

Close a dataset.

Returns: integer(kind=I4P)

fortran
function h5_dataset_close(dset_id) result(error)

Arguments

NameTypeIntentAttributesDescription
dset_idinteger(kind=hid_kind)inoutDataset identifier, -1 once closed.

Call graph

h5_dataset_dims ​

Return the shape of a dataset, in Fortran order (the first dimension varies fastest).

Returns: integer(kind=I4P)

fortran
function h5_dataset_dims(loc_id, name, dims) result(error)

Arguments

NameTypeIntentAttributesDescription
loc_idinteger(kind=hid_kind)inParent (file or group).
namecharacter(len=*)inDataset name (or path).
dimsinteger(kind=I8P)outallocatableShape, Fortran order.

Call graph

h5_dataset_chunk ​

Return the chunk shape of a dataset, in Fortran order; empty for a dataset that is not chunked.

Returns: integer(kind=I4P)

fortran
function h5_dataset_chunk(loc_id, name, chunk) result(error)

Arguments

NameTypeIntentAttributesDescription
loc_idinteger(kind=hid_kind)inParent (file or group).
namecharacter(len=*)inDataset name (or path).
chunkinteger(kind=I8P)outallocatableChunk shape, Fortran order.

h5_dataset_info ​

Return the VTK type of a dataset (Float64, Float32, Int64, ..., UInt8; String for a string dataset, fixed or variable length, as vtkHDFWriter writes a vtkStringArray) and its shape (Fortran order).

Returns: integer(kind=I4P)

fortran
function h5_dataset_info(loc_id, name, data_type, dims) result(error)

Arguments

NameTypeIntentAttributesDescription
loc_idinteger(kind=hid_kind)inParent (file or group).
namecharacter(len=*)inDataset name (or path).
data_typecharacter(len=:)outallocatableVTK type, empty if not a numeric type.
dimsinteger(kind=I8P)outallocatableShape, Fortran order.

Call graph

h5_dataset_read_bytes ​

Read the slice first+1 ... first+count of the last Fortran dimension (the first HDF5 one) of a numeric dataset, all of its other dimensions, as the bytes of its values in the native type of the file's type (see h5_dataset_info); of a string dataset (fixed or variable length), the bytes of its strings, each one followed by a NUL (VTK's String).

Returns: integer(kind=I4P)

fortran
function h5_dataset_read_bytes(loc_id, name, first, count, bytes) result(error)

Arguments

NameTypeIntentAttributesDescription
loc_idinteger(kind=hid_kind)inParent (file or group).
namecharacter(len=*)inDataset name (or path).
firstinteger(kind=I8P)inValues (rows) skipped along the last dimension.
countinteger(kind=I8P)inValues (rows) read along the last dimension.
bytesinteger(kind=I1P)outallocatableBytes of the values.

Call graph

h5_dataset_resize ​

Resize an appendable dataset along its last Fortran dimension (the first HDF5 one) to n: values past it are dropped, the other dimensions are kept.

Returns: integer(kind=I4P)

fortran
function h5_dataset_resize(loc_id, name, n) result(error)

Arguments

NameTypeIntentAttributesDescription
loc_idinteger(kind=hid_kind)inParent (file or group).
namecharacter(len=*)inDataset name (or path).
ninteger(kind=I8P)inNew size of the last dimension.

Call graph

h5_dataset_write_R8P ​

Create a dataset of R8P values (HDF5 native double), shape dims in Fortran order.

Returns: integer(kind=I4P)

fortran
function h5_dataset_write_R8P(loc_id, name, x, dims, appendable, deflate, comm, chunk_bytes) result(error)

Arguments

NameTypeIntentAttributesDescription
loc_idinteger(kind=hid_kind)inParent (file or group).
namecharacter(len=*)inDataset name.
xreal(kind=R8P)intargetValues, any rank (sequence association).
dimsinteger(kind=I8P)inShape, Fortran order.
appendablelogicalinoptionalChunked, unlimited along the last dimension.
deflateinteger(kind=I4P)inoptionalDeflate level (1-9), implies chunking.
comminteger(kind=I4P)inoptionalMPI communicator: every rank writes its rows (appendable, collective).
chunk_bytesinteger(kind=I8P)inoptionalBytes of a chunk at most (default 1 MiB), at least 1.

Call graph

h5_dataset_write_R4P ​

Create a dataset of R4P values (HDF5 native float), shape dims in Fortran order.

Returns: integer(kind=I4P)

fortran
function h5_dataset_write_R4P(loc_id, name, x, dims, appendable, deflate, comm, chunk_bytes) result(error)

Arguments

NameTypeIntentAttributesDescription
loc_idinteger(kind=hid_kind)inParent (file or group).
namecharacter(len=*)inDataset name.
xreal(kind=R4P)intargetValues, any rank (sequence association).
dimsinteger(kind=I8P)inShape, Fortran order.
appendablelogicalinoptionalChunked, unlimited along the last dimension.
deflateinteger(kind=I4P)inoptionalDeflate level (1-9), implies chunking.
comminteger(kind=I4P)inoptionalMPI communicator: every rank writes its rows (appendable, collective).
chunk_bytesinteger(kind=I8P)inoptionalBytes of a chunk at most (default 1 MiB), at least 1.

Call graph

h5_dataset_write_I8P ​

Create a dataset of I8P values (HDF5 native int64, or uint64 with unsigned=.true.), shape dims in Fortran order.

Returns: integer(kind=I4P)

fortran
function h5_dataset_write_I8P(loc_id, name, x, dims, appendable, deflate, unsigned, comm, chunk_bytes) result(error)

Arguments

NameTypeIntentAttributesDescription
loc_idinteger(kind=hid_kind)inParent (file or group).
namecharacter(len=*)inDataset name.
xinteger(kind=I8P)intargetValues, any rank (sequence association).
dimsinteger(kind=I8P)inShape, Fortran order.
appendablelogicalinoptionalChunked, unlimited along the last dimension.
deflateinteger(kind=I4P)inoptionalDeflate level (1-9), implies chunking.
unsignedlogicalinoptionalStore the bits as the unsigned type of the same width.
comminteger(kind=I4P)inoptionalMPI communicator: every rank writes its rows (appendable, collective).
chunk_bytesinteger(kind=I8P)inoptionalBytes of a chunk at most (default 1 MiB), at least 1.

Call graph

h5_dataset_write_strings ​

Create a rank-1 dataset of variable-length ASCII strings (as vtkHDFWriter writes a vtkStringArray), one per element of x, its trailing blanks dropped.

Returns: integer(kind=I4P)

fortran
function h5_dataset_write_strings(loc_id, name, x, appendable, chunk_bytes) result(error)

Arguments

NameTypeIntentAttributesDescription
loc_idinteger(kind=hid_kind)inParent (file or group).
namecharacter(len=*)inDataset name.
xcharacter(len=*)inStrings.
appendablelogicalinoptionalChunked, unlimited.
chunk_bytesinteger(kind=I8P)inoptionalBytes of a chunk at most (default 1 MiB), at least 1.

Call graph

h5_dataset_append_strings ​

Append variable-length strings (trailing blanks dropped) to an appendable string dataset of h5_dataset_write_strings.

Returns: integer(kind=I4P)

fortran
function h5_dataset_append_strings(loc_id, name, x) result(error)

Arguments

NameTypeIntentAttributesDescription
loc_idinteger(kind=hid_kind)inParent (file or group).
namecharacter(len=*)inDataset name.
xcharacter(len=*)inStrings appended.

Call graph

h5_dataset_write_I4P ​

Create a dataset of I4P values (HDF5 native int32, or uint32 with unsigned=.true.), shape dims in Fortran order.

Returns: integer(kind=I4P)

fortran
function h5_dataset_write_I4P(loc_id, name, x, dims, appendable, deflate, unsigned, comm, chunk_bytes) result(error)

Arguments

NameTypeIntentAttributesDescription
loc_idinteger(kind=hid_kind)inParent (file or group).
namecharacter(len=*)inDataset name.
xinteger(kind=I4P)intargetValues, any rank (sequence association).
dimsinteger(kind=I8P)inShape, Fortran order.
appendablelogicalinoptionalChunked, unlimited along the last dimension.
deflateinteger(kind=I4P)inoptionalDeflate level (1-9), implies chunking.
unsignedlogicalinoptionalStore the bits as the unsigned type of the same width.
comminteger(kind=I4P)inoptionalMPI communicator: every rank writes its rows (appendable, collective).
chunk_bytesinteger(kind=I8P)inoptionalBytes of a chunk at most (default 1 MiB), at least 1.

Call graph

h5_dataset_write_I2P ​

Create a dataset of I2P values (HDF5 native int16, or uint16 with unsigned=.true.), shape dims in Fortran order.

Returns: integer(kind=I4P)

fortran
function h5_dataset_write_I2P(loc_id, name, x, dims, appendable, deflate, unsigned, comm, chunk_bytes) result(error)

Arguments

NameTypeIntentAttributesDescription
loc_idinteger(kind=hid_kind)inParent (file or group).
namecharacter(len=*)inDataset name.
xinteger(kind=I2P)intargetValues, any rank (sequence association).
dimsinteger(kind=I8P)inShape, Fortran order.
appendablelogicalinoptionalChunked, unlimited along the last dimension.
deflateinteger(kind=I4P)inoptionalDeflate level (1-9), implies chunking.
unsignedlogicalinoptionalStore the bits as the unsigned type of the same width.
comminteger(kind=I4P)inoptionalMPI communicator: every rank writes its rows (appendable, collective).
chunk_bytesinteger(kind=I8P)inoptionalBytes of a chunk at most (default 1 MiB), at least 1.

Call graph

h5_dataset_write_I1P ​

Create a dataset of I1P values (HDF5 native int8, or uint8 with unsigned=.true.), shape dims in Fortran order.

Returns: integer(kind=I4P)

fortran
function h5_dataset_write_I1P(loc_id, name, x, dims, appendable, deflate, unsigned, comm, chunk_bytes) result(error)

Arguments

NameTypeIntentAttributesDescription
loc_idinteger(kind=hid_kind)inParent (file or group).
namecharacter(len=*)inDataset name.
xinteger(kind=I1P)intargetValues, any rank (sequence association).
dimsinteger(kind=I8P)inShape, Fortran order.
appendablelogicalinoptionalChunked, unlimited along the last dimension.
deflateinteger(kind=I4P)inoptionalDeflate level (1-9), implies chunking.
unsignedlogicalinoptionalStore the bits as the unsigned type of the same width.
comminteger(kind=I4P)inoptionalMPI communicator: every rank writes its rows (appendable, collective).
chunk_bytesinteger(kind=I8P)inoptionalBytes of a chunk at most (default 1 MiB), at least 1.

Call graph

h5_dataset_slab_R8P ​

Write the block count of the values x (R8P; shape mem_dims, the block at mem_start) into the dataset name, at file_start (Fortran order, from 0); with create, the dataset is created first, shape dims (in a parallel file by every rank: collective; the blocks are then written by each rank alone). An empty block writes nothing.

Returns: integer(kind=I4P)

fortran
function h5_dataset_slab_R8P(loc_id, name, x, dims, mem_dims, mem_start, file_start, count, create, append, chunk_bytes) result(error)

Arguments

NameTypeIntentAttributesDescription
loc_idinteger(kind=hid_kind)inParent (file or group).
namecharacter(len=*)inDataset name.
xreal(kind=R8P)intargetValues, any rank (sequence association).
dimsinteger(kind=I8P)inShape of the dataset, Fortran order.
mem_dimsinteger(kind=I8P)inShape of the values, Fortran order.
mem_startinteger(kind=I8P)inStart of the block in the values, from 0.
file_startinteger(kind=I8P)inStart of the block in the dataset, from 0.
countinteger(kind=I8P)inShape of the block.
createlogicalinCreate the dataset first.
appendlogicalinoptionalGrow along the last dimension (see dataset_slab).
chunk_bytesinteger(kind=I8P)inoptionalBytes of a chunk at most, with append (default 1 MiB).

Call graph

h5_dataset_slab_R4P ​

Write the block count of the values x (R4P; shape mem_dims, the block at mem_start) into the dataset name, at file_start (Fortran order, from 0); with create, the dataset is created first, shape dims (in a parallel file by every rank: collective; the blocks are then written by each rank alone). An empty block writes nothing.

Returns: integer(kind=I4P)

fortran
function h5_dataset_slab_R4P(loc_id, name, x, dims, mem_dims, mem_start, file_start, count, create, append, chunk_bytes) result(error)

Arguments

NameTypeIntentAttributesDescription
loc_idinteger(kind=hid_kind)inParent (file or group).
namecharacter(len=*)inDataset name.
xreal(kind=R4P)intargetValues, any rank (sequence association).
dimsinteger(kind=I8P)inShape of the dataset, Fortran order.
mem_dimsinteger(kind=I8P)inShape of the values, Fortran order.
mem_startinteger(kind=I8P)inStart of the block in the values, from 0.
file_startinteger(kind=I8P)inStart of the block in the dataset, from 0.
countinteger(kind=I8P)inShape of the block.
createlogicalinCreate the dataset first.
appendlogicalinoptionalGrow along the last dimension (see dataset_slab).
chunk_bytesinteger(kind=I8P)inoptionalBytes of a chunk at most, with append (default 1 MiB).

Call graph

h5_dataset_slab_I8P ​

Write the block count of the values x (I8P; shape mem_dims, the block at mem_start) into the dataset name, at file_start (Fortran order, from 0); with create, the dataset is created first, shape dims (in a parallel file by every rank: collective; the blocks are then written by each rank alone). An empty block writes nothing.

Returns: integer(kind=I4P)

fortran
function h5_dataset_slab_I8P(loc_id, name, x, dims, mem_dims, mem_start, file_start, count, create, unsigned, append, chunk_bytes) result(error)

Arguments

NameTypeIntentAttributesDescription
loc_idinteger(kind=hid_kind)inParent (file or group).
namecharacter(len=*)inDataset name.
xinteger(kind=I8P)intargetValues, any rank (sequence association).
dimsinteger(kind=I8P)inShape of the dataset, Fortran order.
mem_dimsinteger(kind=I8P)inShape of the values, Fortran order.
mem_startinteger(kind=I8P)inStart of the block in the values, from 0.
file_startinteger(kind=I8P)inStart of the block in the dataset, from 0.
countinteger(kind=I8P)inShape of the block.
createlogicalinCreate the dataset first.
unsignedlogicalinoptionalStore the bits as the unsigned type of their width.
appendlogicalinoptionalGrow along the last dimension (see dataset_slab).
chunk_bytesinteger(kind=I8P)inoptionalBytes of a chunk at most, with append (default 1 MiB).

Call graph

h5_dataset_slab_I4P ​

Write the block count of the values x (I4P; shape mem_dims, the block at mem_start) into the dataset name, at file_start (Fortran order, from 0); with create, the dataset is created first, shape dims (in a parallel file by every rank: collective; the blocks are then written by each rank alone). An empty block writes nothing.

Returns: integer(kind=I4P)

fortran
function h5_dataset_slab_I4P(loc_id, name, x, dims, mem_dims, mem_start, file_start, count, create, unsigned, append, chunk_bytes) result(error)

Arguments

NameTypeIntentAttributesDescription
loc_idinteger(kind=hid_kind)inParent (file or group).
namecharacter(len=*)inDataset name.
xinteger(kind=I4P)intargetValues, any rank (sequence association).
dimsinteger(kind=I8P)inShape of the dataset, Fortran order.
mem_dimsinteger(kind=I8P)inShape of the values, Fortran order.
mem_startinteger(kind=I8P)inStart of the block in the values, from 0.
file_startinteger(kind=I8P)inStart of the block in the dataset, from 0.
countinteger(kind=I8P)inShape of the block.
createlogicalinCreate the dataset first.
unsignedlogicalinoptionalStore the bits as the unsigned type of their width.
appendlogicalinoptionalGrow along the last dimension (see dataset_slab).
chunk_bytesinteger(kind=I8P)inoptionalBytes of a chunk at most, with append (default 1 MiB).

Call graph

h5_dataset_slab_I2P ​

Write the block count of the values x (I2P; shape mem_dims, the block at mem_start) into the dataset name, at file_start (Fortran order, from 0); with create, the dataset is created first, shape dims (in a parallel file by every rank: collective; the blocks are then written by each rank alone). An empty block writes nothing.

Returns: integer(kind=I4P)

fortran
function h5_dataset_slab_I2P(loc_id, name, x, dims, mem_dims, mem_start, file_start, count, create, unsigned, append, chunk_bytes) result(error)

Arguments

NameTypeIntentAttributesDescription
loc_idinteger(kind=hid_kind)inParent (file or group).
namecharacter(len=*)inDataset name.
xinteger(kind=I2P)intargetValues, any rank (sequence association).
dimsinteger(kind=I8P)inShape of the dataset, Fortran order.
mem_dimsinteger(kind=I8P)inShape of the values, Fortran order.
mem_startinteger(kind=I8P)inStart of the block in the values, from 0.
file_startinteger(kind=I8P)inStart of the block in the dataset, from 0.
countinteger(kind=I8P)inShape of the block.
createlogicalinCreate the dataset first.
unsignedlogicalinoptionalStore the bits as the unsigned type of their width.
appendlogicalinoptionalGrow along the last dimension (see dataset_slab).
chunk_bytesinteger(kind=I8P)inoptionalBytes of a chunk at most, with append (default 1 MiB).

Call graph

h5_dataset_slab_I1P ​

Write the block count of the values x (I1P; shape mem_dims, the block at mem_start) into the dataset name, at file_start (Fortran order, from 0); with create, the dataset is created first, shape dims (in a parallel file by every rank: collective; the blocks are then written by each rank alone). An empty block writes nothing.

Returns: integer(kind=I4P)

fortran
function h5_dataset_slab_I1P(loc_id, name, x, dims, mem_dims, mem_start, file_start, count, create, unsigned, append, chunk_bytes) result(error)

Arguments

NameTypeIntentAttributesDescription
loc_idinteger(kind=hid_kind)inParent (file or group).
namecharacter(len=*)inDataset name.
xinteger(kind=I1P)intargetValues, any rank (sequence association).
dimsinteger(kind=I8P)inShape of the dataset, Fortran order.
mem_dimsinteger(kind=I8P)inShape of the values, Fortran order.
mem_startinteger(kind=I8P)inStart of the block in the values, from 0.
file_startinteger(kind=I8P)inStart of the block in the dataset, from 0.
countinteger(kind=I8P)inShape of the block.
createlogicalinCreate the dataset first.
unsignedlogicalinoptionalStore the bits as the unsigned type of their width.
appendlogicalinoptionalGrow along the last dimension (see dataset_slab).
chunk_bytesinteger(kind=I8P)inoptionalBytes of a chunk at most, with append (default 1 MiB).

Call graph

h5_name_invalid ​

Why name cannot be the name of a VTKHDF array or block, empty if it can: VTKHDF names cannot contain / (the separator of HDF5 paths) nor . (the VTKHDF specification, Limitations), and cannot be empty. HDF5 sets no limit to the length of a name (measured: 200000 characters accepted).

Attributes: pure

Returns: character(len=:)

fortran
function h5_name_invalid(name) result(reason)

Arguments

NameTypeIntentAttributesDescription
namecharacter(len=*)inName.

Call graph

h5_mpi_max ​

The maximum of n over the ranks of comm (a Fortran MPI communicator, collective); n without MPI.

Returns: integer(kind=I8P)

fortran
function h5_mpi_max(comm, n) result(nmax)

Arguments

NameTypeIntentAttributesDescription
comminteger(kind=I4P)inMPI communicator (Fortran handle).
ninteger(kind=I8P)inValue of this rank.

Call graph

h5_mpi_rank ​

The rank of this process in comm (a Fortran MPI communicator); 0 without MPI.

Returns: integer(kind=I4P)

fortran
function h5_mpi_rank(comm) result(rank)

Arguments

NameTypeIntentAttributesDescription
comminteger(kind=I4P)inMPI communicator (Fortran handle).

Call graph

h5_mpi_allgather ​

The values of every rank of comm (a Fortran MPI communicator), gathered(:, r) those of the rank r - 1; the values of this rank alone without MPI (and an error).

Returns: integer(kind=I4P)

fortran
function h5_mpi_allgather(comm, values, gathered) result(error)

Arguments

NameTypeIntentAttributesDescription
comminteger(kind=I4P)inMPI communicator (Fortran handle).
valuesinteger(kind=I8P)inValues of this rank.
gatheredinteger(kind=I8P)outallocatableValues of every rank.

Call graph

h5_dataset_append_R8P ​

Append R8P values to an appendable dataset; dims is the shape of the values appended, Fortran order.

Returns: integer(kind=I4P)

fortran
function h5_dataset_append_R8P(loc_id, name, x, dims, comm) result(error)

Arguments

NameTypeIntentAttributesDescription
loc_idinteger(kind=hid_kind)inParent (file or group).
namecharacter(len=*)inDataset name.
xreal(kind=R8P)intargetValues appended, any rank.
dimsinteger(kind=I8P)inShape of the values appended, Fortran order.
comminteger(kind=I4P)inoptionalMPI communicator: every rank appends its values, in rank order.

Call graph

h5_dataset_append_R4P ​

Append R4P values to an appendable dataset; dims is the shape of the values appended, Fortran order.

Returns: integer(kind=I4P)

fortran
function h5_dataset_append_R4P(loc_id, name, x, dims, comm) result(error)

Arguments

NameTypeIntentAttributesDescription
loc_idinteger(kind=hid_kind)inParent (file or group).
namecharacter(len=*)inDataset name.
xreal(kind=R4P)intargetValues appended, any rank.
dimsinteger(kind=I8P)inShape of the values appended, Fortran order.
comminteger(kind=I4P)inoptionalMPI communicator: every rank appends its values, in rank order.

Call graph

h5_dataset_append_I8P ​

Append I8P values to an appendable dataset; dims is the shape of the values appended, Fortran order.

Returns: integer(kind=I4P)

fortran
function h5_dataset_append_I8P(loc_id, name, x, dims, unsigned, comm) result(error)

Arguments

NameTypeIntentAttributesDescription
loc_idinteger(kind=hid_kind)inParent (file or group).
namecharacter(len=*)inDataset name.
xinteger(kind=I8P)intargetValues appended, any rank.
dimsinteger(kind=I8P)inShape of the values appended, Fortran order.
unsignedlogicalinoptionalThe values are the bits of the unsigned type of the same width.
comminteger(kind=I4P)inoptionalMPI communicator: every rank appends its values, in rank order.

Call graph

h5_dataset_append_I4P ​

Append I4P values to an appendable dataset; dims is the shape of the values appended, Fortran order.

Returns: integer(kind=I4P)

fortran
function h5_dataset_append_I4P(loc_id, name, x, dims, unsigned, comm) result(error)

Arguments

NameTypeIntentAttributesDescription
loc_idinteger(kind=hid_kind)inParent (file or group).
namecharacter(len=*)inDataset name.
xinteger(kind=I4P)intargetValues appended, any rank.
dimsinteger(kind=I8P)inShape of the values appended, Fortran order.
unsignedlogicalinoptionalThe values are the bits of the unsigned type of the same width.
comminteger(kind=I4P)inoptionalMPI communicator: every rank appends its values, in rank order.

Call graph

h5_dataset_append_I2P ​

Append I2P values to an appendable dataset; dims is the shape of the values appended, Fortran order.

Returns: integer(kind=I4P)

fortran
function h5_dataset_append_I2P(loc_id, name, x, dims, unsigned, comm) result(error)

Arguments

NameTypeIntentAttributesDescription
loc_idinteger(kind=hid_kind)inParent (file or group).
namecharacter(len=*)inDataset name.
xinteger(kind=I2P)intargetValues appended, any rank.
dimsinteger(kind=I8P)inShape of the values appended, Fortran order.
unsignedlogicalinoptionalThe values are the bits of the unsigned type of the same width.
comminteger(kind=I4P)inoptionalMPI communicator: every rank appends its values, in rank order.

Call graph

h5_dataset_append_I1P ​

Append I1P values to an appendable dataset; dims is the shape of the values appended, Fortran order.

Returns: integer(kind=I4P)

fortran
function h5_dataset_append_I1P(loc_id, name, x, dims, unsigned, comm) result(error)

Arguments

NameTypeIntentAttributesDescription
loc_idinteger(kind=hid_kind)inParent (file or group).
namecharacter(len=*)inDataset name.
xinteger(kind=I1P)intargetValues appended, any rank.
dimsinteger(kind=I8P)inShape of the values appended, Fortran order.
unsignedlogicalinoptionalThe values are the bits of the unsigned type of the same width.
comminteger(kind=I4P)inoptionalMPI communicator: every rank appends its values, in rank order.

Call graph

h5_dataset_read_R8P ​

Read all the values of a dataset as R8P, flattened in the order of its elements (the shape: h5_dataset_dims).

Returns: integer(kind=I4P)

fortran
function h5_dataset_read_R8P(loc_id, name, x) result(error)

Arguments

NameTypeIntentAttributesDescription
loc_idinteger(kind=hid_kind)inParent (file or group).
namecharacter(len=*)inDataset name (or path).
xreal(kind=R8P)outallocatableValues.

Call graph

h5_dataset_read_R4P ​

Read all the values of a dataset as R4P, flattened in the order of its elements (the shape: h5_dataset_dims).

Returns: integer(kind=I4P)

fortran
function h5_dataset_read_R4P(loc_id, name, x) result(error)

Arguments

NameTypeIntentAttributesDescription
loc_idinteger(kind=hid_kind)inParent (file or group).
namecharacter(len=*)inDataset name (or path).
xreal(kind=R4P)outallocatableValues.

Call graph

h5_dataset_read_I8P ​

Read all the values of a dataset as I8P, flattened in the order of its elements (the shape: h5_dataset_dims).

Returns: integer(kind=I4P)

fortran
function h5_dataset_read_I8P(loc_id, name, x) result(error)

Arguments

NameTypeIntentAttributesDescription
loc_idinteger(kind=hid_kind)inParent (file or group).
namecharacter(len=*)inDataset name (or path).
xinteger(kind=I8P)outallocatableValues.

Call graph

h5_dataset_read_I4P ​

Read all the values of a dataset as I4P, flattened in the order of its elements (the shape: h5_dataset_dims).

Returns: integer(kind=I4P)

fortran
function h5_dataset_read_I4P(loc_id, name, x) result(error)

Arguments

NameTypeIntentAttributesDescription
loc_idinteger(kind=hid_kind)inParent (file or group).
namecharacter(len=*)inDataset name (or path).
xinteger(kind=I4P)outallocatableValues.

Call graph

h5_dataset_read_I2P ​

Read all the values of a dataset as I2P, flattened in the order of its elements (the shape: h5_dataset_dims).

Returns: integer(kind=I4P)

fortran
function h5_dataset_read_I2P(loc_id, name, x) result(error)

Arguments

NameTypeIntentAttributesDescription
loc_idinteger(kind=hid_kind)inParent (file or group).
namecharacter(len=*)inDataset name (or path).
xinteger(kind=I2P)outallocatableValues.

Call graph

h5_dataset_read_I1P ​

Read all the values of a dataset as I1P, flattened in the order of its elements (the shape: h5_dataset_dims).

Returns: integer(kind=I4P)

fortran
function h5_dataset_read_I1P(loc_id, name, x) result(error)

Arguments

NameTypeIntentAttributesDescription
loc_idinteger(kind=hid_kind)inParent (file or group).
namecharacter(len=*)inDataset name (or path).
xinteger(kind=I1P)outallocatableValues.

Call graph

is_true ​

Return the value of an optional logical, false when absent.

Attributes: pure

Returns: logical

fortran
function is_true(flag) result(is)

Arguments

NameTypeIntentAttributesDescription
flaglogicalinoptionalOptional flag.

c_dims ​

Return a shape in C order (HDF5) from the Fortran order.

Attributes: pure

Returns: integer(kind=c_long_long)

fortran
function c_dims(dims) result(reversed)

Arguments

NameTypeIntentAttributesDescription
dimsinteger(kind=I8P)inShape, Fortran order.

dataset_size ​

Return the number of values of a dataset.

Returns: integer(kind=I4P)

fortran
function dataset_size(loc_id, name, n) result(error)

Arguments

NameTypeIntentAttributesDescription
loc_idinteger(kind=hid_kind)inParent (file or group).
namecharacter(len=*)inDataset name (or path).
ninteger(kind=I8P)outNumber of values.

Call graph