<p>You should expect some negative values for <span class="math-container">$dp$</span> as that's the pressure difference from 1000 hPa. Another thing that are doing wrong is not scaling your <span class="math-container">$dp$</span> values to convert from pascals to hPa. The product of a density in kg/m<sup>3</sup>, acceleration in m/s<sup>2</sup>, and distance in meters is pressure in pascals. Divide by 100 to yield hPa.</p>
<p>It also appears that you have a sign problem. If the 1000 hPa geopotential height is positive (above sea level), the pressure at sea level should be higher than 1000 hPa, The opposite applies if the 1000 hPa geopotential height is negative.</p>
<p>From your first plot, it appears that the 1000 hPa geopotential height ranges from 125.2 meters below sea level (the deepest blue) to 274.8 meters above sea level (the deepest red). That 400 meter range means that is not quite correct to assume constant density, but it's close enough for a zeroth order approximation. The -125.2 meter geopotential height results in a sea level pressure of <a href="https://www.wolframalpha.com/input/?i=1000%2B%28%28-85.2-%28234.8-154.8%29%2F2%29*%281.25%29*%289.80665%29%29%2F100" rel="nofollow noreferrer">984.7 hPa</a> (assuming a constant density of <span class="math-container">$1.25\,\text{kg}/\text{m}^3$</span> and a constant gravitational acceleration of <span class="math-container">$9.80665\,\text{m}/\text{s}^2$</span>), while the +274.8 meter geopotential height results in a sea level pressure of <a href="https://www.wolframalpha.com/input/?i=1000%2B%28234.8%2B%28234.8-154.8%29%2F2%29*%281.25%29*%289.80665%29%2F100" rel="nofollow noreferrer">1033.7 hPa</a>.</p>

CC BY-SA 4.0
2021-10-16T18:52:35.483Z
@alberto_gar dp is change in pressure. You need to add 1000 hPa. It's that simple.
David Hammen
CC BY-SA 4.0
2021-10-16T18:53:46.367Z
So do I need to do some adjustment to this dp that I calculated in order to get the pressure at the surface? Thanks
meteo_96
CC BY-SA 4.0
2021-10-16T18:59:33.240Z
@alberto_gar dp is not pressure. It is change in pressure. In this case, it is change in pressure from 1000 hPa. So in this case you add 1000 hPa to your dp values to get the values at sea level. You do need to get the sign and the units correct. I provided Wolfram Alpha links in my latest edit that shows how I arrived at those numbers. Click on 984.7 hPa and 1033.7 hPa. The calculations are simple with those zeroth order simplifying assumptions.
David Hammen
CC BY-SA 4.0
2021-10-16T19:10:11.040Z
Thanks for the help!
meteo_96
CC BY-SA 4.0
2021-10-16T15:35:25.900Z
2021-10-16T18:50:21.010Z
2021-10-16T18:50:21.010Z
David Hammen
<p>For this, I am using python to plot and manipulate the data.</p>
<p>I am using reanalysis data in a netcdf format for this problem.</p>
<p>The data includes geopotential, for which I estimated the geopotential height through the following.</p>
<p>The netcdf variable for geopotential is as follows:</p>
<pre><code>&lt;class 'netCDF4._netCDF4.Variable'&gt;
int16 z(time, level, latitude, longitude)
    scale_factor: 0.9163788350787961
    add_offset: 28797.397523473086
    _FillValue: -32767
    missing_value: -32767
    units: m**2 s**-2
    long_name: Geopotential
    standard_name: geopotential
unlimited dimensions: 
current shape = (1, 2, 51, 101)
filling on
</code></pre>
<p>I then proceeded to extract this variable as follows, and calculate the geopotential height by dividing the variable geop by <span class="math-container">$g_{o} = 9.81$</span>. I then assigned this to a variable <span class="math-container">$Z$</span></p>
<pre><code>geop    = file.variables['z'][:]
g = 9.81
Z = geop/g # Geopotential Height
</code></pre>
<p>Now I plot this variable and the resulting plot is shown below (Units in geopotential meters):</p>
<p><a href="https://i.sstatic.net/cfQbs.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/cfQbs.png" alt=" " /></a></p>
<p>Through the hydrostatic equation <span class="math-container">$ dp = -\rho gdz $</span>, I tried directly calculating for p. by doing the following calculation:</p>
<pre><code>Zl=Z[0,level==1000,:,:]
rho = 1.25
g = 9.81
dp = -1 *(rho*g*Zl)  # employing the hydrostatic approximation
dp
</code></pre>
<p>Which gives me these values as seen below and in the plot:</p>
<pre><code>masked_array(
  data=[[[410.9842133392113, 307.8915943928496, 209.38086962187754, ...,
          187.6168722887587, 256.3452849196665, 289.56401769127297],
         [650.3881840035501, 506.05851747863653, 360.58337740988014,
          ..., 358.29243032218073, 456.8031550931528, 493.4583084963061],
         [901.2468901063676, 731.716805616793, 570.2050359341547, ...,
          334.23748590136256, 433.893684216182, 479.71262597012355],
         ...,
         [-1690.9597396227766, -1719.596578218989, -1756.251731622142,
          ..., -348.46474623233917, -248.80854791751972,
          -521.4312513534605],
         [-1539.7572318347738, -1561.5212291678972, -1642.84985078114,
          ..., -371.37421710930994, -324.409801811521,
          -394.2836879862807],
         [-1335.8629410297408, -1397.7185123975598, -1535.1753376593797,
          ..., -397.7201086178229, -355.3375874954281,
          -338.15548433770346]]],
  mask=[[[False, False, False, ..., False, False, False],
         [False, False, False, ..., False, False, False],
         [False, False, False, ..., False, False, False],
         ...,
         [False, False, False, ..., False, False, False],
         [False, False, False, ..., False, False, False],
         [False, False, False, ..., False, False, False]]],
  fill_value=1e+20)
</code></pre>
<p><a href="https://i.sstatic.net/IHpA9.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/IHpA9.png" alt="enter image description here" /></a></p>
<p>but it gives me negative values.</p>
<p>How do I exactly convert geopotential height to pressure at surface?</p>

CC BY-SA 4.0
2021-10-16T12:53:22.000Z
You didn't show enough detail in how you used the assumption of hydrostatic equilibrium. You should get values close to 1000 hPa. By "close to" I mean within 30 hPa or so of 1000 hPa. By the way, that assumption of hydrostatic equilibrium is not exactly valid (that plot shows an atmosphere that is slightly out of hydrostatic equilibrium) but it's close enough.
David Hammen
CC BY-SA 4.0
2021-10-16T12:53:52.600Z
I have voted to close because of the lack of detail.
David Hammen
CC BY-SA 4.0
2021-10-16T15:20:35.263Z
Hi. I've edited and added more details on how I used the hydrostatic assumption. Yes, it should just an approximate to the pressure at the surface, but I still get negative values. Any help on where I am going wrong?
meteo_96
CC BY-SA 4.0
2021-10-16T15:29:40.697Z
I've retracted my vote to close given the added details.
David Hammen
<meteorology>
How to calculate sea level pressure from geopotential height?
meteo_96
# How to calculate sea level pressure from geopotential height?

(Asked by: username_0 on 2021-10-15)

For this, I am using python to plot and manipulate the data.

I am using reanalysis data in a netcdf format for this problem.

The data includes geopotential, for which I estimated the geopotential height through the following.

The netcdf variable for geopotential is as follows:

```
<class 'netCDF4._netCDF4.Variable'>
int16 z(time, level, latitude, longitude)
    scale_factor: 0.9163788350787961
    add_offset: 28797.397523473086
    _FillValue: -32767
    missing_value: -32767
    units: m**2 s**-2
    long_name: Geopotential
    standard_name: geopotential
unlimited dimensions: 
current shape = (1, 2, 51, 101)
filling on

```

I then proceeded to extract this variable as follows, and calculate the geopotential height by dividing the variable geop by $g\_{o} = 9.81$. I then assigned this to a variable $Z$

```
geop    = file.variables['z'][:]
g = 9.81
Z = geop/g # Geopotential Height

```

Now I plot this variable and the resulting plot is shown below (Units in geopotential meters):

[![ ](https://i.sstatic.net/cfQbs.png)](https://i.sstatic.net/cfQbs.png)

Through the hydrostatic equation $ dp = -\rho gdz $, I tried directly calculating for p. by doing the following calculation:

```
Zl=Z[0,level==1000,:,:]
rho = 1.25
g = 9.81
dp = -1 *(rho*g*Zl)  # employing the hydrostatic approximation
dp

```

Which gives me these values as seen below and in the plot:

```
masked_array(
  data=[[[410.9842133392113, 307.8915943928496, 209.38086962187754, ...,
          187.6168722887587, 256.3452849196665, 289.56401769127297],
         [650.3881840035501, 506.05851747863653, 360.58337740988014,
          ..., 358.29243032218073, 456.8031550931528, 493.4583084963061],
         [901.2468901063676, 731.716805616793, 570.2050359341547, ...,
          334.23748590136256, 433.893684216182, 479.71262597012355],
         ...,
         [-1690.9597396227766, -1719.596578218989, -1756.251731622142,
          ..., -348.46474623233917, -248.80854791751972,
          -521.4312513534605],
         [-1539.7572318347738, -1561.5212291678972, -1642.84985078114,
          ..., -371.37421710930994, -324.409801811521,
          -394.2836879862807],
         [-1335.8629410297408, -1397.7185123975598, -1535.1753376593797,
          ..., -397.7201086178229, -355.3375874954281,
          -338.15548433770346]]],
  mask=[[[False, False, False, ..., False, False, False],
         [False, False, False, ..., False, False, False],
         [False, False, False, ..., False, False, False],
         ...,
         [False, False, False, ..., False, False, False],
         [False, False, False, ..., False, False, False],
         [False, False, False, ..., False, False, False]]],
  fill_value=1e+20)

```

[![enter image description here](https://i.sstatic.net/IHpA9.png)](https://i.sstatic.net/IHpA9.png)

but it gives me negative values.

How do I exactly convert geopotential height to pressure at surface?

**Tags:** meteorology

> **Comments:**
> **username_1**: You didn't show enough detail in how you used the assumption of hydrostatic equilibrium. You should get values close to 1000 hPa. By "close to" I mean within 30 hPa or so of 1000 hPa. By the way, that assumption of hydrostatic equilibrium is not exactly valid (that plot shows an atmosphere that is slightly out of hydrostatic equilibrium) but it's close enough.  
> **username_1**: I have voted to close because of the lack of detail.  
> **username_0**: Hi. I've edited and added more details on how I used the hydrostatic assumption. Yes, it should just an approximate to the pressure at the surface, but I still get negative values. Any help on where I am going wrong?  
> **username_1**: I've retracted my vote to close given the added details.  

---

## 1 answers

### Answer by username_1 on 2021-10-16. Score: 2 | Accepted answer

You should expect some negative values for $dp$ as that's the pressure difference from 1000 hPa. Another thing that are doing wrong is not scaling your $dp$ values to convert from pascals to hPa. The product of a density in kg/m3, acceleration in m/s2, and distance in meters is pressure in pascals. Divide by 100 to yield hPa.

It also appears that you have a sign problem. If the 1000 hPa geopotential height is positive (above sea level), the pressure at sea level should be higher than 1000 hPa, The opposite applies if the 1000 hPa geopotential height is negative.

From your first plot, it appears that the 1000 hPa geopotential height ranges from 125.2 meters below sea level (the deepest blue) to 274.8 meters above sea level (the deepest red). That 400 meter range means that is not quite correct to assume constant density, but it's close enough for a zeroth order approximation. The -125.2 meter geopotential height results in a sea level pressure of [984.7 hPa](https://www.wolframalpha.com/input/?i=1000%2B%28%28-85.2-%28234.8-154.8%29%2F2%29*%281.25%29*%289.80665%29%29%2F100) (assuming a constant density of $1.25\,\text{kg}/\text{m}^3$ and a constant gravitational acceleration of $9.80665\,\text{m}/\text{s}^2$), while the +274.8 meter geopotential height results in a sea level pressure of [1033.7 hPa](https://www.wolframalpha.com/input/?i=1000%2B%28234.8%2B%28234.8-154.8%29%2F2%29*%281.25%29*%289.80665%29%2F100).

> **Comments:**
> **username_1**: @alberto_gar dp is change in pressure. You need to add 1000 hPa. It's that simple.  
> **username_0**: So do I need to do some adjustment to this dp that I calculated in order to get the pressure at the surface? Thanks  
> **username_1**: @alberto_gar dp is not pressure. It is change in pressure. In this case, it is change in pressure from 1000 hPa. So in this case you add 1000 hPa to your dp values to get the values at sea level. You do need to get the sign and the units correct. I provided Wolfram Alpha links in my latest edit that shows how I arrived at those numbers. Click on 984.7 hPa and 1033.7 hPa. The calculations are simple with those zeroth order simplifying assumptions.  
> **username_0**: Thanks for the help!  

---

