Ekman damping from the lower boundary layer. Furthermore, $h$ is the height between the top and bottom rigid horizontal boundaries (the two vorticity layers and the temperature midlayer divide the space between the horizontal boundaries into four equal intervals, with the temperature midlayer situated between the two vorticity layers), $f$ is the Coriolis term, $N$ is the frequency, and $Q$ the thermal forcing term. The temperature $T$ is related with the streamfunctions $\gy_1$ and $\gy_2$ via the geostrophic condition $T = (2/h)(\gy_1-\gy_2)$. Finally, $J(a, b)$ is defined as the Jacobian between the fields $a$ and $b$ and it reads: $$J (a,b) = \pderiv{a}{x} \pderiv{b}{y} - \pderiv{b}{x} \pderiv{a}{y}.$$ Solving for the vertical velocity $\gw$ in the temperature equation, after substituting the geostrophic condition, leads to the definition of the potential vorticities $q_1$ and $q_2$ given by $$\begin{aligned}
q_1 &=  \del^2 \gy_1 + f + \frac{k_R^2}{2}(\gy_2-\gy_1), \label{eq:DefPotVortOne} \\
q_2 &=  \del^2 \gy_2 + f - \frac{k_R^2}{2}(\gy_2-\gy_1), \label{eq:DefPotVortTwo} \end{aligned}$$ and their corresponding governing equations which read: $$\begin{aligned}
\pderiv{q_1}{t} &+ J(\gy_1, q_1) = f_1 + d_1, \label{eq:PotVortOne}  \\
\pderiv{q_2}{t} &+ J(\gy_2, q_2) = f_2 + d_2+ e_2. \label{eq:PotVortTwo}\end{aligned}$$ Here, $k_R$ is the Rossby deformation wavenumber defined as $k_R \equiv 2\sqrt{2} f/(hN)$, $f_1 = -(1/4)k_R^2 