Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ ClimaCoupler.jl Release Notes

### ClimaCoupler features

#### Change some closures used in the Oceananigans model PR[#1524](https://github.com/CliMA/ClimaCoupler.jl/pull/1524)
Per ocean team recommendation, we changed some closures to be non-default.

#### Change the behavior of `detect_restart_file` PR[#1515](https://github.com/CliMA/ClimaCoupler.jl/pull/1515)
Users now only need to specify `restart_dir` and `restart_t` to restart a simulation from a specific file, and do
not need to set `detect_restart_file` to true. `detect_restart_file` is used for detecting restart file automatically.
Expand Down
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Dates = "1"
JLD2 = "0.5, 0.6"
Logging = "1"
SciMLBase = "~2.110, ~2.111, ~2.112"
StaticArrays = "1.6"
StaticArrays = "1.9.8"
SurfaceFluxes = "0.12.3, 0.13"
Thermodynamics = "0.14.1, 0.15"
julia = "1.10"
25 changes: 20 additions & 5 deletions experiments/ClimaEarth/components/ocean/oceananigans.jl
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,24 @@ function OceananigansSimulation(
end

# Create ocean simulation
ocean = CO.ocean_simulation(grid; forcing)
free_surface = OC.SplitExplicitFreeSurface(grid; substeps = 70)
momentum_advection = OC.WENOVectorInvariant(order = 5)
tracer_advection = OC.WENO(order = 5)
eddy_closure = OC.TurbulenceClosures.IsopycnalSkewSymmetricDiffusivity(
κ_skew = 1e3,
κ_symmetric = 1e3,
)
vertical_mixing = CO.OceanSimulations.default_ocean_closure()
horizontal_viscosity = OC.HorizontalScalarBiharmonicDiffusivity(ν = 1e11)

ocean = CO.ocean_simulation(
grid;
forcing,
momentum_advection,
tracer_advection,
free_surface,
closure = (eddy_closure, horizontal_viscosity, vertical_mixing),
)

# Set initial condition to EN4 state estimate at start_date
OC.set!(ocean.model, T = en4_temperature[1], S = en4_salinity[1])
Expand Down Expand Up @@ -147,8 +164,6 @@ function OceananigansSimulation(

# Before version 0.96.22, the NetCDFWriter was broken on GPU
if arch isa OC.CPU || pkgversion(OC) >= v"0.96.22"
# TODO: Add more diagnostics, make them dependent on simulation duration, take
# monthly averages
# Save all tracers and velocities to a NetCDF file at daily frequency
outputs = merge(ocean.model.tracers, ocean.model.velocities)
netcdf_writer = OC.NetCDFWriter(
Expand Down Expand Up @@ -286,9 +301,9 @@ Interfacer.get_field(sim::OceananigansSimulation, ::Val{:roughness_momentum}) =
Interfacer.get_field(sim::OceananigansSimulation, ::Val{:beta}) = Float32(1)
Interfacer.get_field(sim::OceananigansSimulation, ::Val{:emissivity}) = Float32(0.97)
Interfacer.get_field(sim::OceananigansSimulation, ::Val{:surface_direct_albedo}) =
Float32(0.06)
Float32(0.011)
Interfacer.get_field(sim::OceananigansSimulation, ::Val{:surface_diffuse_albedo}) =
Float32(0.06)
Float32(0.069)

# NOTE: This is 3D, but it will be remapped to 2D
Interfacer.get_field(sim::OceananigansSimulation, ::Val{:surface_temperature}) =
Expand Down
Loading