Barotropic vorticity model
The barotropic vorticity model describes the evolution of a 2D non-divergent flow with velocity components
The dynamical core presented here to solve the barotropic vorticity equations largely follows the idealized models with spectral dynamics developed at the Geophysical Fluid Dynamics Laboratory[^1]: A barotropic vorticity model[^2].
Many concepts of the Shallow water model and the Primitive equation model are similar, such that for example horizontal diffusion and the Time integration are only explained here.
Barotropic vorticity equation
The barotropic vorticity equation is the prognostic equation that describes the time evolution of relative vorticity
We denote time
Starting with some relative vorticity
The zonal velocity
which is described in Derivatives in spherical coordinates. Using
with BarotropicModel, as outlined in the following section.
Algorithm
We briefly outline the algorithm that SpeedyWeather.jl uses in order to integrate the barotropic vorticity equation. As an initial step
- Start with initial conditions of
in spectral space and transform this model state to grid-point space:
Invert the Laplacian of vorticity
to obtain the stream function in spectral space obtain zonal velocity
through a Meridional derivative obtain meridional velocity
through a Zonal derivative Transform zonal and meridional velocity
, to grid-point space Unscale the
factor to obtain Transform
to in grid-point space
Now loop over
Compute the forcing (or drag) terms
Multiply
with in grid-point spaceAdd
andTransform these vector components to spectral space
, Compute the curl of
in spectral space, add to to accumulate the tendency of Compute the horizontal diffusion based on that tendency
Compute a leapfrog time step as described in Time integration with a Robert-Asselin and Williams filter
Transform the new spectral state of
to grid-point as described in 0. Possibly do some output
Repeat from 1.
Horizontal diffusion
In SpeedyWeather.jl we use hyperdiffusion through an
In SpeedyWeather.jl the diffusion is applied implicitly. For that, consider a leapfrog scheme with time step
with
As the application of
and expand the numerator to
Hence the diffusion can be applied implicitly by updating the tendency
which only depends on
Hence 2 multiplications and 1 subtraction with precomputed constants. However, we will normalize the (hyper-)Laplacians as described in the following. This also will take care of the alternating sign such that the diffusion operation is dissipative regardless the power
Normalization of diffusion
In physics, the Laplace operator
and the hyper-Laplacian of power
and the implicit part is accordingly
Radius scaling
Similar to a non-dimensionalization of the equations, SpeedyWeather.jl scales the barotropic vorticity equation with
This is also convenient as vorticity is often
where the dimensionless gradients simply omit the scaling with
with
, the scaled time , the velocity vector (no scaling applied) , the scaled Coriolis parameter , the scaled forcing vector , the scaled diffusion coefficient, which itself is normalized to a damping time scale, see Normalization of diffusion.
So scaling with the radius squared means we can use dimensionless operators, however, this comes at the cost of needing to deal with both a time step in seconds as well as a scaled time step in seconds per meter, which can be confusing. Furthermore, some constants like Coriolis or the diffusion coefficient need to be scaled too during initialization, which may be confusing too because values are not what users expect them to be. SpeedyWeather.jl follows the logic that the scaling to the prognostic variables is only applied just before the time integration and variables are unscaled for output and after the time integration finished. That way, the scaling is hidden as much as possible from the user. In hopefully many other cases it is clearly denoted that a variable or constant is scaled.
References
[^1]: Geophysical Fluid Dynamics Laboratory, Idealized models with spectral dynamics
[^2]: Geophysical Fluid Dynamics Laboratory, The barotropic vorticity equation.