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

Home » Public Forums » archive » Re: Linking IDL with FORTRAN routines under UNIX: interpol_c.c
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: Linking IDL with FORTRAN routines under UNIX: interpol_c.c [message #178] Tue, 24 September 1991 12:56
thompson is currently offline  thompson
Messages: 584
Registered: August 1991
Senior Member
This is the C interface routine (interpol_c.c) for the FORTRAN sample program
for a Sun workstation. Basically, one calls the FORTRAN routine with its name
followed by an extra underscore character. Just replace the variable names
(x_in, y_in, ...) with those for the routine being linked to.

Complex variables should be referred to as float in this interface routine.

#include <stdio.h>

/*********************************************************** ******************/
/** **** **** **** **** **** **** **** **** **** **/
/*********************************************************** ******************/
void interpol_c(argc, argv)
int argc; /* The number of arguments */
void *argv[]; /* The arguments */
{
float *x_in, *y_in, *x_out, *y_out;
long *n_in, *n_out;

/* Convert the IDL input parameters into FORTRAN parameters. */

x_in = (float *) argv[0];
y_in = (float *) argv[1];
n_in = (long *) argv[2];
x_out = (float *) argv[3];
y_out = (float *) argv[4];
n_out = (long *) argv[5];

/* Call the FORTRAN routine INTERPOL. */

interpol_(x_in,y_in,n_in,x_out,y_out,n_out);
return;
}
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Linking IDL with FORTRAN routines under UNIX -- Makefile
Next Topic: Re: Linking IDL with FORTRAN routines under UNIX: interpol.pro

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

Current Time: Fri Oct 10 13:26:22 PDT 2025

Total time taken to generate the page: 1.11903 seconds