geospace-code / h5fortran

Lightweight HDF5 polymorphic Fortran: h5write() h5read()
https://geospace-code.github.io/h5fortran
BSD 3-Clause "New" or "Revised" License
99 stars 24 forks source link

Write Attribute: Is it possible? #5

Closed nyckmaia closed 4 years ago

nyckmaia commented 4 years ago

Is there a way to write a HDF5 attribute?

How can I do that?

scivision commented 4 years ago

Thanks I realized this was not documented though it has been a feature for a long time.

call h5f%initialize('test_attr.h5')

call h5f%write('/x', 1)

call h5f%writeattr('/x', 'note', 'this is just a little number')

call h5f%writeattr('/x', 'hello', 'hi')

call h5f%finalize()
scivision commented 4 years ago

h5fortran v2.11.0 has full read / write attribute support. thank you.