From cfd3d3bcd2da9c4368838105d8a6a75ba70a9963 Mon Sep 17 00:00:00 2001 From: Gregory Wagner Date: Fri, 23 May 2025 07:07:34 -0600 Subject: [PATCH 01/10] improve one degree further --- docs/make.jl | 8 ++++---- examples/one_degree_simulation.jl | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/make.jl b/docs/make.jl index 2b06b6dc..44b6d3b3 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", + # "single_column_os_papa_simulation.jl", "one_degree_simulation.jl", - "near_global_ocean_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", + # "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", + # "Near-global ocean simulation" => "literated/near_global_ocean_simulation.md", ], "Interface fluxes" => "interface_fluxes.md", diff --git a/examples/one_degree_simulation.jl b/examples/one_degree_simulation.jl index efb29e0f..20202866 100644 --- a/examples/one_degree_simulation.jl +++ b/examples/one_degree_simulation.jl @@ -44,8 +44,8 @@ grid = ImmersedBoundaryGrid(underlying_grid, GridFittedBottom(bottom_height); # # We include temperature and salinity surface restoring to ECCO data from 1993 thoughout the water column. -start_date = DateTime(1993, 1, 1) -stop_date = DateTime(1993, 12, 1) +start_date = DateTime(1993, 6, 1) +stop_date = DateTime(1994, 5, 1) dates = range(start_date, step=Month(1), stop=stop_date) ecco_temperature = Metadata(:temperature; dates, dataset=ECCO4Monthly()) ecco_salinity = Metadata(:salinity; dates, dataset=ECCO4Monthly()) @@ -117,7 +117,7 @@ function progress(sim) u, v, w = ocean.model.velocities T = ocean.model.tracers.T e = ocean.model.tracers.e - Tmin, Tmax = minimum(T), maximum(T) + Tmin, Tmax, Tavg = minimum(T), maximum(T), mean(T) emax = maximum(e) umax = (maximum(abs, u), maximum(abs, v), maximum(abs, w)) @@ -125,7 +125,7 @@ function progress(sim) msg1 = @sprintf("Time: %s, iter: %d", prettytime(sim), iteration(sim)) msg2 = @sprintf(", max|u|: (%.1e, %.1e, %.1e) m s⁻¹, ", umax...) - msg3 = @sprintf(", extrema(T): (%.1f, %.1f) ᵒC, ", Tmin, Tmax) + msg3 = @sprintf(", extrema(T): (%.1f, %.1f) ᵒC, mean(T): %.1f", Tmin, Tmax, Tavg) msg4 = @sprintf(", maximum(e): %.2f m² s⁻², ", emax) msg5 = @sprintf(", wall time: %s \n", prettytime(step_time)) From 1f772869ac28a6b26362487dfbbe84136e166bb2 Mon Sep 17 00:00:00 2001 From: "Gregory L. Wagner" Date: Fri, 23 May 2025 14:24:37 -0600 Subject: [PATCH 02/10] Update examples/one_degree_simulation.jl --- examples/one_degree_simulation.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/one_degree_simulation.jl b/examples/one_degree_simulation.jl index 20202866..4436eb38 100644 --- a/examples/one_degree_simulation.jl +++ b/examples/one_degree_simulation.jl @@ -117,7 +117,7 @@ function progress(sim) u, v, w = ocean.model.velocities T = ocean.model.tracers.T e = ocean.model.tracers.e - Tmin, Tmax, Tavg = minimum(T), maximum(T), mean(T) + Tmin, Tmax, Tavg = minimum(T), maximum(T), mean(view(T, :, :, ocean.model.grid.Nz)) emax = maximum(e) umax = (maximum(abs, u), maximum(abs, v), maximum(abs, w)) From fd4192b6808ec6ed3876af1b50488cdc1a63809d Mon Sep 17 00:00:00 2001 From: "Gregory L. Wagner" Date: Fri, 23 May 2025 16:13:16 -0600 Subject: [PATCH 03/10] Update one_degree_simulation.jl --- examples/one_degree_simulation.jl | 1 + 1 file changed, 1 insertion(+) diff --git a/examples/one_degree_simulation.jl b/examples/one_degree_simulation.jl index 4436eb38..8d1cd295 100644 --- a/examples/one_degree_simulation.jl +++ b/examples/one_degree_simulation.jl @@ -13,6 +13,7 @@ using Oceananigans using Oceananigans.Units using Dates using Printf +using Statistics # ### Grid and Bathymetry From bea2d85a0f0a28dbd3d8235ebbef831ce49d6f9e Mon Sep 17 00:00:00 2001 From: "Gregory L. Wagner" Date: Fri, 23 May 2025 16:13:21 -0600 Subject: [PATCH 04/10] Update examples/one_degree_simulation.jl --- examples/one_degree_simulation.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/one_degree_simulation.jl b/examples/one_degree_simulation.jl index 8d1cd295..bfdd3abd 100644 --- a/examples/one_degree_simulation.jl +++ b/examples/one_degree_simulation.jl @@ -126,7 +126,7 @@ function progress(sim) msg1 = @sprintf("Time: %s, iter: %d", prettytime(sim), iteration(sim)) msg2 = @sprintf(", max|u|: (%.1e, %.1e, %.1e) m s⁻¹, ", umax...) - msg3 = @sprintf(", extrema(T): (%.1f, %.1f) ᵒC, mean(T): %.1f", Tmin, Tmax, Tavg) + msg3 = @sprintf(", extrema(T): (%.1f, %.1f) ᵒC, mean(T(z=0)): %.1f", Tmin, Tmax, Tavg) msg4 = @sprintf(", maximum(e): %.2f m² s⁻², ", emax) msg5 = @sprintf(", wall time: %s \n", prettytime(step_time)) From 9e014db2e5761abd3533b5782ae7531a6b9f8d65 Mon Sep 17 00:00:00 2001 From: "Navid C. Constantinou" Date: Sat, 24 May 2025 09:58:30 +0300 Subject: [PATCH 05/10] =?UTF-8?q?add=20=E1=B5=92C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- examples/one_degree_simulation.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/one_degree_simulation.jl b/examples/one_degree_simulation.jl index bfdd3abd..0b92a992 100644 --- a/examples/one_degree_simulation.jl +++ b/examples/one_degree_simulation.jl @@ -126,7 +126,7 @@ function progress(sim) msg1 = @sprintf("Time: %s, iter: %d", prettytime(sim), iteration(sim)) msg2 = @sprintf(", max|u|: (%.1e, %.1e, %.1e) m s⁻¹, ", umax...) - msg3 = @sprintf(", extrema(T): (%.1f, %.1f) ᵒC, mean(T(z=0)): %.1f", Tmin, Tmax, Tavg) + msg3 = @sprintf(", extrema(T): (%.1f, %.1f) ᵒC, mean(T(z=0)): %.1f ᵒC", Tmin, Tmax, Tavg) msg4 = @sprintf(", maximum(e): %.2f m² s⁻², ", emax) msg5 = @sprintf(", wall time: %s \n", prettytime(step_time)) @@ -158,7 +158,7 @@ ocean.output_writers[:surface] = JLD2Writer(ocean.model, outputs; # We are ready to press the big red button and run the simulation. -# After we run for a short time (here we set up the simulation with `stop_time = 10days`), +# After we run for a short time (here we set up the simulation with `stop_time = 20days`), # we increase the timestep and run for longer. run!(simulation) From 785107c0c0437d47fe4ecb0b7ec046afbcd0412f Mon Sep 17 00:00:00 2001 From: "Navid C. Constantinou" Date: Sat, 24 May 2025 09:59:12 +0300 Subject: [PATCH 06/10] Update one_degree_simulation.jl --- examples/one_degree_simulation.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/one_degree_simulation.jl b/examples/one_degree_simulation.jl index 0b92a992..51e7aa3c 100644 --- a/examples/one_degree_simulation.jl +++ b/examples/one_degree_simulation.jl @@ -164,7 +164,7 @@ ocean.output_writers[:surface] = JLD2Writer(ocean.model, outputs; run!(simulation) simulation.Δt = 20minutes -simulation.stop_time = 360days +simulation.stop_time = 5 * 365days run!(simulation) # ### A pretty movie From 3d4ebfd028e2dd33672ff0cddd101b7e8450b083 Mon Sep 17 00:00:00 2001 From: "Navid C. Constantinou" Date: Sat, 24 May 2025 15:26:11 +0300 Subject: [PATCH 07/10] Update one_degree_simulation.jl --- examples/one_degree_simulation.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/one_degree_simulation.jl b/examples/one_degree_simulation.jl index 51e7aa3c..adfb46a4 100644 --- a/examples/one_degree_simulation.jl +++ b/examples/one_degree_simulation.jl @@ -223,7 +223,7 @@ axe = Axis(fig[3, 1]) hm = heatmap!(axs, sn, colorrange = (0, 0.5), colormap = :deep, nan_color=:lightgray) Colorbar(fig[1, 2], hm, label = "Surface speed (m s⁻¹)") -hm = heatmap!(axT, Tn, colorrange = (-1, 30), colormap = :magma, nan_color=:lightgray) +hm = heatmap!(axT, Tn, colorrange = (-1, 38), colormap = :magma, nan_color=:lightgray) Colorbar(fig[2, 2], hm, label = "Surface Temperature (ᵒC)") hm = heatmap!(axe, en, colorrange = (0, 1e-3), colormap = :solar, nan_color=:lightgray) From 7d48893c60103d1856198ae3f42af21c690f6d58 Mon Sep 17 00:00:00 2001 From: "Navid C. Constantinou" Date: Sun, 25 May 2025 13:18:18 +0300 Subject: [PATCH 08/10] Update make.jl --- docs/make.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/make.jl b/docs/make.jl index 44b6d3b3..187b9dfd 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -42,9 +42,9 @@ pages = [ "Home" => "index.md", "Examples" => [ - # "Single-column ocean simulation" => "literated/single_column_os_papa_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", + "Near-global ocean simulation" => "literated/near_global_ocean_simulation.md", ], "Interface fluxes" => "interface_fluxes.md", From e9f8d659cfdbd5fb38040b63eab2b24b649830d8 Mon Sep 17 00:00:00 2001 From: "Navid C. Constantinou" Date: Sun, 25 May 2025 13:19:05 +0300 Subject: [PATCH 09/10] Update one_degree_simulation.jl --- examples/one_degree_simulation.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/one_degree_simulation.jl b/examples/one_degree_simulation.jl index adfb46a4..9170dc45 100644 --- a/examples/one_degree_simulation.jl +++ b/examples/one_degree_simulation.jl @@ -164,7 +164,7 @@ ocean.output_writers[:surface] = JLD2Writer(ocean.model, outputs; run!(simulation) simulation.Δt = 20minutes -simulation.stop_time = 5 * 365days +simulation.stop_time = 365days run!(simulation) # ### A pretty movie @@ -223,7 +223,7 @@ axe = Axis(fig[3, 1]) hm = heatmap!(axs, sn, colorrange = (0, 0.5), colormap = :deep, nan_color=:lightgray) Colorbar(fig[1, 2], hm, label = "Surface speed (m s⁻¹)") -hm = heatmap!(axT, Tn, colorrange = (-1, 38), colormap = :magma, nan_color=:lightgray) +hm = heatmap!(axT, Tn, colorrange = (-1, 32), colormap = :magma, nan_color=:lightgray) Colorbar(fig[2, 2], hm, label = "Surface Temperature (ᵒC)") hm = heatmap!(axe, en, colorrange = (0, 1e-3), colormap = :solar, nan_color=:lightgray) From 487eae9e82fad5246f78de316643d980cb293312 Mon Sep 17 00:00:00 2001 From: "Navid C. Constantinou" Date: Sun, 25 May 2025 13:19:32 +0300 Subject: [PATCH 10/10] Update make.jl --- docs/make.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/make.jl b/docs/make.jl index 187b9dfd..2b06b6dc 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", + "single_column_os_papa_simulation.jl", "one_degree_simulation.jl", - # "near_global_ocean_simulation.jl" + "near_global_ocean_simulation.jl" ] for file in to_be_literated