@@ -54,6 +54,31 @@ function hydrostatic_free_surface_model_tracers_and_forcings_work(arch)
54
54
return nothing
55
55
end
56
56
57
+ function time_step_hydrostatic_model_with_catke_works (arch, FT)
58
+ grid = LatitudeLongitudeGrid (
59
+ arch,
60
+ FT,
61
+ topology = (Bounded, Bounded, Bounded),
62
+ size = (8 , 8 , 8 ),
63
+ longitude = (0 , 1 ),
64
+ latitude = (0 , 1 ),
65
+ z = (- 100 , 0 )
66
+ )
67
+
68
+ model = HydrostaticFreeSurfaceModel (;
69
+ grid,
70
+ buoyancy = BuoyancyTracer (),
71
+ tracers = (:b , :e ),
72
+ closure = CATKEVerticalDiffusivity (FT)
73
+ )
74
+
75
+ simulation = Simulation (model, Δt= 1.0 , stop_iteration= 1 )
76
+
77
+ run! (simulation)
78
+
79
+ return model. clock. iteration == 1
80
+ end
81
+
57
82
topo_1d = (Flat, Flat, Bounded)
58
83
59
84
topos_2d = ((Periodic, Flat, Bounded),
@@ -66,7 +91,7 @@ topos_3d = ((Periodic, Periodic, Bounded),
66
91
67
92
@testset " Hydrostatic free surface Models" begin
68
93
@info " Testing hydrostatic free surface models..."
69
-
94
+
70
95
@testset " $topo_1d model construction" begin
71
96
@info " Testing $topo_1d model construction..."
72
97
for arch in archs, FT in [Float64] # float_types
@@ -80,7 +105,7 @@ topos_3d = ((Periodic, Periodic, Bounded),
80
105
@test ! (:η ∈ keys (fields (model))) # doesn't include free surface
81
106
end
82
107
end
83
-
108
+
84
109
for topo in topos_2d
85
110
@testset " $topo model construction" begin
86
111
@info " Testing $topo model construction..."
@@ -92,7 +117,7 @@ topos_3d = ((Periodic, Periodic, Bounded),
92
117
end
93
118
end
94
119
end
95
-
120
+
96
121
for topo in topos_3d
97
122
@testset " $topo model construction" begin
98
123
@info " Testing $topo model construction..."
@@ -180,8 +205,8 @@ topos_3d = ((Periodic, Periodic, Bounded),
180
205
precompute_metrics = true
181
206
lat_lon_sector_grid = LatitudeLongitudeGrid (arch; size= (H, H, H), longitude= (0 , 60 ), latitude= (15 , 75 ), z= (- 1 , 0 ), precompute_metrics, halo)
182
207
lat_lon_strip_grid = LatitudeLongitudeGrid (arch; size= (H, H, H), longitude= (- 180 , 180 ), latitude= (15 , 75 ), z= (- 1 , 0 ), precompute_metrics, halo)
183
-
184
- z = z_face_generator ()
208
+
209
+ z = z_face_generator ()
185
210
lat_lon_sector_grid_stretched = LatitudeLongitudeGrid (arch; size= (H, H, H), longitude= (0 , 60 ), latitude= (15 , 75 ), z, precompute_metrics, halo)
186
211
lat_lon_strip_grid_stretched = LatitudeLongitudeGrid (arch; size= (H, H, H), longitude= (- 180 , 180 ), latitude= (15 , 75 ), z, precompute_metrics, halo)
187
212
@@ -196,7 +221,7 @@ topos_3d = ((Periodic, Periodic, Bounded),
196
221
topo = topology (grid)
197
222
grid_type = typeof (grid). name. wrapper
198
223
free_surface_type = typeof (free_surface). name. wrapper
199
- test_label = " [$arch , $grid_type , $topo , $free_surface_type ]"
224
+ test_label = " [$arch , $grid_type , $topo , $free_surface_type ]"
200
225
@testset " Time-stepping HydrostaticFreeSurfaceModels with various grids $test_label " begin
201
226
@info " Testing time-stepping HydrostaticFreeSurfaceModels with various grids $test_label ..."
202
227
@test time_step_hydrostatic_model_works (grid; free_surface)
@@ -278,7 +303,7 @@ topos_3d = ((Periodic, Periodic, Bounded),
278
303
279
304
@test time_step_hydrostatic_model_works (rectilinear_grid, momentum_advection = nothing , velocities = velocities)
280
305
@test time_step_hydrostatic_model_works (lat_lon_sector_grid, momentum_advection = nothing , velocities = velocities)
281
-
306
+
282
307
parameters = (U= 1 , m= 0.1 , W= 0.001 )
283
308
u (x, y, z, t, p) = p. U
284
309
v (x, y, z, t, p) = exp (p. m * z)
@@ -294,5 +319,11 @@ topos_3d = ((Periodic, Periodic, Bounded),
294
319
@info " Testing HydrostaticFreeSurfaceModel with tracers and forcings [$arch ]..."
295
320
hydrostatic_free_surface_model_tracers_and_forcings_work (arch)
296
321
end
322
+
323
+ # See: https://github.com/CliMA/Oceananigans.jl/issues/3870
324
+ @testset " HydrostaticFreeSurfaceModel with Float32 CATKE [$arch ]" begin
325
+ @info " Testing HydrostaticFreeSurfaceModel with Float32 CATKE [$arch ]..."
326
+ @test time_step_hydrostatic_model_with_catke_works (arch, Float32)
327
+ end
297
328
end
298
329
end
0 commit comments