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

Home » Public Forums » archive » R: How to call fortran subroution?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
R: How to call fortran subroution? [message #24763] Thu, 12 April 2001 02:58
StefanoM is currently offline  StefanoM
Messages: 5
Registered: April 2001
Junior Member
Sadly, IDL cannot call directly a fortran subroutine, but it must be
compiled into a DLL. Then you can use call_external ... the things are
complicated by the fact that IDL and Fortran require the parameters to be
passed in different ways: by value and by reference (see my post the
10/04/01). There is an example in the distribution of IDL, but I was not
able to make it work. I you will find the way to do this, please let me
know.

regards

Stefano


web <jiali3@21cn.com> wrote in message 9b2soc$28d$1@mail.cn99.com...
> Hi, I havenot find a perfect example on how to call fortran subroutine
from
> idl.
>
> For example, a(0) and a(1) are computed in an IDL program, I want a
fortran
> subroutine to compute c=a(0)+a(1). After c has been returned,
d=a(0)+a(1)+c
> is computed in IDL. How to do that? I think we will know how to call
fortran
> subroutine if we can do above.
>
> 1.IDL PROGRAM: test.pro
>
> pro test
> a=fltarr(2)
> a(0)=100 & a(1)=200
> call_external sum_fortran(a,c)
> d=a(0)+a(1)+c
> print,a,c,d
> end
>
> 2.FORTRAN SUBROUTINE: sum_fortran.f
>
> subroutine sum_fortran(a,c)
> dimension a(2)
> c=a(1)+a(2)
> return
> end
>
> Would you please help me to modify the above and tell me how to run?
>
> Can fortran call idl program?
>
> Best regards
> Jiali
>
>
>
>
>
[Message index]
 
Read Message
Previous Topic: open file > 2 GB
Next Topic: Re: open file > 2 GB

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

Current Time: Fri Oct 10 06:16:23 PDT 2025

Total time taken to generate the page: 0.16279 seconds