-
Notifications
You must be signed in to change notification settings - Fork 118
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
allows mix precision compilation #360
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.
Looks good to me.
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.
lgtm
I just caution you to check the area of the Earth quantity output during dycore initialization to ensure it doesn't have errors with the OVERLOAD_R4 option and these code modifications.
Thanks for the hint, I will keep that in mind, so far I haven't seen any output error. Please let me know if there is anything specific to keep an eye on. |
If you are getting identical results from before and after the changes, then I'm sure it's all good. You can do a visual check by looking at the Earth area in the stdout and compare it to known values. |
@JosephMouallem you should also check the area of the earth in the stdout, especially for both lower- and higher-resolution grids. It has a comparison to the exact value that is very useful for this purpose. |
For low resolution 200km cases, the stdout values are exactly the same between the computed global areas (but still slightly different compared to the ideal global area) I just tried XSHiELD and saw a small difference in the values between 32bit and 64bit: We can assume this is an acceptable difference? |
@JosephMouallem This is a good result. For reference here is the area values for my original 32-bit X-SHiELD run:
The difference with your 32 bit run is only at the 12th decimal point, and is smaller than the difference in the computed and true global area in the 64-bit run (9th decimal point). The small differences come in from rounding errors in the computation of the angles between grid lengths. Since in FV3 grid cells are bounded by great circles/geodesics, if we know the interior angles and the radius, we can compute the area of the cell exactly. This differs from many dynamical cores that assume grid cells are flat plates, which introduces significant error in computing areas. More fun with differential geometry: Wikipedia: Spherical excess and Geodesic polygon |
Allows a mixed precision compilation of the dycore. FV3 can be compiled in 32bit and works with other components compiled in 64bit. This depends on:
NOAA-GFDL/SHiELD_physics#56
NOAA-GFDL/SHiELD_build#46
Inspired from #357