Solution (source code)

= Solution

Let $D=H-h$ be the constant interior depth. Assume a homogeneous hydrostatic interior with depth-independent horizontal velocity, negligible friction, steady small-<Rossby number> flow, and no normal flow through the flat bottom. The vertical velocity varies from $w(-H)=0$ to $w(-h)=w_E$, so <incompressible flow> gives
$$
u_x+v_y=-\frac{w_E}{D}.
$$
The leading horizontal momentum balance is <geostrophic balance>:
$$
-fv=-\frac1\rho p_x,
\qquad
fu=-\frac1\rho p_y.
$$
Taking its vertical curl on a <beta plane> gives
$$
f(u_x+v_y)+\beta v=0.
$$
Combining the last two equations yields <Sverdrup balance>
$$
\boxed{
\beta Dv=fw_E},
\qquad
\boxed{
v=\frac{f}{\beta D}w_E}.
$$
The zonal velocity is then fixed, up to its value on one side boundary, by
$$
\boxed{
u_x=-\frac{w_E}{D}
-\frac{\partial}{\partial y}
\left(\frac{fw_E}{\beta D}\right)}.
$$
Equivalently, substituting part a gives the depth-integrated form
$$
\boxed{
\beta Dv
=\frac f\rho
\widehat{\mathbf z}\mathbin\cdot
\nabla_h\times\left(\frac{\boldsymbol\tau}{f}\right)}.
$$
A lateral boundary condition, normally supplied by matching to a boundary current, determines the remaining zonally uniform part of $u$.