-
Notifications
You must be signed in to change notification settings - Fork 415
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
Adds additional lapse rate options for moist_lapse #3224
base: main
Are you sure you want to change the base?
Conversation
Osamu Miyawaki seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
This has been a long wanted feature, and makes some progress towards achieving #461 (which I said I would work on as I need it for a personal project, and then... school happened... oof) Anyway, I'm not very available to help with this but consider me cheering from the sidelines for this PR! |
Thank you so much for your work on this! As shouted out above, there absolutely is a need for this, and we will gladly take your help and contributions to get us there. Before you spend a ton of additional time and work on this, we do have some considerations that have come up recently that might put this on pause:
We think your input could be incredibly valuable to both of these pieces moving forward, so please do stick around and consider dropping by one of our many community developer calls (#3166) in the near future. If the regularly scheduled call doesn't work for you, many of us can make ourselves available to meet to chat with you about this work and carrying it forward into performance and flexibility work described above! |
Thank you for filling me in on these developments, @dcamron. I'm happy to participate in future discussions on moist_lapse. Will part of refactoring and improving moist_lapse involve breaking changes to existing scripts that call moist_lapse? If so, I think it makes sense to put my pull request on pause because the current usage of moist_lapse will become obsolete. If not, is there a possibility for these changes to be incorporated on a faster timeline than what is planned for the overhaul of moist_lapse? The reason I ask is because we are hoping to make these new functionalities available to a broad audience as part of a review paper we are writing on tropical lapse rates. I think having these features included in the main branch (vs asking people to download my fork) will lead to a greater adoption of these tools. The paper is currently on schedule to be submitted by the end of the year. |
I chat with @dopplershift and we're totally on board with prioritizing getting this in for the broader community alongside this review paper. Our performance refactoring will mostly happen "under the hood", and we should be able to do the work to fit your formulations into it. We will need to settle for sure on the expanded Thanks for your work and communication. |
Sounds great! I can join the meeting this Thursday from 9-9:30 am MST (I have another meeting at 9:30). |
As a possible unit test case, see Table 4.2 in Emanuel, p. 133. In reproducing that table in the past there were some subtleties. The text doesn't say, but it uses variable latent heat of varporization (K Attached is the notebook that I used to do the reproduction in the past. It has some commentary at the bottom that might be helpful. |
Description Of Changes
This request adds lapse rate options for the moist_lapse function in MetPy. Currently moist_lapse calculates a moist adiabat by integrating the moist adiabatic lapse rate defined in the AMS glossary entry on adiabatic lapse rates. However, alternative definitions of the moist adiabatic lapse rate exist such as the pseudoadiabatic and reversible moist adiabatic lapse rate. Additionally, there are simple expressions for lapse rates that include the effect of convective entrainment (e.g., Singh and O'Gorman 2013, Romps 2014). This pull request adds these alternative lapse rates to the moist_lapse and parcel_profile functions.
The modifications are simple. I added 2 optional arguments to moist_lapse and parcel_profile: lapse_type and params. lapse_type is a string that specifies the lapse rate type and params is a dictionary that includes additional input parameters that are needed for the entraining lapse rates. I added alternative lapse rate definitions as dt_"lapse_type" and an if statement defines dt based on the chosen lapse_type. lapse_type defaults to the existing lapse rate definition so this change retains the previous behavior of moist_lapse and parcel_profile (i.e., they work just as before when lapse_type and params are not specified in the function call).
This pull request closes #434 and may also be useful for #3187.
Checklist
Example