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

Home » Public Forums » archive » Re: Calling Fortran program
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
Re: Calling Fortran program [message #2163] Sun, 05 June 1994 20:00 Go to next message
rivers is currently offline  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.
Re: Calling Fortran program [message #2168 is a reply to message #2163] Sun, 05 June 1994 08:01 Go to previous messageGo to next message
dors is currently offline  dors
Messages: 8
Registered: June 1994
Junior Member
In article <2sl3sr$2o1q@itsa.ucsf.edu> aki@itsa.ucsf.edu (Andreas Kiefer) writes:
[snip]
>
> 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.)
>
> Thanks in advance ....
>
> aki

From this groups FAQ:

T03. How do I get IDL to call routines in language X, running
under system Y?

Jeff Valenti has written a sizable document about calling external
FORTRAN routines from IDL. You can find it at
esrg.ucsb.edu:/pub/idl/idl-fortran.



Hope this helps,

Eric
--

============================================================ ================
| Eric E. Dors | Internet: eedors@unh.edu |
| University of New Hampshire | Span: 6866:DORS |
============================================================ ================
| "if free particles were truly free..." |
| |
| "they wouldn't be represented by bras, <k| " |
| ---oh no, how did a physics joke make it in here? :^) |
============================================================ ================
Re: Calling Fortran program [message #2176 is a reply to message #2168] Sat, 04 June 1994 08:27 Go to previous messageGo to next message
thompson is currently offline  thompson
Messages: 584
Registered: August 1991
Senior Member
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.

That's not true. I've used CALL_EXTERNAL with vectors as both input and
output.

Bill Thompson
Re: Calling Fortran program [message #2183 is a reply to message #2176] Fri, 03 June 1994 08:38 Go to previous messageGo to next message
crdmi is currently offline  crdmi
Messages: 10
Registered: February 1994
Junior 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.

I recommend that you use CALL_EXTERNAL. Pass the return value vector
as an argument to the fortran subroutine.

--
"Brother, you can't go to jail for what you're Daniel M. Israel
thinking, or for that "oooo!" look in your <crdmi@vulcan.giss.nasa.gov>
eyes. You're only standing on the corner Goddard Institute of Space Studies
watching all the girls go by." -Most Happy Fella 2880 Broadway, New York, NY
Re: Calling Fortran program [message #2276 is a reply to message #2168] Tue, 07 June 1994 09:31 Go to previous message
8015 is currently offline  8015
Messages: 52
Registered: November 1993
Member
In article <DORS.94Jun5110110@unhggs1.unh.edu>,
Eric E. Dors <dors@unhggs1.unh.edu> wrote:
>
> From this groups FAQ:
>

...

> FORTRAN routines from IDL. You can find it at
> esrg.ucsb.edu:/pub/idl/idl-fortran.
>

This site name has changed to eos.crseo.ucsb.edu. It will be mentioned
in the next FAQ, as well.

Mike Schienle Hughes Santa Barbara Research Center
mgs@sbjse0.sbrc.hac.com 75 Coromar Drive, M/S B28/87
Voice: (805)562-7466 Fax: (805)562-7881 Goleta, CA 93117
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Question on PLOTS command
Next Topic: IDL's error messages

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

Current Time: Wed Oct 08 15:05:41 PDT 2025

Total time taken to generate the page: 0.00381 seconds