Re: Linking IDL with FORTRAN routines under UNIX: interpol_c.c [message #178] |
Tue, 24 September 1991 12:56 |
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;
}
|
|
|