CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Main CFD Forum (https://www.cfd-online.com/Forums/main/)
-   -   Difference betw Binary & Fortran Unformatted? (https://www.cfd-online.com/Forums/main/4662-difference-betw-binary-fortran-unformatted.html)

Ruobo April 24, 2002 23:38

Difference betw Binary & Fortran Unformatted?
 
My cfd output file is in Fortran Unformatted PLOT3D format, I want to convert it to get PLOT3D Binary file? How should I do? Anyone can point out their difference?

Thank you

YRB

sylvain April 25, 2002 08:43

Re: Difference betw Binary & Fortran Unformatted?
 
If they are both of same Endian kind (big/little) and if I remenber well, it's just a matter of C. Return. Fortran ends each line with a CR.

Sylvain

Lionel Larcheveque April 26, 2002 04:42

Re: Difference betw Binary & Fortran Unformatted?
 
Hi,

For each single instruction write(), the binary fortran format (unformatted) include at the beginning and the end of the data block a word (4 bytes) giving the size of the data block. For instance :

write(10) k

write(10) ((a(i,j),i=1,2),j=1,3)

write(10) b,c

where each variable as a size of four bytes (integer and float)

will result in :

[4] [binary value for k] [4]

[24] 6*[binary value for a(.,.)] [24]

[8] [binary value for b] [binary value for c] [8]

with [] a four bytes block.

The existence of these blocks is the only difference between a binary format and the fortran unformatted format for PLOT3D.

Best regards

Ruobo April 28, 2002 03:04

Re: Difference betw Binary & Fortran Unformatted?
 
Thanks a lot. What you pointed out is exactly the difference. I have fixed my format problem.

Ruobo


All times are GMT -4. The time now is 23:49.