On Tuesday 06 June 2006 4:04 pm, Maura Edeweiss Monville wrote:
I do not have experience of interfacing Fortran with C.. I mean exchanging and sharing data between C routines and Fortran routines linked together. I would appreciate some guidelines how to do that.
Basically, assume the following common block is defined in a fortran routine called "m1505.f": COMMON/LEXP/DLEXP,TO,AINT
That is the Fortran routine defined the common block named "LEXP" containing the three valiables DLEXP, TO, AINT Now assume that such a Fortran routine is linked to some C routines and some Tcl/Tk procedures through a GNUmakefile. How can I, from inside a C routine, access the content of the variable AINT in the common block LEXP ? It's been a while since I have done some mixed code. Essentially, the FORTRAN Common block is roughly equivalent to the C static storage class. In C, you should be able to access them by name. In C, for instance extern double DLEXP;
http://h21007.www2.hp.com/dspp/files/unprotected/Fortran/docs/vf-html/pg/pgw...
However, be very careful. While floating point and integer variables have
the same format, strings, structures, and arrays are quite different.
--
Jerry Feldman