Re: Fortran + IDL [message #26368 is a reply to message #26230] |
Mon, 20 August 2001 20:37   |
A. D. & J.C. Cool
Messages: 16 Registered: February 2000
|
Junior Member |
|
|
Craig Markwardt wrote:
>
> fskhk@puknet.puk.ac.za (Helena Kruger) writes:
>> I am working in Fortran (with a complicated program) and IDL. Up to
>> now I put the output of the fortran data in a text file, go to IDL,
>> read the text file in IDL and draw the graphs. For every small change
>> in fortran I have to go in and out the fortran program and IDL
>> program. Will it be easier and better to use ActiveX or Callable IDL
>> under Windows? How and where can I learn to make the linkage?
>
> Stein Vidar's response spawned a thought. Why aren't you using SPAWN?
> One point of any programming language is to proceduralize mundane
> tasks so you don't have to keep doing the tasks yourself.
>
> You could start with something like this:
>
> pro dofortran, array
> ;; Call fortran program
> spawn, 'runfortran', output
>
> ;; Determine number of elements in array - assume it's a 3xN array
> n = n_elements(output)
> array = fltarr(3,n)
>
> for i = 0L, n-1 do begin
> v0 = [0., 0., 0.]
> reads, output(i), v0
> array(*,i) = v0
> endfor
>
> return
> end
>
> Obviously you will have to customize for your program name and the
> number of variables, etc.
>
> Craig
Helena hasn't said what platform she's actually running IDL on.
If she is running IDL on OpenVMS, then yes, she must exit her IDL
session
every time she re-compiles the Fortran. Alas IDL on VMS does not
release/delete/
overwrite the routine/memory (what's the jargon?) called by
CALL_EXTERNAL...
Andrew
andrew.cool@dsto.defence.gov.au
|
|
|