FORTRAN
Table of Contents
1. Overview
Fortran is the "gold standard" for numerical computation. Since the F90 dialect came about, it has evolved from the "assembly doppleganger" to something resembling Pascal.
Like Common Lisp, it's case insensitive (unfortunately).
2. Tools
I am specifically trying to not reinvent the wheel. Towards this end, I am willing to delegate work to specialized libraries (like LAPACK and friends).
2.1. Literate Fortran
If I wanted to write a program in Fortran and include the motivation, derivation, etc., then a common trick is to use literate programming. There are a few toolkits available:
- Noweb, a generic tool for literate programming, which works really well with LaTeX, and can produce HTML output. The only disadvantage I can think of is it doesn't easily handle syntax highlighting.
- FWEB, a fork of WEB specifically for Fortran
- Org-mode, which I prefer least
2.2. Unit Testing Frameworks
There are about a dozen frameworks for unit testing Fortran code. One of the tenets of unit testing is to keep reports of test results, and the only framework producing an artifact (in the form of a file) is FRUIT.
3. References
- Fortran Wiki
- Best Practices
- Assertion utilities
- assert.h for Fortran
- Assertions in Fortran (stackoverflow)
- Object Oriented Fortran
- Damian Rouson, Jim Xia, Xiaofeng Xu,
Scientific Software Design: The Object-Oriented Way.
Cambridge University Press, 2011.- Discusses a number of interesting design patterns unique to scientific computation, like encoding differential operators using abstract data types in a manner which is independent of numerical schemes (so it's more readable, reusable, stable).