February 18th, 2011: New version 0.7 released
foul - The Fortran Output Library
foul is a Fortran 90 library designed to simplify a variety of tasks related to program output. foul currently has three main components:
- Functions for writing formatted output (see below)
- Functions for converting numerical values to strings
- Functions for timing program execution and other processes
All functions are fully documented within the source code.
For example, foul can turn this program output ...
... into this
Allowing the Fortran programmer to harness for the first time the full power of escape codes, foul makes formatting console output easy.
Don't believe it? Take a look at this sample program written using foul:
PROGRAM foul_demo
USE foul
CALL write_formatted('Rule of Sarrus', 'bright red underline', ' (Linear Algebra)', 'bright normal')
END PROGRAM foul_demo
This will produce the first line of the console output shown above. It doesn't get any more convenient than this!
Features of foul include:
- Full control over foreground and background color, text styles and more
- Functions to switch (and reset) text attributes without writing text, allowing for coloring of input as well
- Switch to turn off all escape codes for output to files or terminals not supporting them. No code changes neccessary!
- Powerful functions for formatting numerical data
- Easy-to-use functions for timing program execution
- 100 % pure Fortran 90; no external dependencies
- Everything encapsulated in a single Fortran module
- Free and open source software (GPLv3)
By now you've probably figured out that you have nothing to lose by giving foul a try. So, what are you waiting for?
Download it already! (foul 0.7, released on Feburary 18th, 2011)
foul
was developed to format output in a thesis project of mine. I have made
good use of it already. If it has done anything for you as well, or if
you have any suggestions or improvements, I'd love to hear about it.
Copyright © 2010-2011 by Philipp Emanuel Weidmann