  We present a formal derivation of the inviscid 3D quasi-geostrophic system
(QG) from primitive equations on a bounded, cylindrical domain. A key point in
the derivation is the treatment of the lateral boundary and the resulting
boundary conditions it imposes on solutions. To our knowledge, these boundary
conditions are new and differentiate our model from closely related models
which have been the object of recent study. These boundary conditions are
natural for a variational problem in a particular Hilbert space. We construct
solutions and prove an elliptic regularity theorem corresponding to the
variational problem, allowing us to show the existence of global weak solutions
to (QG).
