Christopher Eldred
email: christopher.eldred@inria.fr

Variational and Hamiltonian Formulations of Geophysical Fluids using Split Exterior Calculus

Keywords: geophysical fluids, variational, Hamiltonian, exterior calculus, differential forms, tonti diagram

Variational and Hamiltonian formulations for geophysical fluids have proven to be a very useful tool in understanding the physics of flows and developing new numerical discretizations, and represent an important aspect of the geometric structure of the equations for geophysical fluid flow. However, the majority of such formulations have been developed in the language of vector calculus: scalars and vectors. Another key aspect of the geometric structure is a representation using split exterior calculus: straight and twisted differential forms. This arguably began with the work of Enzo Tonti, who developed a classification of physical quantities into source and configuration variables; which are unambiguously associated with inneroriented (configuration) and outer-oriented (source) geometric entities, which are themselves associated with straight (inner) and twisted (outer) differential forms. Such a classification has proven fruitful in various areas of classical mechanics, such as electrodynamics, solid mechanics and and some aspects of fluid dynamics. However, an extension of the idea to compressible fluids was lacking until the development of the split covariant equations by Werner Bauer. The current work aims to unify these two aspects of the geometric structure for fluids, by developing variational and Hamiltonian formulations for geophysical fluids using split exterior calculus. A key aspect is that the Hamiltonian structure gives a natural representation of the topological-metric splitting in the split covariant equations through the Poisson brackets (purely topological equations) and the functional derivatives of the Hamiltonian (metric-dependent equations). Additionally, the Lagrangian and Hamiltonian are seen to consist of terms that are pairings between straight and twisted forms. These new formulations are illustrated with some specific examples of commonly studied geophysical fluids: the shallow water equations, thermal shallow water equations and the compressible Euler equations.

Introduction

Fundamental aspects of the geometric structure of the equations for geophysical fluids can be understood by studying the variational [START_REF] Cotter | A variational formulation of vertical slice models[END_REF]; [START_REF] Holm | The euler-poincaré variational framework for modeling fluid dynamics[END_REF]; [START_REF] Holm | The euler-poincaré equations and semidirect products with applications to continuum theories[END_REF]; [START_REF] Cotter | Variational formulations of soundproof models[END_REF]; [START_REF] Tort | Usual approximations to the equations of atmospheric motion: A variational perspective[END_REF] and Hamiltonian [START_REF] Dubos | Equations of atmospheric motion in non-eulerian vertical coordinates: Vector-invariant form and quasi-hamiltonian formulation[END_REF]; [START_REF] Gassmann | Towards a consistent numerical compressible non-hydrostatic model using generalized hamiltonian tools[END_REF]; [START_REF] Névir | Energy-vorticity theory of ideal fluid mechanics[END_REF]; [START_REF] Salmon | Lectures on geophysical fluid dynamics[END_REF]; [START_REF] Shepherd | Symmetries, conservation laws, and hamiltonian structure in geophysical fluid dynamics[END_REF] formulations. These approaches facilitate a unified representation of a diverse range of topics, such as: stability theorems and pseudo-energy/pseudomomentum/finite-amplitude invariants for wave-mean flow interactions and associated linearizations [START_REF] Shepherd | A unified theory of available potential energy[END_REF], structure-preserving numerical discretizations [START_REF] Bauer | Energy-enstrophy conserving compatible finite element schemes for the rotating shallow water equations with slip boundary conditions[END_REF]; [START_REF] Dubos | Dynamico-1.0, an icosahedral hydrostatic dynamical core designed for consistency and versatility[END_REF]; [START_REF] Eldred | A Quasi-Hamiltonian Discretization of the Thermal Shallow Water Equations[END_REF]; [START_REF] Eldred | Total energy and potential enstrophy conserving schemes for the shallow water equations using hamiltonian methods -part 1: Derivation and properties[END_REF]; [START_REF] Gassmann | A global hexagonal c-grid non-hydrostatic dynamical core (iconiap) designed for energetic consistency[END_REF]; [START_REF] Salmon | Poisson-bracket approach to the construction of energy-and potentialenstrophy-conserving algorithms for the shallow-water equations[END_REF]; [START_REF] Tort | Energy-conserving finite-difference schemes for quasi-hydrostatic equations[END_REF] and consistent approximate models [START_REF] Tort | Usual approximations to the equations of atmospheric motion: A variational perspective[END_REF]. However, existing literature on variational approaches in geophysical fluids has been formulated mostly in terms of vector calculus (scalars and vectors), with some limited work using exterior calculus and standard differential forms [START_REF] Cotter | A finite element exterior calculus framework for the rotating shallow-water equations[END_REF].

Another fundamental aspect of the geometric structure is the representation in terms of differential forms instead of scalars and vectors. The use of exterior calculus in fluids [START_REF] Abraham | Manifolds, tensor analysis, and applications[END_REF]; [START_REF] Bauer | A new hierarchically-structured n-dimensional covariant form of rotating equations of geophysical fluid dynamics[END_REF]; [START_REF] Cotter | A finite element exterior calculus framework for the rotating shallow-water equations[END_REF]; [START_REF] Wilson | Differential forms, fluids, and finite models[END_REF] and other physical theories such as electromagnetics and solid mechanics [START_REF] Burke | Manifestly parity invariant electromagnetic theory and twisted tensors[END_REF]; [START_REF] Deschamps | Electromagnetics and differential forms[END_REF]; [START_REF] Flanders | Differential Forms with Applications to the Physical Sciences by Harley Flanders[END_REF]; [START_REF] Kanso | On the geometric character of stress in continuum mechanics[END_REF]; [START_REF] Kitano | Reformulation of electromagnetism with differential forms[END_REF]; [START_REF] Yavari | On geometric discretization of elasticity[END_REF] has a long history. For the most part, these approaches use standard differential forms. However, the work of Enzo [START_REF] Tonti | The mathematical structure of classical and relativistic physics[END_REF], 2014) suggests that it is fruitful to instead represent physical quantities in terms of straight and twisted differential forms that carry information about the ambient orientation or space. This permits a natural classification of variables into source (twisted) and configuration (straight) quantities, that has shown to be robust for a wide range of physical theories [START_REF] Tonti | The mathematical structure of classical and relativistic physics[END_REF]. Using these ideas, a split covariant formulation of several geophysical fluids was developed in [START_REF] Bauer | A new hierarchically-structured n-dimensional covariant form of rotating equations of geophysical fluid dynamics[END_REF], that naturally separated the equations into topological equations and metric equations. However, the underlying variational and Hamiltonian structures were not explored.

This work combines these two threads, and develops a version of the Euler-Poincaré framework with associated Euler-Lagrange equations [START_REF] Holm | The euler-poincaré variational framework for modeling fluid dynamics[END_REF]; [START_REF] Holm | The euler-poincaré equations and semidirect products with applications to continuum theories[END_REF] in terms of split exterior calculus, along the corresponding curl-form Hamiltonian formulation (termed the split Hamiltonian formulation). We treat a single component, single phase fully compressible fluid in a rigid domain (n " 2 and n " 3) with material boundaries that can be characterized by a mass density, a velocity and possibly a thermodynamic scalar. Lagrangians (and Hamiltonians) are shown to be the result of a pairing between source (twisted) and configuration (straight) variables, or in other words, between twisted and straight differential forms. The Poisson brackets arise through the use of a new notion specific to split exterior calculus: the topological pairing, which pairs k-forms with the associated n ´k forms of the opposite type (that arise from the action of the Hodge star). Unlike the metric pairing, this pairing requires only the wedge and integration, which are purely topological operators. The split Hamiltonian formulation is shown to reproduce the split covariant equations from [START_REF] Bauer | A new hierarchically-structured n-dimensional covariant form of rotating equations of geophysical fluid dynamics[END_REF], and gives a natural representation of the topological-metric splitting found there through the Poisson brackets (topological equations) and the functional derivatives of the Hamiltonian (metric equations).

This new variational formulation of geophysical fluids in terms of split exterior calculus provides a deeper understanding of the geometric structure underlying the equations of motion. It is also believed that the split Hamiltonian formulation will provide new insight into existing discretization schemes and facilitate the development of new approaches [START_REF] Bauer | A structure-preserving split finite element discretization of the split wave equations[END_REF]. Just as the standard exterior calculus formulation underlies single grid compatible discretizations [START_REF] Bochev | Principles of mimetic discretizations of differential operators[END_REF]; [START_REF] Cotter | A finite element exterior calculus framework for the rotating shallow-water equations[END_REF], it seems likely that the split exterior calculus formulation underlies primal-dual grid compatible discretizations [START_REF] Hiemstra | High order geometric methods with exact conservation properties[END_REF]; [START_REF] Kreeft | Mimetic framework on curvilinear quadrilaterals of arbitrary order[END_REF]; Thuburn andCotter (2012, 2015). An important example of such a discretization is the TRiSK scheme [START_REF] Eldred | Total energy and potential enstrophy conserving schemes for the shallow water equations using hamiltonian methods -part 1: Derivation and properties[END_REF]; [START_REF] Thuburn | A framework for mimetic discretization of the rotating shallow-water equations on arbitrary polygonal grids[END_REF]; [START_REF] Thuburn | A mimetic, semi-implicit, forwardin-time, finite volume shallow water model: comparison of hexagonalicosahedral and cubed-sphere grids[END_REF][START_REF] Thuburn | Numerical representation of geostrophic modes on arbitrarily structured c-grids[END_REF]; [START_REF] Weller | Controlling the computational modes of the arbitrarily structured c grid[END_REF][START_REF] Weller | Non-orthogonal version of the arbitrary polygonal c-grid and a new diamond grid[END_REF]; [START_REF] Weller | Computational modes and grid imprinting on five quasi-uniform spherical c grids[END_REF], which is widely used in existing atmospheric and ocean models [START_REF] Dubos | Dynamico-1.0, an icosahedral hydrostatic dynamical core designed for consistency and versatility[END_REF]; [START_REF] Ringler | A multi-resolution approach to global ocean modeling[END_REF]; [START_REF] Skamarock | A multiscale nonhydrostatic atmospheric model using centroidal voronoi tesselations and c-grid staggering[END_REF] despite its known shortcomings with respect to accuracy.

The remainder of this paper is structured as follows. Section 2 introduces exterior calculus in a concise way, while Section 3 covers split exterior calculus and the new notion of a topological pairing. A review of variational and curl-form Hamiltonian formulations using vector calculus appears in Section 4. Then, in Section 5 the Lagrangian and curlform Hamiltonian formulations for n " 3 using split exterior calculus are presented. In Section 6 the properties of these equations, such as energy conservation, Casimirs and the Kelvin Circulation Theorem are verified. The formulation is illustrated (by introducing specific Lagrangians and Hamiltonians) in Section 7 with some examples of commonly studied geophysical fluids: shallow water, thermal shallow water and compressible Euler. Finally, Section 8 draws some conclusions and discusses future direction of research. Appendix A discusses the use of some alternative forms of the thermodynamic scalar (which are simply a change of variables) and Appendix B contains the details of some simplifications that arise when n " 2 or there is no thermodynamic scalar. Appendix C contains useful relationships connecting vector calculus operators and exterior calculus operators.

Exterior Calculus, Differential Geometry and Vector Proxies

In this section we introduce the required concepts of differential geometry in a concise way without proofs. For more details, we refer the reader to standard textbooks on differential geometry or to [START_REF] Bauer | A new hierarchically-structured n-dimensional covariant form of rotating equations of geophysical fluid dynamics[END_REF] for a concise overview.

Topological operators on topological manifold

We start our introduction of differential geometry with a discussion about differentiable topological manifolds, differential forms (DF), and topological operators. For the following definitions within this subsection neither orientation nor metric is needed. We consider a domain of interest given by a smooth n-dimensional closed compact orientable manifold M. The pair pU, φ U q consisting of patches U Ă M that cover M and of invertible maps φ U : U Ñ V P R n defines local coordinate representations x on the patch U Ă M such that the local coordinates of point x P M are given by px 1 , . . . x n q " φ U pxq.

The span of vectors that are tangent to x P M form the tangent space T x M. A vector field u on M is a smooth mapping from each x to T x M; hence it is tangent to M everywhere. The space of vector fields is denoted as X pMq. The dual objects to tangent vectors are cotangent vectors; at every point x they are linear maps from T x M to R. Cotangent vectors span at x the cotangent space T x M. A differential 1-form 1 ω is a smooth mapping from x to the cotangent space T x M. Hence, 1 ω defines a smooth mapping from the vector field u to a scalar function 1 ωpuq with values 1 ωpuqpxq P R at point x. The superscript in front of ω indicates the degree of the differential form.

A differential k-form k ω, or simply k-form, is a smooth mapping that assigns to each point x an anti-symmetric k-linear mapping T x M k´times ˆ¨¨¨ˆT x M Ñ R on the tangent space T x M. We denote the space of all k-forms as Λ k pMq, or simply Λ k . The direct sum ΛpMq :" ' n k"0 Λ k pMq is a graded algebra where the algebraic structure is given by the wedge product (or exterior product)

^. The wedge product of a k-form and an l-form gives a pk `lq-form. For k α, k β P Λ k , l γ, l δ P Λ l , and a, b scalars (0-forms), this product has the following properties:

1. bilinearity:

pa k α `b k βq ^l γ " ap k α ^l γq `bp k β ^l γq, k α ^pa l γ `b l δq " ap k α ^l γq `bp k α ^l δq; 2. anticommutativity: k α ^l γ " p´1q kl l γ ^kα; 3. associativity: p k α ^l βq ^mγ " k α ^pl β ^mγq.
Noting that 0-forms are scalar functions f , their wedge products with k-forms are given by the product f ^kω " f k ω.

Remark 1 Using the wedge product, differential k-forms can be constructed out of 1forms. For instance, the wedge product of two 1-forms 1 α and 1 β gives the 2-form 1 α ^1β that is defined via 1 α ^1βpX 1 , X 2 q " 1 αpX 1 q ^1βpX 2 q ´1αpX 2 q ^1βpX 1 q for all pairs of vector fields X 1 , X 2 P X pMq. In the same vein, any k-form can be constructed following this procedure from 1-forms.

Finally, we introduce two very important topological operators acting on k-forms, the exterior derivative d and the interior product i p¨q . The exterior derivative d is a map from k to k `1-forms that satisfies the following properties:

1. for a function

0 f P Λ 0 , its total differential in local coordinates is d 0 f " ř i Bf Bx i dx i ,
2. product rule (Leibniz rule): d is R linear and for k α P Λ k and l γ P Λ l there is

dp k α ^l γq " pd k αq ^l γ `p´1q pkq k α ^pd l γq, 3. closure: dpd k ωq " d 2 k ω " 0 for any k-form k ω.
The inverse operation to d is the interior product (contraction) of a k-form k ω with the vector field X, denoted as i X k ω. It is a map from k to pk ´1q forms defined by i X k ωpX 2 , . . . , X k q " k ωpX, X 2 , . . . , X k q for all vectors X i P X pMq, i " 2, . . . , k, while the contraction of a 0-form is zero. As d, the interior product is R-linear and, for k α P Λ k and l γ P Λ l : i

X p k α ^l γq " pi X k αq ^l γ p´1q pkq k α ^pi X l βq. Moreover, we have i f pXq k α " f i X k α.
Example 2 For instance, the contraction of a 1-form 1 ω with a vector field u is the scalar function i u 1

ω " 1 ωpuqpxq P Λ 0 . The contraction of a 2-form 2 ω with u is the 1-form i u 2 ω.

We can define the Lie derivative L X of a k-form k ω with respect to the vector field X in terms of interior product and exterior derivative:

L X k ω " i X d k ω `d i X k ω.
(2.1)

This formula is frequently referred to as Cartan's formula.

Oriented manifolds, integrals, and Stokes theorem

To define the notion of integrals of k-forms an orientation must be fixed. We will denote the selected orientation with Or and the opposite one with ´Or. Given a k-form in local coordinates, k ω " ωpxqdx 1 ^. . . dx k with component function ωpxq, its integral over the

k-dimensional submanifold V k Ă M is given by ż V k k ω " ż φ U pV k q ωpxqdx 1 . . . dx k .
This definition is independent of the choice of coordinates, due to the change-of-variables formula. Stokes theorem for k-form k ω on an oriented manifold M is given by

ż M d k ω " ż BM k ω.
The value of the integral depends on the ambient orientation, as the sign of the volume form changes from Or to ´Or. Using a twisted volume form instead (see (3.1) and Section 3) will allow us to define integrals that are invariant under changes of the ambient orientation.

(Oriented) Riemannian manifold and Hodge star operator

We equip the topological manifold M, not necessarily oriented, with a metric gp, q " g ij dx i dx j with coefficients g ij " gp B Bx i , B Bx j q, i, j " 1, ...n. At point x P M, g| x is an inner product on T x M. The pair pM, gq is called Riemannian manifold.

The metric g induces a nondegenerate symmetric bilinear form g pkq " x, y on M, a mapping from two k-forms to functions, by x¨, ¨y : Λ k ˆΛk Ñ C 8 with x k ω, k ηy " x k η, k ωy for all k ω, k η P Λ k . The metric g also induces a uniquely defined volume form µ on M, which can be used to define the Hodge star operator ‹. Given the oriented n-dimensional manifold M with nondegenerate symmetric bilinear form x¨, ¨y and volume form µ induced by the metric g, then there exists a unique isomorphism, called the Hodge star operator,

‹ : Λ k Ñ Λ n´k satisfying k α ^‹ k β " x k α, k βyµ for k α, k β P Λ k , (2.2)
and with properties:

1. k α ^‹k β " k β ^‹k α " x k α, k βyµ, 2. ‹1 " µ n , ‹µ " 1, 3. ‹ ‹ k α " p´1q kpn´kq k α, 4. x k α, k βy " x‹ k α, ‹ k βy.
The latter definitions depend on orientation and may change sign when the ambient orientation changes. Such change can be avoided when using twisted DF and twisted operators, as introduced in the following.

3 Split exterior calculus for formulations independent of ambient orientation

In this section we introduce concepts of differential geometry and exterior calculus in an ambient orientation independent manner by using straight and twisted DFs. Based on these ideas, we introduce two novel key concepts essential for this manuscript, namely the topological pairing of straight and twisted DFs as a metric independent version of an inner product of k-forms and the topological functional derivatives with respect to this topological pairing.

Definition of twisted objects. Given an orientation Or on M with opposite orientation ´Or, and given a straight differential form k ω P Λ k , we define twisted differential forms by k ω :" tt k ω, Oru, t´kω, ´Oruu P Λk .

(3.1)

We denote the space of twisted k-forms as Λk . Using a combination of straight and twisted differential forms to describe a system of equations allows for formulations that do not depend on the choice of the ambient orientation of M Bauer (2016) or dimension. We also define an orientation independent Hodge star operator which we refer to as twisted Hodge star ‹. It is defined by ‹ :" tt‹, Oru, t´‹, ´Oruu. When we use twisted quantities, the formulation is independent of the chosen orientation. Possible sign changes are taken care of by the twisted forms and the twisted operators.

The pairing of differential forms. An important tool for our formulation is the pairing of differential forms. The inner product x, y induced by the metric g is a metric dependent pairing of differential forms of the same type, and can be defined in terms of the wedge product ^and the twisted Hodge star ‹, as done in Definition 3. In addition, in Definition 4 we define the topological pairing of differential forms of opposite (dual) type (e.g. of a straight k-form and a twisted n ´k-form), denoted with xx, yy, as a metric independent version. Definition 3 On an orientable Riemannian manifold pM, gq, the metric g with associated inner product x, y induces metric pairings between either two straight or two twisted k-forms:

x k α, k βy :" ż M k α ^‹ k β, x k α, k βy :" ż M k α ^‹p k βq. (3.2)
Note that the inner product is symmetric. 1.) The topological pairing is independent of the metric g and of the ambient orientation;

2.) The topological pairing xx k α, pn´kq βyy is an inner (metric) product if the metric closure equation pn´kq β " ‹ k β holds. An analogous statement holds for xx k α, pn´kq βyy.

3.) In case the metric closure equation holds, the topological pairing is symmetric with respect to a duality exchange:

xx k α, pn´kq βyy " xx k β, pn´kq αyy (3.4)
where ‹ k α " pn´kq α and ‹ pn´kq β " k β .

Proof: Property 1 follows immediately from the definition of the topological pairing in terms of the wedge product ^and an integrals over a twisted n-form, both of which are purely topological operations independent of the ambient orientation. Property 2 arises immediately by substituting in (3.3) the metric closure equation ‹ k β for the pn ´kqform pn´kq β, and comparing to the metric product from Definition 3. Finally, Property 3 follows by duality pairs ‹ k α " pn´kq α and ‹ pn´kq β " k β into the definition of the topological pairing. Equation (3.3) is independent of both orientation and metric.

Functional derivatives. On the basis of the pairings of DF, we define two versions of functional derivatives: (i) with respect to the metric pairing x, y and (ii) with respect to the topological pairing xx, yy.

We start by recalling the standard exterior calculus definition for functional derivatives. Given a functional Fr k us : Λ k Ñ R depending on (straight) k-forms, variations of the functional δF results from variations of k u, defined by δF :" Fr k u `δ k us ´Fr k us.

Introducing an arbitrary straight test function k ω we write δ k u " k ω and evaluate δF in terms of a Taylor expansion in :

Fr k u ` k ωs " Fr k us `d d Fr k u ` k ωs ˇˇ "0 `Op 2 q. (3.5)
Therefore we can relate the derivatives of F with respect to to functional derivatives:

d d Fr k u ` k ωs ˇˇ "0 " lim Ñ0 1 `Fr k u ` k ωs ´Fr k us ˘": ż M n µ δF δ k u k ω ": δF. (3.6)
This definition relates the derivative of F with respect to with a linear functional with kernel δF δ k u that acts on the test function k ωpxq. To guarantee that this definition exists, we assume to take only differentiable functionals.

In the following two definitions, we extend the definition of functional derivatives (3.6) in standard exterior calculus using instead split exterior calculus.

Definition 6

The standard (or metric) functional derivatives of Fr k us : Λ k Ñ R (or Fr k ũs : Λk Ñ R) with respect to the k-form k u (or k ũ) and with respect to the inner product x, y are defined by

δF :" lim Ñ0 1 `F r k u ` k ωs ´F r k us ˘": @ k ω, δF δ k u D " ż M k ω ^‹ δF δ k u @ k ω P Λ k (3.7)
for arbitrary test functions k ω (or k ω). In particular, if

k u P Λ k is a straight k-form, also δF δ k u P Λ k is a straight k-form, while for a twisted k-form k ũ P Λk , δF δ k ũ P Λk is a twisted k-form.
Definition 7 The topological functional derivatives of Fr k us : Λ k Ñ R (resp. Fr k ũs : Λk Ñ R) with respect to the k-form k u (resp. k ũ) and with respect to the topological pairing xx, yy are defined by

δF :" lim Ñ0 1 `F r k u ` k ωs ´F r k us ˘": xx k ω, δF δ k u yy " ż M k ω ^δF δ k u @ k ω P Λ k resp. δF :" lim Ñ0 1 `F r k ũ ` k ωs ´F r k ũs ˘": xx k ω, δF δ k ũyy " ż M k ω ^δF δ k ũ @ k ω P Λk (3.8)
for arbitrary test functions k ω (resp. k ω) under the metric closure condition δF

δ k u :" ‹ δF δ k u ´resp. δF δ k ũ :" ‹ δF δ k ũ¯.
(3.9)

In particular, if k u P Λ k is a straight k-form, δF δ k u P Λpn´kq is a twisted pn´kq-form,while for a twisted k-form k ũ P Λk , δF δ k ũ P Λ pn´kq is a straight pn ´kq-form. Remark 8 Note that the appearance of two tildes in δF δ k ũ indicates that the twisting cancels to produce a straight form. In general an odd number of tildes gives a twisted DF, an even number a straight one.

The topological functional derivatives defined in (3.8) are metric-independent, since they involve only the wedge product. In contrast, the metric functional derivatives involve ‹ and therefore depend on the metric. Furthermore, the metric and topological functional derivatives coincide when enforcing the metric closure condition (3.9).

Further useful relations.

Using x¨, ¨y we find a duality between vector fields and 1-forms ω 1 , given by 5 : X Ñ Λ 1 , u 5 pvqpxq " xu, vypxq for all vector fields v P X pMq. The inverse operator is given by 7 : Λ 1 Ñ X pMq. We refer to both mappings 5 and 7 as Riemannian lift.

The 5 operator allows us to represent the interior product in terms of ^and ‹.

Definition 9 (Hirani's formula) The interior product i X k ω of a k-form k ω P Λ k with the vector field X P X pMq can be written as i X k α " p´1q kpn´kq ‹p‹ k α ^pXq 5 q.

(3.10)

Variational and Hamiltonian Formulations using Vector Calculus

This section presents a review of variational and Hamiltonian formulations using vector calculus for a single component, single phase fluid that can be described in terms of a (transport) velocity u, a mass density D and a thermodynamic scalar s, in preparation for the development of these formulations using split exterior calculus. More details on the traditional approach can be found in standard texts on the subject, such as [START_REF] Holm | The euler-poincaré variational framework for modeling fluid dynamics[END_REF]; [START_REF] Holm | The euler-poincaré equations and semidirect products with applications to continuum theories[END_REF]; [START_REF] Salmon | Lectures on geophysical fluid dynamics[END_REF]; [START_REF] Shepherd | Symmetries, conservation laws, and hamiltonian structure in geophysical fluid dynamics[END_REF]. We assume a fixed domain Ω Ă R n (this is relaxed to general manifolds later) with boundary BΩ, where the boundary is a material surface (u ¨n " 0 on BΩ). An extension to domains with time dependent boundaries (such as a free surface or elastic lid) is possible, and leads only to an additional surface term in the Lagrangian L or Hamiltonian H [START_REF] Dubos | Equations of atmospheric motion in non-eulerian vertical coordinates: Vector-invariant form and quasi-hamiltonian formulation[END_REF]. As is standard in geophysical fluid dynamics, we use the scalar (s) rather than density (S " Ds) form of the thermodynamic variable in the variational Lagrangian formulation. In contrast, in the Hamiltonian formulation we use the density form of the thermodynamic variable. We consider here only the case when n " 3, the case of n " 2 is discussed in Appendix B.

Variational Lagrangian Formulation

Given the Lagrangian functional Lru, D, ss in Eulerian coordinates that characterizes the fluid, standard variational techniques involving constrained variations [START_REF] Holm | The euler-poincaré equations and semidirect products with applications to continuum theories[END_REF][START_REF] Holm | The euler-poincaré equations in geophysical fluid dynamics[END_REF] yield the corresponding Euler-Lagrange momentum equation:

B Bt ˆ1 D δL δ u ˙`L u ˆ1 D δL δ u ˙´∇ ˆδL δD ˙`1 D δL δs ∇s " 0 (4.1)
where L u is the Lie derivative with respect to u. Specializing now to n " 3 and expanding the Lie derivative term using L u x " ∇ ˆx ˆu `∇pu ¨xq gives finally the curl-form Euler-Lagrangian equations: A closed set of equations is given by equations (4.7) -(4.8) and either (4.9) or (4.10).

B Bt ˆ1 D δL δ u ˙`∇ ˆˆ1 D δL δ u ˙ˆu `∇ ˆu ¨1 D δL δ u ´δL δD ˙`1 D δL δs ∇s " 0. (4.2)

Rotation

For geophysical fluids, it is often beneficial to work in terms of a coordinate system that is undergoing solid body rotation. In R 3 , a solid body rotation is described by a rotation vector Ω, which is a uniform constant vector. Therefore, ∇ ¨Ω " ∇ ˆΩ " 0.

It is important to note that Ω is a pseudo-vector that changes sign under a reversal of orientation. The velocity R associated with the rotation is defined by ∇ ˆR " 2Ω. In fact, this definition for R is fundamental and holds for more general manifolds than R 3 . Note the gauge symmetry in the definition of R, similar to the one found in electrodynamics. However, unlike electrodynamics, we are not aware of any work exploiting this. In R 3 the standard choice is R " Ω ˆr, where r is the position vector. Rotation is introduced by adding a term to the Lagrangian L, as

L 1 " L ` D u, R . Therefore δ L 1 δ u " δ L δ u `D R .
According to (4.6), the latter implies that v 1 " v `R, or in other words, when rotation is added

v 1 " 1 D δ L 1
δ u represents the absolute velocity rather than a relative velocity. More details on this can be found in [START_REF] Holm | The euler-poincaré equations and semidirect products with applications to continuum theories[END_REF][START_REF] Holm | The euler-poincaré equations in geophysical fluid dynamics[END_REF].

Kelvin Circulation Theorem

Integrating (4.1) over a closed curve γptq and using the fundamental theorem of calculus, the Kelvin circulation theorem is obtained as

d dt ¿ γptq 1 D δ L δ u ¨dx " ´¿ γptq 1 D δ L δs ∇s ¨dx
where d dt " B Bt `Lu is the total derivative.

Potential Vorticity

The potential vorticity is

q " ∇ ˆv ¨∇s D " Q ¨∇s .
where Q " ∇ˆv D . In fact, the potential vorticity can be defined more generally by replacing ∇s by ∇λpsq, where λpsq is an arbitrary function, but this is not pursued further. Combining (4.7) -(4.9) gives the evolution equation for potential vorticity density

BpDqq

Bt `∇ ¨pqD uq " 0 and for potential vorticity Bq Bt `u ¨∇q " 0 .

The last equation is a statement of the fact that potential vorticity is materially conserved ( dq dt " 0).

Hamiltonian Formulation

Here we will focus on the variant that predicts (v, D, S), some alternatives are discussed in Appendix A. Note that we have switched from the thermodynamic scalar s to the thermodynamic scalar density S. By combining (4.11) and (4.12), it is clear that the Casimirs are conserved quantities. More details can be found in [START_REF] Shepherd | Symmetries, conservation laws, and hamiltonian structure in geophysical fluid dynamics[END_REF] or any standard text on non-canonical Hamiltonian mechanics.

Hamiltonian

The Hamiltonian Hrv, D, Ss corresponding to Lru, D, Ss is obtained via a Legendre transform as Hrv, D, Ss "

ż ˆu ¨δL δ u ˙´L " ż pD u ¨vq ´L . (4.13)
Hence, in the Hamiltonian formulation the fluid's velocity is described by the vector field v, which is usually written using covariant components. The functional derivatives of H are given by

δH δ v " D u " F, δH δD " u ¨v ´δL δD `s D δL δs " B, δH δS " ´1 D δL δs " T,
which agree with the definitions in (4.6).

Poisson Brackets

The Poisson bracket is

tA, Bu " tA, Bu R `tA, Bu S `tA, Bu Q (4.14)
where

tA, Bu R " ż Ω p´δ A δD ∇ ¨δB δ v `δB δD ∇ ¨δA δ v qdΩ , (4.15) tA, Bu S " ż Ω p´δ A δS ∇ ¨ps δB δ v q `δB δS ∇ ¨ps δA δ v qqdΩ , (4.16) tA, Bu Q " ż Ω ´δA δ v ¨ˆQ ˆδB δ v ˙dΩ , (4.17

Casimirs

The Casimirs of (4.14) take the general form Crv, D, Ss "

ż DF p S D , qq
where F ps, qq is an arbitrary function of the thermodynamic scalar s and the potential vorticity q. The functional derivatives of Crv, D, Ss are

δ C δ v " ∇ ˆp BF Bq ∇sq, δ C δD " F ´q BF Bq ´s BF Bs `s D ∇ ¨p BF Bq ∇ ˆvq, δ C δS " BF Bs ´1 D ∇ ¨p BF Bq ∇ ˆvq.
Important cases are F " 1 (total mass), F " q (total potential vorticity) and F " s (total thermodynamic scalar).

Variational and Hamiltonian Formulations using Split Exterior Calculus

Instead of vector calculus, we now wish to use split exterior calculus: to work in terms of straight and twisted differential forms instead of scalars and vectors. Our intention is to translate the standard variational and curl-form Hamiltonian formulations from vector calculus into split exterior calculus. The resulting novel framework applies for arbitrary manifolds with n ď 3 and is independent of the orientation of the ambient space, and can incorporate many different fluid models through an appropriate choice of Lagrangian functional. A principle result for the Hamiltonian formulation is the appearance of Poisson brackets that involve only topological operators, with all metric operators appearing in the Hamiltonian. This is the major advantage of the split exterior calculus formulation over the vector calculus formulation.

Choice of predicted variables

The transport velocity u is described by a twisted n ´1 form n-1 ũ, representing an n ´1 dimensional flux and defined by

n-1 ũ " i u n μ " ‹p 0 I ^1uq " ‹ 1 u
(5.1) using Hiranis formula (3.10) and 0 I " ‹ n μ with n μ the twisted n-volume form, and where 1 u " u 5 is the straight 1-form associated with u. In fact, 1 u and n-1 ũ are the two differential forms associated to the vector u. The mass density D becomes the twisted n-form n D, the thermodynamic scalar s the straight 0-form 0 s and the thermodynamic scalar density S " Ds the twisted n-form n S " n D ^0s. There is a corresponding mass density straight 0-form 0 D " ‹ n D. The material boundary condition u ¨n " 0 on BΩ becomes i u n μ " ‹p‹ n μ ^1uq " ‹p 0 I ^1uq " n-1 ũ " 0 on BΩ.

Remark 10 These variables follow precisely the classification used in the work of [START_REF] Tonti | The mathematical structure of classical and relativistic physics[END_REF], 2014), which associates each physical quantity to an oriented geometric entity, which are themselves associated with oriented differential forms. One way of viewing this work, and in particular the Hamiltonian formulation using split exterior calculus, is as a generalization of Tonti diagrams to compressible fluids with arbitrary equations of state.

Variational Lagrangian Formulation

The Lagrangian, now formulated in terms of DFs, is Lr n-1 ũ, n D, 0 ss, and the resulting Euler-Lagrange momentum equation is

B Bt ˜1 0 D δ L δ n-1 ũ ¸`L u ˜1 0 D δ L δ n-1 ũ ¸´d δ L δ n D `1 0 D ^‹ δ L δ 0 s ^d 0 s " 0.
(5.2) Using Cartan's formula to expand the Lie derivative this can be written in curl-form as

B Bt ˜1 0 D δ L δ n-1 ũ ¸`i u ˜d 1 0 D δ L δ n-1 ũ ¸`d i u ˜1 0 D δ L δ n-1 ũ ¸´d δ L δ n D `1 0 D ^‹ δ L δ 0 s ^d 0 s " 0 (5.3)
where the functional derivatives of L are calculated with respect to the topological pairing of Definition 7. In particular, (5.2) and (5.3) describe the dynamics of a straight 1-form. This is supplemented with kinematic transport equations for n D and 0 s B n D Bt " ´Lu n D " ´dp 0 D ^n-1 ũq, (5.4) B 0 s Bt " ´Lu 0 s " ´‹ `n-1 ũ ^d 0 s ˘.

(5.5)

As before, (5.4) and (5.5) can be combined to yield Proof: Start by recalling (4.1)

B n S Bt " ´Lu n S " ´d ´0s
B Bt v `Lu v ´∇ ˆδ L δD ˙`1 D δ L δs ∇s " 0 (5.7)
and noting that (5.2) can be rewritten as as

B Bt 1 v `Lu 1 v ´d δ L δ n D `1 0 D ^‹ δ L δ 0 s ^d 0 s " 0.
By the direct association between 0-forms and functions we have D " 0 D and s " 0 s, and therefore δ L δD " δ L δ 0 D and δ L δs " δ L δ 0 s . We also have that v 5 " 1 v. Now take 5 of (5.7) and use the fact that p∇xq 5 " d x 0 for a scalar x (see Appendix C) to get

B Bt 1 v `pL u vq 5 ´d ˆδ L δ 0 D ˙`1 0 D δ L δ 0 s d 0 s " 0.
Using (3.9) and the chain rule (since n D " ‹ 0 D, the standard functional derivatives δ L δ 0 D and δ L δ 0 s are related to the topological functional derivatives by δ L δ n D and δ L δ 0 s by

δ L δ 0 D " ‹ δ L δ 0 D " δ L δ n D, δ L δ 0 s " ‹ δ L δ 0 s .
Therefore, it remains only to show that pL u vq 5 " L u 1 v. Start by expanding L u v into ∇ ˆv ˆu `∇pu ¨vq and then use the material in Appendix C to get pL u vq 5 " p∇ ˆv ˆuq 5 `p∇pu ¨vqq 5 " ‹p‹ d 1 v ^1uq `d ‹p 1 u ^‹ 1 vq. Using Hirani's formula (3.10) this is simply Finally, the kinematic equation Bs Bt " ´Lu s " ´u ¨∇s can be written as B 0 s Bt " ´‹p 1 u ^‹ d 0 sq " ´iu d 0 s using the formulas from Appendix C. Following the same steps as in the vector calculus case, we proceed by defining

pL u vq 5 " i u d 1 v `d i u 1 v " L u v .
0 T :" ´1 0 D ‹ δ L δ 0 s , (5.8
) (5.11) which are equivalent definitions to (4.6) but now in terms of straight and twisted differential forms. Substituting them into (5.3) gives the following momentum and transport equations

1 v :" 1 0 D δ L δ n-1 ũ , (5.9) 0 B :" i u ˜1 0 D δ L δ n-1 ũ ¸´δ L δ n D `0s 0 D ‹ δ L δ 0 s " i u 1 v ´δ L δ n D ´0s ^0T, (5.10) n-1 F :" 0 D ^n-1 ũ,
B 1 v Bt `iu d 1 v `d 0 B `0s ^d 0 T " 0, (5.12) B n D Bt `d n-1 F " 0, (5.13) B 0 s Bt `‹ ˆ1 0 D ^n-1 F ^d 0 s ˙" 0, (5.14) B n S Bt `d ´0s ^n-1 F¯" 0.
(5.15)

Given the equivalence of the EP equations in split (5.3) and in VC form (4.2), the latter equations in (5.12)-(5.15) are equivalent to vector invariant equations in (4.7)-(4.10).

PV Flux Term

The PV flux term i u d 1 v " i u 2 η with 2 η " d 1 v can be written in several equivalent ways. Start by introducing 2 Q, defined by

2 η " d 1 v " 2 Q ^0D .
Taking ‹ of this yields the definition for n-2 Q as ‹ 2 η " n-2 η " n-2 Q ^0D .

(5.16)

Writing i u 2 η out using Hirani's formula (3.10) gives i u 2 η " ‹p‹ 2 η ^1uq.

(5.17) Substituting (5.16) into (5.17) gives

i u 2 η " ‹p n-2 Q ^1Fq " ‹p‹ 2 Q ^1Fq " i F 2 Q .
where we have used 1 F " 0 D ^1u, F " D u and pFq 5 " 1 F. Further manipulations yields i u 2 η " p´1q n´1 ‹p n-2 Q ^‹ n-1 Fq (5.18)

The form will be particularly useful in developing the Hamiltonian formulation.

Rotation

Since Ω is a pseudo-vector, the associated 1-form is twisted, and

1 Ω " Ω 5 .
From this, an associated straight 2-form can be defined as ‹ 1 Ω ": 2 Ω .

In fact, as shown in [START_REF] Bauer | A new hierarchically-structured n-dimensional covariant form of rotating equations of geophysical fluid dynamics[END_REF], the rotation straight 2-form 2 Ω is the correct dimensionagnostic way to describe solid body rotation. Note that 2 Ω is a closed form: d 2 Ω " δ 2 Ω " 0. From 2 Ω, the rotational velocity straight 1-form 1 R is defined through

d 1 R " 2 2 Ω .
This is a dimension independent definition of 1 R, and it implies that the rotational velocity part of the PV flux term can be written as

i u d 1 R " i u 2 2 Ω
which is the standard representation of the Coriolis term. Rotation is introduced into the Lagrangian exactly the same way as in the vector calculus case:

L 1 " L ` 0 D ^1u, 1 R , δ L 1 δ n-1 ũ " δ L δ n-1 ũ `0D ^1R, with 1 v
1 " 1 v `1R, using (5.8).

Hamiltonian Formulation

Here we will focus on the variant that predicts ( 1 v, n D, n S), some alternatives are discussed in Appendix A.

Hamiltonian

The Hamiltonian is obtained from Lr n-1 ũ, n D, 0 ss using a Legendre transform:

Hr 1 v, n D, n Ss " x 0 D, i u 1 vy ´L . (5.19)
This is a transformation from the twisted n ´1-form n-1 ũ to the straight 1-form 1 v. As mentioned in the introduction, the Hamiltonian consist of a metric pairing of two DF of the same kind. However, this can also be viewed as a topological pairing between a straight and a twisted different form

x 0 D, i u 1 vy " xx n D, i u 1 vyy
More examples of this duality can be found in Section 7.

Proposition 12 Equation (5.19) has topological functional derivatives given by δ H

δ 1 v " 0 D ^n-1 ũ " n-1 F, δ H δ n D " i u 1 v ´δ L δ n D `0s 0 D ‹ δ L δ 0 s " 0 B, δ H δ n S " ´1 0 D ‹ δ L δ 0 s " 0 T . (5.20)
We see that the topological functional derivatives relate straight and twisted DFs, and they are in fact a type of metric closure equations related to those studied in [START_REF] Bauer | A new hierarchically-structured n-dimensional covariant form of rotating equations of geophysical fluid dynamics[END_REF].

Proof: Start by writing Hr 1 v, n D, n Ss

Hr 1 v, n D, n Ss " ż 0 D ^p´1q n´1 p‹ 1 v ^1uq ´L
where Lr n-1 ũ, n D, 0 ss " ş Lr n-1 ũ, n D, 0 ss. Using the properties of the wedge product and the twisted Hodge star this becomes

Hr 1 v, n D, n Ss " ż 0 D ^1v ^n-1 ũ ´Lr n-1 ũ, n D, 0 ss. Now taking variations yields δ H " ż `δ 0 D ^1v ^n-1 ũ `0D ^δ 1 v ^n-1 ũ `0D ^1v ^δ n-1 ũ˘´δ Lr n-1 ũ, n D, 0 ss. (5.21) Note that δLr n-1 ũ, n D, 0 ss " δ L δ n D ^δ n D `δ L δ n-1 ũ ^δ n-1 ũ `δ L δ 0 s ^δ 0 s (5.22) and δ 0 s " 1 0 D ^‹ δ n S ´1 0 D ^0s ^‹ δ n D .
(5.23)

The latter comes from the definition of n S " n D ^0s. Substituting (5.22) and (5.23) into (5.21) and grouping terms gives

δ H " ż δ n D ^˜i u 1 v ´δ L δ n D `0s 0 D ^‹ δ L δ 0 s ¸`δ 1 v ^`0 D ^n-1 ũ˘δ n S ^˜´1 0 D ^‹ δ L δ 0 s ¸`δ n-1 ũ ^˜0 D ^1v ´δ L δ n-1 ũ ¸.
The last term is zero since 0 D ^1v " δ L δ n-1 ũ , proving the statement.

5.3.2

Poisson Brackets

The Poisson brackets, written with respect to the topological pairing, are

tA, Bu R " ´xx δ A δ n D, d δ B δ 1 v yy ´xxd δ B δ n D, δ A δ 1 v yy, (5.24) tA, Bu S " ´xx δ A δ n S, dp 0 s ^δ B δ 1 v qyy ´xx 0 s ^d δ B δ n S, δ A δ 1 v yy, (5.25) tA, Bu Q " ´xx‹p n-2 Q ^‹ δ B δ 1 v q, δ A δ 1 v yy, (5.26) with n-2 Q ^n D " 2 η " d 1 v
, where 2 η is the the absolute vorticity straight 2-form. ote that we use in the Q bracket the representation (5.18) for the PV flux term, taking into account that n " 3.

Proposition 13 The Poisson brackets (5.24) -(5.26) are bilinear, anti-symmetric, satisfy the Leibniz rule and Jacobi identity and are purely topological.

Proof: By inspection, these brackets are bilinear and satisfy the Leibniz rule. Similarly, since they involve only the topological pairing and topological operators (d, ^and i u ), they are purely topological. Although it appears that the PV flux term is not topological (since it involves ‹), recall that it is simply another way to write the interior product, which is a topological operator. The Jacobi identity is satisfied since the vector calculus bracket (4.14) satisfies it, and these brackets are simply a translation into split exterior calculus. Now consider the anti-symmetry. Start with the Leibniz rule for d and

^: ż V dp 0 a ^n´1 bq " ż V d 0 a ^n´1 b `0a ^d n´1 b. Now use Stokes theorem ż BV 0 a ^n´1 b " ż d 0 a ^n´1 b `0a ^d n´1 b.
In our case we will have n´1 b " 0 on BV , since we will use n´1 b " δ B δ 1 v , and δ B δ 1 v " 0 on BV due to the boundary conditions. Therefore we can write ż d 0 a ^n´1 b `0a ^d n´1 b " 0.

(5.27)

Now consider the tA, Bu R bracket. We have

tA, Bu R `tB, Au R " ´xx δ A δ n D , d δ B δ 1 v yy´xxd δ B δ n D, δ A δ 1 v yy´xx δ B δ n D , d δ A δ 1 v yy´xxd δ A δ n D, δ B δ 1 v yy.
Using (5.27) with 0 a " δ A δ n D and n´1 b " δ B δ 1 v , the first and last terms combine to zero. Similarly, using (5.27) again with 0 a " δ B δ n D and n´1 b " δ A δ 1 v , the second and third terms combine to zero. Therefore tA, Bu R `tB, Au R " 0.

The same argument can be used with the tA, Bu S bracket, except that now 0 a " δ A δ n S and n´1 b "

0 s ^δ A δ 1 v or 0 a " δ B δ n S and n´1 b " 0 s B δ 1 v . Thus tA, Bu S `tB, Au S " 0.
Finally, consider the tA, Bu Q bracket. We have

tB, Au Q " ´xx‹p n-2 Q ^‹ δ A δ 1 v q, δ B δ 1 v yy " ´ż ‹p n-2 Q ^‹ δ A δ 1 v q ^δ B δ 1 v .
Using the properties of ‹ and ^this can be written as

tB, Au Q " ´ż ‹ δ B δ 1 v ^n-2 Q ^‹ δ A δ 1 v " p´1q n´1 ż n-2 Q ^‹ δ B δ 1 v ^‹ δ A δ 1 v " p´1q n´1 ż δ A δ 1 v ^‹p n-2 Q ^‹ δ B δ 1 v q " ż ‹p n-2 Q ^‹ δ B δ 1 v q ^δ A δ 1 v " ´tA, Bu Q .
Thus (5.24) -(5.26) are anti-symmetric.

5.3.3

Equations of Motion

Inserting functional derivatives (5.20) into the Poisson brackets (5.24) -(5.26) gives the equations of motion as

B 1 v Bt `‹p n-2 Q ^‹ n-1 Fq `d 0 B `0s ^d 0 T " 0, B n D Bt `d n-1 F " 0, B n S Bt `d ´0s ^n-1 F¯" 0.

Summary of Results

For a fully compressible fluid characterized by a mass density, a velocity and a thermodynamic scalar through the Lagrangian Lr n-1 ũ, n D, 0 ss (with associated Hamiltonian Hr 1 v, n D, n Ss) on a general manifold M, the following variational Lagrangian and Hamiltonian formulations hold:

Euler-Lagrange and Kinematic Equations:

B Bt ˜1 0 D δ L δ n-1 ũ ¸`i u ˜d 1 0 D δ L δ n-1 ũ ¸`d i u ˜1 0 D δ L δ n-1 ũ ¸´d δ L δ n D `1 0 D ^‹ δ L δ 0 s ^d 0 s " 0, B Bt n D `Lu n D " 0, B Bt n S `Lu n S " 0, B Bt 0 s `Lu 0 s " 0.
Poisson Brackets:

tA, Bu R " ´xx δ A δ n D , d δ B δ 1 v yy ´xxd δ B δ n δ A δ 1 v yy, tA, Bu S " ´xx δ A δ n S, dp 0 s ^δ B δ 1 v qyy ´xx 0 s ^d δ B δ n S, δ A δ 1 v yy, tA, Bu Q " ´xx‹p n-2 Q ^‹ δ B δ 1 v q, δ A δ 1 v yy.
Topological Functional Derivatives:

0 T " ´1 0 D ‹ δ L δ 0 s " δ H δ n S, 0 B " i u 1 v ´δ L δ n D ´0s ^0T " δ H δ n D , n-1 F " 0 D ^n-1 ũ " δ H δ 1 v .
(Hamiltonian) Equations of Motion:

B 1 v Bt `‹p n-2 Q ^‹ n-1 Fq `d 0 B `0s ^d 0 T " 0, B n D Bt `d n-1 F " 0, B n S Bt `d ´0s ^n-1 F¯" 0.
These formulations are closed by making specific choices for mass density n D, transport velocity n-1 ũ and thermodynamic scalar 0 s; and specifying the Lagrangian in terms of these variables, which determines 1 v and the functional derivatives n-1 F, 0 B and 0 T. Some specific examples of this for common geophysical fluids (shallow water, thermal shallow water, compressible Euler) are given in Section 7. It is also possible to predict 0 s or n s instead of n S in the Hamiltonian formulation, and more details about this are found in Appendix A. There are also some slight changes that arise for n " 2 (in the PV flux term) and if there is no thermodynamic scalar, and these are explored in Appendix B.

Properties of Split Exterior Calculus Variational Formulation

Now we will investigate some basic properties about the general formulation: conservation of energy and Casimirs, Kelvin Circulation theorem and potential vorticity. The last three turn out to depend on dimension and/or the presence of a thermodynamic scalar. Therefore, we discuss only the n " 3 case in these subsections.

Energy conservation

Proposition 14 The three sets of equations of motion in 5.3.3 preserve total energy.

Proof: For all three sets of equations with corresponding Hamiltonian H, H 1 , H 2 , the conservation of energy follows from the anti-symmetry of the corresponding Poisson bracket such that d dt H " tH, Hu " ´tH, Hu " 0 holds for H and, analogously, for H 1 and H 2 (from Appendix A).

6.2

Kelvin Circulation Theorem

Integrating (5.2) over γptq, the Kelvin circulation theorem is

d dt ¿ γptq 1 0 D ^δ L δ n-1 ũ " ´¿ γptq 1 0 D ^‹ δ L δ 0 s d 0 s .
This is a natural definition, since both sides are straight 1-forms that can be integrated over curves. When there is no thermodynamic scalar, this simplifies somewhat (the right hand side vanishes), as discussed in Appendix B.

Potential Vorticity

For n " 3, we define the potential vorticity straight 3-form n q, twisted 0-form 0 q and straight 0-form 0 q by n q " d 0 s ^2Q, 0 q " ‹ n q " ‹pd 0 s ^2Qq, 0 q " 0 Ĩ ^0q,

recalling that 0 D ^2Q " 2 η " d 1 v. Note that 0 D ^nq " n D ^0q .
By combining (5.12) -(5.14), evolution equations for the potential vorticity density 0 D ^nq straight n-form and potential vorticity twisted 0-form 0 q are obtained as

B 0 D ^nq Bt `Lu p 0 D ^nqq " 0, B 0 q Bt `Lu p 0 qq " 0.
The last equation is a statement of material conservation of 0 q. These definitions only make sense when n " 3, when n " 2 the potential vorticity takes a different form, and the governing equations depend on whether or not a thermodynamic scalar is present. This is discussed in Appendix B.

Casimirs

Since the Casimirs are a function of the Poisson bracket, and the Poisson bracket changes when dimension changes or if there is no thermodynamic scalar, there will be three sets of Casimirs: n " 3, n " 2 and n " 2 with no thermodynamic scalar. Here we will discuss only the Casimirs for n " 3, the other two cases can be found in Appendix B. Recall that the Casimirs satisfy tC, Au " 0 @ A .

They are of the form Cr 1 v, n D, n Ss " 0 D, F p 0 s, 0 qq (6.1)

where F p 0 s, 0 qq is an arbitrary function of 0 s and 0 q. The functional derivatives of (6.1) are

δ C δ 1 v " dpF q ^0Ĩ ^d 0 sq, (6.2) δ C δ n D " F ´0q ^Fq ´0s ^Fs `0s ^1 0 D ^0Ĩ ^‹pd F q ^2ηq, (6.3)
δ C δ n S " F s ´1 0 D ^0Ĩ ^‹pd F q ^2ηq, (6.4)
where F q " BF B 0 q and F s " BF B 0 s . Important cases are F " 1 (total mass), F " 0 q (total potential vorticity) and F " 0 s (total thermodynamic scalar).

Proposition 15 Equation (6.1) is a Casimir of the brackets (5.24) -(5.26).

Proof: It is easier to do this proof when predicting 0 s instead of n S (see Appendix A), in which case the topological functional derivatives of

C 1 r 1 v, n D, 0 ss are δ C 1 δ 1 v " dpF q ^0Ĩ ^d 0 sq, δ C 1 δ n D " F ´0q ^Fq , δ C 1 δ 0 s " n D ^Fs ´0Ĩ ^d F q ^2η . (6.5)
In order that tC, Au " 0 @ A, functional derivatives (6.5) must satisfy

d δ C 1 δ 1 v " 0 (6.6) ‹p 1 0 D ^d 0 s ^δ C 1 δ 1 v q " 0 (6.7) ‹p n-2 Q ^‹ δ C 1 δ 1 v q `d δ C 1 δ n D ´1 0 D ^d 0 s ^‹ δ C 1 δ 0 s " 0 (6.8)
The first condition (6.6) follows immediately from d d " 0 and δ C 1 δ 1 v in (6.5). The second condition (6.7) becomes ‹p 1 0 D ^d 0 s ^dpF q ^0Ĩ ^d 0 sqq " ‹p 1 0 D ^d 0 s ^d F q ^0Ĩ ^d 0 sq " 0 since d 0 s ^d 0 s " 0. The third condition (6.8) is the most complicated. Start by considering the middle term of (6.8). It is

d δ C 1 δ n D " F s d 0 s `Fq ^d 0 q ´0q ^d F q ´Fq ^d 0 q " F s d 0 s ´0q ^d F q .
Now consider last term of (6.8). It can be written as

´1 0 D ^d 0 s ^‹ δ C 1 δ 0 s " ´1 0 D ^d 0 s ^‹p n D ^Fs q `1 0 D ^d 0 s ^‹p 0 Ĩ ^d F q ^2ηq. (6.9)
The first part of the right-hand side of (6.9) is equal to (after re-arrangements and using

‹ n D " 0 D) F s ^d 0 s .
The second part of the right-hand side of (6.9) is equal to

d 0 s ^‹p 0 Ĩ ^d F q ^2Qq " 0 Ĩ ^d 0 s ^‹pd F q ^2Qq.
Therefore we can combine the middle and last terms of (6.8) as ´d F q ^0q `0Ĩ ^d 0 s ^‹pd F q ^2Qq.

Inserting the definition 0 q " 0 Ĩ ^‹pd 0 s ^2Qq then yields 0 Ĩ ^`´d F q ^‹pd 0 s ^2Qq `d 0 s ^‹pd F q ^2Qq ˘. (6.10) Now using the exterior calculus analogue of the vector triple product (C.1) from Appendix C, (6.10) becomes ´0Ĩ ^‹p n-2 Q ^‹pd F q ^d 0 sqq.

However, this is nothing more than the minus of the first term of (6.8). Therefore the first condition (6.8) holds, and tC, Au " 0 @ A. 7

Specific Examples

In this section we show how some commonly used equations sets in geophysical fluid dynamics (shallow water equations, thermal shallow water equations and compressible Euler equations) fit into the general formulation discussed above. This will include the split covariant equations from Bauer (2016).

7.1 Shallow Water Equations (n " 2, no thermodynamic scalar)

For the rotating shallow water equations, we have n " 2, the relevant mass variable is the twisted fluid height 2-form 2 h, and there is no thermodynamic scalar.

Hamiltonian

The Lagrangian Lr n-1 ũ, 2 hs for the rotating shallow water equations is formed as usual, it is the kinetic energy plus a rotation term minus the potential energy:

Lr n-1 ũ, 2 hs " 0 h, 0 K ` 0 h ^1u, 1 R ´1 2 0 g ^2h , 2 h ´ 0 g ^2h , 2 t (7.1) with kinetic energy 0 K " 1 2 i u 1 u " ‹ 1 u ^‹ 1 u 2
and height straight 0-form 0 h " ‹ 2 h where 0 g is the gravitational constant straight 0-form and 2 t is the topography twisted 2-form.

Here we have written the Lagrangian using the metric pairing. This gives

1 v " 1 u `1R
for the absolute velocity 1 v. Now note that

i u 1 v " ‹p 1 v ^‹ 1 uq " 2 0 K `‹p 1 R ^‹ 1 uq.
Taking the Legendre transform (4.13) of (7.1) gives the Hamiltonian as

Hr 1 v, 2 hs " 0 h, 2 0 K `‹p 1 R ^‹ 1 uq ´ 0 h, 0 K ´ 0 h ^1u, 1 R `1 2 0 g ^2h , 2 h .
The second part of the first term is equal to 0 h ^1u, 1 R , and thus the Hamiltonian is finally given by

Hr 1 v, 2 hs " 0 h, 0 K `1 2 0 g ^2h , 2 h ` 0 g ^2h , 2 t .
As discussed in the Introduction and Section 5.3.1, the Hamiltonian (and also the Lagrangian) can be written as a topological pairing between straight and twisted forms as Hr 1 v, 2 hs " 1 2 1 u, n-1 F `1 2 0 g ^0h, 2 h ` 0 g ^0h, 2 t .

The topological functional derivatives of Hr 1 v, 2 hs are δ H

δ 1 v " n-1 F " ‹p 0 h ^1uq " 0 h ^n-1 ũ , δ H δ 2 h " 0 K `0g ^p0 h `0tq , (7.2)
where 0 t " ‹ 2 t is the topography straight 0-form.

Equations of Motion

Putting the functional derivatives (7.2) into the Poisson brackets (5.24) and (5.26) gives the equations of motion

B 1 v Bt `n-2 Q ^n-1 F `d 0 K `0g ^dp 0 h `0tq " 0, (7.3) B 2 h Bt `d n-1 F " 0. (7.4)
Note that we did not use (5.25), since there is no thermodynamic scalar. Equations (7.3) -(7.4) are equivalent to the topoological part of the split covariant equations from Bauer (2016), while (7.2) are the associated metric closure equations. This is a demonstration that the split covariant equations can be reproduced by the curl-form Hamiltonian formulation, with the Poisson brackets generating the topological equations and the functional derivatives of the Hamiltonian generating the metric closure equations.

Thermal Shallow Water Equations

The thermal shallow water equations (also known as the Ripa equations) extend the rotating shallow water equations to the case of variable buoyancy [START_REF] Eldred | A Quasi-Hamiltonian Discretization of the Thermal Shallow Water Equations[END_REF]; [START_REF] Ripa | Linear waves in a one-layer ocean model with thermodynamics[END_REF]. As in the shallow water equations, the relevant mass variable is the fluid height 2 h. However, now there is a thermodynamic scalar: the buoyancy 0 s " g ρ ρ ; where ρ " ρpx, y, tq is the horizontally varying density and ρ is the density used in the Boussinesq approximation. When s " g, the rotating shallow water equations are recovered. There are three choices for the representation of the thermodynamics: the buoyancy density twisted n-form n S, buoyancy straight 0-form 0 s and buoyancy twisted n-form n s. Here we will present the Lagrangian Lr n-1 ũ, 2 h, 0 ss, and the Hamiltonian Hr 1 v, 2 h, n Ss; but show the equations of motion for all three choices. The material in Appendix A can be used to make the change of variables to get H 1 r 1 v, 2 h, 0 ss or H 2 r 1 v, 2 h, n ss if desired, and this is left as an exercise for the interested reader.

Hamiltonian

Again, the Lagrangian Lr n-1 ũ, 2 h, 0 ss is the kinetic energy plus a rotation term minus the potential energy:

Lr n-1 ũ, 2 h, 0 ss " 0 h, 0 K ` 0 h ^1u, 1 R ´1 2 0 s ^2h , 2 h ´ 0 s ^2h , 2 t .
The same exact manipulations as in the shallow water case (except with a different potential energy) yield the Hamiltonian Hr 1 v, 2 h, n Ss

Hr 1 v, 2 h, n Ss " 0 h, 0 K `1 2 0 s ^2h , 2 h ` 0 s ^2h , 2 t .
This has functional derivatives δ H

δ 1 v " n-1 F " ‹p 0 h ^1uq " 0 h ^n-1 ũ , δ H 1 δ 2 h " 0 K `0S 2 , δ H 1 δ n S " 0 h 2 `0t , (7.5)
where 0 S " ‹ n S " 0 h ^0s.

Equations of Motion

Putting the functional derivatives (7.5) into the Poisson brackets (5.24) -(5.26) (or the equivalent when 0 s or n s are predicted) gives the equations of motion

B 1 v Bt `n-2 Q ^n-1 F `d 0 K `d n S 2 `0s ^dp 2 h 2 `2t q " 0, (7.6) B 2 h Bt `d n-1 F " 0, (7.7)
B n S Bt `dp 0 s ^n-1 Fq " 0, (7.8) B 0 s Bt `1 0 h ^‹ ´n-1 F ^d 0 s ¯" 0, (7.9) (7.10) where only one of (7.8) -(7.10) is needed.

B n s Bt `1 0 h ^n-1 F ^d 0 s " 0,
7.3 Compressible Euler Equations (n " 2 and n " 3)

For the compressible Euler equations, the relevant mass variable is the density twisted n-form n ρ (with associated straight 0-form 0 ρ " ‹ n ρ) and the thermodynamic scalar is the entropy straight 0-form 0 s, with associated thermodynamic scalar twisted n-form n s and thermodynamic scalar density twisted n-form n S. It would also be possible to use the potential temperature instead of the entropy, which has advantages for an ideal gas (see Section 7.3.3). As for the thermal shallow water equations, we will present the Lagrangian Lr n-1 ũ, 2 h, 0 ss and Hamiltonian Hr 1 v, 2 h, n Ss, but show the equations of motion for all three choices of thermodynamic variable. These equations apply equally well to the n " 2 and n " 3 cases, with some slight simplification in the PV flux term arising when n " 2. The case of n " 2 gives rise to what are commonly known as slice equations. However, these slice equations are somewhat different than others in the literature [START_REF] Cotter | A finite element exterior calculus framework for the rotating shallow-water equations[END_REF]; [START_REF] Cotter | A variational formulation of vertical slice models[END_REF], since they assume that the out of slice velocity is zero, and that there is no variation in the out of slice direction for the thermodynamic scalar. An extension of the general framework to incorporate non-zero out of slice velocity and variability in the out of slice direction for the thermodynamic scalar will be the subject of future work.

Hamiltonian

The Lagrangian Lr n-1 ũ, n ρ, 0 ss is the sum of the kinetic energy plus a rotation term minus the sum of the gravitational potential energy and the internal energy

Lr n-1 ũ, n ρ, 0 ss " @ 0 ρ, 0 K D `@ 0 ρ ^1u, 1 R D ´@ 0 ρ, 0 Φ D
´@ 0 ρ, 0 Upα, 0 sq D where 0 Up 0 α, 0 sq is the internal energy, 0 Φ is the geopotential and 0 K " ‹ ‹ 1 u ^1u

2

. A choice of internal energy is equivalent to a choice of equation of state. These equations will hold for arbitrary choices of 0 U and 0 Φ, which allows a wide range of geophysical fluids to be treated. Again following the same procedure as in the shallow water case, the Hamiltonian is given by

Hr 1 v, n ρ, n Ss " @ 0 ρ, 0 K D `@ 0 ρ, 0 Φ D `@ 0 ρ, 0 Upα, 0 sq D .
The functional derivatives of Hr 1 v, n ρ, n Ss are given by δ H

δ 1 v " n-1 F " ‹p 0 ρ ^1uq " 0 ρ ^n-1 ũ, δ H δ n ρ " 0 K `0Φ `0U ´0p 0 α `0s 0 T, δ H δ n S " 0 T, (7.11)
where we have the temperature straight 0-form 0 T " B 0 U B 0 s and pressure straight 0-form 0 p " ´B 0 U B 0 α .

Equations of Motion

Inserting the topological functional derivatives (7.11) into the Poisson brackets (5.24) -(5.26) (or the equivalent when 0 s or n s are predicted) gives the equations of motion

B 1 v Bt `‹p n-2 Q ^‹ n-1 Fq `d 0 K `d 0 Φ `1 0 ρ ^d 0 p " 0, B n ρ Bt `d n-1 F " 0, B n S Bt `dp 0 s ^n-1 Fq " 0, B 0 s Bt `1 0 h ^‹ ´n-1 F ^d 0 s ¯" 0, B n s Bt `1 0 h ^n-1 F ^d 0 s " 0.
Here we have used the fact that 0 s ^d 0 T `dp 0 U ´0p 0 α `0s 0 Tq " 1 0 ρ ^d 0 p by the fundamental thermodynamic relationship d 0 U " ´0p ^d 0 α `0s ^d 0 T .

These are equivalent to split covariant equations from [START_REF] Bauer | A new hierarchically-structured n-dimensional covariant form of rotating equations of geophysical fluid dynamics[END_REF], although thermodynamic equation was presented there. This is another demonstration that the split covariant equations can be reproduced by the curl-form Hamiltonian formulation, with the Poisson brackets generating the topological equations and the functional derivatives of the Hamiltonian generating the metric closure equations.

Predicting n Θ instead of n S

In geophysical fluid dynamics, potential temperature is often used instead of entropy, especially in the case of an ideal gas. If the thermodynamic scalar is potential temperature 0 θ instead of entropy 0 s, the fundamental thermodynamic relationship becomes d 0 U " ´0p ^d 0 α `0θ ^d 0 π with the Exner pressure straight 0-form 0 π " B 0 U B 0 θ and we have

0 θ ^d 0 π `dp 0 U ´0p 0 α `0θ 0 πq " 1 0 ρ ^d 0 p .
In fact, the formulation remains the same, with 0 s replaced by 0 θ, n S by n Θ " n D ^0θ and 0 T by 0 π. However in the case of an ideal gas, 0 U " 0 p 0 α ´0θ 0 π, and the thermodynamic contribution to δ H δ n ρ drops out:

δ H δ n ρ " 0 B " 0 K `0Φ `0U ´0p 0 α `0θ 0 π " 0 K `0Φ .
For more general equations of state, or other prognostic thermodynamic variables however, the thermodynamic contribution to δ H δ n ρ remains and there seems to be little advantage to using potential temperature instead of entropy.

Conclusions and Outlook

This paper has presented a start towards the development of variational and Hamiltonian formulations for geophysical fluids based on split exterior calculus, providing additional insight into the differential geometric structure underlying the equations of motion. An important aspect of this structure is the splitting between topological and metric parts of the equations, which reproduces the existing split covariant formulation from [START_REF] Bauer | A new hierarchically-structured n-dimensional covariant form of rotating equations of geophysical fluid dynamics[END_REF] for the shallow water and compressible Euler equations. In fact, the Poisson brackets are composed of purely topological operators, while all of the metric information resides in the Hamiltonian. These formulations have been illustrated through the selection of Lagrangians that give the shallow water equation, thermal shallow water equations and compressible Euler equations. Significant work remains to be done, most importantly the development of the split exterior calculus form of the Lie-Poisson bracket. Additional future work further developing the formulation could consist of an extension to: multicomponent, multiphase fluids; to fluids with irreversible processes; to domains with moving boundaries (such a free surface); to non-Eulerian vertical coordinates, to new Lagrangians (such as those for the Green-Naghidi equations); to slice equations with out-of-slice velocity and thermodynamic scalars; to various standard approximations (traditional, shallow atmosphere, quasi-hydrostatic, etc.); and to semi-compressible fluids (anelastic, pseudo-incompressible, Boussinesq, semi-hydrostatic).

The immediate application of this novel formulation is anticipated to be the development of new numerical methods, and a deeper understanding of existing methods. The split exterior calculus formulation is particularly interesting from a numerical modeling point of view, due to its relative simplicity: the only operators that appear are ‹, ând d, along the metric and topological pairing. Work is current ongoing to develop a discrete exterior calculus (or primal-dual discretization) in n " 2 and n " 3 for general, non-orthogonal grids (emphasizing the cubed-sphere and icosahedral grids) that preserves a subset of the key properties of these operators. Such a discretization can be combined with the formulation presented in this paper to yield a quasi-Hamiltonian numerical method that preserves important aspects of the Hamiltonian structure (such as anti-symmetry of the Poisson bracket and a subset of its Casimirs), and therefore has discrete equations that have many of the same properties as the continuous ones. There is strong evidence that the TRiSK scheme [START_REF] Eldred | Total energy and potential enstrophy conserving schemes for the shallow water equations using hamiltonian methods -part 1: Derivation and properties[END_REF]; [START_REF] Thuburn | Numerical representation of geostrophic modes on arbitrarily structured c-grids[END_REF]; [START_REF] Thuburn | A framework for mimetic discretization of the rotating shallow-water equations on arbitrary polygonal grids[END_REF]; [START_REF] Thuburn | A mimetic, semi-implicit, forwardin-time, finite volume shallow water model: comparison of hexagonalicosahedral and cubed-sphere grids[END_REF]; [START_REF] Weller | Non-orthogonal version of the arbitrary polygonal c-grid and a new diamond grid[END_REF], although inconsistent, is in fact a realization of such a discrete exterior calculus. This correspondence will be further explored in future work.

B Simplifications when n " 2 and if there is no thermodynamic scalar Some simplifications and changes arise for certain aspects of the variational formulation when n " 2 and if there is no thermodynamic scalar. These changes are discussed first using vector calculus, and then shown in split exterior calculus. We do not treat the case of n " 3 without a thermodynamic scalar, since it rarely arises in practice.

B.1 Vector Calculus

When n " 2 the Lie derivative for a vector field x is L u x " p∇ T ¨xq u T `∇pu ¨xq, and therefore the Euler-Poincaré equation in curl-form is If there is no thermodynamic scalar, then the last term in (B.1) and (B.2) is dropped, and there is no equation of motion for s or S. This is equivalent to dropping the tA, Bu S or tA 1 , B 1 u s bracket.

Rotation. Rotation is described by pseudo-scalar Ω, which can be associated with a pseudo-vector Ω k where k points in the (local) vertical direction on the manifold. Then the rotational velocity follows as before, and its (two-dimensional) curl is simply f " 2Ω.

Rotation is introduced into the Lagrangian in the same way as before.

B.1.1 Kelvin Circulation Theorem

The Euler-Poincaré equation can be integrated along a curve γptq as before to get the Kelvin circulation theorem. When there is no thermodynamic scalar, it simplifies to

d dt ¿ γptq 1 D δ L δ u ¨dx " 0.

B.1.2 Potential Vorticity

For the case of n " 2, potential vorticity is defined as q " ∇ T ¨v D .

Note for n " 2, we have q " Q. The corresponding evolution equations are BpDqq Bt `∇ ¨pqD uq ´∇T ¨pT ∇sq " 0, Bq Bt `u ¨∇q ´1 D ∇ T ¨pT ∇sq " 0.

Therefore, potential vorticity is only materially conserved if there is no thermodynamic scalar s. However, mass-weighted potential vorticity is still conserved, modulo boundary effects.

B.1.3 Casimirs

The brackets change when going from n " 3 to n " 2, and also when dropping the thermodynamic scalar. Therefore, each case will have a separate set of Casimirs. These are detailed below.

Without a thermodynamic scalar. When n " 2 without a thermodynamic scalar, the Casimirs are of the form Crv, Ds "

ż DF pqq,
where F pqq is an arbitrary function of potential vorticity q. The functional derivatives of Crv, Ds are

δ C δ v " ´∇T F 1 , δ C δD " F ´qF 1 ,
where F 1 " dF dq . Important cases are F " 1 (total mass), F " q (total potential vorticity) and F " q 2 2 (potential enstrophy).

With thermodynamic scalar. When n " 2 with a thermodynamic scalar, the Casimirs are of the form Crv, D, Ss " ż DqF psq `DGpsq,

where F psq and Gpsq are arbitrary functions of the thermodynamic scalar s. The functional derivatives of Crv, D, ss are

δ C δ v " ´∇T F, δ C δD " G ´sQF 1 ´sG 1 , δ C δS " QF 1 `G1 ,
where F 1 " dF ds and G 1 " dG ds . Alternatively, if s is predicted instead, we have C 1 rv, D, ss " Crv, D, Ss and

δ C 1 δ v " ´∇T F, δ C 1 δD " G, δ C 1 δs " DqF 1 `DG 1 .
Important cases are F " 0, G " 1 (total mass), F " 1, G " 0 (total potential vorticity) and F " 0, G " s (total thermodynamic scalar).

B.2.3 Casimirs

As before, there are two sets of Casimirs: one for the case of a fluid without a thermodynamic scalar and one for the case with a thermodynamic scalar.

Without thermodynamic scalar. The Casimirs Cr 1 v, n Ds when there is not thermodynamic scalar are Cr 1 v, n Ds " 0 D, F p 0 qq , where F p 0 qq is an arbitrary function of potential vorticity straight 0-form 0 q. The functional derivatives of Cr 1 v, n Ds are δ C

δ 1 v " dp 0 Ĩ ^F 1 q, δ C δ n D " F ´0q ^F 1 ,
where F 1 " dF d 0 q . Important cases are F " 1 (total mass), F " 0 q (total potential vorticity) and F " 0 q ^0q 2 (potential enstrophy).

With thermodynamic scalar. The Casimirs Cr 1 v, n D, n Ss when there is a thermodynamic scalar are Cr 1 v, n D, n Ss " 0 D ^0q, F p 0 sq ` 0 D, Gp 0 sq , where F p 0 sq and Gp 0 s) are arbitrary functions of 0 s. The functional derivatives of Cr 1 v, n D, n Ss are δ C

δ 1 v " dp 0 Ĩ ^F q, δ C δ n D " G ´0s ^0q ^F 1 ´0s ^G1 , δ C δ n S " 0 q ^F 1 `G1 ,
where F 1 " dF d 0 s and G 1 " dG d 0 s . If 0 s is predicted instead, we have δ C 1 δ 1 v " dp 0 Ĩ ^F q, δ C 1

δ n D " G, δ C 1 δ 0 s " n D ^0q ^F 1 `n D ^G1 .
Finally, if n s is predicted, we have

δ C 2 δ 1 v " dp 0 Ĩ ^F q, δ C 2 δ n D " G, δ C 2
δ n s " ‹p n D ^0q ^F 1 `n D ^G1 q " 0 D ^0q ^F 1 `0D ^G1 .

Important cases are F " 0, G " 1 (total mass), F " 1, G " 0 (total potential vorticity) and F " 0, G " 0 s (total thermodynamic scalar).

C Relationships Between Vector Calculus and Exterior Calculus

Consider a scalar function f with associated straight 0-form 0 f and vector field F with associated straight 1-form 1 F " F 5 . Then for n " 3 the following relationships hold (see [START_REF] Abraham | Manifolds, tensor analysis, and applications[END_REF] for proofs) between the gradient, divergence and curl, Hodge star and exterior derivative: p∇f q 5 " d 0 f,

  ) Equation (4.14) defines a Poisson bracket with respect to the variables pv, D, Sq, which is known as the curl-form Poisson bracket. It is also possible to define a bracket predicting pm, D, Sq where m " D v is the momentum. This is known as the Lie-Poisson bracket, and examples are found in Cotter and Holm (2013, 2014) (amongst others). The Lie-Poisson bracket gives the flux-form momentum equations. It is straightforward to show that the Poisson bracket (4.14) with Hamiltonian (4.13) lead to the equations of motion (4.7), (4.8), and (4.10).

  Now consider the kinematic equationBDBt" ´Lu D " ´∇ ¨pD uq.This can be directly translated asB 0 D Bt " ´‹ d ‹p 0 D^1uq using the formula relating ∇ ¨x and ‹/d from Appendix C. Take ‹ of both sides to yield B n D Bt " ´d ‹p 0 D ^1uq " ´d i u n D " ´Lu n D by combining Hirani's formula (3.10) and Cartan's formula (2.1). Similar considerations give B n S Bt " ´d ‹p 0 S ^1uq " ´d i u n S " ´Lu n S .

  used the skew-gradient ∇ T " k ˆ∇ and 2D curl ∇ T ¨" k ¨∇ˆ, where k is local vertical (these operators have intrinsic definitions valid on any orientable manifold). Only the v equation of motion changes, it becomesB v Bt `Q F T `∇B `s∇T " 0 (B.2)where Q " ∇ T ¨v D . This arises from a new tA, Bu Q bracket, which is tA, Bu Q "

  on the tangent bundle to 1-forms on the cotangent bundle. See[START_REF] Tort | Usual approximations to the equations of atmospheric motion: A variational perspective[END_REF] for more details.Introducing

	T :"	´1 D	δL δs	,	v :"	1 D	δL δ u	,	B :" u	¨1 D	δL δ u	´δL δD `s D	δL δs	,	F :" D u, (4.6)
	in order to simplify the equations, and following standard definitions in the literature
	Holm et al. (1998, 1999); Tort and Dubos (2014a), the momentum and transport equations
	can be written as
					B v Bt	`∇	ˆv D	ˆF `∇B `s∇T " 0,		(4.7)
										BD Bt	`∇ ¨pFq " 0,		(4.8)
										Bs Bt `F D	¨∇s " 0,		(4.9)
										BS Bt	`∇ ¨ps Fq " 0.		(4.10)
	This is supplemented with kinematic transport equations for D and s
									BD Bt	" " ∇ ¨pD uq,		(4.3)
									Bs Bt	" ´u ¨∇s.			(4.4)
	Combining (4.3) and (4.4) gives an equation for S as
									BS Bt	" ´∇ ¨pS uq.		(4.5)

In tensor notation, u is typically treated in contravariant form, while v, introduced in the following definitions, is treated in covariant form. This is akin to the transition from vector fields

Acknowledgments

Christopher Eldred was supported by the French National Research Agency through contract ANR-14-CE23-0010 (HEAT). Werner Bauer was partly supported by the European Union's Horizon 2020 research and innovation programme under the Marie Sk lodowska-Curie grant agreement No 657016.

A Alternative Prognostic Variables: s, 0 s and n s

A.1 Vector Calculus

In the Hamiltonian formulation using vector calculus, it is also possible to predict the thermodynamic scalar s, rather than the thermodynamic scalar density S. This is simply a change of variables from the original set of pv, D, Sq to pv, D, sq.

Chain Rule. For an arbitrary functional we have A 1 rv, D, ss " Arv, D, Ss and the chain rule gives

The proof of this is straightforward, and is left for the interested reader.

Functional Derivatives

The functional derivatives of H 1 rv, D, ss are

and those of the Casimirs C 1 rv, D, ss read

Poisson Bracket tA 1 , B 1 u. Using the chain rule (A.1) in (4.15) -(4.17), the new Poisson brackets are

The proof of this is again left for the interested reader. Note that the tA 1 , B 1 u R and tA 1 , B 1 u Q brackets have the same form as before, just with different arguments.

Equations of Motion. Inserting the functional derivatives (A.2) into the Poisson brackets (A.3) -(A.5), the equations of motion are then

A.2 Split Exterior Calculus

In the Hamiltonian formulation using split exterior calculus, a change of variables from thermodynamic scalar density twisted n-form n S to either thermodynamic scalar straight 0-form 0 s or thermodynamic scalar twisted n-form n s " ‹ 0 s can be made. This is the split exterior calculus analogue of predicting s instead of S.

A.2.1 Predicting 0 s

Chain Rule. Now we have A 1 r 1 v, n D, 0 ss " Ar 1 v, n D, n Ss for any functional A and the chain rule for functional derivatives gives

Functional Derivatives: The functional derivatives of

where n T " ‹ 0 T. The functional derivatives of

Poisson Bracket tA 1 , B 1 u. Using also the chain rule (A.6) in (5.24) -(5.26), the new Poisson brackets are

where again the tA 1 , B 1 u R and tA 1 , B 1 u Q brackets have the same form as before, just with different arguments.

Equations of Motion

Predicting p 1 v, n D, 0 sq the equations of motion are

A.2.2 Predicting n s

Chain Rule. Predicting n s instead of n S means A 2 r 1 v, n D, n ss " Ar 1 v, n D, n Ss for any functional A and the chain rule for functional derivatives gives

where n T " ‹ 0 T. The functional derivatives of

Poisson Bracket tA 2 , B 2 u. Using the chain rule (A.11) in (5.24) -(5.26), the new Poisson brackets are

where again the tA 2 , B 2 u R and tA 2 , B 2 u Q brackets have the same form as before, just with different arguments.

Equations of Motion.

Predicting p 1 v, n D, n sq the equations of motion are

B.2 Split Exterior Calculus

One advantage of using split exterior calculus is that the Lie derivative is dimensionindependent. Therefore the curl-form Euler-Poincaré equations do not change. Only the PV flux term slightly simplifies, since n-2 Q is a 0-form. It becomes

In fact, when n " 2 then n-2 Q is the potential vorticity. This is not the case for n " 3. This leads to a simplified tA,

If there is no thermodynamic scalar, then the last term in (5.2) and ( 5.3) is dropped, and there is no evolution equation for n S, 0 s or n s. This is equivalent to dropping the tA, Bu S , tA 1 , B 1 u s or tA 2 , B 2 u s bracket.

Rotation When n " 2 instead of 1 Ω we have 0 Ω since rotation can be described by a pseudo-scalar. However, this still gives 2 Ω " ‹0 Ω, and d 1 R " 2 2 Ω. Rotation is introduced into the Lagrangian in the same way as before.

B.2.1 Kelvin Circulation Theorem

When there is no thermodynamic scalar, the Kelvin circulation theorem simplifies to

B.2.2 Potential Vorticity

When n " 2, the potential vorticity differential forms are defined as

The corresponding evolution equations are

As before, 0 q is only materially conserved if there is no thermodynamic scalar; then the last term in both (B.3) and (B.4) drops out.

p∇ ˆFq 5 " ‹ d 1 F, ∇ ¨F " ‹ d ‹ 1 F .

Furthermore, given vector fields u and v with associated straight 1-forms 1 u and 1 v, the following relationships hold between the cross product, dot product, wedge product and Hodge star pv ˆuq 5 " ‹p 1 v ^1uq, v ¨u " ‹p 1 v ^‹ 1 uq.

These latter equalities can be used to establish a useful analogue of the vector triple product u ˆpv ˆwq " pw ¨uq v ´pv ¨uq w, as ‹p 1 u ^‹p 1 v ^1wqq " ‹p 1 w ^‹ 1 uq ^1v ´‹p 1 v ^‹ 1 uq ^1w .

(C.1)