Re: Calling fortran [message #7250 is a reply to message #7157] |
Thu, 10 October 1996 00:00  |
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? :^) |
============================================================ ================
|
|
|