Talk Tools for developing a Fortran library

Presented by David Froger in Scientific track 2010 on 2010/07/11 from 15:30 to 15:45 in room Dussane

Developing scientific Fortran programs involve, like anywhere, reuse code and/or share it with other people. Rather than every time copy-paste-modify lines of code from a program to another, it is useful to work with a documented and tested library. This presentation is about some simple Python scripts (which can be called from Shell scripts), to simplify the tasks of:

Compiling Fortran program:

  • building the modules dependencies tree,
  • generating Makefile.

Documenting :

  • examples of subroutines/functions uses: tests based on output (like «doctest»),
  • generating HTML documentation files.

Managing errors in a Fortran program:

  • try to mimic the Python exceptions propagation.


  • functions, subroutines tested with the «unittest» Python module. Need to call Fortran from Python, possible with f2py.

Using the library comfortably: wrapping the library in Python, using f2py.

  • example one: bi-interpolation
  • example two: reading memory-expansive data from numerical simulation for post-processing with Pylab.