Skip to content

Commit b5bce2c

Browse files
Zstar test that actually test conservation (#4342)
* Update test_zstar_coordinate.jl * add a tripolar test * correct the test * jhust test the tests that pass * reinstate RK3 zstar tests * whoops
1 parent eee6ed1 commit b5bce2c

File tree

1 file changed

+6
-27
lines changed

1 file changed

+6
-27
lines changed

test/test_zstar_coordinate.jl

+6-27
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ function test_zstar_coordinate(model, Ni, Δt)
1313

1414
∫bᵢ = Field(Integral(bᵢ))
1515
∫cᵢ = Field(Integral(cᵢ))
16+
compute!(∫bᵢ)
17+
compute!(∫cᵢ)
18+
1619
w = model.velocities.w
1720
Nz = model.grid.Nz
1821

@@ -22,6 +25,8 @@ function test_zstar_coordinate(model, Ni, Δt)
2225

2326
∫b = Field(Integral(model.tracers.b))
2427
∫c = Field(Integral(model.tracers.c))
28+
compute!(∫b)
29+
compute!(∫c)
2530

2631
# Testing that:
2732
# (1) tracers are conserved down to machine precision
@@ -197,31 +202,5 @@ end
197202
end
198203
end
199204
end
200-
201-
@info " Testing a ZStar and Runge Kutta 3rd order time stepping"
202-
203-
topology = topologies[2]
204-
rtg = RectilinearGrid(arch; size = (10, 10, 20), x = (0, 100kilometers), y = (-10kilometers, 10kilometers), topology, z = z_uniform)
205-
llg = LatitudeLongitudeGrid(arch; size = (10, 10, 20), latitude = (0, 1), longitude = (0, 1), topology, z = z_uniform)
206-
irtg = ImmersedBoundaryGrid(rtg, GridFittedBottom((x, y) -> rand() - 10))
207-
illg = ImmersedBoundaryGrid(llg, GridFittedBottom((x, y) -> rand() - 10))
208-
209-
for grid in [rtg, llg, irtg, illg]
210-
211-
split_free_surface = SplitExplicitFreeSurface(grid; cfl = 0.75)
212-
model = HydrostaticFreeSurfaceModel(; grid,
213-
free_surface = split_free_surface,
214-
tracers = (:b, :c),
215-
timestepper = :SplitRungeKutta3,
216-
buoyancy = BuoyancyTracer(),
217-
vertical_coordinate = ZStar())
218-
219-
bᵢ(x, y, z) = x < grid.Lx / 2 ? 0.06 : 0.01
220-
221-
set!(model, c = (x, y, z) -> rand(), b = bᵢ)
222-
223-
Δt = 2minutes
224-
test_zstar_coordinate(model, 100, Δt)
225-
end
226205
end
227-
end
206+
end

0 commit comments

Comments
 (0)