Re: Calling Fortran program [message #2163] |
Sun, 05 June 1994 20:00  |
rivers
Messages: 228 Registered: March 1991
|
Senior Member |
|
|
In article <2sl3sr$2o1q@itsa.ucsf.edu> aki@itsa.ucsf.edu (Andreas Kiefer) writes:
> Hi
>
> I have to call a Fortran program that returns a vector. The IDL function CALL_EXTERNAL
> allows to return a scalar value only. So it seems I have to use LINKIMAGE.
>
> Is there anybody who knows how to use LINKIMAGE in particular who has any idea how to
> pass a vector to IDL using LINKIMAGE ? ( I am using a SUN and I studied the manual for
> dlopen() already. This was not very helpful.)
It is NOT true that CALL_EXTERNAL can only return a scalar, it can
return vectors as well. The vector needs to be allocated in IDL before
calling CALL_EXTERNAL, so it does require that you know a (maximum) size
for the vector in advance. IDL will just pass the address of the
beginning of the vector to your external FORTRAN or C code. I do this
all the time.
--
Mark Rivers (312) 702-2279 (office)
CARS (312) 702-9951 (secretary)
Univ. of Chicago (312) 702-5454 (FAX)
5640 S. Ellis Ave.
|
|
|
|
|
|
|