Documentation of the simple dynamical core part 1: Introduction
As I have written about repeatedly, I have implemented a “very simple” numerical atmospheric model in Python. More specifaclly I have implemented a dry “dynamical core”, ie. the part of a comprehensive atmospheric model that solves the system of fluid equations of motion for the atmosphere (excluding the transport of water vapor). In comprehensive atmospheric models, like weather forecasting or climate models, the dynamical core is the most numerically challening part of the model. Because of their high level of optimization the mathematics, numerics and code of these computer programs are quite inaccessible.
To get a feeling for what it takes to make even the simplest possible such models work, I implemented my own. The model code works quite well, but to aid myself in actually writing documentation for it I will make it into a series of blog posts before I start any new major work on the code. I have several large refactoring and development ideas in consideration, but I need actual documentation before undertaking any more serious development.
A brief summary: The model implemented in the Github repository sdycore_lab is a hydrostatic primitive equations model using pressure as the vertical coordinate. The numerical solution strategy consits of a basic 4th order finite difference method on an Arakawa A-grid for the horizontal derivatives, a 2nd order finite difference method on a staggered Lorentz grid in the vertical, and the leapfrog method for time stepping. The phyical forcing is the standard Held-Suarez benchmark test. Linear numerical stability is achieved by Fourier filetering the poleward regions to remove short wave components. Nonlinear stability is achieved through 4th order Shapiro filters in space. The computational mode of the leapfrog method is suppressed using the Robert-Asselin filter. Neither mass, nor energy is conserved in the numerical model, so both energy and mass is kept constant using ad-hoc fixers.
If the above seems dense, my goal is to describe everything in excruciating detail. Keep tuned for a potentially very boring series of posts.
Next up: Selecting equations of motion