Skip to content

Commit cba5964

Browse files
committed
doc
1 parent 2d179f0 commit cba5964

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

README.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,14 @@ Designed for easy use as a Meson "subproject" or CMake "ExternalProject" using *
1010
Uses Fortran 2008 `submodule` and `error stop` for clean template structure.
1111
This easy-to-use, thin object-oriented modern Fortran library abstracts away the messy parts of HDF5 so that you can read/write various types/ranks of data with a single command.
1212

13-
Polymorphic API with read/write for types integer, real32, real64 with rank:
13+
Polymorphic API with read/write for types int32, int64, real32, real64 with rank:
1414

1515
* scalar (0-D)
1616
* 1-D .. 7-D
1717

1818
as well as character (string) variables and attributes.
19+
Mismatched datatypes are coerced as per standard Fortran rules.
20+
For example, reading a float HDF5 variable into an integer Fortran variable: 42.3 => 42
1921

2022
Tested on systems with HDF5 1.8 and 1.10 including:
2123

@@ -26,6 +28,14 @@ Tested on systems with HDF5 1.8 and 1.10 including:
2628

2729
Currently, Cygwin does not have *Fortran* HDF5 libraries.
2830

31+
## Not yet handled
32+
33+
It's possible to do these things, if there is user need.
34+
35+
* arrays of rank > 7: this has been stubbed in reader_nd.f90, writer_nd.f90. Only the latest compilers support Fortran 2008 arrays up to rank 15.
36+
* complex64/complex128: this is not natively handled in HDF5. Popular approaches to complex numbers in HDF5 include h5py's using an HDF5 compound datatype.
37+
* non-default character kind
38+
2939
## Build
3040

3141
Requirements:
@@ -104,7 +114,7 @@ include(ExternalProject)
104114
105115
ExternalProject_Add(h5fortran
106116
GIT_REPOSITORY https://github.com/scivision/h5fortran.git
107-
GIT_TAG master # it's better to use a specific Git revision or Git tag for reproducibility
117+
GIT_TAG master # it's better to use a specific Git tag for reproducibility
108118
INSTALL_COMMAND "" # disables the install step for the external project
109119
)
110120

tests/test_error.f90

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ subroutine test_wrong_type(path)
108108
write(stderr,*) 'read value /real32: ', u
109109
error stop 'test_wrong_type: read mismatched variable type'
110110
endif
111+
if (u /= 42) error stop 'test_wrong_type: did not coerce real to integer'
111112
call h5f%finalize(ierr)
112113
if (ierr/=0) error stop 'test_nonexist_variable: finalizing'
113114
end subroutine test_wrong_type

0 commit comments

Comments
 (0)