Writing a string array as attribute (in Fortran)

Hi,

I’m trying to write an array of strings as attribute into a .h5 file in Fortran. Something like:

animals = (/ ‘dog’, ‘duck’, ‘horse’ /)

Can I do it using h5ltset_attribute_string_f in a similar way in which I am storing an array of integers:

CALL h5ltset_attribute_int_f(file_id, “/”, “dimensions”, dimensions, 4*size_attribute, error)

Could you please give me an example of code? I apologize if this question is too simple for this forum.

Many thanks!

NV