Re: [f2py] passing var values
Benjamin Kutz <[email protected]> Wed, 28 Jul 2010 15:56:39 +0200
| Newsgroups | gmane.comp.python.f2py.user |
|---|---|
| Message-ID | <[email protected]> |
Thank you very much! Greetings from Germany Benjamin Am 28.07.2010 14:24, schrieb Pearu Peterson: > On Wed, Jul 28, 2010 at 2:33 PM, Benjamin Kutz > <[email protected]> wrote: > >> Hi, >> >> I've got a problem with passing values of variables from Fortran to Python. >> I've wrapped a Fortran Routine and pass a variable as a Parameter. I >> change the variable in Fortran and want, that Python knows the new value >> of the variable. >> >> My code looks like: >> >> >>>variable=0 >> >>>fortranmodule.sub(variable) >> #in Fortran the value of the variable is changed to 1 >> > Try: > > variable = fortranmodule.sub(variable) > > Pearu > > >> >>>print 'var',variable >> var 0 >> #should be var 1 >> >> How can I realize, that I receive the correct value of the variable? >> >> My file wrapp.pyf looks like: >> >> subroutine sub(variable) >> integer intent(in,out) :: variable >> end subroutine sub >> >> Maybe some one of you can give me some advise. >> Thank you very much! >> >> Greetings >> Ben >> >> _______________________________________________ >> f2py-users mailing list >> f2py-users-Y4l6ocDipWCuvFJfX82//[email protected] >> http://cens.ioc.ee/mailman/listinfo/f2py-users >> >> > _______________________________________________ > f2py-users mailing list > f2py-users-Y4l6ocDipWCuvFJfX82//[email protected] > http://cens.ioc.ee/mailman/listinfo/f2py-users >