Skip to content

Commit dac9760

Browse files
taimoorsohailnavidcysimone-silvestri
authored
Changes ExponentialCoordinate to ExponentialDiscretization (#638)
* Changed `ExponentialCoordinate` to `ExponentialDiscretization` in ClimaOcean.jl * Update vertical_grids.md with ExponentialDiscretization * Update download_glorys_data.jl * Update arctic_simulation.jl * Update one_degree_simulation.jl * Update ocean_sea_ice_coupled_simulation.jl * Update near_global_ocean_simulation.jl * Update one_degree_simulation.jl * Update Oceananigans compat to 0.100 * Apply suggestions from code review * Update one_degree_simulation.jl * Update ClimaSeaIce version to 0.3.8 * use mutable kwarg --------- Co-authored-by: Navid C. Constantinou <[email protected]> Co-authored-by: Simone Silvestri <[email protected]>
1 parent 8def2b6 commit dac9760

File tree

9 files changed

+14
-17
lines changed

9 files changed

+14
-17
lines changed

Project.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ ClimaOceanReactantExt = "Reactant"
4646
Adapt = "4"
4747
CFTime = "0.1, 0.2"
4848
CUDA = "4, 5"
49-
ClimaSeaIce = "0.3.7"
49+
ClimaSeaIce = "0.3.8"
5050
CondaPkg = "0.2.28"
5151
CubicSplines = "0.2"
5252
DataDeps = "0.7"
@@ -59,7 +59,7 @@ KernelAbstractions = "0.9"
5959
MPI = "0.20"
6060
MeshArrays = "0.3"
6161
NCDatasets = "0.12, 0.13, 0.14"
62-
Oceananigans = "0.97.6, 0.98, 0.99"
62+
Oceananigans = "0.100"
6363
OffsetArrays = "1.14"
6464
PrecompileTools = "1"
6565
PythonCall = "0.9"

docs/src/vertical_grids.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Vertical grids
22

3-
We construct vertical coordinates using `Oceananigans.ExponentialCoordinate` and
4-
`Oceananigans.ConstantToStretchedCoordinate`. The
3+
We construct vertical coordinates using `Oceananigans.ExponentialDiscretization` and
4+
`Oceananigans.ReferenceToStretchedDiscretization`. The
55
[Grids section](https://clima.github.io/OceananigansDocumentation/dev/grids/#Coordinate-helper-utilities)
66
in the Oceananigans Documentation includes a mini-tutorial on how the above-mentioned methods
77
can be used to generate a coordinate of your liking.

examples/download_glorys_data.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Ny = 20 * 12
88
Nz = 50
99

1010
depth = 6000
11-
z = ExponentialCoordinate(Nz, -depth, 0; scale=depth/4.5)
11+
z = ExponentialDiscretization(Nz, -depth, 0; scale=depth/4.5)
1212

1313
grid = LatitudeLongitudeGrid(arch;
1414
size = (Nx, Ny, Nz),

examples/near_global_ocean_simulation.jl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,7 @@ Ny = 600
3737
Nz = 40
3838

3939
depth = 6000meters
40-
z = ExponentialCoordinate(Nz, -depth, 0)
41-
z = Oceananigans.Grids.MutableVerticalDiscretization(z)
40+
z = ExponentialDiscretization(Nz, -depth, 0, mutable=true)
4241

4342
grid = LatitudeLongitudeGrid(arch;
4443
size = (Nx, Ny, Nz),

examples/one_degree_simulation.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ Ny = 180
2727
Nz = 50
2828

2929
depth = 5000meters
30-
z = ExponentialCoordinate(Nz, -depth, 0; scale = depth/4)
30+
z = ExponentialDiscretization(Nz, -depth, 0; scale = depth/4)
3131

3232
underlying_grid = TripolarGrid(arch; size = (Nx, Ny, Nz), halo = (5, 5, 4), z)
3333

experiments/arctic_simulation.jl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@ arch = GPU()
1515

1616
depth = 2000meters
1717
Nz = 30
18-
z = ExponentialCoordinate(Nz, -depth, 0; scale=depth/3)
19-
z = MutableVerticalDiscretization(z)
18+
z = ExponentialDiscretization(Nz, -depth, 0; scale=depth/3, mutable=true)
2019

2120
Nx = 180 # longitudinal direction -> 250 points is about 1.5ᵒ resolution
2221
Ny = 180 # meridional direction -> same thing, 48 points is about 1.5ᵒ resolution

experiments/coupled_simulation/ocean_sea_ice_coupled_simulation.jl

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@ Ny = 128 # meridional direction -> same thing, 48 points is about 1.5ᵒ resolut
2222
Nz = 10
2323
depth = 1000meters
2424

25-
z = ExponentialCoordinate(Nz, -depth, 0; scale=0.3*depth)
26-
z = MutableVerticalDiscretization(z)
25+
z = ExponentialDiscretization(Nz, -depth, 0; scale=0.3*depth, mutable=true)
2726

2827
grid = TripolarGrid(arch, Float64; size=(Nx, Ny, Nz), z)
2928
sea_ice_grid = TripolarGrid(arch, Float64; size=(Nx, Ny, 1), z = (-10, 0))
@@ -153,4 +152,4 @@ run!(earth)
153152
# ## Visualizing the results
154153
#
155154
# We can visualize the results using CairoMakie. We record a video of surface variables and fluxes.
156-
# To load the data we can use Oceananigans' `FieldTimeSeries` object.
155+
# To load the data we can use Oceananigans' `FieldTimeSeries` object.

experiments/one_degree_simulation/one_degree_simulation.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ using GLMakie
88

99
Oceananigans.defaults.FloatType = Float64
1010
arch = CPU()
11-
Nx = 256
12-
Ny = 128
11+
Nx = 360
12+
Ny = 180
1313
Nz = 32
1414

1515
depth = 6000meters
16-
z = ExponentialCoordinate(Nz, -depth, 0, scale=(34/Nz)*depth)
16+
z = ExponentialDiscretization(Nz, -depth, 0, scale=(34/Nz)*depth)
1717
underlying_grid = TripolarGrid(arch; size=(Nx, Ny, Nz), z)
1818

1919
bottom_height = regrid_bathymetry(underlying_grid; minimum_depth=30, interpolation_passes=20, major_basins=1)

src/ClimaOcean.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ using PrecompileTools: @setup_workload, @compile_workload
108108
Nx, Ny, Nz = 32, 32, 10
109109
@compile_workload begin
110110
depth = 6000
111-
z = Oceananigans.Grids.ExponentialCoordinate(Nz, -depth, 0)
111+
z = Oceananigans.Grids.ExponentialDiscretization(Nz, -depth, 0)
112112
grid = Oceananigans.OrthogonalSphericalShellGrids.TripolarGrid(CPU(); size=(Nx, Ny, Nz), halo=(7, 7, 7), z)
113113
grid = ImmersedBoundaryGrid(grid, GridFittedBottom((x, y) -> -5000))
114114
# ocean = ocean_simulation(grid)

0 commit comments

Comments
 (0)