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

Persist FractionalIndices with two separate arrays for i, j #371

Merged
merged 23 commits into from
Mar 6, 2025
Merged
Changes from 3 commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ using StaticArrays
using Thermodynamics
using SurfaceFluxes
using OffsetArrays
using CUDA: @allowscalar

using ..OceanSeaIceModels: reference_density,
heat_capacity,
Expand Down Expand Up @@ -81,11 +80,9 @@ function StateExchanger(ocean::Simulation, atmosphere)
Nx, Ny, Nz = size(exchange_grid)

# Make an array of FractionalIndices
kᴺ = size(exchange_grid, 3)
@allowscalar X1 = _node(1, 1, kᴺ + 1, exchange_grid, c, c, f)
i1 = FractionalIndices(X1, atmosphere.grid, c, c, nothing)
frac_indices_data = [deepcopy(i1) for i=1:Nx+2, j=1:Ny+2, k=1:1]
frac_indices = OffsetArray(frac_indices_data, -1, -1, 0)
FT = eltype(exchange_grid)
frac_indices = [FractionalIndices(one(FT), one(FT), one(FT)) for i=1:Nx+2, j=1:Ny+2, k=1:1]
frac_indices = OffsetArray(frac_indices, -1, -1, 0)
frac_indices = on_architecture(arch, frac_indices)

kernel_parameters = interface_kernel_parameters(exchange_grid)
Expand Down