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

Home » Public Forums » archive » Re: Guide: how to call Fortran from IDL in a portable and stardard F 2003 way
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Guide: how to call Fortran from IDL in a portable and stardard F 2003 way [message #87818 is a reply to message #87809] Thu, 27 February 2014 09:34 Go to previous messageGo to previous message
Lajos Foldy is currently offline  Lajos Foldy
Messages: 176
Registered: December 2011
Senior Member
On Thursday, February 27, 2014 5:51:08 PM UTC+1, negri...@gmail.com wrote:

> Recently, I felt the necessity (in IDL) of a subroutine that was coded extremely well in Fortran, with a skilled use of nested do loops over some matrices. I though that the time was come to interface IDL and Fortran.

Nowadays I use /AUTO_GLUE in CALL_EXTERNAL. Here is a Fortran 77 example (I used Fortran 30 years ago :-):

test.f:
subroutine test(array, n,m)
integer*4 n, m
real*8 array(n,m)
write(*,*) array
end

gfortran -c -fPIC test.f
gfortran -shared -o test.so test.o

test.pro:

pro test
n=3l
m=4l
array=dindgen(m,n)
trash=call_external('test.so', 'test_', array, n, m, /auto_glue)
end

IDL> test
% Compiled module: TEST.
0.0000000000000000 1.0000000000000000 2.0000000000000000 3.0000000000000000 4.000000000000000
0 5.0000000000000000 6.0000000000000000 7.0000000000000000 8.0000000000000000 9.000000000
0000000 10.000000000000000 11.000000000000000


regards,
Lajos
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Help needed for a CASE statement, something subtle going on ...
Next Topic: Remote X server

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

Current Time: Fri Oct 10 14:57:31 PDT 2025

Total time taken to generate the page: 0.64082 seconds