A comparison of primitive-equation and semigeostrophic simulations of baroclinic waves