Skip to content
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

Potential Cancellation Issue in deln_flux #323

Open
oelbert opened this issue Feb 27, 2024 · 2 comments
Open

Potential Cancellation Issue in deln_flux #323

oelbert opened this issue Feb 27, 2024 · 2 comments

Comments

@oelbert
Copy link

oelbert commented Feb 27, 2024

The d2 calculation near the end of deln_flux has discrepant results between 64- and 32-bit caulculations:

d2(i,j) = (fx2(i,j)-fx2(i+1,j)+fy2(i,j)-fy2(i,j+1))*gridstruct%rarea(i,j)

The GEOS team has resolved this by enforcing the order-of-operations in the flux addition/subtractions:
d2(i,j) = ((fx2(i,j)-fx2(i+1,j))+(fy2(i,j)-fy2(i,j+1)))*gridstruct%rarea(i,j)

This could be a good improvement to 32-bit runs

@lharris4
Copy link
Contributor

Hi, @oelbert. Thank you for identifying these changes from GMAO. Indeed this better representation of order-of-operations when computing flux divergences, which are done at a number of places in the solver, could go a long way to avoiding some of the cancellations that can occur.

They also define the Flux Capacitors mfx,mfy and accumulated Courant numbers cx and cy as double-precision in all runs, and a double-precision version of delp. I definitely think these are worth trying out.

@bensonr
Copy link
Contributor

bensonr commented Dec 6, 2024

@oelbert - is this part of the upcoming public release or does it still need to be done at some point?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants