From b029731cab77123ae8ab1e250868fc3e1884a8f5 Mon Sep 17 00:00:00 2001 From: "Navid C. Constantinou" Date: Sat, 24 May 2025 12:27:11 +0300 Subject: [PATCH 1/9] run the hello-global-ocean --- docs/src/index.md | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/docs/src/index.md b/docs/src/index.md index 8e6ccbc1f..84ac140db 100644 --- a/docs/src/index.md +++ b/docs/src/index.md @@ -32,12 +32,12 @@ julia> Pkg.add("ClimaOcean") ## Quick start -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): +The following script implements a near-global ocean simulation initialized from the [ECCO4 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): -```julia +```@example hello-global-ocean using Oceananigans using Oceananigans.Units -using Dates, CFTime +using Dates import ClimaOcean arch = GPU() @@ -69,13 +69,11 @@ The simulation above achieves approximately 8 simulated years per day of wall ti We can leverage `Oceananigans` features to plot the surface speed at the end of the simulation: -```julia +```@example hello-global-ocean u, v, w = ocean.model.velocities speed = Field(sqrt(u^2 + v^2)) compute!(speed) -using GLMakie +using CairoMakie heatmap(view(speed, :, :, ocean.model.grid.Nz), colorrange=(0, 0.5), colormap=:magma, nan_color=:lightgray) ``` - -![image](https://github.com/user-attachments/assets/4c484b93-38fe-4840-bf7d-63a3a59d29e1) From 7a2253742ab292cd8d22be91156b97cbfe82596f Mon Sep 17 00:00:00 2001 From: "Navid C. Constantinou" Date: Sun, 25 May 2025 00:51:59 +0300 Subject: [PATCH 2/9] Update index.md --- docs/src/index.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/src/index.md b/docs/src/index.md index 84ac140db..05d41827a 100644 --- a/docs/src/index.md +++ b/docs/src/index.md @@ -1,11 +1,11 @@ # ClimaOcean.jl -🌎 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). +🌎 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). ClimaOcean implements a framework for coupling prescribed or prognostic representations of the ocean, sea ice, and atmosphere state. Fluxes of heat, momentum, and freshwater are computed across the interfaces of its component models according to either Monin-Obukhov similarity theory, or coefficient-based "bulk formula". -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. +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. ClimaOcean's core abstraction is [`OceanSeaIceModel`](@ref), which encapsulates the ocean, sea ice, and atmosphere state, and interfacial flux parameterizations. ClimaOcean also implements [`ocean_simulation`](@ref), a utility for building realistic, hydrostatic ocean simulations with Oceananigans ensuring compatibility with `OceanSeaIceModel`. From 320e253c455939aeab98fc49e4220b69d64a86f9 Mon Sep 17 00:00:00 2001 From: "Navid C. Constantinou" Date: Wed, 28 May 2025 17:47:13 +0300 Subject: [PATCH 3/9] Update index.md --- docs/src/index.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/src/index.md b/docs/src/index.md index 05d41827a..1553b0a78 100644 --- a/docs/src/index.md +++ b/docs/src/index.md @@ -55,8 +55,8 @@ grid = ImmersedBoundaryGrid(grid, GridFittedBottom(bathymetry)) ocean = ClimaOcean.ocean_simulation(grid) start_date = DateTime(1993, 1, 1) set!(ocean.model, - T=ClimaOcean.Metadata(:temperature; dates=start_date, dataset=ClimaOcean.ECCO4Monthly()), - S=ClimaOcean.Metadata(:salinity; dates=start_date, dataset=ClimaOcean.ECCO4Monthly())) + T=ClimaOcean.Metadata(:temperature; dates=start_date, dataset=ClimaOcean.ECCO2Daily()), + S=ClimaOcean.Metadata(:salinity; dates=start_date, dataset=ClimaOcean.ECCO2Daily())) # Build and run an OceanSeaIceModel (with no sea ice component) forced by JRA55 reanalysis atmosphere = ClimaOcean.JRA55PrescribedAtmosphere(arch) From 226be172351376f77b9d0ecbddc606eb84d45fff Mon Sep 17 00:00:00 2001 From: "Navid C. Constantinou" Date: Thu, 29 May 2025 06:19:10 +0300 Subject: [PATCH 4/9] update hello-global-ocean --- README.md | 13 ++++++------- docs/src/index.md | 7 +++---- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 761ed76e7..6e0158443 100644 --- a/README.md +++ b/README.md @@ -42,11 +42,10 @@ To illustrate how `OceanSeaIceModel` works we set up a simulation on a grid with ```julia using Oceananigans -using Oceananigans.Units -using Dates, CFTime +using Dates import ClimaOcean -arch = GPU() +arch = CPU() grid = LatitudeLongitudeGrid(arch, size = (1440, 560, 10), halo = (7, 7, 7), @@ -57,12 +56,12 @@ grid = LatitudeLongitudeGrid(arch, bathymetry = ClimaOcean.regrid_bathymetry(grid) # builds gridded bathymetry based on ETOPO1 grid = ImmersedBoundaryGrid(grid, GridFittedBottom(bathymetry)) -# Build an ocean simulation initialized to the ECCO state estimate on Jan 1, 1993 +# Build an ocean simulation initialized to the ECCO state estimate version 2 on Jan 1, 1993 ocean = ClimaOcean.ocean_simulation(grid) start_date = DateTime(1993, 1, 1) set!(ocean.model, - T=ClimaOcean.Metadata(:temperature; dates=start_date, dataset=ClimaOcean.ECCO4Monthly()), - S=ClimaOcean.Metadata(:salinity; dates=start_date, dataset=ClimaOcean.ECCO4Monthly())) + T=ClimaOcean.Metadatum(:temperature; date=start_date, dataset=ClimaOcean.ECCO2Daily()), + S=ClimaOcean.Metadatum(:salinity; date=start_date, dataset=ClimaOcean.ECCO2Daily())) # Build and run an OceanSeaIceModel (with no sea ice component) forced by JRA55 reanalysis atmosphere = ClimaOcean.JRA55PrescribedAtmosphere(arch) @@ -104,7 +103,7 @@ Note that though ClimaOcean is currently focused on hydrostatic modeling with `O If you use ClimaOcean for your research, teaching, or fun 🤩, everyone in our community will be grateful if you give credit by citing the corresponding Zenodo record, e.g., -> Wagner, G. L. et al. (2025). CliMA/ClimaOcean.jl: v0.5.4 (v0.5.4). Zenodo. https://doi.org/10.5281/zenodo.15042648 +> Wagner, G. L. et al. (2025). CliMA/ClimaOcean.jl: v0.6.9 (v0.6.9). Zenodo. https://doi.org/10.5281/zenodo.7677442 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: diff --git a/docs/src/index.md b/docs/src/index.md index 741f21f60..a29d71f1d 100644 --- a/docs/src/index.md +++ b/docs/src/index.md @@ -36,7 +36,6 @@ The following script implements a near-global ocean simulation initialized from ```@example hello-global-ocean using Oceananigans -using Oceananigans.Units using Dates import ClimaOcean @@ -51,12 +50,12 @@ grid = LatitudeLongitudeGrid(arch, bathymetry = ClimaOcean.regrid_bathymetry(grid) # builds gridded bathymetry based on ETOPO1 grid = ImmersedBoundaryGrid(grid, GridFittedBottom(bathymetry)) -# Build an ocean simulation initialized to the ECCO state estimate on Jan 1, 1993 +# Build an ocean simulation initialized to the ECCO state estimate version 2 on Jan 1, 1993 ocean = ClimaOcean.ocean_simulation(grid) start_date = DateTime(1993, 1, 1) set!(ocean.model, - T=ClimaOcean.Metadata(:temperature; dates=start_date, dataset=ClimaOcean.ECCO2Daily()), - S=ClimaOcean.Metadata(:salinity; dates=start_date, dataset=ClimaOcean.ECCO2Daily())) + T=ClimaOcean.Metadatum(:temperature; date=start_date, dataset=ClimaOcean.ECCO2Daily()), + S=ClimaOcean.Metadatum(:salinity; date=start_date, dataset=ClimaOcean.ECCO2Daily())) # Build and run an OceanSeaIceModel (with no sea ice component) forced by JRA55 reanalysis atmosphere = ClimaOcean.JRA55PrescribedAtmosphere(arch) From 84a6bba82dc856640ff1ff93ae719a3ad33c9a9b Mon Sep 17 00:00:00 2001 From: "Navid C. Constantinou" Date: Thu, 29 May 2025 06:20:16 +0300 Subject: [PATCH 5/9] no examples to test --- docs/make.jl | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/make.jl b/docs/make.jl index 2b06b6dc7..3f3464b3b 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -17,9 +17,9 @@ const EXAMPLES_DIR = joinpath(@__DIR__, "..", "examples") const OUTPUT_DIR = joinpath(@__DIR__, "src/literated") to_be_literated = [ - "single_column_os_papa_simulation.jl", - "one_degree_simulation.jl", - "near_global_ocean_simulation.jl" + # "single_column_os_papa_simulation.jl", + # "one_degree_simulation.jl", + # "near_global_ocean_simulation.jl" ] for file in to_be_literated @@ -42,9 +42,9 @@ pages = [ "Home" => "index.md", "Examples" => [ - "Single-column ocean simulation" => "literated/single_column_os_papa_simulation.md", - "One-degree ocean simulation" => "literated/one_degree_simulation.md", - "Near-global ocean simulation" => "literated/near_global_ocean_simulation.md", + # "Single-column ocean simulation" => "literated/single_column_os_papa_simulation.md", + # "One-degree ocean simulation" => "literated/one_degree_simulation.md", + # "Near-global ocean simulation" => "literated/near_global_ocean_simulation.md", ], "Interface fluxes" => "interface_fluxes.md", From 1a1121317ab73ede9211b202124f4b15740121cc Mon Sep 17 00:00:00 2001 From: "Navid C. Constantinou" Date: Thu, 29 May 2025 06:21:36 +0300 Subject: [PATCH 6/9] GPU power --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6e0158443..613f44793 100644 --- a/README.md +++ b/README.md @@ -45,7 +45,7 @@ using Oceananigans using Dates import ClimaOcean -arch = CPU() +arch = GPU() grid = LatitudeLongitudeGrid(arch, size = (1440, 560, 10), halo = (7, 7, 7), From be3885c0c229603dea9084bfa23bd2d6b7b87ea3 Mon Sep 17 00:00:00 2001 From: "Navid C. Constantinou" Date: Thu, 29 May 2025 06:43:50 +0300 Subject: [PATCH 7/9] we need units --- README.md | 1 + docs/src/index.md | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 613f44793..e4a2964e4 100644 --- a/README.md +++ b/README.md @@ -42,6 +42,7 @@ To illustrate how `OceanSeaIceModel` works we set up a simulation on a grid with ```julia using Oceananigans +using Oceananigans.Units using Dates import ClimaOcean diff --git a/docs/src/index.md b/docs/src/index.md index a29d71f1d..4ece0e7a7 100644 --- a/docs/src/index.md +++ b/docs/src/index.md @@ -32,10 +32,11 @@ julia> Pkg.add("ClimaOcean") ## Quick start -The following script implements a near-global ocean simulation initialized from the [ECCO4 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): +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): ```@example hello-global-ocean using Oceananigans +using Oceananigans.Units using Dates import ClimaOcean From f19f38c55b0fa19c3dddf1bf37a64820e5bac0a3 Mon Sep 17 00:00:00 2001 From: "Navid C. Constantinou" Date: Thu, 29 May 2025 07:30:40 +0300 Subject: [PATCH 8/9] Update make.jl --- docs/make.jl | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/make.jl b/docs/make.jl index 3f3464b3b..2b06b6dc7 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -17,9 +17,9 @@ const EXAMPLES_DIR = joinpath(@__DIR__, "..", "examples") const OUTPUT_DIR = joinpath(@__DIR__, "src/literated") to_be_literated = [ - # "single_column_os_papa_simulation.jl", - # "one_degree_simulation.jl", - # "near_global_ocean_simulation.jl" + "single_column_os_papa_simulation.jl", + "one_degree_simulation.jl", + "near_global_ocean_simulation.jl" ] for file in to_be_literated @@ -42,9 +42,9 @@ pages = [ "Home" => "index.md", "Examples" => [ - # "Single-column ocean simulation" => "literated/single_column_os_papa_simulation.md", - # "One-degree ocean simulation" => "literated/one_degree_simulation.md", - # "Near-global ocean simulation" => "literated/near_global_ocean_simulation.md", + "Single-column ocean simulation" => "literated/single_column_os_papa_simulation.md", + "One-degree ocean simulation" => "literated/one_degree_simulation.md", + "Near-global ocean simulation" => "literated/near_global_ocean_simulation.md", ], "Interface fluxes" => "interface_fluxes.md", From 4059a5a3b108ab5d49946da102e6a1fba6d1aacf Mon Sep 17 00:00:00 2001 From: "Navid C. Constantinou" Date: Thu, 29 May 2025 12:08:53 +0300 Subject: [PATCH 9/9] Update index.md --- docs/src/index.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/docs/src/index.md b/docs/src/index.md index 4ece0e7a7..56573195a 100644 --- a/docs/src/index.md +++ b/docs/src/index.md @@ -34,7 +34,7 @@ julia> Pkg.add("ClimaOcean") 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): -```@example hello-global-ocean +```julia using Oceananigans using Oceananigans.Units using Dates @@ -69,11 +69,14 @@ The simulation above achieves approximately 8 simulated years per day of wall ti We can leverage `Oceananigans` features to plot the surface speed at the end of the simulation: -```@example hello-global-ocean +```julia u, v, w = ocean.model.velocities speed = Field(sqrt(u^2 + v^2)) compute!(speed) -using CairoMakie +using GLMakie heatmap(view(speed, :, :, ocean.model.grid.Nz), colorrange=(0, 0.5), colormap=:magma, nan_color=:lightgray) ``` + +![image](https://github.com/user-attachments/assets/4c484b93-38fe-4840-bf7d-63a3a59d29e1) +