climt
climt copied to clipboard
Refactor Emanuel convection to support non-contiguous arrays
Currently the Emanuel convection Fortran code is written to only work on contiguous vertical columns. Since the GFS dynamical core only works on contiguous horizontal slices, that means array copying has to occur between calls to these two components. We could re-factor the Emanuel Fortran code to avoid this.
Honestly, if you look at the Emanuel fortran code, I would rather write a pure python implementation than refactor it ;)
For now, I think I can live with this copy. I really plan to write a pure python implementation of the emanuel scheme, both as a learning project and to clean it up. But that is way out in the future.
I would suggest writing it in Cython when you do. You should see significant speed-ups relative to pure Python, and Cython isn't bad.
Let's leave this issue open, with the plan to eventually fix it by writing a non-Fortran Emanuel convection implementation.