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.
- 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.