Hybrid Coordinates

Ok so the code assumes that Atopp0+dp3d=psv A_{\textrm{top}} p_0 + \sum \textrm{dp3d} = p_{sv} . Our initialization must satisfy this relation.

Philosophical interpretation of initialization: We initialize UMJS14 based on point-wise hydrostatic pressure at a particular position in the atmosphere. The calculated dp variable that comes out of initialization and is used to call, e.g., set_elem_state is actually dp3ddp3d due to how the η\eta coordinate behaves in the deep atmosphere.

The key to this problem is that r^2sgz=RdΠpΘv    (a+z0+z2a)2(g(zz0))=Q    (1+z0+z2a)2(g(zz0))=Q    g((1+z02a)+z2a)2(zz0)=Q \begin{align*} &\hat{r}^2 \partial_s g z = -R_d \frac{\Pi}{p} \Theta_v\\ \implies& \left(\frac{a + \frac{z_0 + z}{2}}{a}\right)^2 (g(z-z_0)) = Q \\ \implies& \left(1 + \frac{z_0 + z}{2a}\right)^2 (g(z-z_0)) = Q \\ \implies& g\left(\left(1 + \frac{z_0}{2a}\right) + \frac{z}{2a}\right)^2 (z-z_0) = Q \\ \end{align*} and the derivative is z[g((1+z02a)+z2a)2(zz0)]g(1a(zz0)((1+z02a)+z2a)+((1+z02a)+z2a)2) \begin{align*} \partial_z \left[g\left(\left(1 + \frac{z_0}{2a}\right) + \frac{z}{2a}\right)^2 (z-z_0) \right] \approx g\left(\frac{1}{a}(z-z_0)\left(\left(1 + \frac{z_0}{2a}\right) + \frac{z}{2a}\right) + \left(\left(1 + \frac{z_0}{2a}\right) + \frac{z}{2a}\right)^2 \right) \end{align*}

the integration by parts

pr^2δ[η[ϕ]]+BC+r^2η[p]δϕdηdA=[pr^2ϕ]η=1η=0+BC+η[pr^2]δϕ+r^2η[p]δϕdηdA=[pr^2ϕ]η=1η=0+BC+r^2η[p]δϕpη[r^2]δϕ+r^2η[p]δϕdηdA=[pr^2ϕ]η=1η=0+BCpη[r^2]δϕdηdA=[pr^2ϕ]η=1η=0+BCpη[r^2]δϕdηdA \begin{align*} \int \int p\hat{r}^2\delta[\partial_{\eta}[\phi]] + \textrm{BC} +\hat{r}^2 \partial_{\eta} [p] \delta \phi \intd{\eta} \intd{A} &= \int \left[p\hat{r}^2 \phi\right]_{\eta = 1}^{\eta = 0} + \textrm{BC} + \int -\partial_{\eta} [p\hat{r}^2]\delta \phi + \hat{r}^2 \partial_{\eta} [p] \delta \phi \intd{\eta} \intd{A}\\ &= \int \left[p\hat{r}^2 \phi\right]_{\eta = 1}^{\eta = 0} + \textrm{BC} + \int - \hat{r}^2 \partial_{\eta} [p] \delta \phi -p\partial_{\eta} [\hat{r}^2] \delta \phi + \hat{r}^2 \partial_{\eta} [p] \delta \phi \intd{\eta} \intd{A}\\ &= \int \left[p\hat{r}^2 \phi\right]_{\eta = 1}^{\eta = 0} + \textrm{BC} - \int p\partial_{\eta} [\hat{r}^2] \delta \phi \intd{\eta} \intd{A}\\ &= \int \left[p\hat{r}^2 \phi\right]_{\eta = 1}^{\eta = 0} + \textrm{BC} - \int p\partial_{\eta} [\hat{r}^2] \delta \phi \intd{\eta} \intd{A} \end{align*} If we don't expand out and use the typical boundary conditions, then δHδϕ=η[π](1η[r^2p]η[π]) \fder{\mathcal{H}}{\phi} = \partial_{\eta} [\pi] \left(1-\frac{\partial_{\eta}[\hat{r}^2 p]}{\partial_{\eta} [\pi]}\right)

Idea: μ\mu is used to calculate the vertical pressure gradient force, i.e. 1ρpk=g1ρηpηϕ=gμ\frac{1}{\rho} \nabla p \cdot \mathbf{k} = g\frac{1}{\rho} \frac{\partial_{\eta} p}{\partial_{\eta} \phi} = - g \mu . In our new, fucked coordinates, the area of the upper surface is larger than the lower surface. Therefore in calculating the pressure gradient (and associated quantities), the quantity μ\mu should take this into account.

Therefore, the choice BC=r^top2ptopϕtopBC = \hat{r}_{\textrm{top}}^2 p_\textrm{top}\phi_{\textrm{top}} gives pr^2δ[η[ϕ]]+r^2ptopϕtop+η[r^2p]δϕdηdA=(pr^2δϕ)bot(pr^2δϕ)top+r^2ptopϕtop+η[r^2p]δϕη[r^2p]δϕdηdA \begin{align*} \int \int p\hat{r}^2\delta[\partial_{\eta}[\phi]] + \hat{r}^2 p_\textrm{top}\phi_{\textrm{top}} + \partial_{\eta} [\hat{r}^2p] \delta \phi \intd{\eta} \intd{A} &= \int (p\hat{r}^2\delta\phi)_{\textrm{bot}} - (p\hat{r}^2\delta\phi)_{\textrm{top}} + \hat{r}^2 p_\textrm{top}\phi_{\textrm{top}} + \int \partial_{\eta} [\hat{r}^2 p] \delta \phi - \partial_{\eta} [\hat{r}^2p] \delta \phi \intd{\eta} \intd{A} \end{align*} and assuming that we have solved the boundary condition problems at the bottom such that [δϕ]bot=0 [\delta \phi]_{\textrm{bot}} = 0, then we get that the boundary condition and integration by parts perform essentially the same as in the shallow atmosphere case. In the new coordinates we must assume that μtop=1 \mu_{\textrm{top}}=1?

How to constrain the quantities

The recent paper by the MPAS folks makes a compelling case that our choice of upper boundary condition should retain an essentially isobaric character. IMPORTANT: this publication concedes conservation of energy near the boundary! The core takeaway from their paper is that we can use discrete hydrostatic balance to link pressure and height near the top boundary in a principled way, allowing for hybrids of pressure and height coordinates to be used.

However, we have a bit of a problem. It's immediately obvious that if we set r^2pϕ=C \hat{r}^2 p\phi = C as our boundary condition, we can either set pp or ϕ\phi, as r^\hat{r} is uniquely determined by ϕ\phi. The vertical velocity term prognostic equation takes the form t[w]+ur^sw+s˙s[w]u2rfc[u]+(1μ)g=0 \partial_t [w] + \frac{\mathbf{u}}{\hat{r}} \cdot \nabla_s w + \dot{s} \partial_{s}[w] - \frac{\mathbf{u}^2}{r} - f_c [u] + (1-\mu )g = 0 it would be highly undesirable if the top boundary initiated motion in a benign atmosphere (i.e. no wind, vertical hydrostatic balance). In such an atmosphere the prognostic equations reduce to a constraint μ=1 \mu = 1. Using the new definition of μ\mu, this constrains that sr^2p=sπ\partial_{s} \hat{r}^2 p = \partial_{s} \pi. The pressure is known at the midpoint below the top interface, and geopotential is prognostic at the upper boundary in pressure coordinates.

The only option for enforcing μ=1\mu=1 at the top boundary is changing how dp3d\textrm{dp3d} is treated near the top boundary. As this may wreak havoc on discrete averaging identities, it may actually be prefereable to allow a mismatch between hydrostatic and nonhydrostatic pressure at the top barrier. Either that or enforce

If we allow such a free surface, then ϕ\phi is allowed to evolve according to the prognostic equation. As such ptopp_{\textrm{top}} is determined to satisfy the boundary condition algebraically. However, this may violate the agreement between discrete EOS, which is r^2sϕ=RdΘvΠp\hat{r}^2 \partial_{s} \phi = -R_d \Theta_v \frac{\Pi}{p} and the requirement that midpoints lie halfway between interfaces.

Can we just change to a Neumann boundary condition at the top?

  • Phi at top interface is prognostic
  • Combination of discrete averaging and EOS uniquely extrapolates p to top level given phi and pdensity.

Things to note:

  • Sponge layers etc already strongly violate energy conservation at the top boundary!
  • Remapping violates energy conservation on interior of model for lagrangian vertical coordinate!
  • All things considered, math is quite clean and concise on interior of model.
  • Still want to avoid mass loss, as that's sacrosanct.
  • If we allow energy loss at top barrier, then we can just twiddle Θv\Theta_v to accomodate.

If we allow energy loss at top barrier, then we have a choice of either Neumann or Dirichlet boundary conditions at the top.

The plan for implementation:

  • μ=1\mu=1 condition determines pp at model top given prognostic ϕ\phi.
  • Slack is taken up by Θv\Theta_v. Unclear if Θv\Theta_v needs to be modified to match definition.

(r^top,i2ptop,ir^top,m2ptop, m)=dp3dtop,m2 \begin{align*} &(\hat{r}^2_{top, i} p_{\textrm{top,i}} - \hat{r}^2_{top, m}p_{\textrm{top, m}}) = \frac{\textrm{dp3d}_{top, m}}{2} \\ \end{align*}

The Deep Atmosphere Baroclinic Wave

So the constraining equation given in the paper is u2r2Ωucosϕ+g0a2r2+RTr[logp]=u2r2Ωucosϕ+g0a2r2+1ρz[p] \begin{align*} -\frac{u^2}{r} - 2\Omega u \cos\phi + g_0 \frac{a^2}{r^2} + RT \partial_r [\log p] = -\frac{u^2}{r} - 2\Omega u \cos\phi + g_0 \frac{a^2}{r^2} + \frac{1}{\rho} \partial_z [p] \end{align*}

This can only be satisfied if μ1\mu \neq 1. `

Initializing the atmosphere in general

Idea:

  • ppsp\equiv p_s and ϕϕs\phi \equiv \phi_s indicate that we should start initialization at the surface
  • Assume that we know physical pressure pp and geometric height zz.
  • The eta coordinates used for initialization give us dp3d\textrm{dp3d}.
  • The EOS states that if we know Δϕ\Delta \phi, then we can calculate p=RdTdp3dr^2Δϕ. p = -\frac{R_d T \cdot \textrm{dp3d}}{\hat{r}^2 \Delta \phi}.
  • Therefore a consistent initialization results from progressively rootfinding from the lowest model level to the top such that the EOS is satisfied.
  • Justifying that this is guaranteed to converge for an (approximately) hydrostatic atmosphere should be possible.
  • The above strategy can also be rephrased in terms of guaranteeing that 0zρgdz=dp3d\int_0^z \rho g \intd{z} = \textrm{dp3d}, which can be translated into a monotonicity constraint. When this is combined with Δϕ>0\Delta \phi > 0, I expect this gives us the best strategy to show that this initialization strategy works.
  • Current progress:
    • (ongoing) determine why this fails for the DCMIP2016 test case. It seems to hold analytically, but is the code right?
    • Possible missing term in τint\tau_{\textrm{int}} terms
    • Write up these initialization findings into a document to share with Sandia.

Boundary conditions and initialization

We define our mass coordinate in terms of column-integrated mass MM. 1ηr2R02η[r]ρdη. \int_{1}^\eta \frac{r^2}{R_0^2} \partial_{\eta} [r] \rho \intd{\eta}..

For an atmosphere where w(0)0w(0) \equiv 0, the quasi hydrostatic equation is given by: u2r2Ωcos(φ)u+g(1μ)=0 -\frac{\mathbf{u}^2}{r} - 2\Omega \cos(\varphi) u + g(1-\mu) = 0 with μ=r^2pηπη=r^2pηρϕη=continuumr^21ρpϕ\mu = \hat{r}^2 \frac{\pder{p}{\eta}}{\pder{\pi}{\eta}} = \hat{r}^2 \frac{\pder{p}{\eta}}{-\rho\pder{\phi}{\eta}} \stackrel{\textrm{continuum}}{=} -\hat{r}^2 \frac{1}{\rho} \pder{p}{\phi}

For a stationary atmosphere where u=v=0u=v=0, hydrostatic balance still translates into μ=1 \mu = 1.

Parent post: