-
Notifications
You must be signed in to change notification settings - Fork 173
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
Employ new halo-filling functions to update halos of prognostic variables on the cubed sphere #3570
base: main
Are you sure you want to change the base?
Conversation
Let me know when this is ready to review. Could you rename this to a title the just refers to what has happened in this PR? |
src/Fields/field.jl
Outdated
if size(data)[3] == 1 && first.(axes(data))[3] == grid.Nz + 1 # take ssh into consideration | ||
parent_indices = collect(parent_indices) | ||
parent_indices[3] = 1:1 | ||
end |
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.
this seems like a hack
also, what does ssh
refers to?
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, it is a temporary hack. I have outlined the issue arising in the absence of this hack in issue #3572 and created PR #3573 to resolve it. In the comment, ssh
refers to fields like ssh defined on the xy
plane, for which the parent array takes the z-halo into consideration even though it does not exist. In case of a field like the meridional average of a scalar quantity which is defined on the xz
plane, the same issue arises without an equivalent hack.
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.
OK. Well we won't merge a hack, right?
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.
No, we won't. It's only temporary. Once I fix it in PR #3573, we will import the solution (not hack) in this PR.
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.
OK, I see. This PR requires first #3573. Gotcha!
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 don't understand though why filling halos in z for free surface has a problem now; that was OK up to now, right? Why is #3573 holding us here? What I'm saying is that filling halos in the vertical shouldn't be any different that how we were doing it for other grids, right?
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.
@siddharthabishnu could you merge main
now that #3573 is merged? I think then this comment is not relevant any more and can be resolved ;)
@siddharthabishnu, what capability does this PR add? |
I just renamed the title to reflect the main functionality of this PR. The description outlines the additional features included in this PR. I will notify you when it is ready for review. |
@glwagner, this PR uses the new halo-filling functions to update halos for prognostic variables and refines the vorticity computation function on the cubed sphere. Additional features introduced in this PR are detailed in the description. |
Does this PR resolved #1584 (amongst other things)? |
2c6ee3f
to
18bf2d9
Compare
To compare the numerical solution of the Rossby-Haurwitz wave on the cubed sphere against an established benchmark, I chose the exact solution of the non-linear barotropic vorticity equation on the sphere (not the solution of the non-linear shallow water equations). This was achieved by replacing the initial phase Rλ with the time-dependent phase Rλ−νt in Equations (143)–(146) of Williamson et al., using the angular velocity ν given by Equation (142). The results at a resolution of 128x128 cells per panel are as follows:
I have attached panel-wise plots of the exact vorticity and the error of its numerical counterpart on the cubed sphere for the initial condition and after 500 time steps for reference. Given these circumstances, @navidcy and I are contemplating whether we should continue using the exact solution for verification in the test script or consider alternative verification methods, such as ensuring that the norm of the numerical solution of the Rossby-Haurwitz wave remains bounded within a specified range (as mentioned in the introduction to this PR). @glwagner, @simone-silvestri and @jm-c, let us know your thoughts. Exact initial vorticity Error in initial vorticity Exact vorticity after 500 time steps Error in vorticity after 500 time steps |
So to be honest @siddharthabishnu phrasing regarding me "contemplating" is a bit generous. Personally, I'm not sure whether this can be a dynamics test; something for which the error is just an order of magnitude less than the solution itself seems a bit loose for me... isn't there anything else we can use for a dynamics test? feels like we've been stuck on this for ages... we need a dynamics test to merge the cubed sphere code and move on I think. Perhaps there is no dynamics test we can have? The solution @siddharthabishnu uses above is not an exact solution of the HydrostaticFreeSurfaceModel equations... thus the big error. (It's an exact solution of the barotropic vorticity equation...) But whether this big of an error is expected or is it because the code has a bug I don't know and we've been in this vagueness for long. Anybody has any ideas? |
What if we have |
This PR incorporates significant updates from PR #3306. Most importantly, it employs the new halo-filling functions to update the halos of the prognostic variables. Additionally, it removes the replace_horizontal_vector_halos! function, enhances existing methods and function calls related to the cubed sphere grid, and refines the vorticity computation function. It also implements a new test to verify that the norm of the prognostic variables of the Rossby-Haurwitz wave remains almost constant as it propagates over the cubed sphere.