Back to Lev's Home page
Lessons and recommendations for modellers
Model builders
- Design your models for flexibility and ease of use.
- Develop your models incrementally.
- Analysize and document the model sensitivity
to each new component or modified parameterization.
- Write out the key algorithms.
- Document your source code. And make good use of blank lines to compartimentalize the logic/algorithms
- Write a publication quality "Methods" or "Model description" while you're developing
the code. It's easier than coming back to it later, and it helps to catch algorithmic problems
- Use short descriptive variable names
- All parameters should have their units explicitly indicated in the code
- Use F90 (or C++), implicit none, explicit intents, and modules (not common blocks)
- Order arguments consistently, eg: inputs, outputs, control flags
- Use existing software libraries whenever possible
- Design your own standard data formats for IO (or consider
using standards such as netcdf)
- Design and implement strong model tests such as flux conservation, sensitivity to time-step and grid resolution...
- Test array index ranges with compiler flags
- Check all compiler warning messages
- Plot key fields
Model based analyses
- Consider ensemble-based analyses. There are too many papers published
that are based on model analyses with no rational error bars and many hidden
parameters.
- Before carrying out sensitivity analyses, put careful
thought into the choice of parameter ranges
- Write out all variable parameters to an ID file for each model run
- Build scripts for automated output analysis
- Save lots of output especially at the beginning. You can always dump data
later. And some of the most interesting results (and subtlest bugs) show up in the least suspected
fields.
- Plot results. Make movies. Get a visual sense of the model dynamics.
Open-source (or at least free) software recommendations
I'm picky about reasonable learning curves, logical syntax, and simple scripts. These
packages are my favourites:
1D (timeseries,..) plots: gnuplot
scriptable, logical syntax
2D area map graphics and netcdf access/regridding...: Ferret
Ferret has a short learning curve and is script based (with
optional GUI interface for those so inclined). It is also backed
by a very helpful user/developer community
matrix/numerical analysis: Octave
Octave is an open-source partial clone of Matlab
data management/scripting: Python
Python is much more numerically oriented than Perl and as far as I'm
concerned, has a more logical syntax
vector graphics: xfig
xfig is easy to use and can import many types of graphic files
GIS: grass5
Powerful, scriptable, relatively easy learning curve, diverse set of toolboxes
Statistical Computing: R
Similar to the S language and environment but open-sourced and
with loads of tool-boxes.
general scripting: awk
awk, csh, sed, join, cut are all easy to use and powerful tools for managing
large datasets, automating dataprocessing,...
Artificial Neural Networks
Netlab
is a freely available Neural Toolbox for Matlab (that
unfortunately doesn't work on Octave). It's biggest plus is
the associated text: Netlab:
Algorithms for Pattern Recognition. All the algorithms are
spelled out in detail in the textbook and for me this was a
great learning aid. Phil Goodman's Nevprop is the
easiest package that I've found to use. It is a good starting
point for someone who wants to get quick results even though
it is limited to standard feedforward multilayer perceptron
networks. For Bayesian neural networks and Markov chain
sampling I reccomend Radford Neal's
software for flexible Bayesian modelling which is being
used in our calibration project.
Back to Lev's Home page