comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Use IDL6.0 to read Fortran 90 written data
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Use IDL6.0 to read Fortran 90 written data [message #55226 is a reply to message #55225] Tue, 07 August 2007 05:39 Go to previous message
Paul Van Delst[1] is currently offline  Paul Van Delst[1]
Messages: 1157
Registered: April 2002
Senior Member
Nianming Zuo wrote:
> Dear all,
>
> I have sufferred file read/write problems between Fortran 90/95 and
> IDL 6.0.
>
> My Fortran compiler:
> Silverfrost ftn95, Compatable for Fortran 77/90/95
> http://www.silverfrost.com/12/ftn95/ftn95_feature_details.as p
>
> IDL 6.0 (Interactive Data Language, RSI)
>
> Both are in MS Windows XP(sp2) OS system.
>
> Write data to a file by use of Fortran:
> dimension dat(m, n)
> !........ Manipulations..., matrix dat(m, n) is float
> open(unit=11, file="file.dat", form="unformatted")
> write(11) dat
> !..........
> ! The above are really f77 code, so I guess it is related to Compiler.
>
>
> Read the data above by IDL6.0: (Way 1)
> dat = fltarr(m,n)
> openr, 1, 'file.dat'
> readu, 1, b, dat, b
>
> In "readu, 1, b, dat, b", the "b"s are used to skip the record area in
> Fortran data format.
> Unfortunately, it can not get the right result, and prompts "End of
> the file"
>
> I have also tried another way in IDL: (Way 2)
> dat = fltarr(m,n)
> openr, 1, 'file.dat' /f77_unformatted
> readu, 1, dat
>
> But, it prompts,
> "% READU: Corrupted f77 unformatted file detected. "
>
> For the above Fortran code, when it is compied by g77, IDL can read it
> by Way 2.
>
> So, I doubt that different compilers give different response to the
> standard Fortran sentences ?
> Since there is no f90_unformatted or f95_unformatted, f77/f90/f95 will
> produce the same record for the "open-write" sentence.
>
>
> Now, how can I read ftn95 compiled output data by IDL6.0 ? I have
> searched this forum, but without any desirable results.

Have a lookee at:

http://groups.google.com/group/comp.lang.idl-pvwave/browse_t hread/thread/513c48ceb53e6933/57c16d337a1aea99?lnk=gst&q =unformatted+endian&rnum=1&hl=en#57c16d337a1aea99


(Crikey that's a long link)

cheers,

paulv
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: efficiency of eigenvalue calculations
Next Topic: Locking sav files

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Sun Oct 12 03:30:52 PDT 2025

Total time taken to generate the page: 0.01116 seconds