Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a `biogeochemistry kwarg to ocean_simulation #304

Merged
merged 7 commits into from
Dec 18, 2024
Merged

Add a `biogeochemistry kwarg to ocean_simulation #304

merged 7 commits into from
Dec 18, 2024

Conversation

glwagner
Copy link
Member

@glwagner glwagner commented Dec 17, 2024

@seamanticscience
Copy link

seamanticscience commented Dec 17, 2024

Can we have tracers and boundary_conditions too, please? Is there a different way we should be adding the bgc forcing instead?

@glwagner
Copy link
Member Author

glwagner commented Dec 17, 2024

There is tracers as a kwarg:

@glwagner
Copy link
Member Author

Is there a different way we should be adding the bgc forcing instead?

I'm not 100% sure what you mean by bgc forcing. Do you mean the CO2 flux?

@glwagner
Copy link
Member Author

You can experiment with adding the CO2 flux in a script. I think ultimately it would be nice if you incorporated this feature directly into ocean_simulation, ie detecting whether the user is using a model from ClimaOceanBiogeochemistry, and then adding the appropriate boundary conditions.

Another design is possible too. For example, the CO2 flux could be treated like momentum and heat fluxes. So when user asks for a BGC model from ClimaOceanBiogeochemistry, you build an array to hold the fluxes, and then compute the fluxes alongside the air-sea momentum, heat, freshwater fluxes, using knowledge of the atmospheric state. This makes sense to me.

I'm not totally sure what design makes sense. Let us know.

@glwagner
Copy link
Member Author

Can we have tracers and boundary_conditions too, please?

Okay, both are there. Feel free to commit to this PR if you need other things.

@glwagner
Copy link
Member Author

Here's some output from my laptop:

julia> include("three_degree_simulation.jl")
┌ Warning: `ImmersedBoundaryCondition` is experimental.
└ @ Oceananigans.ImmersedBoundaries ~/.julia/packages/Oceananigans/Qooz1/src/ImmersedBoundaries/immersed_boundary_condition.jl:57
┌ Warning: `ImmersedBoundaryCondition` is experimental.
└ @ Oceananigans.ImmersedBoundaries ~/.julia/packages/Oceananigans/Qooz1/src/ImmersedBoundaries/immersed_boundary_condition.jl:57
┌ Warning: `ImmersedBoundaryCondition` is experimental.
└ @ Oceananigans.ImmersedBoundaries ~/.julia/packages/Oceananigans/Qooz1/src/ImmersedBoundaries/immersed_boundary_condition.jl:57
┌ Warning: `ImmersedBoundaryCondition` is experimental.
└ @ Oceananigans.ImmersedBoundaries ~/.julia/packages/Oceananigans/Qooz1/src/ImmersedBoundaries/immersed_boundary_condition.jl:57
┌ Warning: This simulation will run forever as stop iteration = stop time = wall time limit = Inf.
└ @ Oceananigans.Simulations ~/.julia/packages/Oceananigans/Qooz1/src/Simulations/simulation.jl:55
[ Info: Initializing simulation...
[ Info: Time: 0 seconds, n: 0, Δt: 20 minutes, max|u|: (0.00e+00, 0.00e+00, 0.00e+00) m s⁻¹, extrema(T): (30.46, -1.86) ᵒC, wall time: 379.473 ms
[ Info:     ... simulation initialization complete (94.220 ms)
[ Info: Executing initial time step...
┌ Warning: Simulation stopped during initialization.
└ @ Oceananigans.Simulations ~/.julia/packages/Oceananigans/Qooz1/src/Simulations/run.jl:129
[ Info:     ... initial time step complete (10.552 seconds).
[ Info: Time: 3.333 hours, n: 10, Δt: 20 minutes, max|u|: (4.20e-01, 4.94e-01, 1.34e-03) m s⁻¹, extrema(T): (30.50, -2.03) ᵒC, wall time: 1.507 minutes
[ Info: Time: 6.667 hours, n: 20, Δt: 20 minutes, max|u|: (6.66e-01, 1.06e+00, 2.87e-03) m s⁻¹, extrema(T): (30.53, -2.15) ᵒC, wall time: 32.509 seconds
[ Info: Time: 10 hours, n: 30, Δt: 20 minutes, max|u|: (8.22e-01, 1.65e+00, 4.44e-03) m s⁻¹, extrema(T): (30.55, -2.25) ᵒC, wall time: 32.206 seconds
[ Info: Time: 13.333 hours, n: 40, Δt: 20 minutes, max|u|: (9.17e-01, 2.20e+00, 5.91e-03) m s⁻¹, extrema(T): (30.56, -2.29) ᵒC, wall time: 31.577 seconds
[ Info: Time: 16.667 hours, n: 50, Δt: 20 minutes, max|u|: (1.14e+00, 2.76e+00, 7.33e-03) m s⁻¹, extrema(T): (30.57, -2.29) ᵒC, wall time: 31.334 seconds
[ Info: Time: 20 hours, n: 60, Δt: 20 minutes, max|u|: (1.33e+00, 3.28e+00, 8.59e-03) m s⁻¹, extrema(T): (30.58, -2.28) ᵒC, wall time: 33.893 seconds
[ Info: Time: 23.333 hours, n: 70, Δt: 20 minutes, max|u|: (1.52e+00, 3.78e+00, 9.76e-03) m s⁻¹, extrema(T): (30.59, -2.28) ᵒC, wall time: 31.503 seconds
[ Info: Time: 1.111 days, n: 80, Δt: 20 minutes, max|u|: (1.69e+00, 4.23e+00, 1.08e-02) m s⁻¹, extrema(T): (30.63, -2.26) ᵒC, wall time: 30.088 seconds
[ Info: Time: 1.250 days, n: 90, Δt: 20 minutes, max|u|: (1.84e+00, 4.63e+00, 1.17e-02) m s⁻¹, extrema(T): (30.68, -2.25) ᵒC, wall time: 30.614 seconds
[ Info: Time: 1.389 days, n: 100, Δt: 20 minutes, max|u|: (1.95e+00, 4.96e+00, 1.24e-02) m s⁻¹, extrema(T): (30.73, -2.24) ᵒC, wall time: 31.093 seconds
[ Info: Time: 1.528 days, n: 110, Δt: 20 minutes, max|u|: (2.04e+00, 5.21e+00, 1.30e-02) m s⁻¹, extrema(T): (30.75, -2.23) ᵒC, wall time: 30.985 seconds
[ Info: Time: 1.667 days, n: 120, Δt: 20 minutes, max|u|: (2.10e+00, 5.36e+00, 1.34e-02) m s⁻¹, extrema(T): (30.74, -2.22) ᵒC, wall time: 30.767 seconds
[ Info: Time: 1.806 days, n: 130, Δt: 20 minutes, max|u|: (2.35e+00, 5.44e+00, 1.37e-02) m s⁻¹, extrema(T): (30.75, -2.20) ᵒC, wall time: 29.904 seconds
[ Info: Time: 1.944 days, n: 140, Δt: 20 minutes, max|u|: (2.66e+00, 5.43e+00, 1.38e-02) m s⁻¹, extrema(T): (30.76, -2.23) ᵒC, wall time: 31.025 seconds
[ Info: Time: 2.083 days, n: 150, Δt: 20 minutes, max|u|: (2.84e+00, 5.34e+00, 1.41e-02) m s⁻¹, extrema(T): (30.80, -2.26) ᵒC, wall time: 29.861 seconds
[ Info: Time: 2.222 days, n: 160, Δt: 20 minutes, max|u|: (2.84e+00, 5.16e+00, 1.48e-02) m s⁻¹, extrema(T): (30.86, -2.29) ᵒC, wall time: 28.911 seconds
[ Info: Time: 2.361 days, n: 170, Δt: 20 minutes, max|u|: (2.77e+00, 4.91e+00, 1.71e-02) m s⁻¹, extrema(T): (30.89, -2.31) ᵒC, wall time: 28.505 seconds
[ Info: Time: 2.500 days, n: 180, Δt: 20 minutes, max|u|: (3.04e+00, 4.61e+00, 2.08e-02) m s⁻¹, extrema(T): (30.91, -2.34) ᵒC, wall time: 33.556 seconds
[ Info: Time: 2.639 days, n: 190, Δt: 20 minutes, max|u|: (3.42e+00, 4.26e+00, 2.85e-02) m s⁻¹, extrema(T): (30.91, -2.36) ᵒC, wall time: 29.080 seconds
[ Info: Time: 2.778 days, n: 200, Δt: 20 minutes, max|u|: (3.85e+00, 3.87e+00, 3.85e-02) m s⁻¹, extrema(T): (30.88, -2.37) ᵒC, wall time: 28.900 seconds
[ Info: Time: 2.917 days, n: 210, Δt: 20 minutes, max|u|: (4.20e+00, 3.65e+00, 4.81e-02) m s⁻¹, extrema(T): (30.86, -2.38) ᵒC, wall time: 28.005 seconds
[ Info: Time: 3.056 days, n: 220, Δt: 20 minutes, max|u|: (4.43e+00, 3.68e+00, 5.13e-02) m s⁻¹, extrema(T): (30.88, -2.41) ᵒC, wall time: 28.266 seconds
[ Info: Time: 3.194 days, n: 230, Δt: 20 minutes, max|u|: (4.98e+00, 3.88e+00, 6.09e-02) m s⁻¹, extrema(T): (30.94, -2.44) ᵒC, wall time: 28.028 seconds
[ Info: Time: 3.333 days, n: 240, Δt: 20 minutes, max|u|: (5.58e+00, 4.27e+00, 7.01e-02) m s⁻¹, extrema(T): (31.00, -2.48) ᵒC, wall time: 28.140 seconds
[ Info: Time: 3.472 days, n: 250, Δt: 20 minutes, max|u|: (6.17e+00, 4.62e+00, 6.43e-02) m s⁻¹, extrema(T): (31.00, -2.51) ᵒC, wall time: 27.879 seconds
[ Info: Time: 3.611 days, n: 260, Δt: 20 minutes, max|u|: (6.64e+00, 4.89e+00, 7.05e-02) m s⁻¹, extrema(T): (30.96, -2.55) ᵒC, wall time: 28.737 seconds
[ Info: Time: 3.750 days, n: 270, Δt: 20 minutes, max|u|: (6.80e+00, 5.06e+00, 6.83e-02) m s⁻¹, extrema(T): (30.91, -2.58) ᵒC, wall time: 28.719 seconds
[ Info: Time: 3.889 days, n: 280, Δt: 20 minutes, max|u|: (7.00e+00, 5.31e+00, 7.18e-02) m s⁻¹, extrema(T): (30.89, -2.61) ᵒC, wall time: 29.172 seconds
[ Info: Time: 4.028 days, n: 290, Δt: 20 minutes, max|u|: (8.05e+00, 6.12e+00, 7.46e-02) m s⁻¹, extrema(T): (30.91, -2.64) ᵒC, wall time: 29.933 seconds
[ Info: Time: 4.167 days, n: 300, Δt: 20 minutes, max|u|: (8.53e+00, 6.71e+00, 9.05e-02) m s⁻¹, extrema(T): (30.97, -2.68) ᵒC, wall time: 29.540 seconds
[ Info: Time: 4.306 days, n: 310, Δt: 20 minutes, max|u|: (8.22e+00, 6.96e+00, 1.03e-01) m s⁻¹, extrema(T): (30.99, -2.71) ᵒC, wall time: 30.149 seconds

Copy link

codecov bot commented Dec 18, 2024

Codecov Report

Attention: Patch coverage is 0% with 4 lines in your changes missing coverage. Please review.

Project coverage is 0.00%. Comparing base (b6b8757) to head (f20537e).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/OceanSimulations/OceanSimulations.jl 0.00% 4 Missing ⚠️
Additional details and impacted files
@@          Coverage Diff          @@
##            main    #304   +/-   ##
=====================================
  Coverage   0.00%   0.00%           
=====================================
  Files         34      34           
  Lines       1961    1962    +1     
=====================================
- Misses      1961    1962    +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@glwagner glwagner merged commit b3ae3fe into main Dec 18, 2024
20 checks passed
@glwagner glwagner deleted the glw/bgc branch December 18, 2024 05:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants