-
Notifications
You must be signed in to change notification settings - Fork 19
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
Add 1-moment microphysics to prognostic EDMF #2858
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Just some minor comments for now. I will go through the rest later today or over the weekend.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a thought. Looking at the code, another way to calculate sources for one moment microphysics is to dispatch on compute_precipitation_sources!
by the sgs model, rather than saving the precipitation sources in edmf precomputed quantities. We can keep this for now and see what would be better as we add more options.
Sounds good. I agree, there should be a more elegant way to switch between 0M/1M w/wo EDMF(diagnostic and prognostic). And also w/wo quadratures in the future. I think with the promised advent of fusion I could write the whole 1-moment microphysics as a point-wise function that returns a tuple of numbers. Instead of having to use it inside But it is easier for me to write a better solution once we have something working. |
aa75505
to
49d1144
Compare
49d1144
to
0f2a202
Compare
This PR adds 1-moment microphysics scheme to prognostic EDMF.
Precipitation (rain and snow) is only computed as a grid mean quantity (i.e. we don't have updraft and environment precipitation variables). The sources to precipitation are computed as a sum of contributions from updrafts and the environment. The precipitation sinks (evaporation, melting, deposition/sublimation) are only computed on the grid mean.
My main priority was to only have one definition of
compute_precipitation_sources!
andcompute_precipitation_sinks!
. This is where I loop over all microphysics processes and I don't want to have multiple versions of it. That function returns 4 outputs (source terms to total water, rain, snow and energy) and I didn't know how to write it outside of acolidx
loop.Things I don't like about the code right now:
colidx
loopcompute_precipitation_sinks!
andcompute_precipitation_sources!
behave differently. Thesources
one zeroes out the cachedS
before adding to it. Thesinks
does not. This is because when used without EDMF, thesinks
are done after thesources
and add to the same cached values. This is clunky, but I didn't have a better idea and I did not want to add another 4 variables to the cacheAlso, can I re-use my tmp scalar between different updraft j-s and the environment?