NCAR / NCAR/wrf-python

A question about the equation used in wrf.rh

Open
#259 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
498
Forks
178
PR merge metrics
No merged PRs in 30d

Description

I recently converted mixing ratio (qv) to relative humidity (RH) by using wf-python and metpy. I compared the results from wrf.rh and metpy.calc.relative_humidity_from_mixing_ratio, and found that the RH from wrf-python is overall higher than the one from metpy.

Although the definitions of relative humidity are different between wrf-python (qv/qvs) and metpy (WMO standard), there is another significant difference between these two libraries. In both libraries, related functions compute the saturation vapor pressure using an empirical equation and then the saturation mixing ratio (qvs). However, in wrf_user.f90, there is another term (1.D0 - EPS) in subroutine DCOMPUTERH.
qvs = EPS*es/(0.01D0*pressure - (1.D0 - EPS)*es)
I am wondering whether this term should appear here.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with wrf_user.f90 and the DCOMPUTERH subroutine, then trace how wrf.rh exposes this calculation. Compare its qvs equation, including the (1.D0 - EPS) term, with metpy.calc.relative_humidity_from_mixing_ratio and the documented definitions. Done means determining whether the term is correct and documenting or correcting the discrepancy with a focused regression check.

Written by the indexing model from the issue text.

Assessment

Tech stack
fortran, python
Domain
data
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.