-
Notifications
You must be signed in to change notification settings - Fork 238
Integrate cubed sphere functionality with halo filling and core infrastructure updates #4538
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
Changes from 3 commits
0a9ac05
485c9b2
7883b96
f7fbd9f
43a3299
184349c
c63b09f
c1ad7c8
234b0ca
dce1de7
d45843e
c3fdf26
12d3429
c3554fd
f44de9d
8ebdbba
c6735e9
f324fa7
c954455
4c4f53e
a452ee4
20c76b0
e451f35
6e702fe
2d4a938
cc88318
dbb9d07
6cf9e66
a5456f0
9c6f27b
2cbedfd
5cad195
6a92f67
b7dbf3e
5dc7e0f
eadc403
d81bc83
3d59c83
23f5a24
579e7f6
8b8c1b7
9711037
29b793c
5de105c
9dce5d5
0bb2f79
a76bb7b
f7a4521
832595d
a4b210e
77c871c
62ec81d
9f23ffd
6522112
aa40552
24e2632
b7135f2
45a39c3
ac630d6
d7a1a21
0b9548a
ceed343
a53bf07
a8cb979
3118f46
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -5,7 +5,7 @@ using Oceananigans.Architectures | |||||
using Oceananigans.Grids: with_halo, isrectilinear, halo_size | ||||||
using Oceananigans.Architectures: device | ||||||
|
||||||
import Oceananigans.Solvers: solve!, precondition! | ||||||
import Oceananigans.Solvers: solve!, precondition!, auxiliary_actions! | ||||||
import Oceananigans.Architectures: architecture | ||||||
|
||||||
""" | ||||||
|
@@ -50,7 +50,12 @@ function PCGImplicitFreeSurfaceSolver(grid::AbstractGrid, settings, gravitationa | |||||
vertically_integrated_lateral_areas = (xᶠᶜᶜ = ∫ᶻ_Axᶠᶜᶜ, yᶜᶠᶜ = ∫ᶻ_Ayᶜᶠᶜ) | ||||||
|
||||||
@apply_regionally compute_vertically_integrated_lateral_areas!(vertically_integrated_lateral_areas) | ||||||
fill_halo_regions!(vertically_integrated_lateral_areas) | ||||||
|
||||||
u = vertically_integrated_lateral_areas.xᶠᶜᶜ | ||||||
v = vertically_integrated_lateral_areas.yᶜᶠᶜ | ||||||
|
||||||
grid isa ConformalCubedSphereGrid ? fill_halo_regions!((u, v); signed=false) : | ||||||
fill_halo_regions!(vertically_integrated_lateral_areas) | ||||||
|
||||||
# Set some defaults | ||||||
settings = Dict{Symbol, Any}(settings) | ||||||
|
@@ -134,16 +139,16 @@ function implicit_free_surface_linear_operation!(L_ηⁿ⁺¹, ηⁿ⁺¹, ∫ | |||||
grid = L_ηⁿ⁺¹.grid | ||||||
arch = architecture(L_ηⁿ⁺¹) | ||||||
|
||||||
# Note: because of `fill_halo_regions!` below, we cannot use `PCGImplicitFreeSurface` on a | ||||||
# multi-region grid; `fill_halo_regions!` cannot be used within `@apply_regionally` | ||||||
fill_halo_regions!(ηⁿ⁺¹) | ||||||
|
||||||
launch!(arch, grid, :xy, _implicit_free_surface_linear_operation!, | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
L_ηⁿ⁺¹, grid, ηⁿ⁺¹, ∫ᶻ_Axᶠᶜᶜ, ∫ᶻ_Ayᶜᶠᶜ, g, Δt) | ||||||
|
||||||
return nothing | ||||||
end | ||||||
|
||||||
ImplicitFreeSurfaceOperation = typeof(implicit_free_surface_linear_operation!) | ||||||
|
||||||
auxiliary_actions!(::ImplicitFreeSurfaceOperation, L_ηⁿ⁺¹, ηⁿ⁺¹, args...) = fill_halo_regions!(ηⁿ⁺¹) | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is used in the solver module right? I am not sure this is very clear. Is there a way to maybe write it in a more streamlined way? Like, for example, by removing the @inline function mylinearoperation(...)
@apply_regionally my_actual_linear_operation(...)
fill_halo_regions!()
end There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please see the modifications here: f324fa7...4c4f53e. |
||||||
|
||||||
# Kernels that act on vertically integrated / surface quantities | ||||||
@inline ∫ᶻ_Ax_∂x_ηᶠᶜᶜ(i, j, k, grid, ∫ᶻ_Axᶠᶜᶜ, η) = @inbounds ∫ᶻ_Axᶠᶜᶜ[i, j, k] * ∂xᶠᶜᶠ(i, j, k, grid, η) | ||||||
@inline ∫ᶻ_Ay_∂y_ηᶜᶠᶜ(i, j, k, grid, ∫ᶻ_Ayᶜᶠᶜ, η) = @inbounds ∫ᶻ_Ayᶜᶠᶜ[i, j, k] * ∂yᶜᶠᶠ(i, j, k, grid, η) | ||||||
|
Uh oh!
There was an error while loading. Please reload this page.