-
Notifications
You must be signed in to change notification settings - Fork 16
[WIP] Rayleigh Damping mixed precision fix #32
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: develop
Are you sure you want to change the base?
[WIP] Rayleigh Damping mixed precision fix #32
Conversation
Fix the implementation check for RayleighDamping and move it closer to the code
|
Poking @oelbert to show mixed precision in dycore in action |
pyFV3/stencils/ray_fast.py
Outdated
|
|
||
|
|
||
| SDAY = 86400.0 | ||
| SDAY = Float(86400.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.
If seconds per day is used frequently in the the ndsl, dycore, and physics, would it be better to define it in the ndsl constants section to ensure uniformity?
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.
Yes we probably should be moving that to constant
| def compute_rff_vals(pfull, dt, rf_cutoff, tau0, ptop): | ||
| rffvals = compute_rf_vals(pfull, dt, rf_cutoff, tau0, ptop) | ||
| rffvals = 1.0 / (1.0 + rffvals) | ||
| rffvals = f64(1.0) / (f64(1.0) + rffvals) |
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 an f32 run, aren't you only promoting the constants here and not rffvals?
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.
The upcaster will force in the rffvals to be f64. Alternatively you could, type hint rffvals e.g.
rffvals: f64 = ...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.
The upcaster follows basic C up-casting rules
Trigger damping increment calculation exactly once
gt4pybut only available on the experimental NASA branch