<div dir="ltr">Are you implying that if I use the HDF5 fortran wrapper to convert the fortran binary data in h5 format and then visualize this h5 file using Paraview, I am looking at the the actual data with correct dimensions? Or I have to make some modifications so that I see the data correctly in Paraview?<div>

<br></div><div>I dont want to transpose the data. I just want to visualize what I wrote using Fortran without any alterations.</div><div><br></div><div>Pradeep<br><div><div style><br></div></div></div></div><div class="gmail_extra">

<br><br><div class="gmail_quote">2013/3/13 Biddiscombe, John A. <span dir="ltr">&lt;<a href="mailto:biddisco@cscs.ch" target="_blank">biddisco@cscs.ch</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">







<div lang="EN-GB" link="blue" vlink="purple">
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">“</span>How do I write the h5 file data in exactly the same way as it was written in original binary file written by Fortran?”<span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d"><u></u><u></u></span></p>


<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">It is writing the file the same, the problem is that fortran stores arrays in column major, and C in row major order. You state “</span>it
 automatically transposes the matrix” – <span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">
not true – it transposes the dimensions so that the data is still stored the same, but when you write array[z,y,x] from fortran, you want to read it as array[x,y,z] from C. The actual data on disk is the same as your binary fortran data, but the dimensions
 are reversed compared to the same data from C.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">Does that help? – the short answer is just swap the order of the dimensions in your read function in the C version and then things
 should appear the same. (but you must declare your arrays with the dimensions flipped).<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">If you want to actually transpose the data, then I’m sure google will provide a code snippet<u></u><u></u></span></p>


<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">I hope I’m not remembering this wrong.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">JB<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;">From:</span></b><span lang="EN-US" style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;"> <a href="mailto:paraview-bounces@paraview.org" target="_blank">paraview-bounces@paraview.org</a> [mailto:<a href="mailto:paraview-bounces@paraview.org" target="_blank">paraview-bounces@paraview.org</a>]
<b>On Behalf Of </b>Pradeep Jha<br>
<b>Sent:</b> 13 March 2013 10:58<br>
<b>To:</b> <a href="mailto:paraview@paraview.org" target="_blank">paraview@paraview.org</a><br>
<b>Subject:</b> [Paraview] Fortran wrapper of HDF5<u></u><u></u></span></p><div class="im">
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<p class="MsoNormal">I recently noticed that when I am using the fortran wrapper of HDF5 to convert a binary file written by fortran into the &quot;h5&quot; format, it automatically transposes the matrix. Apparently, this is because HDF5 uses the C convention for writing
 binary files, as explained in <a href="http://www.hdfgroup.org/HDF5/doc/UG/UG_frame12Dataspaces.html" target="_blank"><span style="font-size:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#222222">section: 7.3.2.5. </span>of this page.</a><u></u><u></u></p>


<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">Is anyone aware of this situation? And any solutions for this problem? How do I write the h5 file data in exactly the same way as it was written in original binary file written by Fortran?<u></u><u></u></p>


</div>
</div>
</div></div>
</div>

</blockquote></div><br></div>