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

Consider caching saturation vapor pressure #119

Open
charleskawczynski opened this issue Jul 28, 2022 · 0 comments
Open

Consider caching saturation vapor pressure #119

charleskawczynski opened this issue Jul 28, 2022 · 0 comments

Comments

@charleskawczynski
Copy link
Member

charleskawczynski commented Jul 28, 2022

Computing saturation vapor pressure includes both calls to exp and ^ here, and based on looking at flame graphs in ClimaAtmos, it seems that this is actually pretty expensive.

bors bot added a commit that referenced this issue Aug 8, 2022
123: Use p_vap_sat func in q_vap_sat r=charleskawczynski a=charleskawczynski

This PR is a small refactoring step towards #119. This PR:
 - Slightly generalizes `saturation_vapor_pressure` to allow users to provide a phase partition
 - `saturation_vapor_pressure` is then called inside `q_vap_saturation`, whose contents were moved over

This mostly just deletes duplicate code. There is a bit of algebraic difference between the two, but I've confirmed that they're equivalent.

Co-authored-by: Charles Kawczynski <[email protected]>
bors bot added a commit that referenced this issue Aug 9, 2022
124: Reduce number of ^ calls r=charleskawczynski a=charleskawczynski

This PR
 - Adds a few methods that allow us to compute saturation vapor pressure ahead of time
 - Reduce the number of saturation vapor pressure calls using these new methods
 - a step towards #119

Co-authored-by: Charles Kawczynski <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant