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

Home » Public Forums » archive » Calling fortran
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: Calling fortran [message #7250 is a reply to message #7157] Thu, 10 October 1996 00:00 Go to previous message
dors is currently offline  dors
Messages: 8
Registered: June 1994
Junior Member
Examples of how to use call_external come WITH idl. The are located
in a path something like: /usr/local/rsi/idl_4/external/examples/sharelib/

Also check out the IDL FORTRAN-FAQ:

ftp://eos.crseo.ucsb.edu:/pub/idl/idl-fortran.Z

Note that the call external example given uses a C interface program,
it is also possible to use a FORTRAN interface program.

A very simple shell of a FORTRAN interface program would look like:
(check out the post I made last week about this with a more
complicated example, I erased it, maybe someone else will be kind
enough to repost it. :)

c Interface routine
SUBROUTINE pass (argc, argv)
c note size of intergers on the next line depends on your system pointer size
INTEGER*8 argc, argv(*)
CALL mysub (%VAL(argv(1)),%val(argv(2)))
RETURN
END

SUBROUTINE mysub (a, b)
integer*4 a, b

print *, a, b

end

idl:

j=CALL_EXTERNAL ('mylib.so','pass_',NBLOCKS,len,VALUE=[0,0])


Eric

--

\
\ O,
\___________\/ )_________/
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ \~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| Eric E. Dors \| Internet: eric.dors@unh.edu |
| 203 Van Allen Hall | |
| Iowa City, IA 52242 | |
============================================================ ================
| "if free particles were truly free..." |
| "they wouldn't be represented by bras, <k| " |
| ---oh no, how did a physics joke make it in here? :^) |
============================================================ ================
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Filters
Next Topic: Looking for: IDL-widget routine for spectrosc. Data (Raman/IR)

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

Current Time: Tue Oct 21 00:17:56 PDT 2025

Total time taken to generate the page: 4.32025 seconds