Skip to content

Commit a928e24

Browse files
authored
Update example in README and Docs landing page (#416)
* update example in README * update example in docs landing page * add default Radiation(arch) instead of nothing * simplify examples; no need for Radiation * fixes
1 parent 1d9ae10 commit a928e24

File tree

3 files changed

+14
-12
lines changed

3 files changed

+14
-12
lines changed

README.md

+7-6
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55

66
<!-- description -->
77
<p align="center">
8-
<strong>🌎 A framework for realistic ocean-only and coupled ocean + sea-ice simulations driven by prescribed atmospheres and based on <a href=https://github.com/CliMA/Oceananigans.jl>Oceananigans</a> and <a href=https://github.com/CliMA/ClimaSeaIce.jl>ClimaSeaIce</a></strong>.
8+
<strong>🌎 A framework for realistic ocean-only and coupled ocean + sea-ice simulations driven by prescribed atmospheres and based on <a href=https://github.com/CliMA/Oceananigans.jl>Oceananigans</a> and <a href=https://github.com/CliMA/ClimaSeaIce.jl>ClimaSeaIce</a></strong>.
99
</p>
1010

11-
###
11+
###
1212

1313
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.7677442.svg?style=flat-square)](https://doi.org/10.5281/zenodo.7677442)
1414
[![Build status](https://badge.buildkite.com/3113cca353b83df3b5855d3f0d69827124614aef7017c835d2.svg?style=flat-square)](https://buildkite.com/clima/climaocean-ci)
@@ -32,7 +32,7 @@ For more information, see the [documentation for `Pkg.jl`](https://pkgdocs.julia
3232

3333
## Why? What's the difference between ClimaOcean and [Oceananigans](https://github.com/CliMA/Oceananigans.jl)?
3434

35-
Oceananigans is a general-purpose library for ocean-flavored fluid dynamics.
35+
Oceananigans is a general-purpose library for ocean-flavored fluid dynamics.
3636
ClimaOcean implements a framework for driving realistic Oceananigans simulations with prescribed atmospheres, and coupling them to prognostic sea ice simulations.
3737

3838
### A core abstraction: `ClimaOcean.OceanSeaIceModel`
@@ -59,9 +59,10 @@ grid = ImmersedBoundaryGrid(grid, GridFittedBottom(bathymetry))
5959

6060
# Build an ocean simulation initialized to the ECCO state estimate on Jan 1, 1993
6161
ocean = ClimaOcean.ocean_simulation(grid)
62-
dates = DateTimeProlepticGregorian(1993, 1, 1)
63-
set!(ocean.model, T = ClimaOcean.ECCOMetadata(:temperature; dates),
64-
S = ClimaOcean.ECCOMetadata(:salinity; dates))
62+
dates = DateTime(1993, 1, 1) : Month(1) : DateTime(1994, 1, 1)
63+
set!(ocean.model,
64+
T=ClimaOcean.Metadata(:temperature; dates=first(dates), dataset=ClimaOcean.ECCO4Monthly()),
65+
S=ClimaOcean.Metadata(:salinity; dates=first(dates), dataset=ClimaOcean.ECCO4Monthly()))
6566

6667
# Build and run an OceanSeaIceModel (with no sea ice component) forced by JRA55 reanalysis
6768
atmosphere = ClimaOcean.JRA55PrescribedAtmosphere(arch)

docs/src/index.md

+5-4
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ julia> Pkg.add("ClimaOcean")
2525

2626
!!! compat "Julia 1.10 is required"
2727
ClimaOcean requires Julia 1.10 or later.
28-
28+
2929
## Quick start
3030

3131
The following script implements a near-global ocean simulation initialized from the [ECCO state estimate](https://gmd.copernicus.org/articles/8/3071/2015/) and coupled to a prescribed atmosphere derived from the [JRA55-do reanalysis](https://www.sciencedirect.com/science/article/pii/S146350031830235X):
@@ -49,9 +49,10 @@ grid = ImmersedBoundaryGrid(grid, GridFittedBottom(bathymetry))
4949

5050
# Build an ocean simulation initialized to the ECCO state estimate on Jan 1, 1993
5151
ocean = ClimaOcean.ocean_simulation(grid)
52-
date = DateTime(1993, 1, 1)
53-
set!(ocean.model, T = ClimaOcean.ECCOMetadata(:temperature; date),
54-
S = ClimaOcean.ECCOMetadata(:salinity; date))
52+
dates = DateTime(1993, 1, 1) : Month(1) : DateTime(1994, 1, 1)
53+
set!(ocean.model,
54+
T=ClimaOcean.Metadata(:temperature; dates=first(dates), dataset=ClimaOcean.ECCO4Monthly()),
55+
S=ClimaOcean.Metadata(:salinity; dates=first(dates), dataset=ClimaOcean.ECCO4Monthly()))
5556

5657
# Build and run an OceanSeaIceModel (with no sea ice component) forced by JRA55 reanalysis
5758
atmosphere = ClimaOcean.JRA55PrescribedAtmosphere(arch)

src/OceanSeaIceModels/ocean_sea_ice_model.jl

+2-2
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ end
107107

108108
function OceanSeaIceModel(ocean, sea_ice=FreezingLimitedOceanTemperature(eltype(ocean.model));
109109
atmosphere = nothing,
110-
radiation = nothing,
110+
radiation = Radiation(architecture(ocean.model)),
111111
clock = deepcopy(ocean.model.clock),
112112
ocean_reference_density = reference_density(ocean),
113113
ocean_heat_capacity = heat_capacity(ocean),
@@ -122,7 +122,7 @@ function OceanSeaIceModel(ocean, sea_ice=FreezingLimitedOceanTemperature(eltype(
122122
pop!(ocean.callbacks, :wall_time_limit_exceeded, nothing)
123123
pop!(ocean.callbacks, :nan_checker, nothing)
124124
end
125-
125+
126126
if sea_ice isa SeaIceSimulation
127127
if !isnothing(sea_ice.callbacks)
128128
pop!(sea_ice.callbacks, :stop_time_exceeded, nothing)

0 commit comments

Comments
 (0)