next up previous
Next: Write a Driving Routine Up: The Output Routines Previous: The jet of derivatives

The Fortran 77 wrapper

  The produced C code cannot be directly called from a Fortran program, because Fortran sends all the parameters by address while the C code expects some of them by value. So, to call this package from a Fortran program we need a wrapping C routine that receives all the parameters by address and calls the integration routine properly. The -f77 flag produces such a routine:
void taylor_f77_ODE_NAME__(MY_FLOAT *time,
                           MY_FLOAT *xvars,
                           int      *direction,
                           int      *step_ctrl_method,
                           double   *log10abserr,
                           double   *log10relerr,
                           MY_FLOAT *endtime,
                           MY_FLOAT *stepused,
                           int      *order,
                           int      *flag)
This routine should be called as
        call taylor_f77_ODE_NAME(...)
Note that, in the call, we have removed the string ``__'' at the end of the name. The reason is that the standard GNU compiler (g77) adds ``__'' at the end of the name of the procedures and the C compiler (gcc) does not.

Important note: different compilers could use different alterations of these names. So, if your compilers are not g77/gcc, you may need to modify the name of this routine accordingly.

The meaning of the parameters is the same as in the C main call (see Section 5.3.1), except that here we have an extra parameter at the end of the call, that contains the value returned by the C procedure:



Maorong Zou
Tue Nov 13 09:42:48 CST 2001