Python/Fortran interoperability

sturlamolden sturlamolden at yahoo.no
Sun Aug 23 19:17:19 EDT 2009


On 23 Aug, 20:42, n... at cam.ac.uk wrote:

> That is precisely what I am investigating.  TR 29113 falls a LONG
> way before it gets to any of the OOP data - indeed, you can't even
> pass OOP derived types as pure data (without even the functionality)
> in its model.  Nor most of what else Python would expect.

I am note sure what you mean. This has the same ABI:

typedef struct {
    int m, n;
    float r;
} myctype;


use iso_c_binding
type, bind(c) :: myftype
    integer(c_int) :: m, n
    real(c_float) :: s
end type

You thus can pass derived types between C and Fortran.












More information about the Python-list mailing list