It would be useful to have the background flow functionality that we recently implemented in the 1-layer model included in the SQG model. I'll have a look at doing this when I get a chance.
Also, regarding diagnostics, I think there's three things we need; surface kinetic energy, buoyancy variance and domain integrated energy. The first two are already added but if the finite depth option gets added, some of the comments might need to be updated. The third isn't (I think) included currently but probably should be.
Let's define the Dirichlet-to-Neumann operator relating the streamfunction and buoyancy as:
$$ \hat{b} = D(|k|)\hat{\psi} $$
where
$$
D(|k|) = \begin{cases}
|k| & H = \infty, \\
|k|\tanh(|k|H) & \text{otherwise.}
\end{cases}
$$
We can now define our three diagnostics as:
$$ SKE = \frac{1}{2} \int u^2+v^2 dxdy = \frac{1}{2} \int |\nabla_2 \psi|^2 dxdy = \frac{1}{2} \int |k|^2 |\hat{\psi}|^2 dkdl, $$
$$ B_{var} = \int b^2 dxdy = \int |\hat{b}|^2 dkdl = \int |D(|k|)|^2 |\hat{\psi}|^2 dkdl, $$
$$ DE = \frac{1}{2} \int u^2 + v^2 + b^2 dxdydz = \frac{1}{2} \int |\nabla_3 \psi|^2 dxdydz = \frac{1}{2} \int [\nabla\cdot(\psi\nabla\psi) - \psi\nabla^2\psi] dxdydz = \frac{1}{2} \int \psi\psi_z dxdy = \frac{1}{2} \int \psi b dxdy = \frac{1}{2} \int D(|k|) |\hat{\psi}|^2 dkdl,$$
up to mathematical errors. We can now conclude that the buoyancy variance and SKE are the same in the infinite depth case (up to a factor of 2) with both conserved (in the inviscid case). However, in the finite depth case they differ, with the SKE no longer conserved. Therefore I think the DE makes a better metric as it's always conserved so we should add this.
TLDR: I think we should add domain integrated (or averaged) energy to the SurfaceQG module. Happy to do this. We should also copy across the background flow functionality from SingleLayerQG.
It would be useful to have the background flow functionality that we recently implemented in the 1-layer model included in the SQG model. I'll have a look at doing this when I get a chance.
Also, regarding diagnostics, I think there's three things we need; surface kinetic energy, buoyancy variance and domain integrated energy. The first two are already added but if the finite depth option gets added, some of the comments might need to be updated. The third isn't (I think) included currently but probably should be.
Let's define the Dirichlet-to-Neumann operator relating the streamfunction and buoyancy as:
where
We can now define our three diagnostics as:
up to mathematical errors. We can now conclude that the buoyancy variance and SKE are the same in the infinite depth case (up to a factor of 2) with both conserved (in the inviscid case). However, in the finite depth case they differ, with the SKE no longer conserved. Therefore I think the DE makes a better metric as it's always conserved so we should add this.
TLDR: I think we should add domain integrated (or averaged) energy to the
SurfaceQGmodule. Happy to do this. We should also copy across the background flow functionality fromSingleLayerQG.