Friday 11 February 2011

What I hate about modelling

One of the things that I hate most about being an ecosystem modeller is how easy it is to be hamstrung by a single (and usually simple) coding error in a model equation. Worse, as long as they don't immediately produce NaNs, such errors can lie undetected for months or years until, upon discovery, they invalidate a vast body of simulation output that has been generated using them. A recent schoolboy error, which I'm far too embarrassed to describe here and which wasn't even in an equation, cost me a big chunk of simulation time, and no shortage of embarrassment when I had to 'fess up to it.

One of the worst parts of such errors is finding them. It usually starts off with either an anomaly in model output or, as in the case I'm coming to, an attempt to disentangle a model equation during a write-up. After a few minutes of attempted bughunting, which usually becomes increasingly desperate as the sums continue not to add up, a cold dread begins to seep into my mind, followed by a sinking collapse into depression (plus optional banging of the head on a wall). Could I really have been so stupid? Just how much work is hanging on this mistake? Did I publish anything using this model version?

Sometimes, and this is what's just happened to me, after reaching this nadir, and contemplating leaving my office by the window because of the vast, crushing shame that's just fallen onto me, the penny drops, and what's hitherto been a fatal error upon which months of work have just been dashed turns out to be nothing of the sort. A quick correction later, and the seeming error turns out to instead have been some good, solid programming that I did months/years ago. But the gushing relief that comes in these latter cases (which, to be fair, are the majority for me) doesn't offset the preceding darkness.

And that's one of the things I hate most about modelling. Those terrible moments when it looks like a vast tranche of my work has just slipped off down the pan. To get all melodramatic about it: it's the living on a knife edge between just-about-OK, and catastrophic-disaster-cum-fiasco that I can't stand.

Sinking flux model

Today's cold sweat was inspired by my attempt to draw this diagram to illustrate a paper. Try as I might, I just couldn't get my equations to stack up. Cue questions about whether all my simulations were wrong ...

No comments: