source = """ real*8 function fcb(x, y) ... subroutine gridloop2_fcb(a, xcoor, ycoor, nx, ny) ... """ % fstr f2py_args = "--fcompiler='Gnu' --build-dir tmp2"\ " -DF2PY_REPORT_ON_ARRAY_COPY=1 "\ " ./ext_gridloop.so" f2py2e.compile(source, modulename='callback', extra_args=f2py_args, verbose=True, source_fn='_cb.f') import callback a = callback.gridloop2_fcb(self.xcoor, self.ycoor)