-
Notifications
You must be signed in to change notification settings - Fork 8
Improvements in Graupel code #1033
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
base: muphys_bug_fix_staging
Are you sure you want to change the base?
Conversation
This reverts commit 337a402.
| x = (zeta * (flx_eff - flx_partial)) / ((1.0 + zeta * vt) * rho) # q update | ||
| p = (x * rho * vt + flx_partial) * 0.5 # flux |
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.
Can we swap the conditionals to avoid the code duplication? I wouldn't like to take this code, because it's clearly less readable.
What's the impact of this change?
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 reverted this change since I didn't see any significant speed up in the end with my changes
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 would like to refactor to the following. Do you think it has performance implications?
if current_level_activated:
vt = previous_level_q.vc * prefactor * power((rhox_prev + offset), exponent) if previous_level_q.activated else 0.0
x = (zeta * (flx_eff - flx_partial)) / ((1.0 + zeta * vt) * rho) # q update
p = (x * rho * vt + flx_partial) * 0.5 # flux
else:
x = q
p = 0.0
.../muphys/src/icon4py/model/atmosphere/subgrid_scale_physics/muphys/implementations/graupel.py
Outdated
Show resolved
Hide resolved
| kmin_i: fa.CellKField[bool], # ice minimum level | ||
| kmin_s: fa.CellKField[bool], # snow minimum level | ||
| kmin_g: fa.CellKField[bool], # graupel minimum level | ||
| # original_q: Q, |
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.
TODO
(moving kmins inside didn't make a difference?)
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.
It made the code much slower. I didn't look into why though
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 think it's slightly nicer like this anyway.
…nal_q and rename mask
|
Mandatory Tests Please make sure you run these tests via comment before you merge!
Optional Tests To run benchmarks you can use:
To run tests and benchmarks with the DaCe backend you can use:
To run test levels ignored by the default test suite (mostly simple datatest for static fields computations) you can use:
For more detailed information please look at CI in the EXCLAIM universe. |
if-statementto make sure that we only enter the update functions only if there is some mask or previous level activatedprecip_qx_level_updatefor betterif-statementhandlinggpu_maxnreg = 128option to the optimizer to improve the scan kernel performance