Doing the hamiltonian myself
We assume that the derivation of the prognostic equations should be fine, aside from the definition of pseudodensity.
We use Dubos and Tort TD14 to explain how to get a correct pseudodensity for our equation set in Lagrangian mass coordinates.
Useful stuff from TD14:
Pseudodensity in Lagrangian coordinates
We work continuously for the moment. Let μ^
be the pseudodensity in Eulerian coordinates. The paragraph between Eqn (6) and Eqn (7) gives that μ^=αr2cosϕ=ρr2cosϕ.
Let η
be an arbitrary vertical coordinate. Let ξ3
be the vertical Eulerian vertical coordinate. The aforementioned paragraph gives that for spherical geometry ξ3≡r
.
The mass budget, which is quite closely related to the question we want to answer, is governed in Lagrangian coordinates by
0μJ=∂tμ+∂l(μul)=Jμ^=det∂lξk
Eqn (24) in TD14 states that pseudodensity under an arbitrary vertical coordinate η
is
μ=μ^∂ηξ3=μ^∂ηr,
which follows from the expression for J
and the fact that λ,ϕ
are still Eulerian. Therefore the Jacobian is diagonal, with all entries equal to 1 except for the ∂ηr
term.
Now suppose that η
is specifically the mass-based eta coordinate used by HOMME. It is Lagrangian, i.e. u3=η˙=0.
Let η∈[0,1]
. This is defined in terms of
M(ξ1,ξ2,t)μ=∫01μ(ξ1,ξ2,η)dη=∂η[A]M+∂η[B]
The rather peculiar dependence of μ
on M
leads TD14 to claim that M
is the quantity which should be used to determine the prognostic equations. TD14 prognoses M
. This should be equivalent to calculating it within levels, since we are prognosing ∫ηiηi+1μdη
?
TD14 makes the definition H′[vi,r,μv3,M,S]=H[vi,r,μv3,A′M+B′,S].
Why is this a problem?}
Note: Chris's appendix in Tea20 attempts to derive the equations of motion using
δ∂s∂πδH
I suspect that the "energetically neutral transport term" of Tea20 V⋅s˙
rectifies the difference. In any case,
Miscellany from appendix
M(ξ1,ξ2,t)=∫bottomtopμdη=∫bottomtopμ^dr
This uniquely defines the position of r(ξ1,ξ2,η)
according to
A(η)M(ξ1,ξ2)+B(η)=∫r0r(η)μ^dr
Oksana's notes
For the purposes of disambiguation, I'll stick with calling pseudodensity μ
and refer to the pressure adjustment factor (μ
in Oksana's notes) as ψ
.
A pseudodensity is simply a quantity which evolves according to a flux-form continuity equaiton. The simplest such density is a rewrite of the continuity equation
ρt+∇⋅(ρv)=0
and the notes state that from this we could derive (rsr2ρ)τ+∇s(r−1rsr2u)+(s˙rsr2ρ)s.
The definition above μ=μ^∂sr
combined with μ^=r2ρ
gives μ=rsr2ρ.
The trouble with defining
∂sph=∂s[ph]∂r[s]=−gρrsr^2
is that g=g0r^−2.
This implies that the actual pressure value per gridpoint in the deep atmosphere would be essentially the same, but it would represent a fundamentally different quantity.
Ok so the hypsometric equation is hidden in here (assume shallow atm for the moment):
⟹⟹⟹⟹∂sϕ=−Rd∂s[π]θvpΠ∫∂s[ϕ]ds=−Rd∫∂s[π]θvpΠdsΔϕ=−Rd∫∂s[π]θvpΠdsΔϕ=−Rd∫pT∂s[π]dsΔϕ=−Rd∫pTdπ
Assuming T=T0
and p=π,
then we get the standard hydrostatic hypsometric equation.
Following Quasi-hamiltonian derivation in Tea20
The definition for the mass coordinate is
π≡A(η)p0+B(η)ps
which allows us to back out that
η˙∂ηπ=B(η)∫ηtop1∇η⋅∂η[π]udη−∫ηtopη∇η⋅∂η[π]uds
Assuming that π
is defined with respect to the deep atmosphere, I see no problems with this so far.
The components to assemble the equation of state include
∂η[π]∂z[η]=−ρg=−∂η[π](∂η[gz])−1⋅g
Mass integrals:
Shallow:
∫zsurfztopρXdz=∫zsurfztop∂η[π](∂η[g0z])−1Xdz=g0−1∫zsurfztop∂η[π]∂z[η]Xdz=g0−1∫ηtopηsurf∂η[π]Xdη
which demonstrates the shallow atmosphere identity from the paper.
Deep:
Let's do this for the deep atmosphere in a naive way:
∫zsurfztopρXdz=∫zsurfztop∂η[π](∂η[g0(R0+z)2zR02])−1Xdz
which is garbage. But can we get further if we don't expand geopotential (it's still monotonic in η
so we can use the inverse function theorem)
∫zsurfztopρXdz=∫zsurfztop∂η[π]∂ϕ[η]Xdz
which invites the question whether the physical integral on the LHS can be restated in terms of geopotential.
∫zbotztopρXdz=∫ϕbotϕtopρ(∂z[ϕ])−1Xdϕ=∫ϕbotϕtop∂η[π]∂ϕ[η](∂z[ϕ])−1Xdϕ=∫ηtopηbot∂η[π](∂z[ϕ])−1Xdη
where
∂z[ϕ]=g′(z)z+g(z)
where
⟹g′(z)z=−R02z(R0+z)32∣g′(z)z∣≈0.024 m s−2
so in assuming that (∂zϕ)−1=g01
we incur a 0.3% multiplicative error.
The Hamiltonian derivation
Kinetic, internal, and potential energy are supposedly given by
K=21∂η[π]v2,I=cpΘΠ−∂η[π]ρ1p+ptopϕtopP=∂η[π]ϕ
and note that ptop
is really a hydrostatic p
. This section simply notes that dA
is an "area" metric. This has no radial dependence in the shallow atmosphere but (in the most naive formulation) gains a radial dependence in the deep atmosphere.
Note: no functional derivatives with respect to non-hydrostatic pressure p
are sought. Due to the EOS p
is subjugated byϕ
.
Therefore define
H=∬21∂η[π](⟨u,u⟩+w2)(1)+cpΘΠ+∂η[ϕ]p+ptopϕtop(2)+∂η[π]ϕ(3)dAdη
and we do the typical algebraic shenanigans and discard second-order terms:
(1):=====21(∂η[π]+δ[∂η[π]])(⟨u+δu,u+δu⟩+(w+δw)2)21(∂η[π]+δ[∂η[π]])(⟨u,u⟩+2⟨δu,u⟩+⟨δu,δu⟩+w2+2wδw+δw2)21(∂η[π]+δ[∂η[π]])(⟨u,u⟩+2⟨δu,u⟩+w2+2wδw)+O(ε2)21∂η[π](⟨u,u⟩+w2)+∂η[π](⟨δu,u⟩+wδw)+21δ[∂η[π]](⟨u,u)+w2)+δ[∂η[π]](⟨δu,u⟩+wδw)+O(ε2)K+∂η[π](⟨δu,u⟩+wδw)+21δ[∂η[π]](⟨u,u)+w2)+O(ε2)K+⟨∂η[π]u,δu⟩+∂η[π]wδw+21(⟨u,u⟩+w2)δ[∂η[π]]+O(ε2)
and
(2):==cp(Θ+δΘ)Π+(∂η[ϕ]+δ[∂η[ϕ]])p+ptop(ϕtop+δϕtop)cpΘΠ+∂η[ϕ]p+ptopϕtop+cpΠδΘ+pδ[∂η[ϕ]]+ptopδ[ϕtop]I+cpΠδΘ+pδ[∂η[ϕ]]+ptopδ[ϕtop]
and
(3):==(∂η[π]+δ[∂η[π]])(ϕ+δϕ)∂η[π]ϕ+∂η[π]δϕ+ϕδ[∂η[π]]+δ[∂η[π]]δϕP+∂η[π]δϕ+ϕδ[∂η[π]]+O(ε2)
giving
δH=ε→0limεH(u+εδu,w+εδw,ϕ+εδϕ,Θ+δΘ,∂η[π]+δ[∂η[π]])−H(u,w,ϕ,Θ,∂η[π])=∬⟨∂η[π]u,δu⟩+∂η[π]wδw+21(⟨u,u⟩+w2)δ[∂η[π]]+cpΠδΘ+pδ[∂η[ϕ]]+ptopδ[ϕtop]+∂η[π]δϕ+ϕδ[∂η[π]]dAdη=∬⟨∂η[π]u,δu⟩+∂η[π]wδw+(2⟨u,u⟩+w2+ϕ)δ[∂η[π]]+cpΠδΘ+pδ[∂η[ϕ]]+ptopδ[ϕtop]+∂η[π]δϕdAdη.
and we rewrite
∫∫pδ[∂η[ϕ]]+ptopδϕtopdAdη=∫∫pδ[∂η[ϕ]]dη+ptopδϕtopdA=∫[pδϕ]η=ηtopη=1−∫∂η[p]δϕdη+ptopδϕtopdA=∫pbotδϕbot−ptopδϕtop+ptopδϕtop−∫∂η[p]δϕdηdA
and we now note that δϕbot=0
due to the stationary topography at the lower boundary condition. Therefore
∫∫pδ[∂η[ϕ]]+ptopδϕtopdAdη=∫pbotδϕbot−∫∂η[p]δϕdηdA=∫∫−∂η[p]δϕdηdA.
where we have relied on the fact that ∂ηδϕ=δ∂ηϕ
. We can return to the total functional differential to find
δH=∬⟨∂η[π]u,δu⟩+∂η[π]wδw+(2⟨u,u⟩+w2+ϕ)δ[∂η[π]]+cpΠδΘ+(∂η[π]−∂η[p])δϕdAdη.
which gives
δuδHδwδHδϕδHδΘδHδ∂η[π]δH=∂η[π]u=∂η[π]w=∂η[π]−∂η[p]=cpΠ=2u2+w2+ϕ
which agrees precisely with Tea20. However: does the integration by parts trickery work if we do the pseudodensity trick instead of modifying dA
?
Rectifying pseudodensity using TD14:
A fundamental property of our pseudodensity is that
ms=gps=∫01μdη
and TD14 suggests that we define μ=∂η(A)M+∂η(B)M0
. Let's validate that this works:
∫01∂η(A)M+∂η(B)dη=[A]η=0η=1M+[B]η=0η=1=M
so this constrains that the dp3d=psΔA+p0ΔB=g0(msΔA+m0ΔB)
.
Dividing by g0
, even in the deep atmosphere, gives the mass located between particular model levels.
This means that the correct generalization to the deep atmosphere is dp3d=g0(a+z)2a2(msΔA+m0ΔB)
This would make the value of ∑dp3d
coincide with the mass-weighted integral. However, this means
that the g
correction really must be inside the integral.
Curl form for mass coordinates in TD14:
In TD14 notation we have
∂tM+∂i∫δviδH′dη∂tS+∂i(sδviδH′)+∂η(Sη˙)∂tvi+(∂ηvi−∂iv3)η˙+μ∂jvi−∂ivjδvjδH′+∂i(δμδH+η˙v3)+s∂i(δSδH′)∂tV3+∂η(V3η˙)+δξ3δH′=0∂tξ3+η˙∂ηξ3−δV3δH′=0=0=0=0
where
V3vivl^≡μv^3≡v^i+v^3∂iξ3≡∂u^l∂L^.
We note that ξ3=r
.
Tea20 makes the definition μ=∂η[A]M+∂η[B]
. With this definition
∂tM+∂i∫δviδH′dη=∂t∫μdη+∂i∫μuidη
which is quite straightforwardly the continuity equation in weak form. It remains to show that (43) and (44) in TD14 are satisfied by this definition,
but I suspect they are.
Let's examine
∫∂η
The Hamiltonian derivation for Oksana's notes
The idea for this hack is to essentially redefine dA
as r^2dA
by defining dp3d
.
Kinetic, internal, and potential energy are supposedly given by
K=21∂η[π]r^2v2,I=cpΘΠ−∂η[π]r^2ρ1p+ptopϕtopP=∂η[π]r^2ϕ
and note that ptop
is really a hydrostatic p
. In mass-based coordinates, it is also time-invariant. Since Θ=∂η[π]θv
, terms containing Θ
gain a correction.
This time we are rather more careful, noting that if
r^2∂ηϕ=−Rd∂η[π]r^2θvpΠ=−pRdθvθvTv∂η[π]r^2=−ρ1∂η[π]r^2..
Therefore define
H=∬21∂η[π]r^2(⟨u,u⟩+w2)(1)+cpΘr^2Π+∂η[ϕ]r^2p+r^top2ptopϕtop(2)+∂η[π]r^2ϕ(3)dAdη
and the same algebraic manipulations gives
δH=ε→0limεH(u+εδu,w+εδw,ϕ+εδϕ,Θr^2+δΘr^2,∂η[π]r^2+δ[∂η[π]r^2])−H(u,w,ϕ,Θr^2,∂η[π]r^2)=∬⟨∂η[π]r^2u,δu⟩+∂η[π]r^2wδw+21(⟨u,u⟩+w2)δ[∂η[π]r^2]+cpΠδΘr^2+pδ[∂η[ϕ]r^2]+ptopδ[ϕtop]+∂η[π]r^2δϕ+ϕδ[∂η[π]r^2]dAdη=∬⟨∂η[π]r^2u,δu⟩+∂η[π]r^2wδw+(2⟨u,u⟩+w2+ϕ)δ[∂η[π]r^2]+cpΠδΘr^2+pδ[∂η[ϕ]r^2]+ptopδ[ϕtop]+∂η[π]r^2δϕdAdη..
We rewrite
∫∫pδ[∂η[ϕ]r^2]+ptopδϕtopdηdA=∫∫pδ[∂η[ϕ]r^2]dη+ptopδϕtopdA=∫[pδϕ]η=ηtopη=1−∫∂η[p]δϕdη+∫ptopδϕtopdηdA=∫pbotδϕbot−ptopδϕtop+ptopδϕtop−∫∂η[p]δϕdηdA,
which relies on the fact that reconstructing ϕ
from ∂ηϕr^2
is a mass-weighted integral,
which consumes the r^2
factor. We now note that δϕbot=0
due to the stationary topography at the lower boundary condition. Therefore
∫∫pδ[r^2∂η[ϕ]]+ptopδϕtopdAdη=∫pbotδϕbot−∫∂η[p]δϕdηdA=∫∫−∂η[p]δϕdηdA
where we have relied on the fact that ∂ηδϕ=δ∂ηϕ
. We can return to the total functional differential to find
δH=∬⟨∂η[π]r^2u,δu⟩+∂η[π]r^2wδw+(2⟨u,u⟩+w2+ϕ)δ[∂η[π]r^2]+cpΠδΘr^2+(∂η[π]r^2−∂η[p])δϕdAdη.
The only problem term in this equation is in the differential for δϕ
, namely ∂η[p]δϕ
. The lack of a r^2
correction in this term
dictates the modification of μ≡∂η[p](∂η[π])−1
so we rewrite
δH=∬⟨∂η[π]r^2u,δu⟩+∂η[π]r^2wδw+(2⟨u,u⟩+w2+ϕ)δ[∂η[π]r^2]+cpΠδΘr^2+∂η[π]r^2(1−∂η[p](∂η[π]r^2)−1)δϕdAdη=∬⟨∂η[π]r^2u,δu⟩+∂η[π]r^2wδw+(2⟨u,u⟩+w2+ϕ)δ[∂η[π]r^2]+cpΠδΘr^2+∂η[π]r^2(1−∂η[p](∂η[π]r^2)−1)δϕdAdη.
which dictates that μr^2=r^2∂η[p](∂η[π]r^2)−1
.
δuδHδwδHδϕδHδΘδHδ∂η[π]δH=∂η[π]u=∂η[π]w=∂η[π]r^2(1−μr^2)=cpΠ=2u2+w2+ϕ
which illustrates that the integration by parts trick works
Let us check if this is consistent by returning to the implicit hypsometric equation that defines our EOS.
Returning to EOS
⟹⟹⟹⟹∂ηϕ=−Rd∂η[π]r^2θvpΠ∫∂η[ϕ]dη=−Rd∫∂η[π]r^2θvpΠdηΔϕ=−Rd∫∂η[π]r^2θvpΠdηΔϕ=−Rd∫pT∂η[π]r^2dηΔϕ=−Rd∫pTdπ
and so we see that this holds if ∫[⋅]∂η[π]r^2dη=∫[⋅]r^2∂η[π]dη=∫[⋅]dπ
which is precisely what we constructed ∂η[π]r^2
to satisfy!
The integration by parts:
∫∫pr^2δ[∂η[ϕ]]+BC+r^2∂η[p]δϕdηdA=∫[pr^2ϕ]η=1η=0+BC+∫−∂η[pr^2δϕ]+r^2∂η[p]δϕdηdA
and so
^