Fortran Writing dataSet with more than 7 dimensions


Is there a way of writing ‘dataSets’ with more than 7 dimensions (i.e., arbitrary) from Fortran?

For instance in python this is possible because one can have there arrays with more 7 dimensions and then using h5py we can just export them (H5dCreate). But in Fortran we can’t because arrays with more than 7 dims are not supported.

Maybe appending/extending/adding dimensions? Having a working example can be very useful.


ps1: In Fortan we could have for example a derived type with more than 7 dims like “d1()%d2()%d3()%…”

ps2: From the hdf5 source code:
! (1) The maximum rank of an array allowed in Fortran is 7, therefore
! we only provide an interface for arrays up to and including rank 7.

Yes, use the Fortran 2003 H5Dwrite API, see h5ex_d_rdwr_kind_F03.f90,


Thanks Scot (I haven’t tried it though).