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

Home » Public Forums » archive » Re: Read & write data files b/w IDL & Fortran 90
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: Read & write data files b/w IDL & Fortran 90 [message #39049 is a reply to message #39048] Fri, 09 April 2004 13:37 Go to previous messageGo to previous message
Paul Van Delst[1] is currently offline  Paul Van Delst[1]
Messages: 1157
Registered: April 2002
Senior Member
bridgemat wrote:
> I did try the /f77_unformatted keyword when writing the original file,
> but I still couldn't get it to work. It shouldn't have anything to do
> w/ using Fortran 90 instead of 77, right? Or am I doing something
> altogether wrong in my Fortran program?

Hello,

I just grabbed both your codes and mucked about and had a "d'oh" episode.

You create the data in IDL using INDGEN == 2 byte ints. In your f90 code you read the data
with the default int which is 4 bytes. That's why you're getting the I/O error.

Two options:

1) In IDL create the data like so:
test=LINDGEN(3,4,5)
And read it with your current f90 code.

Or

2) Create the data file with your current IDL code and in Fortran90, define your integer
arrays like so:
INTEGER, PARAMETER :: ip = SELECTED_INT_KIND(4)
INTEGER(ip), DIMENSION(3,4,5)::arr_in,arr_out

The integer kind parameter from SELECTED_INT_KIND(4) should give you the kind type for a
2-byte integer.

I prefer option (1) coz it's the simplest, but YMMV.

cheers,

paulv
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: How to rebin complex array?
Next Topic: processor for idl on MoinMoin

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

Current Time: Fri Oct 10 00:07:57 PDT 2025

Total time taken to generate the page: 0.16172 seconds