Python/Fortran interoperability

nmm1 at nmm1 at
Mon Aug 24 21:24:35 CEST 2009

In article <7abee4bb-b18a-4680-817b-7e76aed40194 at>,
sturlamolden  <sturlamolden at> wrote:
>> Precisely. =A0And the kludge does NOT work under all circumstances,
>> which is why I said that it doesn't work very well.
>Do you have an example?

I gave you one.  Also see below.

>> Consider, for example:
>> =A0 =A0 SUBROUTINE Fred (X) BIND(C)
>> =A0 =A0 CHARACTER*(*) :: X
>Obviously that is not allowed, because C does not know anything about
>Fortran strings. How should a C compiler pass the correct data
>structure to Fred?

Precisely.  The reason I asked that question is that it would be
possible to extend the standard to make it possible in a portable

You might also like to consider the converse problem: how to write
a Fortran function that takes a C string of arbitrary length and
uses it.

Nick Maclaren.

More information about the Python-list mailing list