@@ -584,7 +584,7 @@ function test_netcdf_grid_metrics_latlon(arch, FT)
584
584
return nothing
585
585
end
586
586
587
- function test_netcdf_rectilinear_grid_fitted_bottom (arch)
587
+ function test_netcdf_rectilinear_grid_fitted_bottom (arch, bottom_boundary_type )
588
588
Nx, Ny, Nz = 16 , 16 , 16
589
589
Hx, Hy, Hz = 2 , 3 , 4
590
590
@@ -603,7 +603,7 @@ function test_netcdf_rectilinear_grid_fitted_bottom(arch)
603
603
mount (x, y) = height * exp (- x^ 2 / 2 width^ 2 ) * exp (- y^ 2 / 2 width^ 2 )
604
604
bottom (x, y) = - H + mount (x, y)
605
605
606
- grid = ImmersedBoundaryGrid (underlying_grid, GridFittedBottom (bottom))
606
+ grid = ImmersedBoundaryGrid (underlying_grid, bottom_boundary_type (bottom))
607
607
608
608
model = NonhydrostaticModel (; grid,
609
609
closure = ScalarDiffusivity (ν= 4e-2 , κ= 4e-2 ),
@@ -666,14 +666,14 @@ function test_netcdf_rectilinear_grid_fitted_bottom(arch)
666
666
@test dimsize (ds_h[:bottom_height ]) == (x_caa= Nx + 2 Hx, y_aca= Ny + 2 Hy)
667
667
668
668
for loc in (" ccc" , " fcc" , " cfc" , " ccf" )
669
- @test haskey (ds_h, " immersed_boundary_mask_ $loc " )
670
- @test eltype (ds_h[" immersed_boundary_mask_ $loc " ]) == Float64
669
+ @test haskey (ds_h, " peripheral_nodes_ $loc " )
670
+ @test eltype (ds_h[" peripheral_nodes_ $loc " ]) == Float64
671
671
end
672
672
673
- @test dimsize (ds_h[:immersed_boundary_mask_ccc ]) == (x_caa= Nx + 2 Hx, y_aca= Ny + 2 Hy, z_aac= Nz + 2 Hz)
674
- @test dimsize (ds_h[:immersed_boundary_mask_fcc ]) == (x_faa= Nx + 2 Hx + 1 , y_aca= Ny + 2 Hy, z_aac= Nz + 2 Hz)
675
- @test dimsize (ds_h[:immersed_boundary_mask_cfc ]) == (x_caa= Nx + 2 Hx, y_afa= Ny + 2 Hy + 1 , z_aac= Nz + 2 Hz)
676
- @test dimsize (ds_h[:immersed_boundary_mask_ccf ]) == (x_caa= Nx + 2 Hx, y_aca= Ny + 2 Hy, z_aaf= Nz + 2 Hz + 1 )
673
+ @test dimsize (ds_h[:peripheral_nodes_ccc ]) == (x_caa= Nx + 2 Hx, y_aca= Ny + 2 Hy, z_aac= Nz + 2 Hz)
674
+ @test dimsize (ds_h[:peripheral_nodes_fcc ]) == (x_faa= Nx + 2 Hx + 1 , y_aca= Ny + 2 Hy, z_aac= Nz + 2 Hz)
675
+ @test dimsize (ds_h[:peripheral_nodes_cfc ]) == (x_caa= Nx + 2 Hx, y_afa= Ny + 2 Hy + 1 , z_aac= Nz + 2 Hz)
676
+ @test dimsize (ds_h[:peripheral_nodes_ccf ]) == (x_caa= Nx + 2 Hx, y_aca= Ny + 2 Hy, z_aaf= Nz + 2 Hz + 1 )
677
677
678
678
@test all (ds_h[:bottom_height ][:, :] .≈ Array (parent (grid. immersed_boundary. bottom_height)))
679
679
@@ -688,14 +688,14 @@ function test_netcdf_rectilinear_grid_fitted_bottom(arch)
688
688
@test dimsize (ds_n[:bottom_height ]) == (x_caa= Nx, y_aca= Ny)
689
689
690
690
for loc in (" ccc" , " fcc" , " cfc" , " ccf" )
691
- @test haskey (ds_n, " immersed_boundary_mask_ $loc " )
692
- @test eltype (ds_n[" immersed_boundary_mask_ $loc " ]) == Float32
691
+ @test haskey (ds_n, " peripheral_nodes_ $loc " )
692
+ @test eltype (ds_n[" peripheral_nodes_ $loc " ]) == Float32
693
693
end
694
694
695
- @test dimsize (ds_n[:immersed_boundary_mask_ccc ]) == (x_caa= Nx, y_aca= Ny, z_aac= Nz)
696
- @test dimsize (ds_n[:immersed_boundary_mask_fcc ]) == (x_faa= Nx + 1 , y_aca= Ny, z_aac= Nz)
697
- @test dimsize (ds_n[:immersed_boundary_mask_cfc ]) == (x_caa= Nx, y_afa= Ny + 1 , z_aac= Nz)
698
- @test dimsize (ds_n[:immersed_boundary_mask_ccf ]) == (x_caa= Nx, y_aca= Ny, z_aaf= Nz + 1 )
695
+ @test dimsize (ds_n[:peripheral_nodes_ccc ]) == (x_caa= Nx, y_aca= Ny, z_aac= Nz)
696
+ @test dimsize (ds_n[:peripheral_nodes_fcc ]) == (x_faa= Nx + 1 , y_aca= Ny, z_aac= Nz)
697
+ @test dimsize (ds_n[:peripheral_nodes_cfc ]) == (x_caa= Nx, y_afa= Ny + 1 , z_aac= Nz)
698
+ @test dimsize (ds_n[:peripheral_nodes_ccf ]) == (x_caa= Nx, y_aca= Ny, z_aaf= Nz + 1 )
699
699
700
700
@test all (ds_n[:bottom_height ][:, :] .≈ Array (interior (grid. immersed_boundary. bottom_height)))
701
701
@@ -710,14 +710,14 @@ function test_netcdf_rectilinear_grid_fitted_bottom(arch)
710
710
@test dimsize (ds_s[:bottom_height ]) == (x_caa= nx, y_aca= ny)
711
711
712
712
for loc in (" ccc" , " fcc" , " cfc" , " ccf" )
713
- @test haskey (ds_s, " immersed_boundary_mask_ $loc " )
714
- @test eltype (ds_s[" immersed_boundary_mask_ $loc " ]) == Float32
713
+ @test haskey (ds_s, " peripheral_nodes_ $loc " )
714
+ @test eltype (ds_s[" peripheral_nodes_ $loc " ]) == Float32
715
715
end
716
716
717
- @test dimsize (ds_s[:immersed_boundary_mask_ccc ]) == (x_caa= nx, y_aca= ny, z_aac= nz)
718
- @test dimsize (ds_s[:immersed_boundary_mask_fcc ]) == (x_faa= nx, y_aca= ny, z_aac= nz)
719
- @test dimsize (ds_s[:immersed_boundary_mask_cfc ]) == (x_caa= nx, y_afa= ny, z_aac= nz)
720
- @test dimsize (ds_s[:immersed_boundary_mask_ccf ]) == (x_caa= nx, y_aca= ny, z_aaf= nz)
717
+ @test dimsize (ds_s[:peripheral_nodes_ccc ]) == (x_caa= nx, y_aca= ny, z_aac= nz)
718
+ @test dimsize (ds_s[:peripheral_nodes_fcc ]) == (x_faa= nx, y_aca= ny, z_aac= nz)
719
+ @test dimsize (ds_s[:peripheral_nodes_cfc ]) == (x_caa= nx, y_afa= ny, z_aac= nz)
720
+ @test dimsize (ds_s[:peripheral_nodes_ccf ]) == (x_caa= nx, y_aca= ny, z_aaf= nz)
721
721
722
722
@test all (ds_s[:bottom_height ][:, :] .≈ Array (interior (grid. immersed_boundary. bottom_height, i_slice, j_slice)))
723
723
@@ -727,7 +727,7 @@ function test_netcdf_rectilinear_grid_fitted_bottom(arch)
727
727
return nothing
728
728
end
729
729
730
- function test_netcdf_latlon_grid_fitted_bottom (arch)
730
+ function test_netcdf_latlon_grid_fitted_bottom (arch, bottom_boundary_type )
731
731
Nλ, Nφ, Nz = 16 , 16 , 16
732
732
Hλ, Hφ, Hz = 2 , 3 , 4
733
733
Lλ, Lφ, H = 20 , 10 , 1000
@@ -747,7 +747,7 @@ function test_netcdf_latlon_grid_fitted_bottom(arch)
747
747
seamount (λ, φ) = height * exp (- λ^ 2 / 2 λ_width^ 2 ) * exp (- φ^ 2 / 2 φ_width^ 2 )
748
748
bottom (λ, φ) = - H + seamount (λ, φ)
749
749
750
- grid = ImmersedBoundaryGrid (underlying_grid, GridFittedBottom (bottom))
750
+ grid = ImmersedBoundaryGrid (underlying_grid, bottom_boundary_type (bottom))
751
751
752
752
model = HydrostaticFreeSurfaceModel (; grid,
753
753
momentum_advection = VectorInvariant (),
@@ -815,14 +815,14 @@ function test_netcdf_latlon_grid_fitted_bottom(arch)
815
815
@test dimsize (ds_h[:bottom_height ]) == (λ_caa= Nλ + 2 Hλ, φ_aca= Nφ + 2 Hφ)
816
816
817
817
for loc in (" ccc" , " fcc" , " cfc" , " ccf" )
818
- @test haskey (ds_h, " immersed_boundary_mask_ $loc " )
819
- @test eltype (ds_h[" immersed_boundary_mask_ $loc " ]) == Float64
818
+ @test haskey (ds_h, " peripheral_nodes_ $loc " )
819
+ @test eltype (ds_h[" peripheral_nodes_ $loc " ]) == Float64
820
820
end
821
821
822
- @test dimsize (ds_h[:immersed_boundary_mask_ccc ]) == (λ_caa= Nλ + 2 Hλ, φ_aca= Nφ + 2 Hφ, z_aac= Nz + 2 Hz)
823
- @test dimsize (ds_h[:immersed_boundary_mask_fcc ]) == (λ_faa= Nλ + 2 Hλ + 1 , φ_aca= Nφ + 2 Hφ, z_aac= Nz + 2 Hz)
824
- @test dimsize (ds_h[:immersed_boundary_mask_cfc ]) == (λ_caa= Nλ + 2 Hλ, φ_afa= Nφ + 2 Hφ + 1 , z_aac= Nz + 2 Hz)
825
- @test dimsize (ds_h[:immersed_boundary_mask_ccf ]) == (λ_caa= Nλ + 2 Hλ, φ_aca= Nφ + 2 Hφ, z_aaf= Nz + 2 Hz + 1 )
822
+ @test dimsize (ds_h[:peripheral_nodes_ccc ]) == (λ_caa= Nλ + 2 Hλ, φ_aca= Nφ + 2 Hφ, z_aac= Nz + 2 Hz)
823
+ @test dimsize (ds_h[:peripheral_nodes_fcc ]) == (λ_faa= Nλ + 2 Hλ + 1 , φ_aca= Nφ + 2 Hφ, z_aac= Nz + 2 Hz)
824
+ @test dimsize (ds_h[:peripheral_nodes_cfc ]) == (λ_caa= Nλ + 2 Hλ, φ_afa= Nφ + 2 Hφ + 1 , z_aac= Nz + 2 Hz)
825
+ @test dimsize (ds_h[:peripheral_nodes_ccf ]) == (λ_caa= Nλ + 2 Hλ, φ_aca= Nφ + 2 Hφ, z_aaf= Nz + 2 Hz + 1 )
826
826
827
827
@test all (ds_h[:bottom_height ][:, :] .≈ Array (parent (grid. immersed_boundary. bottom_height)))
828
828
@@ -837,14 +837,14 @@ function test_netcdf_latlon_grid_fitted_bottom(arch)
837
837
@test dimsize (ds_n[:bottom_height ]) == (λ_caa= Nλ, φ_aca= Nφ)
838
838
839
839
for loc in (" ccc" , " fcc" , " cfc" , " ccf" )
840
- @test haskey (ds_n, " immersed_boundary_mask_ $loc " )
841
- @test eltype (ds_n[" immersed_boundary_mask_ $loc " ]) == Float32
840
+ @test haskey (ds_n, " peripheral_nodes_ $loc " )
841
+ @test eltype (ds_n[" peripheral_nodes_ $loc " ]) == Float32
842
842
end
843
843
844
- @test dimsize (ds_n[:immersed_boundary_mask_ccc ]) == (λ_caa= Nλ, φ_aca= Nφ, z_aac= Nz)
845
- @test dimsize (ds_n[:immersed_boundary_mask_fcc ]) == (λ_faa= Nλ + 1 , φ_aca= Nφ, z_aac= Nz)
846
- @test dimsize (ds_n[:immersed_boundary_mask_cfc ]) == (λ_caa= Nλ, φ_afa= Nφ + 1 , z_aac= Nz)
847
- @test dimsize (ds_n[:immersed_boundary_mask_ccf ]) == (λ_caa= Nλ, φ_aca= Nφ, z_aaf= Nz + 1 )
844
+ @test dimsize (ds_n[:peripheral_nodes_ccc ]) == (λ_caa= Nλ, φ_aca= Nφ, z_aac= Nz)
845
+ @test dimsize (ds_n[:peripheral_nodes_fcc ]) == (λ_faa= Nλ + 1 , φ_aca= Nφ, z_aac= Nz)
846
+ @test dimsize (ds_n[:peripheral_nodes_cfc ]) == (λ_caa= Nλ, φ_afa= Nφ + 1 , z_aac= Nz)
847
+ @test dimsize (ds_n[:peripheral_nodes_ccf ]) == (λ_caa= Nλ, φ_aca= Nφ, z_aaf= Nz + 1 )
848
848
849
849
@test all (ds_n[:bottom_height ][:, :] .≈ Array (interior (grid. immersed_boundary. bottom_height)))
850
850
@@ -859,14 +859,14 @@ function test_netcdf_latlon_grid_fitted_bottom(arch)
859
859
@test dimsize (ds_s[:bottom_height ]) == (λ_caa= nλ, φ_aca= nφ)
860
860
861
861
for loc in (" ccc" , " fcc" , " cfc" , " ccf" )
862
- @test haskey (ds_s, " immersed_boundary_mask_ $loc " )
863
- @test eltype (ds_s[" immersed_boundary_mask_ $loc " ]) == Float32
862
+ @test haskey (ds_s, " peripheral_nodes_ $loc " )
863
+ @test eltype (ds_s[" peripheral_nodes_ $loc " ]) == Float32
864
864
end
865
865
866
- @test dimsize (ds_s[:immersed_boundary_mask_ccc ]) == (λ_caa= nλ, φ_aca= nφ, z_aac= nz)
867
- @test dimsize (ds_s[:immersed_boundary_mask_fcc ]) == (λ_faa= nλ, φ_aca= nφ, z_aac= nz)
868
- @test dimsize (ds_s[:immersed_boundary_mask_cfc ]) == (λ_caa= nλ, φ_afa= nφ, z_aac= nz)
869
- @test dimsize (ds_s[:immersed_boundary_mask_ccf ]) == (λ_caa= nλ, φ_aca= nφ, z_aaf= nz)
866
+ @test dimsize (ds_s[:peripheral_nodes_ccc ]) == (λ_caa= nλ, φ_aca= nφ, z_aac= nz)
867
+ @test dimsize (ds_s[:peripheral_nodes_fcc ]) == (λ_faa= nλ, φ_aca= nφ, z_aac= nz)
868
+ @test dimsize (ds_s[:peripheral_nodes_cfc ]) == (λ_caa= nλ, φ_afa= nφ, z_aac= nz)
869
+ @test dimsize (ds_s[:peripheral_nodes_ccf ]) == (λ_caa= nλ, φ_aca= nφ, z_aaf= nz)
870
870
871
871
@test all (ds_s[:bottom_height ][:, :] .≈ Array (interior (grid. immersed_boundary. bottom_height, i_slice, j_slice)))
872
872
@@ -2738,8 +2738,10 @@ for arch in archs
2738
2738
test_netcdf_grid_metrics_latlon (arch, Float64)
2739
2739
test_netcdf_grid_metrics_latlon (arch, Float32)
2740
2740
2741
- test_netcdf_rectilinear_grid_fitted_bottom (arch)
2742
- test_netcdf_latlon_grid_fitted_bottom (arch)
2741
+ test_netcdf_rectilinear_grid_fitted_bottom (arch, GridFittedBottom)
2742
+ test_netcdf_rectilinear_grid_fitted_bottom (arch, PartialCellBottom)
2743
+ test_netcdf_latlon_grid_fitted_bottom (arch, GridFittedBottom)
2744
+ test_netcdf_latlon_grid_fitted_bottom (arch, PartialCellBottom)
2743
2745
2744
2746
test_netcdf_rectilinear_flat_xy (arch)
2745
2747
test_netcdf_rectilinear_flat_xz (arch, immersed= false )
0 commit comments