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

Home » Public Forums » archive » Re: how can i call a compiled fortran code from IDL?
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: how can i call a compiled fortran code from IDL? [message #33961 is a reply to message #33956] Wed, 05 February 2003 20:08 Go to previous messageGo to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
mads (madhu@erc.msstate.edu) writes:

> This is what I need to do. I need to integrate the kuusk canopy reflectance
> model(5 .f files) into IDl code. I can use g77 and compile them into .exe
> and call from IDL - in this case how do i do it?

Uh, SPAWN.

> or i can call the fortran
> code directly frm IDL. In this case how do I do it?

You don't want to do this. :-)

> If the explanation is
> too complicated where online can I find it.

I'd try this:

IDL> ? SPAWN

This FORTRAN code takes no input and produces a file
as output, right? After it produces the file (and
SPAWN returns), you can just read the file into IDL.

> If its impossible I might as
> well recode all the fortran code in IDL . This will require that I learn
> FORTRAN first :(

Well, it is MUCH easier to learn FORTRAN than it is
to learn the IDL internals with the documentation available.
I really recommend SPAWN. Even I can understand how that works. :-)

> Please help me in these 2 options. I have to further automate everything to
> train SNNS into recognising canopy types. So spawning and typing command
> will not serve my purpose.

Why would you be typing something? You will SPAWN the command that
runs your FORTRAN program:

SPAWN, '/usr/local/me/myprogram.exe'
; Now I am going to read the data file MYPROGRAM produced
OpenR, lun, 'myprogram_output.dat', /Get_Lun
etc.

> I tried all resources but couldnt find relevant info.

It's a pain, sometimes.

Cheers,

David
--
David W. Fanning, Ph.D.
Fanning Software Consulting, Inc.
Phone: 970-221-0438, E-mail: david@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Postscript output mods
Next Topic: Re: XROI in IDL5.6 on MAC OS 10.2?

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

Current Time: Sun Oct 12 06:44:47 PDT 2025

Total time taken to generate the page: 0.64136 seconds