
![]() | We may edit hw.pyf and specify s in hw3 as an output argument, using F90's intent(out) keyword:
python module hw ! in
interface ! in :hw
...
subroutine hw3(r1,r2,s) ! in :hw:hw.f
real*8 :: r1
real*8 :: r2
real*8, intent(out) :: s
end subroutine hw3
end interface
end python module hw
|
![]() | Next step: run F2PY with the edited interface file:
f2py -c hw.pyf hw.f |