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

Home » Public Forums » archive » Re: fortran feasability
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: fortran feasability [message #54873] Mon, 16 July 2007 07:54
Haje Korth is currently offline  Haje Korth
Messages: 651
Registered: May 1997
Senior Member
Conor,
what you want can be done among others with a DLM (RTFM for description). I
strongly suggest to call fortran from idl rather than the other way around.
You cannot share COMMON block between the fortran and idl side. However,
once setup on the fortran side the common block will live between idl calls
until the session is reset (e.g., .f). You will have to write a wrapper to
change fortran common block variables from idl. Last recommendation, get a
good book, e.g., Calling C from IDL by Ronn Kling; lots of examples save
lots of grief.

Haje


"Conor" <cmancone@gmail.com> wrote in message
news:1184589778.527491.114030@q75g2000hsh.googlegroups.com.. .
> For a project I'm working on, I'm trying to implement in one of my
> programs the pikaia minimization algorithm (http://www.hao.ucar.edu/
> Public/models/pikaia/pikaia.html). It has a non-optimized IDL port
> which I've used so far. My problem is that when I run it with any
> reasonable number of generations, the result is REALLY slow. What
> used to take half a day with other algorithims would take roughly 20
> days using pikaia in IDL. Unfortunately, this algorith is simply
> computationaly expensive, and I really don't think that optimizing the
> IDL code is going to facilitate a 40x speed up.
>
> The solution, I think, is to run the original fortran code and call it
> from IDL. However, I've never tried such a thing and so I have a few
> questions. I'll also take other suggestions, if anyone has any. My
> first question is about common blocks. Implementing pikaia requires a
> couple common blocks. Currently I have common blocks in IDL that
> store all the necessary data. Is there a way to share common blocks
> in IDL with fortran code called by IDL? Or would I have to pass all
> the necessary data to fortran and then have it load it's own common
> blocks?
>
> Also, does anyone know any good tips sites or tutorials on running IDL
> from fortran? I found this of course:
> http://www.dfanning.com/tips/fortran_linking.html
> It would be nice to have some background though - I can probably
> follow the steps but it would be ince to know what is going on (and
> what is a DLM?). Also, any ideas if this still works? It's listed
> for IDL version 5.2-5.4.
>
> Thanks,
> Conor
>
Re: fortran feasability [message #54875 is a reply to message #54873] Mon, 16 July 2007 06:08 Go to previous message
Brian Larsen is currently offline  Brian Larsen
Messages: 270
Registered: June 2006
Senior Member
I don't have any good suggestions here but I do offer an example that
I use all the time transparently.

http://dysprosium.jhuapl.edu/idl_geopack/

Maybe in the study of some of this IDL something good can be learned
(or maybe not).


Brian



------------------------------------------------------------ ---------------------
Brian Larsen
Boston University
Center for Space Physics
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: for loops for total newbies
Next Topic: keywords and passing values

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

Current Time: Wed Oct 08 17:56:36 PDT 2025

Total time taken to generate the page: 0.00485 seconds