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

Home » Public Forums » archive » problem in reading unformatted data from a FORTRAN file
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: problem in reading unformatted data from a FORTRAN file [message #91247 is a reply to message #91246] Mon, 22 June 2015 07:36 Go to previous message
DK is currently offline  DK
Messages: 12
Registered: June 2015
Junior Member
在 2015年6月22日星期一 UTC+8下午10:23:37,Paul van Delst写道:
> What error did you get?
>
>
> On 06/22/15 09:48, DK wrote:
>> The output in the FORTRAN file wrote like this:
>>
>> -------------------------
>>
>> real, x(10, 722, 144)
>>
>> open(21, file='result.dat', form='unformatted')
>> ...(some calculation about x)
>> write(21) x
>> close(21)
>>
>> -------------------------
>>
>>
>> and reading program in IDL is like this:
>>
>> ----------------------------------
>>
>> data=fltarr(10,722,144)
>> openr, lun, 'result.dat', /get_lun, /f77_unformatted
>> readu, lun, data
>> free_lun,lun
>>
>> --------------------------------
>>
>>
>> But it looks like these code cannot read the file "result.dat" into
> the array "data". Where is the problem? Thanks!
>>
>>
>>
>>
>>

No error. Just could not read the data in. There "0.000000" in the array "data" except the last part "data[*,*,143]". However, when the array was set to 2-Dimension in the FORTRAN file, the results will be OK.
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: size(/dimen) that automatically fills in extra dimensions
Next Topic: Inconsistency in the position of the text() function

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

Current Time: Wed Oct 08 16:04:57 PDT 2025

Total time taken to generate the page: 0.00435 seconds