-
Notifications
You must be signed in to change notification settings - Fork 196
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
PolarBoundaryCondition
for tracer + views for AbstractOperations
#3953
base: main
Are you sure you want to change the base?
Conversation
PolarBoundaryCondition
for tracer Fields on LatitudeLongitudeGrid
s that reach the poles
…gans.jl into ss/top-boundary-condition
|
||
if φmin == - 90 | ||
_, LY, LZ = loc | ||
field = Field{Nothing, LY, LZ}(grid; indices = (:, 1, :)) |
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 does seem 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.
But should LY
actually be flipped? Eg this is Face for a Center location. (It may not matter)
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.
Probably you are right. I have found out unfortunately that reductions on windowed fields do not work. I ll try to make it work so here we can do
mean!(windowed_field, full_field)
…gans.jl into ss/top-boundary-condition
PolarBoundaryCondition
for tracer Fields on LatitudeLongitudeGrid
s that reach the polesPolarBoundaryCondition
for tracer + Reductions on reduced windowed field
PolarBoundaryCondition
for tracer + Reductions on reduced windowed fieldPolarBoundaryCondition
for tracer + views for AbstractOperations
In the end, using fields in boundary conditions is a bit too complicated because fields are defined after boundary conditions making it a bit of a mess. For this reason, I just wrote a very simple averaging kernel in the polar boundary conditions file. The improvements for reductions on windowed fields still stand though, so I have added some tests also to make sure that reductions on windowed fields work. |
A
FluxBoundaryCondition
is not correct on a latitude-longitude grid that covers the whole earth, i.e. whenlatitude = (-90, 90)
.The actual boundary condition (for tracers) should be a value boundary condition that holds the average of the last / first row.
Vectors are a little more complicated because we need to account for the frame of reference.
(We can probably do that in a new PR)
This is required mainly for input data define on a
LatitudeLongitudeGrid
that needs interpolation on full spherical grids for global ocean simulations.As part of this PR, to allow reducing on the last / first row of the
LatitudeLongitudeGrid
I needed to implement reductions on windowed reduced fields, which required extendingviews
forAbstractOperations
The implementation is not final since it does not account for the case of an array (non-field) being part of an
AbstractOperation
. But I guess we can tackle that case when we encounter it.