Skip to content

Commit d1bbd60

Browse files
Merge remote-tracking branch 'origin/main' into ss-nc/fix-climatoloy-experiment
2 parents 50861af + 42bc765 commit d1bbd60

File tree

83 files changed

+4040
-2399
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

83 files changed

+4040
-2399
lines changed

.buildkite/pipeline.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@ steps:
2323
- "julia --project -e 'using Pkg; Pkg.precompile(strict=true)'"
2424
- "julia --project -e 'using Pkg; Pkg.status()'"
2525

26-
# Force the initialization of the CUDA runtime as it is lazily loaded by default:
27-
- "echo '--- Initialize the CUDA runtime'"
26+
- "echo '--- Initialize ClimaOcean test suite'"
2827
- "julia --project -e 'using CUDA; CUDA.precompile_runtime()'"
2928
- "julia --project -e 'using Pkg; Pkg.test()'"
3029
agents:
@@ -183,7 +182,7 @@ steps:
183182
slurm_ntasks: 1
184183
slurm_gpus_per_task: 1
185184

186-
- label: "Run simulation tests"
185+
- label: "GPU OceanSeaIceModel tests"
187186
key: "test_ocean_sea_ice_model"
188187
env:
189188
TEST_GROUP: "ocean_sea_ice_model"

.github/workflows/ci.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,43 @@ jobs:
5757
files: lcov.info
5858
token: ${{ secrets.CODECOV_TOKEN }}
5959

60+
copernicus_downloading:
61+
name: Copernicus Marine Store Downloading - Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }}
62+
runs-on: ${{ matrix.os }}
63+
timeout-minutes: 60
64+
strategy:
65+
fail-fast: false
66+
matrix:
67+
version:
68+
- '1.10'
69+
os:
70+
- ubuntu-latest
71+
# - windows-latest
72+
arch:
73+
- x64
74+
include:
75+
- os: macOS-latest
76+
arch: aarch64
77+
version: '1.10'
78+
steps:
79+
- uses: actions/checkout@v4
80+
- uses: julia-actions/setup-julia@latest
81+
with:
82+
version: ${{ matrix.version }}
83+
arch: ${{ matrix.arch }}
84+
- uses: julia-actions/cache@v2
85+
- uses: julia-actions/julia-buildpkg@v1
86+
- uses: julia-actions/julia-runtest@v1
87+
env:
88+
TEST_GROUP: "copernicus_downloading"
89+
COPERNICUSMARINE_SERVICE_USERNAME: ${{ secrets.COPERNICUSMARINE_SERVICE_USERNAME }} # To download ECCO data from the podaac website
90+
COPERNICUSMARINE_SERVICE_PASSWORD: ${{ secrets.COPERNICUSMARINE_SERVICE_PASSWORD }} # To download ECCO data from the podaac website
91+
- uses: julia-actions/julia-processcoverage@v1
92+
- uses: codecov/codecov-action@v5
93+
with:
94+
files: lcov.info
95+
token: ${{ secrets.CODECOV_TOKEN }}
96+
6097
reactant:
6198
name: Reactant extension - Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }}
6299
runs-on: ${{ matrix.os }}

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,4 +59,7 @@ docs/src/literated/
5959
*.txt
6060

6161
# vscode
62-
.vscode
62+
.vscode
63+
64+
.CondaPkg
65+
CondaPkg.toml

Project.toml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name = "ClimaOcean"
22
uuid = "0376089a-ecfe-4b0e-a64f-9c555d74d754"
33
license = "MIT"
44
authors = ["Climate Modeling Alliance and contributors"]
5-
version = "0.6.5"
5+
version = "0.6.10"
66

77
[deps]
88
Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e"
@@ -12,6 +12,7 @@ ClimaSeaIce = "6ba0ff68-24e6-4315-936c-2e99227c95a4"
1212
CubicSplines = "9c784101-8907-5a6d-9be6-98f00873c89b"
1313
DataDeps = "124859b0-ceae-595e-8997-d05f6a7a8dfe"
1414
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
15+
DocStringExtensions = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae"
1516
Downloads = "f43a241f-c20a-4ad4-852c-f6b1247861c6"
1617
ImageMorphology = "787d08f9-d448-5407-9aad-5290dd7ab264"
1718
JLD2 = "033835bb-8acc-5ee8-8aae-3f567f8a3819"
@@ -31,18 +32,23 @@ Thermodynamics = "b60c26fb-14c3-4610-9d3e-2d17fe7ff00c"
3132
ZipFile = "a5390f91-8eb1-5f08-bee0-b1d1ffed6cea"
3233

3334
[weakdeps]
35+
CondaPkg = "992eb4ea-22a4-4c89-a5bb-47a3300528ab"
36+
PythonCall = "6099a3de-0909-46bc-b1f4-468b9a2dfc0d"
3437
Reactant = "3c362404-f566-11ee-1572-e11a4b42c853"
3538

3639
[extensions]
40+
ClimaOceanPythonCallExt = ["PythonCall", "CondaPkg"]
3741
ClimaOceanReactantExt = "Reactant"
3842

3943
[compat]
4044
Adapt = "4"
41-
CFTime = "0.1"
45+
CFTime = "0.1, 0.2"
4246
CUDA = "4, 5"
43-
ClimaSeaIce = "0.2.6"
47+
ClimaSeaIce = "0.3"
48+
CondaPkg = "0.2.28"
4449
CubicSplines = "0.2"
4550
DataDeps = "0.7"
51+
DocStringExtensions = "0.9"
4652
Downloads = "1.6"
4753
ImageMorphology = "0.4"
4854
JLD2 = "0.4, 0.5"
@@ -52,6 +58,7 @@ NCDatasets = "0.12, 0.13, 0.14"
5258
Oceananigans = "0.96 - 0.99"
5359
OffsetArrays = "1.14"
5460
PrecompileTools = "1"
61+
PythonCall = "0.9"
5562
Reactant = "0.2.45"
5663
Scratch = "1"
5764
SeawaterPolynomials = "0.3.5"
@@ -69,4 +76,4 @@ MPIPreferences = "3da0fdf6-3ccc-4f1b-acd9-58baa6c99267"
6976
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
7077

7178
[targets]
72-
test = ["Coverage", "Test", "MPIPreferences", "CUDA_Runtime_jll", "Reactant"]
79+
test = ["Coverage", "Test", "MPIPreferences", "CUDA_Runtime_jll", "Reactant", "PythonCall", "CondaPkg"]

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ To illustrate how `OceanSeaIceModel` works we set up a simulation on a grid with
4343
```julia
4444
using Oceananigans
4545
using Oceananigans.Units
46-
using Dates, CFTime
46+
using Dates
4747
import ClimaOcean
4848

4949
arch = GPU()
@@ -57,12 +57,12 @@ grid = LatitudeLongitudeGrid(arch,
5757
bathymetry = ClimaOcean.regrid_bathymetry(grid) # builds gridded bathymetry based on ETOPO1
5858
grid = ImmersedBoundaryGrid(grid, GridFittedBottom(bathymetry))
5959

60-
# Build an ocean simulation initialized to the ECCO state estimate on Jan 1, 1993
60+
# Build an ocean simulation initialized to the ECCO state estimate version 2 on Jan 1, 1993
6161
ocean = ClimaOcean.ocean_simulation(grid)
6262
start_date = DateTime(1993, 1, 1)
6363
set!(ocean.model,
64-
T=ClimaOcean.Metadata(:temperature; dates=start_date, dataset=ClimaOcean.ECCO4Monthly()),
65-
S=ClimaOcean.Metadata(:salinity; dates=start_date, dataset=ClimaOcean.ECCO4Monthly()))
64+
T=ClimaOcean.Metadatum(:temperature; date=start_date, dataset=ClimaOcean.ECCO2Daily()),
65+
S=ClimaOcean.Metadatum(:salinity; date=start_date, dataset=ClimaOcean.ECCO2Daily()))
6666

6767
# Build and run an OceanSeaIceModel (with no sea ice component) forced by JRA55 reanalysis
6868
atmosphere = ClimaOcean.JRA55PrescribedAtmosphere(arch)
@@ -104,7 +104,7 @@ Note that though ClimaOcean is currently focused on hydrostatic modeling with `O
104104
If you use ClimaOcean for your research, teaching, or fun 🤩, everyone in our community will be grateful
105105
if you give credit by citing the corresponding Zenodo record, e.g.,
106106

107-
> Wagner, G. L. et al. (2025). CliMA/ClimaOcean.jl: v0.5.4 (v0.5.4). Zenodo. https://doi.org/10.5281/zenodo.15042648
107+
> Wagner, G. L. et al. (2025). CliMA/ClimaOcean.jl: v0.6.9 (v0.6.9). Zenodo. https://doi.org/10.5281/zenodo.7677442
108108
109109
and also the recent [preprint submitted to the Journal of Advances in Modeling Earth Systems](https://arxiv.org/abs/2502.14148) that presents an overview of all the things that make Oceananigans unique:
110110

docs/Project.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ CFTime = "179af706-886a-5703-950a-314cd64e0468"
33
CairoMakie = "13f3f980-e62b-5c42-98c6-ff1f3baf88f0"
44
DataDeps = "124859b0-ceae-595e-8997-d05f6a7a8dfe"
55
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
6+
DocumenterCitations = "daee34ce-89f3-4625-b898-19384cb65244"
67
Literate = "98b081ad-f1c9-55d3-8b20-4c87d4299306"
78
Oceananigans = "9e8cae18-63c1-5223-a75c-80ca9d6e9a09"
89
SeawaterPolynomials = "d496a93d-167e-4197-9f49-d3af4ff8fe40"
@@ -11,5 +12,6 @@ SeawaterPolynomials = "d496a93d-167e-4197-9f49-d3af4ff8fe40"
1112
CairoMakie = "0.10.12, 0.11, 0.12, 0.13"
1213
DataDeps = "0.7"
1314
Documenter = "1"
15+
DocumenterCitations = "1.3"
1416
Oceananigans = "0.96 - 0.99"
1517
SeawaterPolynomials = "0.3.5"

docs/climaocean.bib

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
@article{edson2013exchange,
2+
title={On the exchange of momentum over the open ocean},
3+
author={Edson, James B and Jampana, Venkata and Weller, Robert A and Bigorre, Sebastien P and Plueddemann, Albert J and Fairall, Christopher W and Miller, Scott D and Mahrt, Larry and Vickers, Dean and Hersbach, Hans},
4+
journal={Journal of Physical Oceanography},
5+
volume={43},
6+
number={8},
7+
pages={1589--1610},
8+
year={2013},
9+
doi={10.1175/JPO-D-12-0173.1}
10+
}
11+
12+
@article{large2009global,
13+
title={The global climatology of an interannually varying air--sea flux data set},
14+
author={Large, W G and Yeager, S G},
15+
journal={Climate Dynamics},
16+
volume={33},
17+
pages={341--364},
18+
year={2009},
19+
doi={10.1007/s00382-008-0441-3}
20+
}
21+
22+
@article{nishizawa2018surface,
23+
author = {Nishizawa, S. and Kitamura, Y.},
24+
title = {A Surface Flux Scheme Based on the {Monin--Obukhov} Similarity for Finite Volume Models},
25+
journal = {Journal of Advances in Modeling Earth Systems},
26+
volume = {10},
27+
number = {12},
28+
pages = {3159-3175},
29+
doi = {10.1029/2018MS001534},
30+
year = {2018}
31+
}
32+
33+
@article{stewart2020jra55,
34+
title={{JRA55-do-based} repeat year forcing datasets for driving ocean--sea-ice models},
35+
author={Stewart, K D and Kim, W M and Urakawa, S and Hogg, A McC and Yeager, S and Tsujino, H and Nakano, H and Kiss, A E and Danabasoglu, G},
36+
journal={Ocean Modelling},
37+
volume={147},
38+
pages={101557},
39+
year={2020},
40+
doi={10.1016/j.ocemod.2019.101557}
41+
}
42+
43+
@article{tsujino2018jra,
44+
title={JRA-55 based surface dataset for driving ocean--sea-ice models ({JRA55-do})},
45+
author={Tsujino, H and Urakawa, S and Nakano, H and Small, R J and Kim, W M and Yeager, S G and Danabasoglu, G and Suzuki, T and Bamber, J L and Bentsen, M and and B{\"o}ning, C and Bozec, A and Chassignet, E and Curchitser, E and Dias, F and Durack, P J and Griffies, S M and Harada, Y and Ilicak, M and Josey, S A and Kobayashi, C and Kobayashi, S and Komuro, Y and Large, W G and Sommer, J and Marsland, S J and Masina, S and Scheinert, M and Tomita, H and Valdivieso, M and Yamazaki, D},
46+
journal={Ocean Modelling},
47+
volume={130},
48+
pages={79--139},
49+
year={2018},
50+
doi={10.1016/j.ocemod.2018.07.002}
51+
}

docs/make.jl

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
using
22
ClimaOcean,
33
Documenter,
4+
DocumenterCitations,
45
Literate
56

67
ENV["DATADEPS_ALWAYS_ACCEPT"] = "true"
78

9+
bib_filepath = joinpath(dirname(@__FILE__), "climaocean.bib")
10+
bib = CitationBibliography(bib_filepath, style=:authoryear)
11+
812
#####
913
##### Generate examples
1014
#####
@@ -13,12 +17,8 @@ const EXAMPLES_DIR = joinpath(@__DIR__, "..", "examples")
1317
const OUTPUT_DIR = joinpath(@__DIR__, "src/literated")
1418

1519
to_be_literated = [
16-
# "ecco_inspect_temperature_salinity.jl",
17-
# "generate_bathymetry.jl",
18-
# "generate_surface_fluxes.jl",
1920
"single_column_os_papa_simulation.jl",
2021
"one_degree_simulation.jl",
21-
# "mediterranean_simulation_with_ecco_restoring.jl",
2222
"near_global_ocean_simulation.jl"
2323
]
2424

@@ -42,26 +42,26 @@ pages = [
4242
"Home" => "index.md",
4343

4444
"Examples" => [
45-
# "Inspect ECCO2 data" => "literated/ecco_inspect_temperature_salinity.md",
46-
# "Generate bathymetry" => "literated/generate_bathymetry.md",
47-
# "Surface fluxes" => "literated/generate_surface_fluxes.md",
48-
"Single-column simulation" => "literated/single_column_os_papa_simulation.md",
49-
# "Mediterranean simulation with ECCO restoring" => "literated/mediterranean_simulation_with_ecco_restoring.md",
50-
"One-degree Ocean simulation" => "literated/one_degree_simulation.md",
51-
"Near-global Ocean simulation" => "literated/near_global_ocean_simulation.md",
45+
"Single-column ocean simulation" => "literated/single_column_os_papa_simulation.md",
46+
"One-degree ocean simulation" => "literated/one_degree_simulation.md",
47+
"Near-global ocean simulation" => "literated/near_global_ocean_simulation.md",
5248
],
5349

50+
"Interface fluxes" => "interface_fluxes.md",
51+
5452
"Library" => [
5553
"Contents" => "library/outline.md",
5654
"Public" => "library/public.md",
5755
"Private" => "library/internals.md",
5856
"Function index" => "library/function_index.md",
5957
],
58+
"References" => "references.md",
6059
]
6160

6261
makedocs(sitename = "ClimaOcean.jl";
6362
format,
6463
pages,
64+
plugins = [bib],
6565
modules = [ClimaOcean],
6666
doctest = true,
6767
clean = true,

docs/src/index.md

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
# ClimaOcean.jl
22

3-
🌎 Realistic ocean-only and coupled ocean + sea-ice simulations driven by prescribed atmospheres and based on [Oceananigans](https://github.com/CliMA/Oceananigans.jl) and [ClimaSeaIce](https://github.com/CliMA/ClimaSeaIce.jl).
3+
🌎 Realistic ocean-only and coupled ocean-sea ice simulations driven by prescribed atmospheres and based on [Oceananigans](https://github.com/CliMA/Oceananigans.jl) and [ClimaSeaIce](https://github.com/CliMA/ClimaSeaIce.jl).
44

5-
ClimaOcean implements a framework for driving coupled ocean and sea ice simulations with prescribed atmospheres, using bulk formula to compute atmosphere-ocean, atmosphere-ice, and ocean-ice fluxes of heat, momentum, and freshwater. ClimaOcean builds off the Oceananigans framework, which provides tools for gridded finite volume computations on CPUs and GPUs and building ocean-flavored fluid dynamics simulations. ClimaSeaIce, which provides software for both stand-alone and coupled sea ice simulations, is also built with Oceananigans.
5+
ClimaOcean implements a framework for coupling prescribed or prognostic representations of the ocean, sea ice, and atmosphere state.
6+
Fluxes of heat, momentum, and freshwater are computed across the interfaces of its component models according to either Monin--Obukhov similarity theory,
7+
or coefficient-based "bulk formula".
8+
ClimaOcean builds off Oceananigans, which provides tools for gridded finite-volume computations on CPUs and GPUs and building ocean-flavored fluid dynamics simulations. ClimaSeaIce, which provides software for both stand-alone and coupled sea ice simulations, is also built with Oceananigans.
69

7-
ClimaOcean's core abstractions are `OceanSeaIceModel` which encapsulates the ocean simulation, sea ice simulation, prescribed atmospheric state, atmospheric thermodynamic parameters, and parameterizations that define how the three communicate. ClimaOcean also implements `ocean_simulation`, a utility for building realistic, hydrostatic ocean simulations with Oceananigans ensuring compatibility with `OceanSeaIceModel`.
10+
ClimaOcean's core abstraction is [`OceanSeaIceModel`](@ref), which encapsulates the ocean, sea ice, and atmosphere state, and interfacial flux parameterizations.
11+
ClimaOcean also implements [`ocean_simulation`](@ref), a utility for building realistic, hydrostatic ocean simulations with Oceananigans ensuring compatibility with `OceanSeaIceModel`.
812

913
ClimaOcean is written in Julia by the [Climate Modeling Alliance](https://clima.caltech.edu)
1014
and heroic external collaborators.
@@ -28,12 +32,12 @@ julia> Pkg.add("ClimaOcean")
2832

2933
## Quick start
3034

31-
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):
35+
The following script implements a near-global ocean simulation initialized from the [ECCO state estimate](https://doi.org/10.5194/gmd-8-3071-2015) and coupled to a prescribed atmosphere derived from the [JRA55-do reanalysis](https://www.sciencedirect.com/science/article/pii/S146350031830235X):
3236

3337
```julia
3438
using Oceananigans
3539
using Oceananigans.Units
36-
using Dates, CFTime
40+
using Dates
3741
import ClimaOcean
3842

3943
arch = GPU()
@@ -47,12 +51,12 @@ grid = LatitudeLongitudeGrid(arch,
4751
bathymetry = ClimaOcean.regrid_bathymetry(grid) # builds gridded bathymetry based on ETOPO1
4852
grid = ImmersedBoundaryGrid(grid, GridFittedBottom(bathymetry))
4953

50-
# Build an ocean simulation initialized to the ECCO state estimate on Jan 1, 1993
54+
# Build an ocean simulation initialized to the ECCO state estimate version 2 on Jan 1, 1993
5155
ocean = ClimaOcean.ocean_simulation(grid)
5256
start_date = DateTime(1993, 1, 1)
5357
set!(ocean.model,
54-
T=ClimaOcean.Metadata(:temperature; dates=start_date, dataset=ClimaOcean.ECCO4Monthly()),
55-
S=ClimaOcean.Metadata(:salinity; dates=start_date, dataset=ClimaOcean.ECCO4Monthly()))
58+
T=ClimaOcean.Metadatum(:temperature; date=start_date, dataset=ClimaOcean.ECCO2Daily()),
59+
S=ClimaOcean.Metadatum(:salinity; date=start_date, dataset=ClimaOcean.ECCO2Daily()))
5660

5761
# Build and run an OceanSeaIceModel (with no sea ice component) forced by JRA55 reanalysis
5862
atmosphere = ClimaOcean.JRA55PrescribedAtmosphere(arch)
@@ -75,3 +79,4 @@ heatmap(view(speed, :, :, ocean.model.grid.Nz), colorrange=(0, 0.5), colormap=:m
7579
```
7680

7781
![image](https://github.com/user-attachments/assets/4c484b93-38fe-4840-bf7d-63a3a59d29e1)
82+

0 commit comments

Comments
 (0)