geospace-code / h5fortran

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

How do I read string array? #33

Closed gekowa closed 2 years ago

gekowa commented 2 years ago

README says: "Polymorphic API with read/write types int32, int64, real32, real64 with rank scalar (0-D) through 7-D as well as character (string).".

But when I read string array from HDF5, it still throws "ERROR:h5fortran:reader: character arrays (non-singleton) not yet supported by h5fortran.".

Anything I've missed? Please help, thanks a lot.

scivision commented 2 years ago

Thank you, I corrected the Readme in a0dd0ab.

I would need to make an enhancement to the code to read string arrays.

Are you interested in 1-D vectors of character arrays, dataset/attribute, ... ?

gekowa commented 2 years ago

Thanks for your response. 👍

Yes, I am interested in 1-D vectors of character arrays, and to be frankly, I also need 0-D to 3-D character arrays. 😉

I don't mean to hurry you, but my project is now choosing a library for HDF5 handling, I need to know approximately when the character array feature is ready, in order to decide if I need to wait or come back later.

Thanks again.

scivision commented 2 years ago

I have a prototype that works for reading fixed length character arrays. I believe I found a method to read variable length character arrays as well. I am crunched for time myself, but I think in next several days it can be ready.

gekowa commented 2 years ago

Awesome! I think fixed length character array would be enough for me. Looking forward to your work!

scivision commented 2 years ago

This was implemented in 12e801a. Thanks!

reading attributes and datasets, scalar through 7D, fixed or variable length character strings

gekowa commented 2 years ago

Hooray! Thank you so much, you make my day!