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

Fill halos of conformal cubed sphere grid coordinates and metrics in a single pass #3488

Merged
merged 107 commits into from
Apr 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
107 commits
Select commit Hold shift + click to select a range
9940f77
Incorporated updates from PR #3306
siddharthabishnu Mar 1, 2024
51c10f9
Deleted operation_corner_points
siddharthabishnu Mar 4, 2024
b16cbda
Reverted the function update_state!
siddharthabishnu Mar 5, 2024
f0ec690
Deleted function second_pass_of_fill_halo_regions!
siddharthabishnu Mar 5, 2024
bf3ee83
Deleted commented-out code
siddharthabishnu Mar 5, 2024
1997329
Update src/MultiRegion/multi_region_cubed_sphere_grid.jl
navidcy Mar 5, 2024
5b9e23b
using before import
navidcy Mar 5, 2024
7e0134d
Merge branch 'main' into sb-ncc/cs-grid-metrics
navidcy Mar 5, 2024
ad2652f
revert minor change
navidcy Mar 5, 2024
c64dafc
revert minor change
navidcy Mar 5, 2024
9b7238a
revert minor change
navidcy Mar 5, 2024
47f3692
revert minor change
navidcy Mar 5, 2024
421d09b
revert minor change
navidcy Mar 5, 2024
eb59254
revert minor change
navidcy Mar 5, 2024
f15c47e
revert minor change
navidcy Mar 5, 2024
884f884
correct partition
simone-silvestri Mar 5, 2024
7a53b67
Merge branch 'main' into ss/correct-partitions
navidcy Mar 5, 2024
a335280
inothing -> isnothing
simone-silvestri Mar 6, 2024
db5ef62
Merge branch 'ss/correct-partitions' of github.com:CliMA/Oceananigans…
simone-silvestri Mar 6, 2024
fd831d3
Renamed field₁ to field_1 and field₂ to field_2
siddharthabishnu Mar 6, 2024
345b01f
Adjusted spacings
siddharthabishnu Mar 11, 2024
68cc097
Filled halos of paired quantities in one pass
siddharthabishnu Mar 11, 2024
f702cbe
Merge branch 'main' into ss/correct-partitions
simone-silvestri Mar 12, 2024
0d635b5
Filled halos of face-face quantities in one pass
siddharthabishnu Mar 12, 2024
b06e23a
Merge branch 'main' into sb-ncc/cs-grid-metrics
navidcy Mar 12, 2024
ff158dd
Merge branch 'main' into ss/correct-partitions
simone-silvestri Mar 12, 2024
73fd9c6
does not work on julia 1.9?
simone-silvestri Mar 12, 2024
d2d2449
hopefully last one?
simone-silvestri Mar 12, 2024
eaf318f
this was the last
simone-silvestri Mar 12, 2024
81b3339
other ones slipped
simone-silvestri Mar 12, 2024
efe7b82
other ones remaining
simone-silvestri Mar 12, 2024
0e46f69
Used function to fill ff halos of cs grid metrics
siddharthabishnu Mar 12, 2024
4eb8577
Merge branch 'sb-ncc/cs-grid-metrics' of github.com:CliMA/Oceananigan…
siddharthabishnu Mar 12, 2024
81aaa88
Merge remote-tracking branch 'origin/ss/correct-partitions' into cs-g…
siddharthabishnu Mar 12, 2024
3d5cb9f
Fixed bugs
siddharthabishnu Mar 12, 2024
91386b8
Resolved bug when using a single halo layer
siddharthabishnu Mar 12, 2024
17aafbb
Fixed bugs, refined script, compared metrics
siddharthabishnu Mar 13, 2024
3e2b447
Improved cubed sphere halo filling functions
siddharthabishnu Mar 15, 2024
a028c24
Rectified cubed sphere halo fills at ff locations
siddharthabishnu Mar 19, 2024
c43ed70
Computed difference in cs grid metrics with MITgcm
siddharthabishnu Mar 19, 2024
9156cee
Made minor modification suggested by Navid
siddharthabishnu Mar 19, 2024
2b29faa
Merge branch 'main' into sb-ncc/cs-grid-metrics
navidcy Mar 20, 2024
7e1dc1a
Made comments on comparsion of cubed sphere grids
siddharthabishnu Mar 20, 2024
93285e2
Merge branch 'sb-ncc/cs-grid-metrics' of github.com:CliMA/Oceananigan…
siddharthabishnu Mar 20, 2024
9a02991
add comparison with MITgcm grid
navidcy Mar 21, 2024
92a367a
Merge branch 'main' into sb-ncc/cs-grid-metrics
navidcy Mar 21, 2024
e5382d0
float_types and archs in dependencies
navidcy Mar 21, 2024
d096d39
test now use MITgcm grid with 4 halo points
navidcy Mar 21, 2024
ae8afa4
float_types and archs in dependencies
navidcy Mar 21, 2024
bfdbde6
Merge branch 'main' into sb-ncc/cs-grid-metrics
navidcy Mar 21, 2024
7362a2c
difference -> relative difference
navidcy Mar 24, 2024
bc181de
Merge branch 'main' into sb-ncc/cs-grid-metrics
navidcy Mar 25, 2024
cac2359
revert changes related to updated .jld2 file
navidcy Mar 25, 2024
fb4b2e7
empty line
navidcy Mar 25, 2024
c009072
revert changes related to updated .jld2 file
navidcy Mar 25, 2024
de02f51
Attempt to compare with online MITgcm grid
siddharthabishnu Mar 26, 2024
ff09e4e
use cubed_sphere_32_grid_with_4_halos.jld2 to compare w MITgcm grid
navidcy Mar 26, 2024
e24f824
Merge branch 'main' into sb-ncc/cs-grid-metrics
navidcy Mar 26, 2024
63dfa9e
cubed_sphere_32_grid_with_4_halos.jld2 is now on main
navidcy Mar 27, 2024
cf032c1
Move cs halo filling methods to src/MultiRegion
siddharthabishnu Mar 27, 2024
c1814b9
Compact code
siddharthabishnu Mar 27, 2024
4813141
Compute difference with MITgcm grid
siddharthabishnu Mar 27, 2024
1bf9119
Infer Locations from CubedSphereField arguments
siddharthabishnu Mar 28, 2024
15285c8
delete unused import
navidcy Mar 28, 2024
71cca76
no need to define functions that are defined in the same module
navidcy Mar 28, 2024
20f7cdc
CubedSphereField are always on a ConformalCubedSphereGrid
navidcy Mar 28, 2024
3300311
comma after space
navidcy Mar 28, 2024
3860a90
comma after space
navidcy Mar 28, 2024
55efc46
convert signed in kwarg + ensure fields is Tuple of CubedSphereFields
navidcy Mar 28, 2024
3da2e16
Merge branch 'main' into sb-ncc/cs-grid-metrics
navidcy Mar 28, 2024
8981ef7
fix assertion that grids are the same
navidcy Mar 28, 2024
44a4065
reorganize validation scripts
navidcy Mar 28, 2024
b5a93f7
Merge branch 'sb-ncc/cs-grid-metrics' of github.com:CliMA/Oceananigan…
navidcy Mar 28, 2024
0047b9a
add docstrings and cleanup
navidcy Mar 28, 2024
442b6a0
use find_neighboring_panels
navidcy Mar 28, 2024
aed48c1
combine cc and ff metrics/coords halo filling
navidcy Mar 28, 2024
af5ca2f
resolution -> size
navidcy Mar 28, 2024
cdb1297
more cleaning up
navidcy Mar 28, 2024
6c3d68f
Fill corner-adjacent halos only if signed = true
siddharthabishnu Mar 28, 2024
440ff01
test halo regions (not corners) of φ and λ
navidcy Mar 28, 2024
df5654f
Merge branch 'sb-ncc/cs-grid-metrics' of github.com:CliMA/Oceananigan…
navidcy Mar 28, 2024
81d0e79
Added comment
siddharthabishnu Mar 28, 2024
e901c30
simpler tests
navidcy Mar 28, 2024
b8b2c32
Use new halo-filling functions in test script
siddharthabishnu Mar 28, 2024
1663528
Use "view" to broadcast assignment operator
siddharthabishnu Mar 28, 2024
73e437b
Remove conditional from commit 6c3d68f
siddharthabishnu Apr 1, 2024
406ec63
Rearrange code
siddharthabishnu Apr 1, 2024
33a902f
Add comment on "missing" corners
siddharthabishnu Apr 1, 2024
ed44e3e
Revert lines containing "view" which fail tests
siddharthabishnu Apr 2, 2024
e33d2ff
Revert remaining lines containing "view"
siddharthabishnu Apr 2, 2024
a915085
Fix for broadcasting "=" operator with "view"
siddharthabishnu Apr 3, 2024
3cdd470
Use CUDA.@allowscalar
siddharthabishnu Apr 3, 2024
b1a7b0a
Adjust spacings
siddharthabishnu Apr 3, 2024
7f54c3c
Remove CUDA.@allowscalar
siddharthabishnu Apr 3, 2024
997afbf
Code simplification
siddharthabishnu Apr 3, 2024
c8cf9bb
fill_cubed_sphere_halo_regions! --> fill_halo_regions!
siddharthabishnu Apr 4, 2024
9cab960
Merge branch 'main' into sb-ncc/cs-grid-metrics
navidcy Apr 4, 2024
6b7657e
import before extending
navidcy Apr 4, 2024
f00cf72
clearer
navidcy Apr 4, 2024
ee38001
add comment for some corner coord points
navidcy Apr 4, 2024
cac0824
one k loops seems enough
navidcy Apr 4, 2024
23ee4fc
Merge branch 'main' into sb-ncc/cs-grid-metrics
navidcy Apr 4, 2024
2d6ae2e
simpler
navidcy Apr 4, 2024
b8388a2
fix docstring
navidcy Apr 4, 2024
7d2d15e
cleanup
navidcy Apr 4, 2024
b8d0e6a
remove duplicate import
navidcy Apr 4, 2024
8f79f4d
Slightly modify comment
siddharthabishnu Apr 4, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/AbstractOperations/conditional_operations.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using Oceananigans.Fields: OneField
using Oceananigans.Grids: architecture

import Oceananigans.Architectures: on_architecture
import Oceananigans.Fields: condition_operand, conditional_length, set!, compute_at!, indices

Expand Down
1 change: 1 addition & 0 deletions src/DistributedComputations/distributed_on_architecture.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using CUDA: CuArray
using OffsetArrays

import Oceananigans.Architectures: on_architecture
navidcy marked this conversation as resolved.
Show resolved Hide resolved

# We do not support switching from distributed and serial through `on_architecture`.
Expand Down
28 changes: 10 additions & 18 deletions src/Grids/orthogonal_spherical_shell_grid.jl
Original file line number Diff line number Diff line change
Expand Up @@ -774,28 +774,17 @@ conformal_cubed_sphere_panel(FT::DataType; kwargs...) = conformal_cubed_sphere_p

function load_and_offset_cubed_sphere_data(file, FT, arch, field_name, loc, topo, N, H)

ii = interior_indices(loc[1](), topo[1](), N[1])
jj = interior_indices(loc[2](), topo[2](), N[2])
data = on_architecture(arch, file[field_name])
data = convert.(FT, data)

interior_data = on_architecture(arch, file[field_name][ii, jj])

underlying_data = zeros(FT, arch,
total_length(loc[1](), topo[1](), N[1], H[1]),
total_length(loc[2](), topo[2](), N[2], H[2]))

ip = interior_parent_indices(loc[1](), topo[1](), N[1], H[1])
jp = interior_parent_indices(loc[2](), topo[2](), N[2], H[2])

view(underlying_data, ip, jp) .= interior_data

return offset_data(underlying_data, loc[1:2], topo[1:2], N[1:2], H[1:2])
return offset_data(data, loc[1:2], topo[1:2], N[1:2], H[1:2])
end

function conformal_cubed_sphere_panel(filepath::AbstractString, architecture = CPU(), FT = Float64;
panel, Nz, z,
topology = (Bounded, Bounded, Bounded),
topology = (FullyConnected, FullyConnected, Bounded),
radius = R_Earth,
halo = (1, 1, 1),
halo = (4, 4, 4),
rotation = nothing)

TX, TY, TZ = topology
Expand All @@ -815,9 +804,12 @@ function conformal_cubed_sphere_panel(filepath::AbstractString, architecture = C

## Read everything else from the file

file = jldopen(filepath, "r")["face$panel"]
file = jldopen(filepath, "r")["panel$panel"]

Nξ, Nη = size(file["λᶠᶠᵃ"]) .- 1
Nξ, Nη = size(file["λᶠᶠᵃ"])
Hξ, Hη = halo[1], halo[2]
Nξ -= 2Hξ
Nη -= 2Hη

N = (Nξ, Nη, Nz)
H = halo
Expand Down
navidcy marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,12 @@ using Oceananigans: UpdateStateCallsite
using Oceananigans.Biogeochemistry: update_biogeochemical_state!
using Oceananigans.TurbulenceClosures: compute_diffusivities!
using Oceananigans.ImmersedBoundaries: mask_immersed_field!, mask_immersed_field_xy!, inactive_node
using Oceananigans.Models: update_model_field_time_series!
using Oceananigans.Models.NonhydrostaticModels: update_hydrostatic_pressure!, p_kernel_parameters
using Oceananigans.Fields: replace_horizontal_vector_halos!

import Oceananigans.TimeSteppers: update_state!
import Oceananigans.Models.NonhydrostaticModels: compute_auxiliaries!

using Oceananigans.Models: update_model_field_time_series!
import Oceananigans.TimeSteppers: update_state!

compute_auxiliary_fields!(auxiliary_fields) = Tuple(compute!(a) for a in auxiliary_fields)

Expand All @@ -29,7 +28,6 @@ update_state!(model::HydrostaticFreeSurfaceModel, callbacks=[]; compute_tendenci
update_state!(model, model.grid, callbacks; compute_tendencies)

function update_state!(model::HydrostaticFreeSurfaceModel, grid, callbacks; compute_tendencies = true)
navidcy marked this conversation as resolved.
Show resolved Hide resolved

@apply_regionally mask_immersed_model_fields!(model, grid)

# Update possible FieldTimeSeries used in the model
Expand Down
1 change: 1 addition & 0 deletions src/MultiRegion/MultiRegion.jl
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ include("cubed_sphere_connectivity.jl")
include("multi_region_grid.jl")
include("multi_region_cubed_sphere_grid.jl")
include("cubed_sphere_field.jl")
include("cubed_sphere_boundary_conditions.jl")
include("multi_region_field.jl")
include("multi_region_abstract_operations.jl")
include("multi_region_boundary_conditions.jl")
Expand Down
Loading