-
Notifications
You must be signed in to change notification settings - Fork 377
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
EAMxx: Adds aerosols heterogeneous freezing calculations in P3 microphysics #6947
base: master
Are you sure you want to change the base?
EAMxx: Adds aerosols heterogeneous freezing calculations in P3 microphysics #6947
Conversation
|
TODO:
|
Qucik comments:
|
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.
I have a few comments. Mostly: why are lots of unit tests now commented?
const auto mask = qc_incld > qsmall; | ||
switch (Iflag) { | ||
case 1: // cloud droplet immersion freezing | ||
ncheti_cnt.set(mask, frzimm*1.0e6/rho /* frzimm input is in [#/cm3] */ , Zero); |
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.
In all these "set" calls, how often do you expect the mask to be true/false? If the mask could often be ALL false (not sometimes, often), then you may consider using if statements, to avoid computing the packs for the true case for nothing (e.g., in the 1st line we have to compute frzimm*1e6/rho
regardless of whether we need it or not).
Note: this nano-opt makes sense only if you expect mask to be often false. I assume that's not the case, since qsmall is very small. But I don't know how qc_incld is computed, so maybe it's often 0?
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.
That is a good question. I am not sure about that. @kaizhangpnl or @AaronDonahue might know if mask
can often be false or not.
components/eamxx/src/physics/p3/tests/p3_nc_conservation_tests.cpp
Outdated
Show resolved
Hide resolved
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.
I have a few comments. Mostly: why are lots of unit tests now commented?
Requesting reviews from @hassanbeydoun and @brhillman because I know they're very curious about and interested in this part of the p3 code |
487f9b6
to
9be599e
Compare
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.
Looks good to me. If the tests pass, I support merging.
For the record, I will note that Balwinder, Luca, and I all agree we likely need to restructure the P3 code at some point in the future. This is outside the scope of the current PR, and we will think about finding the time to do it at a later point.
One of the public CI tests failed with (which I think is related to my comment here #6947 (comment))
to reproduce locally, this is the test:
|
Thanks, Naser! With your help, I have fixed this test. |
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.
@singhbalwinder, looks good to me from the standpoint of actual p3 runtime and eamxx runtime, so I am approving.
Note there are likely two sticky problems that someone (not me, because I already gave up, see link below) has to contend with one way or another:
- Your PR is making the p3 unit tests fail (these are p3_tests and p3_sk_tests, found under components/eamxx/p3/tests). The change seems to be in the comparison only, so something you did is changing those. That aligns with my prior experience, but I opted to close the PR rather than figuring it out. See link below.
- A slightly less sticky problem is resolving the MM2 test (it doesn't fail on the ci here because it didn't run at all) but if you test it locally, it will likely fail to build, try SMS_Ln3_P4.ne4pg2_oQU480.F2010-MMF2 on some machine with this PR and it will almost certainly fail to build). I can probably help you fix this if you want; I fixed these fails multiple times in the past.
I ran into this precise situation a few weeks ago and I decided not to bother with it. With even much simpler code edits. You can see the discussion here: #6938
@singhbalwinder I noticed that only p3_tests/p3_sk_tests fail, while all of the XYZ_baseline_cmp tests (where XYZ includes p3) pass. Is it b/c you hard code the new fields to the constant value they have in master? Also, it's interesting that the tests pass in the FPE build. The main diff between FPE and DBG is that the former uses a pack size of 1. That said, also CUDA builds use pack size of 1, and yet they fail. I would love it if you digged a bit, and see if there's an explanation for why all standalone tests fail but the FPE build passes. If fails and pass are expected, then great. If not, I'd hold off the merge. |
Update the MMF2 test fails with this annoying error:
This type of error is almost certainly to do with missing views in the diagnostic_inputs struct based on my prior experience, but I could be misremembering things. Could be fixed by populating these in the PAM interface. |
It could be a bad index of a subview. E.g., try to subview (ncols,nlevs) at first index ncols ... |
Both p3_tests/p3_sk_tests passed on my end on Compy (standalone build) and pm-gpu (using In p3 tests, I am using the Once I reproduce it locally, I should be able to debug it. I am currently looking at ways to reproduce it. |
The fails are to do with comparison, so you likely need to generate the baselines before this PR and then run the tests with compare enabled. Check out the test-all-scream options |
The heterogeneous freezing calculations from prognostics aerosols are
added to P3 microphysics. Setting
use_hetfrz_classnuc
totrue
will turn on these calculations. Otherwise, P3 will use the default
prescribed aerosol calculations.
[BFB] for EAM and EAMxx