horizontal velocity at the surface by using the fact that the fluid layer is shallow. Considering the characteristic magnitudes of all quantities in Eq.  ($L$, $p_0$, $h_0$, $g$, etc.), and using the fact that in a shallow flow $h_0 k \ll 1$ with $k=2\pi/L$, one obtains hydrostatic balance in the vertical direction (for further details, see [@pedlosky_geophysical_1987]), which results in the pressure profile $$p = \rho g (h-z) + p_0 .$$

As $h$ is not a function of $z$, neither will be the horizontal pressure gradient and the horizontal components of the velocity (as long as they do not depend initially on $z$). In this way, the horizontal components of Eq.  can be written as $$\label{eqs_horz}
    \frac{\partial \mathbf{u}}{\partial t} = -(\mathbf{u} \cdot {\boldsymbol{\nabla}}) \mathbf{u}
    -g {\boldsymbol{\nabla}}h .$$ where $\mathbf{u}(x,y,t) = v_x \hat{x} + v_y \hat{y}$ is the horizontal velocity, and ${\boldsymbol{\nabla}}$ is now the horizontal gradient.

Using the fact that $v_x$ and $v_y$ are independent of $z$ we can integrate the incompressibility condition, obtaining $$v_z (x,y,z,t) = -z \left( \frac{\partial v_x}{\partial x} + \frac{\partial
            v_y}{\partial y} \right) + \tilde{v}_z (x,y,t) .
\label{eq:vz}$$

Finally, by taking the appropriate boundary conditions and setting $z=h(x,y,t)$, Eq.  provides an equation for the evolution of 