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

Home » Public Forums » archive » Reading fortran
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: Reading fortran [message #64058 is a reply to message #45591] Fri, 28 November 2008 14:24 Go to previous messageGo to previous message
R.G. Stockwell is currently offline  R.G. Stockwell
Messages: 363
Registered: July 1999
Senior Member
"Andres" <panblosky@gmail.com> wrote in message
news:2ee32df7-524b-4cc9-901f-40ec0fe87288@f40g2000pri.google groups.com...
> Hi all,
>
> perhaps it is an easy one, but I am having problems reading the
> following in IDL:
>
> open(11,file='file_name',form='unformatted')
> rewind 11
> do i3=1,np3
> write(11) ((delta(i1,i2,i3),i1=1,np1),i2=1,np2)
> end do
> close(11)

wild guess, but i'd say it looks like you are writing
a 3D array in binary, and i'll guess it is a floating point number array.

so in IDL do

datain = fltarr(np1, np2, np3)

openr,1,'filename'
readu,1,datain
close,1

This won't work, cause you'll have to figure out
byteswapping, and dimension order.
So, make a fake file in fortran so you know what the
data is (numbers like delta[1,1,1] = 111, delta[ 4,8,5] = 485 etc.)
and see what you get. Then simply debug it into existence.

Cheers,
bob
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: REGRESS Question
Next Topic: Re: IDL Programming Techniques, 3rd edition

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

Current Time: Fri Oct 10 02:22:46 PDT 2025

Total time taken to generate the page: 0.72075 seconds