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

Rewrote rh2qair to account for air pressure. Now true inverse of qair2rh #528

Merged
merged 1 commit into from
Jun 30, 2015

Conversation

ankurdesai
Copy link
Contributor

Still need to change units to be same for both functions and met2CF Ameriflux/CSV/ALMA and temporal downscaling need to pass pressure; two of these functions don’t read in pressure currently. qair2rh is called in met2model for BIOCRO/SIPNET and temporal downscaling, so if units change, these will need to change too. refs #518

mdietze added a commit that referenced this pull request Jun 30, 2015
Rewrote rh2qair to account for air pressure. Now true inverse of qair2rh
@mdietze mdietze merged commit 6899cd7 into PecanProject:master Jun 30, 2015
@dlebauer
Copy link
Member

@ankurdesai Per #518, shouldn't the following return the input value of qair (0.01)?

rh2qair(rh = qair2rh(qair = 0.01, temp = 20, press = 1013.25), T = 20 + 272.15, press = 1013.25)

@dlebauer
Copy link
Member

(note that I've started to draft a test for this in modules/data.atmosphere/tests/testthat/test.metutils.R@qair

@ankurdesai
Copy link
Contributor Author

It does if you do this:
rh2qair(rh = qair2rh(qair = 0.01, temp = 20, press = 1013.25), T = 20 + 273.15, press=101325)

(replace 1013.25 with 101325, replace 272.15 with 273.15)

0.01

rh2qair expects pressure in Pa, temperature in Kelvin. qair2rh expects pressure in hPa, temperature in C. Once the functions calls in various places are fixed, we can change these to be consistent.


Ankur R Desai, Associate Professor
University of Wisconsin - Madison, Atmospheric and Oceanic Sciences
http://flux.aos.wisc.edu http://flux.aos.wisc.edu/ desai@aos.wisc.edu mailto:desai@aos.wisc.edu
O: +1-608-520-0305 / M: +1-608-218-4208

On Jun 30, 2015, at 3:40 PM, David LeBauer notifications@github.com wrote:

@ankurdesai https://github.com/ankurdesai Per #518 #518, shouldn't the following return the input value of qair (0.01)?

rh2qair(rh = qair2rh(qair = 0.01, temp = 20, press = 1013.25), T = 20 + 272.15, press = 1013.25)

Reply to this email directly or view it on GitHub #528 (comment).

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

Successfully merging this pull request may close these issues.

3 participants