Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues with ERA5 specific humidity and surface pressure computation #171

Open
navidcy opened this issue Apr 30, 2024 · 1 comment
Open
Assignees
Labels
documentation 📔 Improvements or additions to documentation

Comments

@navidcy
Copy link
Contributor

navidcy commented Apr 30, 2024

At https://regional-mom6.readthedocs.io/en/latest/demo_notebooks/reanalysis-forced.html#Step-7:-Set-up-ERA5-forcing:
there are some issues:

  1. You should also say you are using the Antoine equation for vapour pressure as a function of temperature.

  2. q = 0.622 * RH * P_sat / P = 0.622 * P_vap / P

  3. Where does the 0.001 come from?

  4. The T in the first equation should really be T_d.

found by @CallumJShakespeare

@navidcy navidcy added the documentation 📔 Improvements or additions to documentation label Apr 30, 2024
@navidcy
Copy link
Contributor Author

navidcy commented Apr 30, 2024

We need to clear up this code here

## Calculate specific humidity from dewpoint temperature
dewpoint = 8.07131 - 1730.63 / (
233.426 + rawdata["2d"]["d2m"] - 273.15
)
humidity = (
(0.622 / rawdata["sp"]["sp"]) * (10**dewpoint) * 101325 / 760
)
q = xr.Dataset(data_vars={"q": humidity})

It might be cleaner if we convert this into a function.
But definitely we should avoid hardcoding numbers in, but rather define variables with values so that it's obvious what's happening here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation 📔 Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants