[f2py] passing var values
Benjamin Kutz <[email protected]> Wed, 28 Jul 2010 13:33:00 +0200
| Newsgroups | gmane.comp.python.f2py.user |
|---|---|
| Message-ID | <[email protected]> |
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
>>>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