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

Home » Public Forums » archive » Run Fortran executable in IDL
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Run Fortran executable in IDL [message #87954] Wed, 05 March 2014 14:50 Go to next message
justinclouds is currently offline  justinclouds
Messages: 25
Registered: December 2012
Junior Member
I need to run a Fortran executable eros.exe. This Fortran executable uses an input file EROS.INP and produces an output files EROS.OUT and EROS.PLT. The executable works just fine (outside of IDL) and you can see that the output files are updated. The objective to run this within IDL is to change the input parameters in a loop. I tried the 'spawn' command like this:

spawn, 'C:\EROS.exe < EROS.inp', /log_output

It seems to want to run as I can see a shell process starting but get this error:

run-time error F6501: READ(EROS.INP)
- end of file encountered

Any ideas on how to get this to work?

EROS.INP is like an ini file and contains text and numerical values.
Re: Run Fortran executable in IDL [message #87956 is a reply to message #87954] Thu, 06 March 2014 00:44 Go to previous messageGo to next message
bstecklu is currently offline  bstecklu
Messages: 14
Registered: February 2012
Junior Member
justinclouds wrote:
> I need to run a Fortran executable eros.exe. This Fortran executable uses an
> input file EROS.INP and produces an output files EROS.OUT and EROS.PLT. The
> executable works just fine (outside of IDL) and you can see that the output
> files are updated. The objective to run this within IDL is to change the
> input parameters in a loop. I tried the 'spawn' command like this:
>
> spawn, 'C:\EROS.exe < EROS.inp', /log_output
>
> It seems to want to run as I can see a shell process starting but get this
> error:
>
> run-time error F6501: READ(EROS.INP) - end of file encountered
>
> Any ideas on how to get this to work?
>
> EROS.INP is like an ini file and contains text and numerical values.

So your IDL program is a wrapper which updates EROS.inp within a loop. Did you
check whether the IDL-generated EROS.inp works from the command line? It seems
the FORTRAN code expects some input which is not written from within IDL.

Regards, B.
Re: Run Fortran executable in IDL [message #87959 is a reply to message #87956] Thu, 06 March 2014 12:18 Go to previous message
justinclouds is currently offline  justinclouds
Messages: 25
Registered: December 2012
Junior Member
The problem was with the spawn command having to be run from the path of the exe file. I had to cd into the path of the exe before executing spawn.

Thanks!
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: idl syntax error
Next Topic: Re: Problem changing color table

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

Current Time: Wed Oct 08 13:34:09 PDT 2025

Total time taken to generate the page: 0.00497 seconds