# geopotential height derivations

1. geopotential height from geopotential

   symbol | description | unit | variable name
   --- | --- | --- | ---
   \(g_{0}\) | mean earth gravity | \(\frac{m}{s^2}\) |
   \(z_{g}\) | geopotential height | \(m\) | geopotential_height {:}
   \(\Phi\) | geopotential | \(\frac{m^2}{s^2}\) | geopotential {:}

   The pattern : for the dimensions can represent {vertical}, {latitude,longitude}, {latitude,longitude,vertical}, {time}, {time,vertical}, {time,latitude,longitude}, {time,latitude,longitude,vertical}, or no dimensions at all.

   \[z_{g} = \frac{\Phi}{g_{0}}\]

2. geopotential height from altitude

   symbol | description | unit | variable name
   --- | --- | --- | ---
   \(g_{0}\) | mean earth gravity | \(\frac{m}{s^2}\) |
   \(g\) | nominal gravity at sea level | \(\frac{m}{s^2}\) |
   \(R\) | local earth curvature radius | \(m\) |
   \(z\) | altitude | \(m\) | altitude {:}
   \(z_{g}\) | geopotential height | \(m\) | geopotential_height {:}
   \(\phi\) | latitude | \(degN\) | latitude {:}

   The pattern : for the dimensions can represent {vertical}, {time}, {time,vertical}, or no dimensions at all.

   \begin{eqnarray} g & = & 9.7803253359 \frac{1 + 0.00193185265241{\sin}^2(\frac{\pi}{180}\phi)} {\sqrt{1 - 0.00669437999013{\sin}^2(\frac{\pi}{180}\phi)}} \\ R & = & \frac{1}{\sqrt{\left(\frac{\cos(\frac{\pi}{180}\phi)}{6356752.0}\right)^2 + \left(\frac{\sin(\frac{\pi}{180}\phi)}{6378137.0}\right)^2}} \\ z_{g} & = & \frac{g}{g_{0}}\frac{Rz}{z + R} \end{eqnarray}

3. geopotential height from pressure

   symbol | description | unit | variable name
   --- | --- | --- | ---
   \(g_{0}\) | mean earth gravity | \(\frac{m}{s^2}\) |
   \(M_{air}(i)\) | molar mass of total air | \(\frac{g}{mol}\) | molar_mass {:,vertical}
   \(p(i)\) | pressure | \(Pa\) | pressure {:,vertical}
   \(p_{surf}\) | surface pressure | \(Pa\) | surface_pressure {:}
   \(R\) | universal gas constant | \(\frac{kg m^2}{K mol s^2}\) |
   \(T(i)\) | temperature | \(K\) | temperature {:,vertical}
   \(z_{g}(i)\) | geopotential height | \(m\) | geopotential_height {:,vertical}
   \(z_{g,surf}\) | surface geopotential height | \(m\) | surface_geopotential_height {:}

   The pattern : for the dimensions can represent {latitude,longitude}, {time}, {time,latitude,longitude}, or no dimensions at all.

   The surface pressure \(p_{surf}\) and surface height \(z_{g,surf}\) need to use the same definition of ‘surface’.

   The pressures \(p(i)\) are expected to be at higher levels than the surface pressure (i.e. lower values). This should normally be the case since even for pressure grids that start at the surface, \(p_{surf}\) should equal the lower pressure boundary \(p^{B}(1,1)\), whereas \(p(1)\) should then be between \(p^{B}(1,1)\) and \(p^{B}(1,2)\) (which is generally not equal to \(p^{B}(1,1)\)).

   \begin{eqnarray} z_{g}(1) & = & z_{g,surf} + 10^{3}\frac{T(1)}{M_{air}(1)}\frac{R}{g_{0}}\ln\left(\frac{p_{surf}}{p(i)}\right) \\ z_{g}(i) & = & z_{g}(i-1) + 10^{3}\frac{T(i-1)+T(i)}{M_{air}(i-1)+M_{air}(i)}\frac{R}{g_{0}}\ln\left(\frac{p(i-1)}{p(i)}\right), 1 < i \leq N \end{eqnarray}

4. surface geopotential height from surface geopotential

   symbol | description | unit | variable name
   --- | --- | --- | ---
   \(g_{0}\) | mean earth gravity | \(\frac{m}{s^2}\) |
   \(z_{g,surf}\) | surface geopotential height | \(m\) | surface_geopotential_height {:}
   \(\Phi_{surf}\) | surface geopotential | \(\frac{m^2}{s^2}\) | surface_geopotential {:}

   The pattern : for the dimensions can represent {latitude,longitude}, {time}, {time,latitude,longitude}, or no dimensions at all.

   \[z_{g,surf} = \frac{\Phi_{surf}}{g_{0}}\]

5. surface geopotential height from surface altitude

   symbol | description | unit | variable name
   --- | --- | --- | ---
   \(g_{0}\) | mean earth gravity | \(\frac{m}{s^2}\) |
   \(g\) | nominal gravity at sea level | \(\frac{m}{s^2}\) |
   \(R\) | local earth curvature radius | \(m\) |
   \(z_{surf}\) | surface altitude | \(m\) | surface_altitude {:}
   \(z_{g,surf}\) | surface geopotential height | \(m\) | surface_geopotential_height {:}
   \(\phi\) | latitude | \(degN\) | latitude {:}

   The pattern : for the dimensions can represent {latitude,longitude}, {time}, {time,latitude,longitude}, or no dimensions at all.

   \begin{eqnarray} g & = & 9.7803253359 \frac{1 + 0.00193185265241{\sin}^2(\frac{\pi}{180}\phi)} {\sqrt{1 - 0.00669437999013{\sin}^2(\frac{\pi}{180}\phi)}} \\ R & = & \frac{1}{\sqrt{\left(\frac{\cos(\frac{\pi}{180}\phi)}{6356752.0}\right)^2 + \left(\frac{\sin(\frac{\pi}{180}\phi)}{6378137.0}\right)^2}} \\ z_{g,surf} & = & \frac{g}{g_{0}}\frac{Rz_{surf}}{z_{surf} + R} \end{eqnarray}