On 24 Aug, 01:59, sturlamolden <[email protected]> wrote:
> subroutine foobar(cstr) bind(c, name='foobar')
> use, intrinsic :: iso_c_binding
> type(c_ptr) :: cstr
> character(*), pointer :: fstr
> call c_f_pointer(cptr, fptr)
>
Which means that you can write a wrapper in Fortran callable from C,
that calls a Fortran routine you want to expose:
subroutine wrap_foobar(cstr) bind(c, name='foobar')
use, intrinsic :: iso_c_binding
type(c_ptr) :: cstr
character(*), pointer :: fstr
call c_f_pointer(cptr, fptr)
call foobar(fstr)
end subroutine
subroutine foobar(fstr)
character(*) :: fstr
! whatever
end subroutine
This by the way is how wrap exposes Fortran functions to Cython.
--
http://mail.python.org/mailman/listinfo/python-list