Re: Calling IDL from Fortran called by IDL [message #28181] |
Tue, 27 November 2001 08:01  |
Mark Rivers
Messages: 49 Registered: February 2000
|
Member |
|
|
Kevin A. Park <kpark@prism-cs.com> wrote in message
news:3c02c150$0$35565$272ea4a1@news.execpc.com...
> Hi,
>
> I have an IDL GUI which sits on top of a calculation engine which
> is written in Fortran 90. Currently IDL accesses the calculation engine
> by calling C wrapper functions via CALL_EXTERNAL. These C wrappers then
> call Fortran routines. The system runs both on Solaris and Windows
> platforms. I am currently using IDL 5.4, but will upgrade to IDL 5.5
> soon.
>
> Some of the calculations in the Fortran take a long time, so what I
> would like to do is have IDL create a progress bar which can be updated
> from the Fortran. Having waded through the IDL External Development
> Guide, I have a few questions.
I have done something like this in the past. Here is the general method.
- IDL calls your external C wrapper routines
- The external C routines launch a new thread and pass this thread
the address of an IDL variable into which some progress information
can be written.
- The external C routine returns to IDL immediately, leaving the new
thread running to do the time-intensive work. The new thread
writes progress information to the IDL variable, which the
IDL code is peridically checking and using to update a progress
meter, display new results or whatever.
The last time I did this was on VMS (!) for a real-time scanning x-ray
microscope display. The "real-time" thread was interupt driven
FORTRAN code that communicated with IDL via the addresses of IDL
variables that were passed to it when a new scan was begun.
The same general ideas should still work. You don't need IDL to
be multi-threaded, you just need to be able to launch a new
thread in your external code.
Mark Rivers
|
|
|