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   |
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
|
|
|