edoddridge / aronnax

An idealised isopycnal model that can be run either with n+1/2 layers, or with n layers and variable bathymetry.
http://aronnax.readthedocs.io/en/latest/
MIT License
24 stars 6 forks source link

Split the main program up into sensible subroutines #70

Closed axch closed 7 years ago

axch commented 7 years ago

Benefits:

axch commented 7 years ago

I've started working on this, and it causes a lot of code rearrangement, so we probably shouldn't do anything more to the core until this completes, on pain of merge conflicts.

axch commented 7 years ago

An unexpected beneficial consequence of this project: the time needed to compile the core has fallen drastically. I'm guessing there's some kind of flow or alias analysis in the compiler whose runtime scales with the product of #variables by #statements in some function, or #variables squared, or some such.

Or, perhaps, variables declared intent(in) are faster to compile than mutable ones.

edoddridge commented 7 years ago

That's a nice side effect!