# An example in Fortran 77 to calculate the fibonacci number (as a sequence) is in the file fib.f
# to compile it, run

$ f2py -c -m fib fib.f -I<path to Python.h>

# and you can then use it in python with e.g.

>>> import fib
>>> print(fib.fib(8))


# An example of a Fortran 90 module can be found in the file moddata.f90
# it contains an integer i, an array of four integers x, a double array with shape (2,3) a and an arbitrary two-dimensional double array, The function foo prints the information about this variables plus adds to the element (1,2) in a 3.0 (Attention: Fortran starts counting at 1).
# to compile it, run

$ f2py -c -m moddata moddata.f90 -I<path to Python.h>

# and you can the us it in python with e.g.

>>> import moddata
>>> moddata.mod.i=5
>>> moddata.mod.x[:2] = [1,2]
>>> moddata.mod.a = [[1,2,3],[4,5,6]]
>>> import numpy as np
>>> moddata.mod.b = np.random.rand(5,8)
>>> print(moddata.mod.b)
>>> moddata.mod.foo()

