You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Routines containing explicit interfaces are excluded by f90wrap.
Routines containing abstract interfaces are not excluded, but are incorrectly wrapped.
Input
! test.f90
module test
implicit none
private
public :: foo, bar
abstract interface
functionfx(x)
integer:: x
integer:: fx
endfunction
end interface
containssubroutinefoo(fnc, a, b)
interface
functionfnc(x)
integer:: x
integer:: fnc
endfunction
end interface
integer, intent(in) :: a
integer, intent(out) :: b
b = fnc(a)
endsubroutinesubroutinebar(fnc, a, b)
procedure(fx) :: fnc
integer, intent(in) :: a
integer, intent(out) :: b
b = fnc(a)
endsubroutine
end module test
Intermediate Result
Note how foo is gone.
! Module test defined in file test.f90
subroutinef90wrap_bar(fnc, a, b)
use test, only: bar
implicit nonereal:: fnc
integer, intent(in) :: a
integer, intent(out) :: b
call bar(fnc=fnc, a=a, b=b)
endsubroutine f90wrap_bar
! End of module test defined in file test.f90
Python module
Note how bar is called as a function, when it is actually a subroutine.
from __future__ importprint_function, absolute_import, divisionimport_fortranmoduleimportf90wrap.runtimeimportloggingimportnumpyclassTest(f90wrap.runtime.FortranModule):
""" Module test Defined at test.f90 lines 1-27 """@staticmethoddefbar(fnc, a):
""" b = bar(fnc, a) Defined at test.f90 lines 23-27 Parameters ---------- fnc : float a : int Returns ------- b : int """b=_fortranmodule.f90wrap_bar(fnc=fnc, a=a)
returnb_dt_array_initialisers= []
test=Test()
The text was updated successfully, but these errors were encountered:
HugoMVale
changed the title
Routines including procedure arguments (callbacks) are excluded
BUG: Routines including procedure arguments (callbacks) are excluded
Jun 6, 2023
Input
Intermediate Result
Note how
foo
is gone.Python module
Note how
bar
is called as a function, when it is actually a subroutine.The text was updated successfully, but these errors were encountered: