- 
                Notifications
    
You must be signed in to change notification settings  - Fork 22
 
Add biogeochemical interface to ocean_simulation #123
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
base: main
Are you sure you want to change the base?
Changes from 8 commits
a1fd5b9
              fb2537b
              95646da
              b51e727
              7f97325
              f2a705b
              31b8f15
              b67ae79
              abbb510
              163e01a
              b059186
              a96b28c
              5012fb7
              9cd5f7e
              1fc667d
              f1f0589
              ba6ae1d
              File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | 
|---|---|---|
| 
          
            
          
           | 
    @@ -50,6 +50,7 @@ default_tracer_advection() = TracerAdvection(WENO(; order = 7), | |
| @inline u_immersed_bottom_drag(i, j, k, grid, clock, fields, μ) = @inbounds - μ * fields.u[i, j, k] * is_immersed_drag_u(i, j, k, grid) * spᶠᶜᶜ(i, j, k, grid, fields) / Δzᶠᶜᶜ(i, j, k, grid) | ||
| @inline v_immersed_bottom_drag(i, j, k, grid, clock, fields, μ) = @inbounds - μ * fields.v[i, j, k] * is_immersed_drag_v(i, j, k, grid) * spᶜᶠᶜ(i, j, k, grid, fields) / Δzᶜᶠᶜ(i, j, k, grid) | ||
| 
     | 
||
| 
     | 
||
| # TODO: Specify the grid to a grid on the sphere; otherwise we can provide a different | ||
| # function that requires latitude and longitude etc for computing coriolis=FPlane... | ||
| function ocean_simulation(grid; Δt = 5minutes, | ||
| 
        
          
        
         | 
    @@ -63,6 +64,9 @@ function ocean_simulation(grid; Δt = 5minutes, | |
| coriolis = HydrostaticSphericalCoriolis(; rotation_rate), | ||
| momentum_advection = default_momentum_advection(), | ||
| tracer_advection = default_tracer_advection(), | ||
| biogeochemistry = nothing, | ||
| tracers = (:T, :S), | ||
| boundary_conditions = NamedTuple(), | ||
| verbose = false) | ||
| 
     | 
||
| # Set up boundary conditions using Field | ||
| 
        
          
        
         | 
    @@ -78,6 +82,10 @@ function ocean_simulation(grid; Δt = 5minutes, | |
| v = FieldBoundaryConditions(top = FluxBoundaryCondition(Jᵛ), bottom = v_bot_bc), | ||
| T = FieldBoundaryConditions(top = FluxBoundaryCondition(Jᵀ)), | ||
| S = FieldBoundaryConditions(top = FluxBoundaryCondition(Jˢ))) | ||
| 
     | 
||
| if !isempty(boundary_conditions) | ||
| ocean_boundary_conditions = merge(ocean_boundary_conditions, boundary_conditions) | ||
| end | ||
| 
     | 
||
| if grid isa ImmersedBoundaryGrid | ||
| Fu = Forcing(u_immersed_bottom_drag, discrete_form=true, parameters=bottom_drag_coefficient) | ||
| 
        
          
        
         | 
    @@ -96,10 +104,12 @@ function ocean_simulation(grid; Δt = 5minutes, | |
| momentum_advection = nothing | ||
| end | ||
| 
     | 
||
| tracers = (:T, :S) | ||
| 
     | 
||
| if closure isa CATKEVerticalDiffusivity | ||
| tracers = tuple(tracers..., :e) | ||
| tracer_advection = (; T = tracer_advection, S = tracer_advection, e = nothing) | ||
| advection_value = tuple(fill(tracer_advection, length(tracers))...) | ||
| tracer_advection = (; zip(tracers,advection_value)...) | ||
| tracer_advection = merge(tracer_advection, (e = nothing,)) | ||
                
       | 
||
| end | ||
| 
     | 
||
| ocean_model = HydrostaticFreeSurfaceModel(; grid, | ||
| 
        
          
        
         | 
    @@ -111,6 +121,7 @@ function ocean_simulation(grid; Δt = 5minutes, | |
| free_surface, | ||
| coriolis, | ||
| forcing, | ||
| biogeochemistry, | ||
| 
         There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🚀  | 
||
| boundary_conditions = ocean_boundary_conditions) | ||
| 
     | 
||
| ocean = Simulation(ocean_model; Δt, verbose) | ||
| 
          
            
          
           | 
    ||
Uh oh!
There was an error while loading. Please reload this page.