Energy diagnostics for CESM

According to Taylor et al. (2020), the continuum energy budget is defined as K+I+PK12πsv2IcpΘvΠπs1ρp+πtopϕtopcpΘvΠ+r^2pϕs+πtopϕtopPπsϕ \begin{align*} K + I + P \\ K \equiv \frac{1}{2} \pder{\pi}{s} \boldsymbol{v}^2 \\ I \equiv c_p \Theta_v \Pi - \pder{\pi}{s}\frac{1}{\rho}p + \pi_{\textrm{top}} \phi_{\textrm{top}} \equiv c_p \Theta_v \Pi + \hat{r}^2 p \pder{\phi}{s} + \pi_{\textrm{top}} \phi_{\textrm{top}} \\ P \equiv \pder{\pi}{s} \phi \end{align*}

Using the equation of state ϕs=r^2RdΘvΠp    πs=ϕsρr^2\pder{\phi}{s} = - \hat{r}^{-2} R_d \Theta_v \frac{\Pi}{p} \implies \pder{\pi}{s} = -\pder{\phi}{s} \rho \hat{r}^2 , we can write (ρ1πs)p=pr^2ϕs-\left(\rho^{-1}\pder{\pi}{s} \right) p = p\hat{r}^2 \pder{\phi}{s} pr^2ϕsdsπtopϕtop=[pr^2ϕ]bottomtops(r^2p)ϕds+πtopϕtop=psr^s2ϕsπtopr^top2r^top2ϕtops(r^2p)ϕds+πtopϕtop=psr^s2ϕss(r^2p)ϕds \begin{align*} \int p \hat{r}^2 \pder{\phi}{s} \intd{s} - \pi_{\textrm{top}} \phi_{\textrm{top}} &= \left[ p \hat{r}^2 \phi \right]_{\textrm{bottom}}^\textrm{top} - \int \pder{}{s} \left( \hat{r}^2 p \right) \phi \intd{s} + \pi_{top} \phi_{\textrm{top}} \\ &= p_s \hat{r}^2_s \phi_s - \frac{\pi_\textrm{top}}{\hat{r}^2_{\textrm{top}}} \hat{r}^2_{\textrm{top}} \phi_{\textrm{top}}- \int \pder{}{s} \left( \hat{r}^2 p \right) \phi \intd{s} + \pi_{\textrm{top}} \phi_{\textrm{top}} \\ &= p_s \hat{r}^2_s \phi_s - \int \pder{}{s} \left( \hat{r}^2 p \right) \phi \intd{s} \end{align*}

Note: bottom boundary does not disappear outside of time derivative!

Parent post: