Friday, November 26, 2010

Computing the weather

On 24 November 2010 19:24, Roy Simpson wrote:

I have just noticed a Met Office link on your blog (scrolling down, on the right), so I think it must have been added recently? Maybe there is now an increased interest in weather details down there in Wells? Looking at the site I would estimate that the atmospheric pressure at Wells is about 1009 right now, which is a slight low.

Maybe this link also presages some blog items on weather science: here is a quote from that site on their current Global Unified Model to get this started:

"The latest version of the atmospheric model uses non-hydrostatic dynamics with semi-Lagrangian advection and semi-implicit time stepping. It is a grid-point model with the ability to run with a rotated pole and variable horizontal grid. A number of sub-grid scale processes are represented, including convection, boundary layer turbulence, radiation, cloud, microphysics and orographic drag. It can be run as a global model, or a limited area."

I will have to explain later what this means ... unless you get there first on a Blog item ...


Sadly my knowledge of computational fluid dynamics (CFD) is just about zero so I'll have to wait for further enlightenment ... Nigel.


Well I have spent some time on CFD and Numerical Weather Prediction (NWP) - and an interesting journey it is...

Firstly NWP isn’t really CFD at all. Perhaps it could be, but NWP is a slightly different discipline at the moment, as it involves modelling global weather phenomena explicitly: this gives rise to thermodynamic equations as well as fluid equations. Furthermore the Navier-Stokes equation (around which CFD is aimed) gives rise to phenomena which are local (and which would interfere with final significant global solutions). So the Navier-Stokes needs to be simplified out. In fact many phenomena need to be simplified out. A good example I found was the question of wave height prediction (in windy conditions). The wave height is really determined by the tides on a multi-hour basis, but the instantaneous values of the waves on the shore provide no clue to any theory of predicting the wave height over the day. So these "high frequency" components need to be removed from observation and theory.

You have read the book about Fry Richardson (Turbulence), who made a prediction that pressure would rise by 100 mb in 6 hrs, which was wrong because similar "high frequency" components (of pressure changes) in his calculation were irrelevant.

Anyway, down to explaining that paragraph from the Met web site (which is a very good site). So let’s introduce the fundamental issue - the grid.

The model will include a discretized grid of 3D space points plus of course a time step. Call the space distance ΔX and the time step ΔT, then we notice the following.

ΔX/ΔT has dimensions of a velocity. It turns out that this "velocity" is key to much of the validity of using the grid successfully. In particular it is necessary that any physical effect (such as the speed of sound 300 m/s) < ΔX/ΔT. This principle is known as the CFL theorem.

However CFL has the unfortunate consequence that if we have such a grid working successfully and we wish to double the resolution so that ΔX' = 1/2 ΔX, to preserve the validity of that equation (in 3 dimensions) we would need to decrease the time step by 8. This results in 8 times more computation - and so a solution has to be found to bypass the CFL theorem. More below....

Now we shall parse the Met Office NWP statement:

The latest version of the atmospheric model uses non-hydrostatic dynamics

Given a model atmosphere a "parcel of air" will exert pressure up and down. In hydrostatic dynamics the pressures between neighbouring parcels are equal:

Pressure(N) up = Pressure(N+1) down + gravity(N+1).

So there is no net vertical flow and the system is in equilibrium. This is the model which works for large scale objects like the global atmosphere. In fact the pressure decrease that this implies is a negative exponential of height as discovered by Laplace / Pascal.

This approximation breaks down as we approach smaller grid scales (ΔX). In particular at the 10 km level (mesoscale) convection-like effects start to appear - resulting in rising/falling air, and so to incorporate these the model needs to be non-hydrostatic.

with semi-Lagrangian advection

Advection is the transport of properties (like heat) along with a fluid flow (wind flow). The advection equation is a square root of the wave equation. There is a problem with solving it numerically however: that CFL condition mentioned above. So the solution has been to introduce the distinction between an explicit solution (using the grid and time-step) and an implicit solution. In an implicit solution the value of a quantity T= N+1 is a function of the solution at N and also N+1. Hence the equation is implicit and might be solvable directly as is possible with advection equations. This sort of bypasses the CFL problem which really only applies to the time step grid approach (where T’= N+1 is calculated from T = N), but at the price of a false rendering of fast moving phenomena. So the trick is to do both explicit and implicit in the same calculation hence:

and semi-implicit time stepping.”

Semi-implicit means do the sensitive bits explicitly and directly and do the less physically important bits implicitly. This somewhat bypasses the CFL theorem and has allowed a speed up so that in most NWP systems a time-step of 2 minutes has been extended to 15 minutes.

It is a grid-point model with the ability to run with a rotated pole

The grid formulation is itself a large topic. The problem again is that CFL theorem and that fact that a standard latitude-longitude grid would all converge towards the North and South Poles. This results in a need to vary the ΔX parameter near the North or South Poles which then runs into the CFL theorem again. So the solution is simple: move the poles out of the way so that the earth region you are modelling has no poles and the grids are of uniform size here.

and variable horizontal grid.”

This means that you can "zoom in" to a sub-region. So you have ΔX at 1000 km for the wider region and 10 km for the area of interest. Of course this is also needed to solve the "boundary condition" problem when modelling a region. If you just had a model for Wells area then how does the weather get into Wells? You cannot use the same micromodel for the rest of the world here (and it would be time consuming) so the ROW is modelled by these larger 1000 km cells.

A number of sub-grid scale processes are represented, including convection, boundary layer turbulence, radiation, cloud, microphysics .”

Remember the grid size ΔX? Well the best UK model is called UK4. This means that ΔX is 4 km in that model. Good but not great. Some weather phenomena (such as cloud formations) are actually at the 1 km scale. And we want to model clouds don’t we? Until we have a 1 km model (under research at the Met Office if you check the page) we still have to account for 1 km physics. That is we cannot allow "under the radar" phenomena to affect our weather model (otherwise it would be like a telecoms company missing IP technology because it was under the radar). The under-the-radar phenomena (listed there) are called "sub-grid scale processes". They are accounted for by so called fixed parameters which adjust values in each cell to make it more "realistic" than otherwise.

and orographic drag.”

Orographic means surface bumps like mountains and hills. So orographic drag is obviously the air friction effect of any mountains/hills in that particular cell.

It can be run as a global model, or a limited area."

An interesting bunch of slides on NWP is

Every major country in the world believes that their model is the best. Still the Met Office does put out a good research programme.

It is ironic that the research frontier for these models is the 1 km level at which clouds form: because Cloud technology is just where IT systems theory is at too ... and don’t ask about Grids :-)

Another question that has occurred to me is how much of this has been applied to planets like Jupiter and Venus? Global waves can be very non-intuitive with the phase velocity going in a different direction to the group velocity and so on. Apparently Europa is like that ... and maybe the Earth's core too (called inertial waves).