[f2py] FW: f90 types as modul variables

Malte.Mauelshagen at dlr.de Malte.Mauelshagen at dlr.de
Fri Jan 29 15:26:41 EET 2010


Hi,
Thank you for your answer. :)
But this is exactly the way i do NOT want to do it! ;-)
Since i have the problem with the derived types, i have several files that only should be compiled, but not wrapped.
I don't need acces on the derived types, i just wanna have acces on a subroutine or module that USES object files with derived types.
Is this possible?

Malte

-----------------------------------------------------------------------------
Deutsches Zentrum für Luft- und Raumfahrt e.V.
in der Helmholtz-Gemeinschaft
Ausbildung - Duale Hochschule Baden-Württemberg

Malte Mauelshagen

Lilienthalplatz 7
38108 Braunschweig
Tel.: 0531/295-2483



-----Original Message-----
From: f2py-users-bounces at cens.ioc.ee on behalf of Pearu Peterson
Sent: Fri 29.01.2010 14:15
To: For users of the f2py program
Subject: Re: [f2py] FW: f90 types as modul variables
 
Hi,

Malte.Mauelshagen at dlr.de wrote:
> Hi,
> I have another problem with f2py, but i hope you can help me.
> There are two .f90 files:
> 
> ---------------------------------------
> !testfile1.f90
> module testmodule
> 	contains
> 	subroutine foo
> 		write(*,*) "yeahh!"
> 	end subroutine foo
> end module testmodule
> --------------------------------------
> !testfile2.f90
> subroutine testroutine
> 	use testmodule
> 	call foo()
> end subroutine testroutine
> ----------------------------------------
> 
> I would like to wrap the second one with f2py, so that i can call mynewodule.testroutine() from python.
> But: The first file should not be wrapped to f2py! I just wanna compile it with '-c' and than link the object file testfile1.o to my new module.
> I think that should be possible but i just cant get it.
> 
> gfortran -c testfile1.f90
> /usr/local/bin/python2.6 /usr/local/bin/f2py -m mynewmodul -h mynewmodul.pyf testfile2.f90
> /usr/local/bin/python2.6 /usr/local/bin/f2py -c --fcompiler=gfortran mynewmodul.pyf testfile2.f90 testfile1.o
> 
> These are the commands I tried...

Try this:

f2py -m mynewmodul -h mynewmodul.pyf testfile2.f90
f2py -c --fcompiler=gfortran mynewmodul.pyf testfile2.f90 testfile1.f90

HTH,
Pearu


_______________________________________________
f2py-users mailing list
f2py-users at cens.ioc.ee
http://cens.ioc.ee/mailman/listinfo/f2py-users

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/ms-tnef
Size: 3736 bytes
Desc: not available
Url : http://cens.ioc.ee/pipermail/f2py-users/attachments/20100129/3d5a2de9/attachment.bin 


More information about the f2py-users mailing list