Skip to content

Commit c04aad4

Browse files
committed
construct TripolarGrid
1 parent 888d3db commit c04aad4

File tree

1 file changed

+7
-24
lines changed

1 file changed

+7
-24
lines changed

experiments/ClimaEarth/components/ocean/oceananigans.jl

Lines changed: 7 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -52,28 +52,15 @@ function OceananigansSimulation(area_fraction, start_date, stop_date; output_dir
5252
download_dataset(ecco_salinity)
5353
end
5454

55-
# Set up ocean grid (1 degree)
56-
resolution_points = (360, 160, 32)
57-
Nz = last(resolution_points)
58-
z_faces = CO.exponential_z_faces(; Nz, depth = 6000, h = 34)
59-
60-
# Regular LatLong because we know how to do interpolation there
61-
62-
# TODO: When moving to TripolarGrid, note that we need to be careful about
63-
# ensuring the coordinate systems align (ie, rotate vectors on the OC grid)
64-
65-
underlying_grid = OC.LatitudeLongitudeGrid(
66-
arch;
67-
size = resolution_points,
68-
longitude = (-180, 180),
69-
latitude = (-80, 80), # NOTE: Don't goo to high up when using LatLongGrid, or the cells will be too small
70-
z = z_faces,
71-
halo = (7, 7, 7),
72-
)
55+
# Set up tripolar ocean grid (1 degree)
56+
Nx = 360
57+
Ny = 180
58+
Nz = 40
7359

60+
z = CO.exponential_z_faces(; Nz, depth = 4000, h = 34)
61+
underlying_grid = OC.TripolarGrid(arch; size = (Nx, Ny, Nz), halo = (5, 5, 4), z)
7462
bottom_height =
7563
CO.regrid_bathymetry(underlying_grid; minimum_depth = 30, interpolation_passes = 20, major_basins = 1)
76-
7764
grid = OC.ImmersedBoundaryGrid(underlying_grid, OC.GridFittedBottom(bottom_height); active_cells_map = true)
7865

7966
if use_ecco
@@ -98,13 +85,9 @@ function OceananigansSimulation(area_fraction, start_date, stop_date; output_dir
9885
OC.set!(ocean.model, T = T_init, S = S_init)
9986
end
10087

88+
# Construct a remapper from the exchange grid to `Center, Center` fields
10189
long_cc = OC.λnodes(grid, OC.Center(), OC.Center(), OC.Center())
10290
lat_cc = OC.φnodes(grid, OC.Center(), OC.Center(), OC.Center())
103-
104-
105-
# TODO: Go from 0 to Nx+1, Ny+1 (for halos) (for LatLongGrid)
106-
107-
# Construct a remapper from the exchange grid to `Center, Center` fields
10891
long_cc = reshape(long_cc, length(long_cc), 1)
10992
lat_cc = reshape(lat_cc, 1, length(lat_cc))
11093
target_points_cc = @. CC.Geometry.LatLongPoint(lat_cc, long_cc)

0 commit comments

Comments
 (0)