|
9 | 9 | # because the boundary-normal index can vary (and array boundary conditions need to be
|
10 | 10 | # 3D in general).
|
11 | 11 |
|
12 |
| -@kernel function set_west_or_east_u!(u, offset, i_boundary, bc, grid, args) |
| 12 | +@kernel function set_west_or_east_u!(u, offset, i_boundary, bc, grid, args...) |
13 | 13 | j, k = @index(Global, NTuple)
|
14 | 14 | j′ = j + offset[1]
|
15 | 15 | k′ = k + offset[2]
|
16 | 16 | @inbounds u[i_boundary, j′, k′] = getbc(bc, j′, k′, grid, args...)
|
17 | 17 | end
|
18 | 18 |
|
19 |
| -@kernel function set_south_or_north_v!(v, offset, j_boundary, bc, grid, args) |
| 19 | +@kernel function set_south_or_north_v!(v, offset, j_boundary, bc, grid, args...) |
20 | 20 | i, k = @index(Global, NTuple)
|
21 | 21 | i′ = i + offset[1]
|
22 | 22 | k′ = k + offset[2]
|
23 | 23 | @inbounds v[i′, j_boundary, k′] = getbc(bc, i′, k′, grid, args...)
|
24 | 24 | end
|
25 | 25 |
|
26 |
| -@kernel function set_bottom_or_top_w!(w, offset, k_boundary, bc, grid, args) |
| 26 | +@kernel function set_bottom_or_top_w!(w, offset, k_boundary, bc, grid, args...) |
27 | 27 | i, j = @index(Global, NTuple)
|
28 | 28 | i′ = i + offset[1]
|
29 | 29 | j′ = j + offset[2]
|
30 | 30 | @inbounds w[i′, j′, k_boundary] = getbc(bc, i′, j′, grid, args...)
|
31 | 31 | end
|
32 | 32 |
|
33 |
| -@inline fill_west_halo!(u, bc::OBC, kernel_size, offset, loc, arch, dep, grid, args...; kwargs...) = launch!(arch, grid, kernel_size, set_west_or_east_u!, u, offset, 1, bc, grid, Tuple(args); dependencies=dep, kwargs...) |
34 |
| -@inline fill_east_halo!(u, bc::OBC, kernel_size, offset, loc, arch, dep, grid, args...; kwargs...) = launch!(arch, grid, kernel_size, set_west_or_east_u!, u, offset, grid.Nx + 1, bc, grid, Tuple(args); dependencies=dep, kwargs...) |
35 |
| -@inline fill_south_halo!(v, bc::OBC, kernel_size, offset, loc, arch, dep, grid, args...; kwargs...) = launch!(arch, grid, kernel_size, set_south_or_north_v!, v, offset, 1, bc, grid, Tuple(args); dependencies=dep, kwargs...) |
36 |
| -@inline fill_north_halo!(v, bc::OBC, kernel_size, offset, loc, arch, dep, grid, args...; kwargs...) = launch!(arch, grid, kernel_size, set_south_or_north_v!, v, offset, grid.Ny + 1, bc, grid, Tuple(args); dependencies=dep, kwargs...) |
37 |
| -@inline fill_bottom_halo!(w, bc::OBC, kernel_size, offset, loc, arch, dep, grid, args...; kwargs...) = launch!(arch, grid, kernel_size, set_bottom_or_top_w!, w, offset, 1, bc, grid, Tuple(args); dependencies=dep, kwargs...) |
38 |
| -@inline fill_top_halo!(w, bc::OBC, kernel_size, offset, loc, arch, dep, grid, args...; kwargs...) = launch!(arch, grid, kernel_size, set_bottom_or_top_w!, w, offset, grid.Nz + 1, bc, grid, Tuple(args); dependencies=dep, kwargs...) |
| 33 | +@inline fill_west_halo!(u, bc::OBC, kernel_size, offset, loc, arch, dep, grid, args...; kwargs...) = launch!(arch, grid, kernel_size, set_west_or_east_u!, u, offset, 1, bc, grid, args...; dependencies=dep, kwargs...) |
| 34 | +@inline fill_east_halo!(u, bc::OBC, kernel_size, offset, loc, arch, dep, grid, args...; kwargs...) = launch!(arch, grid, kernel_size, set_west_or_east_u!, u, offset, grid.Nx + 1, bc, grid, args...; dependencies=dep, kwargs...) |
| 35 | +@inline fill_south_halo!(v, bc::OBC, kernel_size, offset, loc, arch, dep, grid, args...; kwargs...) = launch!(arch, grid, kernel_size, set_south_or_north_v!, v, offset, 1, bc, grid, args...; dependencies=dep, kwargs...) |
| 36 | +@inline fill_north_halo!(v, bc::OBC, kernel_size, offset, loc, arch, dep, grid, args...; kwargs...) = launch!(arch, grid, kernel_size, set_south_or_north_v!, v, offset, grid.Ny + 1, bc, grid, args...; dependencies=dep, kwargs...) |
| 37 | +@inline fill_bottom_halo!(w, bc::OBC, kernel_size, offset, loc, arch, dep, grid, args...; kwargs...) = launch!(arch, grid, kernel_size, set_bottom_or_top_w!, w, offset, 1, bc, grid, args...; dependencies=dep, kwargs...) |
| 38 | +@inline fill_top_halo!(w, bc::OBC, kernel_size, offset, loc, arch, dep, grid, args...; kwargs...) = launch!(arch, grid, kernel_size, set_bottom_or_top_w!, w, offset, grid.Nz + 1, bc, grid, args...; dependencies=dep, kwargs...) |
39 | 39 |
|
40 | 40 | @inline _fill_west_halo!(j, k, grid, c, bc::OBC, loc, args...) = @inbounds c[1, j, k] = getbc(bc, j, k, grid, args...)
|
41 | 41 | @inline _fill_east_halo!(j, k, grid, c, bc::OBC, loc, args...) = @inbounds c[grid.Nx + 1, j, k] = getbc(bc, j, k, grid, args...)
|
|
0 commit comments