  We develop a convex integration scheme for constructing nonunique weak
solutions to the hydrostatic Euler equations (also known as the inviscid
primitive equations of oceanic and atmospheric dynamics) in both two and three
dimensions. We also develop such a scheme for the construction of nonunique
weak solutions to the three-dimensional viscous primitive equations, as well as
the two-dimensional Prandtl equations.
  While in [D.W. Boutros, S. Markfelder and E.S. Titi, arXiv:2208.08334 (2022)]
the classical notion of weak solution to the hydrostatic Euler equations was
generalised, we introduce here a further generalisation. For such generalised
weak solutions we show the existence and nonuniqueness for a large class of
initial data. Moreover, we construct infinitely many examples of generalised
weak solutions which do not conserve energy. The barotropic and baroclinic
modes of solutions to the hydrostatic Euler equations (which are the average
and the fluctuation of the horizontal velocity in the $z$-coordinate,
respectively) that are constructed have different regularities.

Analysis of PDEs