@@ -241,32 +241,34 @@ z_stretched = MutableVerticalDiscretization(collect(-20:0))
241
241
end
242
242
end
243
243
244
- function make_tripolar_test_model (arch; with_wind = false )
244
+ # Code credit:
245
+ # https://github.com/PRONTOLab/GB-25/blob/682106b8487f94da24a64d93e86d34d560f33ffc/src/model_utils.jl#L65
246
+ function mtn₁ (λ, φ)
247
+ λ₁ = 70
248
+ φ₁ = 55
249
+ dφ = 5
250
+ return exp (- ((λ - λ₁)^ 2 + (φ - φ₁)^ 2 ) / 2 dφ^ 2 )
251
+ end
245
252
246
- grid = TripolarGrid (arch; size = (20 , 20 , 20 ), z = z_stretched)
253
+ function mtn₂ (λ, φ)
254
+ λ₁ = 70
255
+ λ₂ = λ₁ + 180
256
+ φ₂ = 55
257
+ dφ = 5
258
+ return exp (- ((λ - λ₂)^ 2 + (φ - φ₂)^ 2 ) / 2 dφ^ 2 )
259
+ end
247
260
248
- # Code credit:
249
- # https://github.com/PRONTOLab/GB-25/blob/682106b8487f94da24a64d93e86d34d560f33ffc/src/model_utils.jl#L65
250
- function mtn₁ (λ, φ)
251
- λ₁ = 70
252
- φ₁ = 55
253
- dφ = 5
254
- return exp (- ((λ - λ₁)^ 2 + (φ - φ₁)^ 2 ) / 2 dφ^ 2 )
255
- end
261
+ function make_tripolar_test_model (arch; with_bathymetry = true , with_wind = false )
256
262
257
- function mtn₂ (λ, φ)
258
- λ₁ = 70
259
- λ₂ = λ₁ + 180
260
- φ₂ = 55
261
- dφ = 5
262
- return exp (- ((λ - λ₂)^ 2 + (φ - φ₂)^ 2 ) / 2 dφ^ 2 )
263
- end
263
+ grid = TripolarGrid (arch; size = (20 , 20 , 20 ), z = z_stretched)
264
264
265
- zb = - 20
266
- h = - zb + 10
267
- gaussian_islands (λ, φ) = zb + h * (mtn₁ (λ, φ) + mtn₂ (λ, φ))
265
+ if with_bathymetry
266
+ zb = - 20
267
+ h = - zb + 10
268
+ gaussian_islands (λ, φ) = zb + h * (mtn₁ (λ, φ) + mtn₂ (λ, φ))
268
269
269
- grid = ImmersedBoundaryGrid (grid, GridFittedBottom (gaussian_islands))
270
+ grid = ImmersedBoundaryGrid (grid, GridFittedBottom (gaussian_islands))
271
+ end
270
272
free_surface = SplitExplicitFreeSurface (grid; substeps= 10 )
271
273
272
274
kwargs = (;
@@ -300,21 +302,16 @@ end
300
302
301
303
@testset " TripolarGrid ZStar tracer conservation tests" begin
302
304
for arch in archs
303
- @info " Testing ZStar coordinate with TripolarGrid on $(arch) ..."
304
-
305
- model = make_tripolar_test_model (arch, with_wind= false )
306
- Δt = 2 minutes
307
- test_zstar_coordinate (model, 300 , Δt)
308
- end
309
- end
310
-
311
- @testset " ZStar tracer conservation tests with wind stress" begin
312
- for arch in archs
313
- @info " Testing ZStar coordinate with TripolarGrid and wind stress on $(arch) ..."
314
-
315
- model = make_tripolar_test_model (arch; with_wind= true )
316
- Δt = 2 minutes
317
- test_zstar_coordinate (model, 300 , Δt)
305
+ for with_wind in (false , true )
306
+ for with_bathymetry in (false , true )
307
+ wind_str = with_wind ? " with wind" : " without wind"
308
+ bathy_str = with_bathymetry ? " with bathymetry" : " without bathymetry"
309
+ @info " Testing ZStar coordinate on TripolarGrid $wind_str , $bathy_str on $(arch) ..."
310
+
311
+ model = make_tripolar_test_model (arch; with_bathymetry = with_bathymetry, with_wind = with_wind)
312
+ Δt = 2 minutes
313
+ test_zstar_coordinate (model, 300 , Δt)
314
+ end
315
+ end
318
316
end
319
317
end
320
-
0 commit comments