You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
Working through a derivation: $q_{vs}=\frac{m_v}{m_d} = \frac{N_v M_v}{N_d M_d}=\frac{M_v}{M_d} \left(\frac{P_v V}{R^* T} / \frac{P_d V}{R^* T}\right) = \frac{M_v}{M_d} \frac{P_v}{P_d} = \frac{M_v}{M_d} \frac{P_v}{P_{tot} - P_v}$
I don't see that term either. It looks like the complement of the mass ratio of water to dry air, but the scenarios I can think of with such a quantity involve parcel-total quantities, rather than only partial pressure of water vapor. Given one could find the same kind of equation for, say, CFCs, which would have $1 - \frac{M_{CFC}}{M_d} < 0$, I am leery of that term.
The logs for that line say it was last changed when adding unit tests, though that commit just got rid of spaces.
Before that was a backport from NCL, which changed the name of the constant and added spaces. Before that was this commit creating wrf_user.f90, so prior history would be in the NCL repository here, which helpfully informs me that it got that code from wrf-python.
This file seems to have the old version, which this commit seems to have created. It looks like that would be the earliest version of wrf_rh/dcomputerh, added for version 4.2.0 alpha 34.
There's another file with the same formulation, but without the constants, present from the 2005 creation of that function, but it doesn't document why
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.
The text was updated successfully, but these errors were encountered: