Thanks for the response. So from what I understand, the HD5 fortran wrapper
automatically transposes the matrix to store it in the C storage
conventions. So puttings "dims(1) = Nx" and "dims(3) = Nz" is correct. HDF5
fortran wrapper is just transposing the data inside the program before
storing it in the final h5 format.

But this is confusing me about something.

I convert my original unformatted data written by fortran to h5 format so
that I can visualize the original data using a software (Paraview). Does
that mean that the data I will visualize using Paraview and the h5 data
file will be a transposed data of what I originally intended to visualize?

And if that is true, are there any simple ways to make sure that the HDF5
stores untransposed data? Will I need to pass a transposed data to HDF5
fortran wrapper to ensure this?

Thank you again for the response,
Pradeep




2013/2/28 <[email protected]>

> 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<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<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<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<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