Solution (source code)

= Solution

At leading order as $\operatorname{Ro}\to0$, horizontal <geostrophic balance> and vertical hydrostatic balance give
$$
v'=p'_x,
\qquad
u'=-p'_y,
\qquad
\theta'=\frac1B p'_z.
$$
The temperature equation gives
$$
Bw'=p'_x-Dp'_z.
$$
Meanwhile $\zeta'=p'_{xx}+p'_{yy}$. The leading vertical-vorticity equation is $D\zeta'=w'_z$. Since derivatives in $z$ do not commute with $D$,
$$
(Dp'_z)_z=Dp'_{zz}+p'_{xz}.
$$
The $p'_{xz}$ terms therefore cancel, leaving the conserved <three-dimensional quasi-geostrophic potential vorticity>
$$
\boxed{
D\left[p'_{zz}+B(p'_{xx}+p'_{yy})\right]=0}.
$$
No normal flow at $y=0,1$ means $v'=p'_x=0$. At $z=0,1$, $w'=0$, so
$$
\boxed{
p'_x=0\quad(y=0,1),
\qquad
Dp'_z=p'_x\quad(z=0,1)}.
$$