# Derivative of Exner function

In chapter 13.1 in 'Mesoscale Meteorology in Midlatitudes' (Markowski and Richardson,2011) they use a Bernoulli equation and the hydrostatic equation and a lot of assumptions to derive an equation that predicts the height $$z_{crit}$$ at where an air parcel with an initial height of $$z_0$$ that is advected towards a barrier loses all horizontal velocity. In their argumentation they state the following identity $$\dfrac{\partial p}{\partial z}(x,z) = \rho(x,z)c_p\theta(x,z)\dfrac{\partial \pi}{\partial z} (x,z)\tag{1}\label{wanted}$$ where $$\pi(x,z)=\left(\frac{p(x,z)}{p_0}\right)^{\frac{R}{c_p}}$$ is the Exner function with reference pressure $$p_0\in\mathbb{R}_+$$ constant, $$p$$ is pressure, $$\theta$$ is potential temperature, $$\rho$$ is density, and $$c_p$$ and $$R$$ are constant $$\in \mathbb{R}_+$$.

If I try to derive this equation by taking the partial derivative of $$\pi$$ with respect to height $$z$$ and use the identity $$\pi(x,z)=\frac{T(x,z)}{\theta(x,z)}$$ as can be found for example on wikipedia ($$T$$ is temperature), then I end up with (suppressing arguments $$x$$ and $$z$$ in favour of readability) $$\dfrac{\partial \pi}{\partial z} = \left(\frac{1}{p_0}\right)^{\frac{R}{c_p}}\dfrac{\partial}{\partial z}\exp\left(\frac{R}{c_p}\log(p)\right)=\left(\frac{1}{p_0}\right)^{\frac{R}{c_p}}* \frac{T}{\theta}*{\frac{R}{c_p}}*\frac{1}{p}*\dfrac{\partial p}{\partial z}.$$ Multiplying this by $$\rho c_p\theta$$ we get $$\rho c_p \theta \dfrac{\partial \pi}{\partial z} = \left(\frac{1}{p_0}\right)^{\frac{R}{c_p}} \frac{T R \rho}{p}*\dfrac{\partial p}{\partial z}$$ and because $$\frac{T R \rho}{p}=1$$ by the ideal gas law we end up with $$\rho c_p \theta \dfrac{\partial \pi}{\partial z} = \left(\frac{1}{p_0}\right)^{\frac{R}{c_p}}\dfrac{\partial p}{\partial z}.$$ This is almost what is stated in $$\eqref{wanted}$$, but not quite and I do not know how to get rid of the factor $$\left(\frac{1}{p_0}\right)^{\frac{R}{c_p}}$$ resp. do not see why it remains unmentioned in the textbook. Any help is appreciated.

$$\frac{\partial p}{\partial z}=-\rho g$$

So let's prove that $$-g=c_p\theta\frac{\partial \pi}{\partial z}$$

If we use the product rule, we observe $$-g=c_p(\frac{\partial \theta \pi}{\partial z}-\pi\frac{\partial \theta}{\partial z})$$

Since $$\pi=\frac{T}{\theta}$$, we can say that $$T=\pi\theta$$, which makes the above equation

$$-g=c_p(\frac{\partial T}{\partial z}-\pi\frac{\partial \theta}{\partial z})$$

It can be shown that $$\frac{\partial \theta}{\partial z}=\frac{\theta}{T}(\frac{\partial T}{\partial z}+\frac{g}{c_p})$$

which can be rewritten as $$\frac{\partial \theta}{\partial z}=\frac{1}{\pi}(\frac{\partial T}{\partial z}+\frac{g}{c_p})$$

Substituting this into my fourth equation $$-g=c_p(\frac{\partial T}{\partial z}-\frac{\pi}{\pi}(\frac{\partial T}{\partial z}+\frac{g}{c_p}))$$

From here I think you can figure it out.

Derivation for $$\frac{\partial \theta}{\partial z}$$ $$\theta=T(\frac{p_0}{p})^\frac{R_d}{c_p}$$ $$log(\theta)=log(T)+\frac{R_d}{c_p}(log(p_0)-log(p))$$ $$\frac{1}{\theta}\frac{\partial \theta}{\partial z}=\frac{1}{T}\frac{\partial T}{\partial z}-\frac{R_d}{c_p P}\frac{\partial P}{\partial z}$$ Utilizing hydrostatic equation $$\frac{1}{\theta}\frac{\partial \theta}{\partial z}=\frac{1}{T}\frac{\partial T}{\partial z}+\frac{R_d \rho g}{c_p P}$$ $$\frac{1}{\theta}\frac{\partial \theta}{\partial z}=\frac{1}{T}\frac{\partial T}{\partial z}+\frac{g}{c_p T}$$

$$\frac{\partial \theta}{\partial z}=\frac{\theta}{T}(\frac{\partial T}{\partial z}+\frac{g}{c_p })$$

• Thanks already! I do not see the error. Perhaps your formula for $\dfrac{\partial \theta}{\partial z}$ has a wrong sign in the parentheses? Can you point me to a source for said formula? – chriss Mar 26 '20 at 14:24
• For the formula for $\frac{\partial \theta}{\partial z}$? I'll add it in. – BarocliniCplusplus Mar 26 '20 at 14:32
• I think the mistake in that argumentation is indeed that $\dfrac{\partial \theta}{\partial z} = \frac{1}{\pi}\left(\dfrac{\partial T}{\partial z} + \frac{g}{c_p}\right)$. This can be derived from $\theta = \frac{T}{\pi}$ by product rule. I will add the steps later. Thank you! – chriss Mar 26 '20 at 14:37
• I solved my negative sign and updated my answer. You're welcome! – BarocliniCplusplus Mar 26 '20 at 14:42

After looking back into this I found my error to lie in the long equation

$$\dfrac{\partial \pi}{\partial z}=\left(\frac{1}{p_0}\right)^{\frac{R}{c_p}}\dfrac{\partial}{\partial z}\exp\left(\frac{R}{c_p}\log(p)\right)=\left(\frac{1}{p_0}\right)^{\frac{R}{c_p}}* \frac{T}{\theta}*{\frac{R}{c_p}}*\frac{1}{p}*\dfrac{\partial p}{\partial z}$$.

I was wrong, because $$\dfrac{\partial}{\partial z}\exp\left(\frac{R}{c_p}\log(p)\right)\neq \frac{T}{\theta}*{\frac{R}{c_p}}*\frac{1}{p}*\dfrac{\partial p}{\partial z},$$ but rather $$\dfrac{\partial}{\partial z}\exp\left(\frac{R}{c_p}\log(p)\right) =\left(p\right)^{\frac{R}{c_p}}*{\frac{R}{c_p}}*\frac{1}{p}*\dfrac{\partial p}{\partial z}.$$

The mistake is hidden in the identity $${\partial \over \partial z} \log (p) = {1\over p} {\partial p \over \partial z}$$.

This formula looks harmless and would be correct if $$p$$ was a real valued function of $$z$$, but $$p$$ is actually a pressure value and so $$\log(p)$$ is undefined. Instead, let $$p^*=p/p_0$$ be a non-dimensional pressure, and then: $${\partial \over \partial z} \log(p^*) = {1\over p^*} {\partial p^*\over \partial z} = {1\over p} {\partial p\over \partial z}.$$

Put this in your derivation and the spurious $$\left( 1 \over p_0 \right)^{R\over c_p}$$ will disappear.

• I do not think that $log(p)$ is undefined. After all, $p$ is a real value with physical dimension of pressure. See my answer, I pointed out my fault there. – chriss Mar 30 '20 at 6:46
• The log of the real value is defined, but the log of the dimension is not. For example, if $p = 1hPa = 100 Pa$, what do you think $log(p)$ is? But, yes, your correction above is dealing with the critical error (which I had missed). – M Juckes Mar 30 '20 at 11:15
• Ah yes, I get your meaning now. But then $\left(\frac{p}{p_0}\right)^{\frac{R}{c_p}}\neq p^{\frac{R}{c_p}}\cdot\left(\frac{1}{p_0}\right)^{\frac{R}{c_p}}$, because the rhs is undefined? – chriss Apr 1 '20 at 8:24
• Raising units to a power is defined, so that is not the same problem. I suppose you could say that your approach works at a mechanistic level (with the correction you've posted in your answer), so it is OK. I'm coming from a maths background and have had it drummed into me that functions and operations which have been carefully defined to work on real values should not be applied to dimensional quantities. – M Juckes Apr 1 '20 at 10:01
• But the standard defintion for the expression $a^b$ for $a>0, b \in \mathbb{R}$ is that $a^b=\exp(b\log(a))$, is it not? Hence my question in the previous comment. – chriss Apr 1 '20 at 11:33