[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

*Subject*: Re: How to call fortran subroution?*From*: "web" <jiali3(at)21cn.com>*Date*: Sun, 15 Apr 2001 09:01:31 +0800*Newsgroups*: comp.lang.idl-pvwave*Organization*: Bentium Ltd.*References*: <9b2soc$28d$1@mail.cn99.com> <9b3u9t$f5c$1@suite03.caspur.it>*Xref*: news.doit.wisc.edu comp.lang.idl-pvwave:24556

Yes, I know that. I have read the example more then 5 times,but I have failed for many times too.Who can help me to modify the subroutine above(a much more simple example) and teach how to link them step by step? Many guys are interested in it. Or are there any detailed document on it? The explanasion of the help document is too simple. "StefanoM" <massetti@tiscalinet.it> wrote in message news:9b3u9t$f5c$1@suite03.caspur.it... > 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 > >

**Follow-Ups**:**Re: How to call fortran subroution?***From:*Craig Markwardt

**References**:**How to call fortran subroution?***From:*web

- Prev by Date:
**Fill in a logic image: possible in IDL ?** - Next by Date:
**Re: Fill in a logic image: possible in IDL ?** - Prev by thread:
**Re: R: How to call fortran subroution?** - Next by thread:
**Re: How to call fortran subroution?** - Index(es):