From 20fe923d2a3682a08505006973fecf99480b9597 Mon Sep 17 00:00:00 2001 From: "William S. Moses" Date: Fri, 17 Jan 2025 16:53:59 -0500 Subject: [PATCH] More generalization of tuples --- .../fill_halo_regions_periodic.jl | 14 +++++++------- ...tatic_free_surface_tendency_kernel_functions.jl | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/BoundaryConditions/fill_halo_regions_periodic.jl b/src/BoundaryConditions/fill_halo_regions_periodic.jl index edd97528fa..b4523bb3ca 100644 --- a/src/BoundaryConditions/fill_halo_regions_periodic.jl +++ b/src/BoundaryConditions/fill_halo_regions_periodic.jl @@ -7,7 +7,7 @@ using KernelAbstractions.Extras.LoopInfo: @unroll @inline parent_size_and_offset(c, dim1, dim2, size, offset) = (parent(c), size, fix_halo_offsets.(offset, c.offsets[[dim1, dim2]])) @inline parent_size_and_offset(c, dim1, dim2, ::Symbol, offset) = (parent(c), size(parent(c))[[dim1, dim2]], (0, 0)) -@inline function parent_size_and_offset(c::NTuple, dim1, dim2, ::Symbol, offset) +@inline function parent_size_and_offset(c::Tuple, dim1, dim2, ::Symbol, offset) p = parent.(c) p_size = (minimum([size(t, dim1) for t in p]), minimum([size(t, dim2) for t in p])) return p, p_size, (0, 0) @@ -71,9 +71,9 @@ end #### Tupled periodic boundary condition #### -@kernel function fill_periodic_west_and_east_halo!(c::NTuple{M}, ::Val{H}, N) where {M, H} +@kernel function fill_periodic_west_and_east_halo!(c::Tuple, ::Val{H}, N) where {H} j, k = @index(Global, NTuple) - @unroll for n = 1:M + @unroll for n = 1:length(c) @unroll for i = 1:H @inbounds begin c[n][i, j, k] = c[n][N+i, j, k] # west @@ -83,9 +83,9 @@ end end end -@kernel function fill_periodic_south_and_north_halo!(c::NTuple{M}, ::Val{H}, N) where {M, H} +@kernel function fill_periodic_south_and_north_halo!(c::Tuple, ::Val{H}, N) where {H} i, k = @index(Global, NTuple) - @unroll for n = 1:M + @unroll for n = 1:length(c) @unroll for j = 1:H @inbounds begin c[n][i, j, k] = c[n][i, N+j, k] # south @@ -95,9 +95,9 @@ end end end -@kernel function fill_periodic_bottom_and_top_halo!(c::NTuple{M}, ::Val{H}, N) where {M, H} +@kernel function fill_periodic_bottom_and_top_halo!(c::Tuple, ::Val{H}, N) where {H} i, j = @index(Global, NTuple) - @unroll for n = 1:M + @unroll for n = 1:length(c) @unroll for k = 1:H @inbounds begin c[n][i, j, k] = c[n][i, j, N+k] # top diff --git a/src/Models/HydrostaticFreeSurfaceModels/hydrostatic_free_surface_tendency_kernel_functions.jl b/src/Models/HydrostaticFreeSurfaceModels/hydrostatic_free_surface_tendency_kernel_functions.jl index 28cb289e58..6455b39b8d 100644 --- a/src/Models/HydrostaticFreeSurfaceModels/hydrostatic_free_surface_tendency_kernel_functions.jl +++ b/src/Models/HydrostaticFreeSurfaceModels/hydrostatic_free_surface_tendency_kernel_functions.jl @@ -133,4 +133,4 @@ where `c = C[tracer_index]`. - immersed_∇_dot_qᶜ(i, j, k, grid, c, c_immersed_bc, closure, diffusivities, val_tracer_index, clock, model_fields) + biogeochemical_transition(i, j, k, grid, biogeochemistry, val_tracer_name, clock, model_fields) + forcing(i, j, k, grid, clock, model_fields)) -end \ No newline at end of file +end