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

BarotropicQG.energy can be better optimized #139

Closed
navidcy opened this issue Nov 20, 2020 · 0 comments · Fixed by #140
Closed

BarotropicQG.energy can be better optimized #139

navidcy opened this issue Nov 20, 2020 · 0 comments · Fixed by #140
Assignees

Comments

@navidcy
Copy link
Member

navidcy commented Nov 20, 2020

@liasiegelman and @wryoung pointed out that BarotropicQG.energy():

energy(sol, grid::AbstractGrid) = 0.5 * ( parsevalsum2(grid.kr .* grid.invKrsq .* sol, grid) + parsevalsum2(grid.l .* grid.invKrsq .* sol, grid) ) / (grid.Lx * grid.Ly)

can be computed simpler using vars.ψh.

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

Successfully merging a pull request may close this issue.

1 participant