For my Masters thesis I used a shallow water model in order to investigate energy-budget based backscatter parametrization for unresolved eddies. I wrote the numerical model in Python in 2016 and although idealized, it involves some features to mention:
- Centred finite differences on an Arakawa C grid. All gradient or interpolation operations are formulated as Matrix-Vector multiplication with hence large potential for optimization.
- Shchepetkin and O'Brien-like biharmonic diffusion operator that scales automatically with the grid size.
- Arakawa and Lamb advection scheme.
- Runge-Kutta 4 scheme for time integration. This scheme was found to allow for much larger time steps than comparable Adams-Bashforth schemes.
You can find the code on github including a documentation. Or see my thesis for more information (currently only available on demand).