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

Home » Public Forums » archive » Re: CALL_EXTERNAL - Fortran Troubles
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: CALL_EXTERNAL - Fortran Troubles [message #5333] Wed, 08 November 1995 00:00
Jim Brown is currently offline  Jim Brown
Messages: 8
Registered: November 1995
Junior Member
Mark Rivers wrote:

> You need to provide some more information:
> - What product are you using (IDL or PV-WAVE). They pass parameters
> differently to CALL_EXTERNAL
> - What operating system are you using, VMS, UNIX, Windows, etc.
> IDL's CALL_EXTERNAL passes parameters differently with Unix and VMS.

IDL
UNIX
SunOS 5.3

> IDL passes STRINGS by descriptor, i.e. the address of a structure
> containing the length and address of the string. You are not allowed to
> change the length of the string in your routine. You can get around this
> by converting to BYTE before calling your FORTRAN routine.
>

I have gotten a few suggestions along with yours since my post yesterday.
It appears that the general consensus is to convert to BYTE. I will give
that a try.

Jim
============================================================ ==============
James T. Brown
CIRES - Cooperative Institute for Research in Environmental Sciences
University of Colorado

email: jtb@cdc.noaa.gov
Re: CALL_EXTERNAL - Fortran Troubles [message #5335 is a reply to message #5333] Wed, 08 November 1995 00:00 Go to previous message
rivers is currently offline  rivers
Messages: 228
Registered: March 1991
Senior Member
In article <309FE62C.F46@cdc.noaa.gov>, Jim Brown <jtb@cdc.noaa.gov> writes:
> Hello all:
>
> Please forgive me if somebody else has posed a similar question, but
> I am stumped! I have obtained some code from a colleague that makes
> use of the CALL_EXTERNAL function to execute Fortran code. I have
> been able to understand hs example and make certain routines work, but
> I have hit a dead end.
>
> Now I can get the above code (and other code for that matter) to work if I
> am only passing back arrays containing REALS. What I would like to do is
> to have a routine pass back both reals and a string such as the following
> shows:

> Note, the only change was the addition of the string variable, units.
> Everything compiles great, but I cannot get the value of the variable
> named units passed back into my IDL routine.

You need to provide some more information:
- What product are you using (IDL or PV-WAVE). They pass parameters
differently to CALL_EXTERNAL
- What operating system are you using, VMS, UNIX, Windows, etc.
IDL's CALL_EXTERNAL passes parameters differently with Unix and VMS.

IDL passes STRINGS by descriptor, i.e. the address of a structure
containing the length and address of the string. You are not allowed to
change the length of the string in your routine. You can get around this
by converting to BYTE before calling your FORTRAN routine.

____________________________________________________________
Mark Rivers (312) 702-2279 (office)
CARS (312) 702-9951 (secretary)
Univ. of Chicago (312) 702-5454 (FAX)
5640 S. Ellis Ave. (708) 922-0499 (home)
Chicago, IL 60637 rivers@cars3.uchicago.edu (Internet)
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Q: Polycontour and Shade_surf with !P.Multi - impossible?
Next Topic: Re: Regular expressions for string matching ...

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

Current Time: Fri Oct 10 21:44:16 PDT 2025

Total time taken to generate the page: 0.40086 seconds