[vtkusers] Fortran Unformatted (binary) data

David D. Marshall gte552m at prism.gatech.edu
Thu Apr 5 11:20:18 EDT 2001


The short answer is that in front of every fortran write there might be a 
record indicator (the meaning of which I do not know).  The record indicator 
has been 4 bytes in all of my experiences (mainly linux x86, irix SGI Indigo2 
and Indy), however the last time this came up Kent (kee at erdc.hpc.mil) pointed 
out to me that on Cray T3E, IBM SMP, and Silicon Graphics Onyx there were no 
record indicators.  He also pointed out that some systems pad the record 
length to the next multiple of 512 or 1024 bytes.  This should be enough to 
allow some experimentation by writing some experimental data on your systems 
and trying to read it back in (using a hex editor will also prove to be very 
useful).

Good luck.

On Thursday 05 April 2001 02:48, feigee at us.sina.com wrote:
> Hi,
>
> For a reader to read binary data written in C/C++ (such as those *.bin
> files in vtkdata) across platforms, I utilize vtkByteSwap::Swap4BE() method
> and it worked great.  Now I would like to know what should we use if we are
> reading binary data written in Fortran through the
>
> OPEN (11, FILE="mydata.unf", FORM="UNFORMATTED")
> WRITE(11) data1, data2, ...
>
> More specifically, if I want to extend vtkPLOT3DReader so that it will read
> not only C-binary files (*.bin) but also F77-binary data (mydata.unf), what
> byteswap methods should I use?  Any examples out there or if someone can
> share the section of the codes for me to "imitate"?  Thanks in advance.
>
> Alan
>
>
> _______________________________________________________________
> http://www.SINA.com - #1 Destination Site for Chinese Worldwide
>
> _______________________________________________
> This is the private VTK discussion list.
> Please keep messages on-topic. Check the FAQ at:
> <http://public.kitware.com/cgi-bin/vtkfaq> Follow this link to
> subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/vtkusers

-- 
David D. Marshall
ARTLab System Administrator/GRA
Georgia Institute of Technology, Atlanta Georgia, 30332
http://www.ae.gatech.edu/research/artlab/artl/artlab.html
mailto:gte552m at prism.gatech.edu
The legitimate object of government is to do for a community
of people whatever they need to have done, but cannot do at all,
or cannot so well do, for themselves in their separate and
individual capacities.  -- Abraham Lincoln




More information about the vtkusers mailing list