Solution (source code)

= Solution

Let $\theta$ be the angle made by the <group velocity> ray with the horizontal. The <internal gravity wave> dispersion relation gives
$$
\sin\theta=\frac{|\omega|}{N},
\qquad
\tan\theta=\frac{|k|}{|m|}
=\frac{|\omega|}{\sqrt{N^2-\omega^2}}.
$$
Each sawtooth face changes height by $2h_0$ over horizontal distance $\lambda_T/2$, so its slope magnitude is
$$
s_T=\frac{4h_0}{\lambda_T}.
$$
The <internal-wave slope criticality> criterion is $s_T<\tan\theta$. Hence reflection is subcritical for
$$
\boxed{
\frac{Ns_T}{\sqrt{1+s_T^2}}<|\omega|<N
}.
$$
In the corresponding <internal-wave ray tracing> sketch, every incident ray meets one planar face and leaves it into the fluid at the same angle $\theta$ to the horizontal. The reflected ray is steeper than either face, so it clears the sawtooth rather than running into an adjacent corner.