[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Binary Files

>>>>>>>>>>>>>>>>>> Original Message <<<<<<<<<<<<<<<<<<

On 28/02/01, 23:09:44, Mike Garrett <hiss@eagle.cc.ukans.edu> wrote 
regarding Binary Files:

> Hey all,

> I am trying to read some binary files that I created using the 
> write in fortran90.  The only problem is that these are the REAL variable
> type and I don't know how to read these in IDL.  I looked for some
> documentation on the lenght of this data type but I didn't have any luck.
> Has anyone else already done this?

> Thanks

> Mike

I'm assuming here that FORTRAN90 works the same as FORTRAN77. I've never 
it myself.

Reading F77 unformatted data is usually pretty straight forward. Look in 
help system index (idhlhelp) for "FORTRAN" and this should put you on the 
track to reading FORTRAN unformatted data. IDL float should equate to 
REAL*4, and IDL double to REAL*8. The size of the plain REAL and DOUBLE 
in FORTRAN may depend on whether your OS is 32 or 64 bits.

This should work for the supported UNIX systems. However, if you have 
the FORTRAN unformatted file from another platform which has a different 
endianness then you will have more fun to come.

I have no idea what will happen on Windows. BSOD probably, that seems to 
be it's 
usual response ;-)

Nigel Wade, System Administrator, Space Plasma Physics Group,
            University of Leicester, Leicester, LE1 7RH, UK 
E-mail :    nmw@ion.le.ac.uk 
Phone :     +44 (0)116 2523568, Fax : +44 (0)116 2523555