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

Home » Public Forums » archive » Re: 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 #45590 is a reply to message #45587] Tue, 20 September 2005 06:00 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Andres writes:

> Hi all,
>
> does somebody knows how to read this (fortran way)
>
> do 210 j=1,ngr2
> write(10) real(rhoc(j)),
> 2 real(psi1(j)),real(psi2(j)),real(psi3(j))
> write(10) aimag(rhoc(j)),
> 2 aimag(psi1(j)),aimag(psi2(j)),aimag(psi3(j))
> 210 continue
>
> in IDL? I managed, but it takes forever for big "ngr2". This is what I
> do:
>
> rhoc=fltarr(ng3)
> psi1=fltarr(ng3) & psi2=fltarr(ng3) & psi3=fltarr(ng3)
>
> For i=0l,ng3-1l do begin
> readu,lun,tmp1,tmp2,tmp3,tmp4
> rhoc[i]=tmp1
> psi1[i]=tmp2
> psi2[i]=tmp3
> psi3[i]=tmp4
> Endfor
>
> but this takes a long time... Anybody knows a fast way?

Here is an article for you to read:

http://www.dfanning.com/tips/ascii_column_data.html

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Finding the path of the IDL executable
Next Topic: Resizing arrays

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

Current Time: Thu Oct 09 14:56:47 PDT 2025

Total time taken to generate the page: 0.71584 seconds