4 ms·
I've worked/studied computational physics for a few years. My experience has not been good. First, I don't think that we've learned how to make complex models
by ced 16y ago
I've worked/studied computational physics for a few years. My experience has not been good.
First, I don't think that we've learned how to make complex models yet. But in fairness, it's a really hard problem. If my numerical code is wrong, I won't get a segfault. Rather, I may notice "unusual" patterns in my model output, which could be:
- A genuine physical effect
- An artifact of the assumptions we used (because models are simplifications)
- A numerical method that hasn't converged, or whose accuracy is insufficient
- A bug
Untangling this is nigh impossible, unless you rely on very, very careful testing of independent parts. That's how the NASA does it [1], but it's simply not within the realm of what the typical physicist can/will do (and understandably so, numerics is hard).
The solution would be to have tried and tested libraries, built by numerical specialists, so that physicists would only have to specify the equations to solve. That's what Mathematica does, and it's the only sane way I know of making complex models.
But it's slow, so physicists use Fortran instead, and code their own numerical routines in the name of efficiency. Tragedy ensues. Fortran's abstraction capabilities are below C [2]. Modularity is out of the window.
I spent a summer working on one particularly huge model, that had been developed and tweaked over twenty years. At some point I encountered a strange 1/2 factor in a variable assignment, and questioned my advisor about it.
"Oh, is that still in there? That's a fudge factor, we should remove it."
A fudge factor. No comment, no variable name, just 1/2.
Another scientist told me: "No one really knows anymore what equations are solved in there.", to which my advisor replied "Ha, if we gathered all the scientists for an afternoon, we could probably figure it out."
But I agree with the other posters and jgrahamc: the incentives for producing quality code and models are just not there. And sadly, I don't see them changing anytime soon.
[1] http://www.fastcompany.com/node/28121/print http://www.fastcompany.com/node/28121/print?
[2] (At least, the subset of Fortran used by the physicists I've met. Modern Fortran is a bit different.)