The HDF5 file uses C storage conventions, which is why the matrix is transposed.

See http://www.hdfgroup.org/HDF5/doc/UG/UG_frame12Dataspaces.html

section: 7.3.2.5. C versus Fortran Dataspaces



On 2013-02-27 06:32, Pradeep Jha wrote:
Hello,

I am trying to convert a unformatted data file created by fortran
into the *h5 format. To do this I am using this program [1] provided
on the website as the base.

I am dealing with a data of size Nx by Ny by Nz. So I changed the
"dims" declaration in the code to something like

-------------------------------------------

**** code ****

INTEGER     :: Nx, Ny, Nz                                            
                                      
INTEGER(HSIZE_T), DIMENSION(3) :: dims 

**** code ****

     dims(1) = Nx                                                    
                                                   
     dims(2) = Ny                                                    
                                                  
     dims(3) = Nz 

**** code ****

--------------------------------------------

This code is working perfectly fine. But when I am doing a "h5dump
-H" on the output file, the output is:

HDF5 "output_file" {
GROUP "/" {
   DATASET "variable" {
      DATATYPE  H5T_IEEE_F32LE
      DATASPACE  SIMPLE { ( Nz,Ny,Nx ) / ( Nz,Ny,Nx) }
   }
}
}

Can you please explain is this how the order of Nz,Ny and Nx should
be? Does this represent a cube of size Nx by Ny by Nz? Or does dims(1)
actually represent the z dimension and I should assign it the value
Nz?

Thank you,
Pradeep



Links:
------
[1] http://www.hdfgroup.org/ftp/HDF5/examples/introductory/F90/h5_rdwt.f90

_______________________________________________
Hdf-forum is for HDF software users discussion.
[email protected]
http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org

_______________________________________________
Hdf-forum is for HDF software users discussion.
[email protected]
http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org

Reply via email to