Compile and import everything from a Fortran code cell, using f2py.
The contents of the cell are written to a .f90
file in the
directory IPYTHONDIR/fortran
using a filename with the hash of the
code. This file is then compiled. The resulting module
is imported and all of its symbols are injected into the user's
namespace.
%install_ext https://raw.github.com/mgaitan/fortran_magic/master/fortranmagic.py
Installed fortranmagic.py. To use it, type: %load_ext fortranmagic
%load_ext fortranmagic
%%fortran
subroutine f1(x, y, z)
real, intent(in) :: x,y
real, intent(out) :: z
z = sin(x+y)
end subroutine f1
f1(1.0, 2.1415)
9.26574066397734e-05
print f1.__doc__
f1 - Function signature: z = f1(x,y) Required arguments: x : input float y : input float Return objects: z : float