Skip to content

Commit a0d48fd

Browse files
tomchorTomas Chor
and
Tomas Chor
authored
(0.96.22) Make NetCDFWriter work with GPU grids with stretched dimensions (#4441)
* remove view call * introduce vertically stretched grids to tests * up patch version --------- Co-authored-by: Tomas Chor <tomchor@x1000c5s5b0n0h0.chn.perlmutter.nersc.gov>
1 parent 8271b4e commit a0d48fd

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "Oceananigans"
22
uuid = "9e8cae18-63c1-5223-a75c-80ca9d6e9a09"
33
authors = ["Climate Modeling Alliance and contributors"]
4-
version = "0.96.21"
4+
version = "0.96.22"
55

66
[deps]
77
Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e"

ext/OceananigansNCDatasetsExt.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ function collect_dim(ξ, ℓ, T, N, H, inds, with_halos)
6060
else
6161
inds = validate_index(inds, ℓ, T, N, H)
6262
inds = restrict_to_interior(inds, ℓ, T, N)
63-
return collect(view(ξ, inds))
63+
return collect(ξ[inds])
6464
end
6565
end
6666

test/test_netcdf_writer.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ function test_netcdf_grid_metrics_rectilinear(arch, FT)
104104
topology = (Periodic, Bounded, Bounded),
105105
size = (Nx, Ny, Nz),
106106
halo = (Hx, Hy, Hz),
107-
extent = (1, 2, 3))
107+
x = (0, 1), y = (0, 2), z = LinRange(0, 3, Nz + 1))
108108

109109
model = NonhydrostaticModel(; grid,
110110
closure = ScalarDiffusivity=4e-2, κ=4e-2),
@@ -333,7 +333,7 @@ function test_netcdf_grid_metrics_latlon(arch, FT)
333333
halo = (Hλ, Hφ, Hz),
334334
longitude = (-15, 15),
335335
latitude = (-10, 10),
336-
z = (-1000, 0))
336+
z = LinRange(-1000, 0, Nz + 1))
337337

338338
model = HydrostaticFreeSurfaceModel(; grid,
339339
momentum_advection = VectorInvariant(),

0 commit comments

Comments
 (0)