[f2py] Kind Values and f2py

Pearu Peterson pearu@cens.ioc.ee
Thu, 5 Jul 2001 10:09:49 +0200 (EET)


On Wed, 4 Jul 2001, Tim Lahey wrote:

> All,
> 
> I've been trying to ensure my code is portable by using a module
> that defines a variable wp to be used to define the precision 
> of a variable:
> 
> use tl_kind, ONLY : wp
> real(wp) :: working_precision_variable
> 
> f2py doesn't seem to like the kind wp. Is there a simple way to
> get this to work without modifying all my code ?

Indeed, there is a workaround for this:
Create a file `.f2py_f2cmap' that contains the following python dictionary

{'real':{'wp':'float'}}

meaning that Fortran `real(wp)' corresponds to C `float', for
instance.

Regards,
	Pearu