Skip to content

Commit

Permalink
Merge pull request #176 from OceanBioME/jsw/update-dependencies
Browse files Browse the repository at this point in the history
Attempt to bump compats
  • Loading branch information
johnryantaylor authored Jul 1, 2024
2 parents 12cfa7f + 05477fe commit 9645c15
Show file tree
Hide file tree
Showing 16 changed files with 185 additions and 163 deletions.
282 changes: 147 additions & 135 deletions Manifest.toml

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "OceanBioME"
uuid = "a49af516-9db8-4be4-be45-1dad61c5a376"
authors = ["Jago Strong-Wright <[email protected]> and contributors"]
version = "0.10.2"
version = "0.10.3"

[deps]
Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e"
Expand All @@ -19,10 +19,10 @@ Documenter = "1"
EnsembleKalmanProcesses = "1"
JLD2 = "0.4"
KernelAbstractions = "0.9"
Oceananigans = "0.90.11"
Oceananigans = "0.91"
Roots = "2"
StructArrays = "0.4, 0.5, 0.6"
julia = "1.9"
julia = "1.10"

[extras]
CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba"
Expand Down
2 changes: 1 addition & 1 deletion docs/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ Documenter = "1"
DocumenterCitations = "1"
JLD2 = "0.4.38"
Literate = "≥2.9.0"
Oceananigans = "0.90.11"
Oceananigans = "0.91.3"
8 changes: 6 additions & 2 deletions src/Boundaries/Sediments/coupled_timesteppers.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,12 @@ using Oceananigans.Architectures: AbstractArchitecture

import Oceananigans.TimeSteppers: ab2_step!, rk3_substep!

@inline function ab2_step!(model::NonhydrostaticModel{<:Any, <:Any, <:Any, <:Any, <:Any, <:Any, <:Any, <:Any, <:Any, <:Any, <:Any, <:Any, <:Any, <:Any, <:Any, <:Any, <:Any, <:Biogeochemistry{<:Any, <:Any, <:FlatSediment}}, Δt, χ)
@inline function ab2_step!(model::NonhydrostaticModel{<:Any, <:Any, <:Any, <:Any, <:Any, <:Any, <:Any, <:Any, <:Any, <:Any, <:Any, <:Any, <:Any, <:Any, <:Any, <:Any, <:Any, <:Biogeochemistry{<:Any, <:Any, <:FlatSediment}}, Δt)
workgroup, worksize = work_layout(model.grid, :xyz)
arch = model.architecture
step_field_kernel! = ab2_step_field!(device(arch), workgroup, worksize)
model_fields = prognostic_fields(model)
χ = model.timestepper.χ

for (i, field) in enumerate(model_fields)

Expand Down Expand Up @@ -45,7 +46,9 @@ import Oceananigans.TimeSteppers: ab2_step!, rk3_substep!
return nothing
end

@inline function ab2_step!(model::HydrostaticFreeSurfaceModel{<:Any, <:Any, <:AbstractArchitecture, <:Any, <:Any, <:Any, <:Any, <:Any, <:Any, <:Any, <:Any, <:Biogeochemistry{<:Any, <:Any, <:FlatSediment}}, Δt, χ)
@inline function ab2_step!(model::HydrostaticFreeSurfaceModel{<:Any, <:Any, <:AbstractArchitecture, <:Any, <:Any, <:Any, <:Any, <:Any, <:Any, <:Any, <:Any, <:Biogeochemistry{<:Any, <:Any, <:FlatSediment}}, Δt)
χ = model.timestepper.χ

# Step locally velocity and tracers
@apply_regionally local_ab2_step!(model, Δt, χ)

Expand All @@ -54,6 +57,7 @@ end

sediment = model.biogeochemistry.sediment
arch = model.architecture


for (i, field) in enumerate(sediment_fields(sediment))
launch!(arch, model.grid, :xy, ab2_step_flat_field!,
Expand Down
4 changes: 2 additions & 2 deletions src/BoxModel/boxmodel.jl
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ end
BoxModel(; biogeochemistry::B,
forcing = NamedTuple(),
timestepper = :RungeKutta3,
clock::C = Clock(0.0, 0, 1),
clock::C = Clock(; time = 0.0),
prescribed_fields::PF = (:T, :PAR))
Constructs a box model of a `biogeochemistry` model. Once this has been constructed you can set initial condiitons by `set!(model, X=1.0...)` and then `run!(model)`.
Expand All @@ -61,7 +61,7 @@ Keyword Arguments
function BoxModel(; biogeochemistry::B,
forcing = NamedTuple(),
timestepper = :RungeKutta3,
clock::C = Clock(0.0, 0, 1),
clock::C = Clock(; time = 0.0),
prescribed_fields::PF = (:T, :PAR)) where {B, C, PF}

variables = (required_biogeochemical_tracers(biogeochemistry)..., required_biogeochemical_auxiliary_fields(biogeochemistry)...)
Expand Down
8 changes: 3 additions & 5 deletions src/Models/Individuals/SLatissima.jl
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ using Oceananigans.Units
using Oceananigans: Center, CPU
using Oceananigans.Architectures: on_architecture, device, architecture
using Oceananigans.Biogeochemistry: required_biogeochemical_tracers, biogeochemical_auxiliary_fields
using Oceananigans.Models.LagrangianParticleTracking: _advect_particles!

using Oceananigans.Operators: volume
using Oceananigans.Grids: AbstractGrid, Flat
Expand All @@ -32,7 +33,7 @@ using Oceananigans.Models: total_velocities

import Adapt: adapt_structure, adapt
import Oceananigans.Biogeochemistry: update_tendencies!
import Oceananigans.Models.LagrangianParticleTracking: update_lagrangian_particle_properties!, _advect_particles!
import Oceananigans.Models.LagrangianParticleTracking: update_lagrangian_particle_properties!

@inline no_dynamics(args...) = nothing

Expand Down Expand Up @@ -333,10 +334,7 @@ function update_lagrangian_particle_properties!(particles::SLatissima, model, bg
# Advect particles
advect_particles_kernel! = _advect_particles!(device(arch), workgroup, worksize)

advect_particles_kernel!((x = particles.x, y = particles.y, z = particles.z),
1.0, model.grid, Δt,
total_velocities(model))

advect_particles_kernel!(particles, 1.0, model.grid, Δt, total_velocities(model))

update_particle_properties_kernel! = _update_lagrangian_particle_properties!(device(arch), workgroup, worksize)

Expand Down
2 changes: 1 addition & 1 deletion src/Particles/Particles.jl
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ abstract type BiogeochemicalParticles end
@inline update_lagrangian_particle_properties!(model, bgc::Biogeochemistry{<:Any, <:Any, <:Any, <:BiogeochemicalParticles}, Δt) =
update_lagrangian_particle_properties!(bgc.particles, model, bgc, Δt)

update_lagrangian_particle_properties!(::BiogeochemicalParticles, model, bgc, Δt) = nothing
@inline update_lagrangian_particle_properties!(::BiogeochemicalParticles, model, bgc, Δt) = nothing

size(particles::BiogeochemicalParticles) = size(particles.x)
length(particles::BiogeochemicalParticles) = length(particles.x)
Expand Down
3 changes: 3 additions & 0 deletions test/dependencies_for_runtests.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
using OceanBioME, Test, CUDA, Oceananigans, JLD2, Documenter

architecture = CUDA.has_cuda() ? GPU() : CPU()
6 changes: 2 additions & 4 deletions test/runtests.jl
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
using OceanBioME, Documenter, Test, CUDA, Oceananigans

architecture = CUDA.has_cuda() ? GPU() : CPU()
include("dependencies_for_runtests.jl")

include("test_utils.jl")
include("test_light.jl")
include("test_slatissima.jl")
include("test_LOBSTER.jl")
include("test_NPZD.jl")
include("test_gasexchange.jl")
include("test_slatissima.jl")
include("test_sediments.jl")

architecture == CPU() && @testset "Doctests" begin
Expand Down
3 changes: 2 additions & 1 deletion test/test_LOBSTER.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Test
include("dependencies_for_runtests.jl")

using OceanBioME: LOBSTER, conserved_tracers, redfield
using Oceananigans, CUDA

Expand Down
3 changes: 2 additions & 1 deletion test/test_NPZD.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Test
include("dependencies_for_runtests.jl")

using OceanBioME: NutrientPhytoplanktonZooplanktonDetritus
using Oceananigans

Expand Down
3 changes: 2 additions & 1 deletion test/test_gasexchange.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Test
include("dependencies_for_runtests.jl")

using OceanBioME: Boundaries, GasExchange, LOBSTER
using Oceananigans, DataDeps, JLD2, Statistics
using Oceananigans.Units
Expand Down
5 changes: 3 additions & 2 deletions test/test_light.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Oceananigans, Test
include("dependencies_for_runtests.jl")

using OceanBioME: TwoBandPhotosyntheticallyActiveRadiation, LOBSTER, NutrientPhytoplanktonZooplanktonDetritus
using Oceananigans.Biogeochemistry: update_biogeochemical_state!, required_biogeochemical_tracers, biogeochemical_auxiliary_fields

Expand Down Expand Up @@ -50,7 +51,7 @@ end
bgc in (LOBSTER, NutrientPhytoplanktonZooplanktonDetritus) # this is now redundant since each model doesn't deal with the light separatly

if !((model == NonhydrostaticModel) && ((grid isa LatitudeLongitudeGrid) | (grid isa OrthogonalSphericalShellGrid)))
@info "Testing $bgc in $model on $grid..."
@info "Testing light with $bgc in $model on $grid..."
@test test_two_band(grid, bgc, model)
end
end
Expand Down
2 changes: 1 addition & 1 deletion test/test_sediments.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using OceanBioME, Oceananigans, Test, JLD2
include("dependencies_for_runtests.jl")

using OceanBioME.Sediments: SimpleMultiG, InstantRemineralisation
using Oceananigans.Units
Expand Down
9 changes: 6 additions & 3 deletions test/test_slatissima.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Test, OceanBioME, Oceananigans
include("dependencies_for_runtests.jl")

using OceanBioME.SLatissimaModel: SLatissima
using Oceananigans.Units
using Oceananigans.Fields: TracerFields
Expand Down Expand Up @@ -31,7 +32,9 @@ sum_tracer_carbon(tracers, redfield, organic_carbon_calcate_ratio) =
# Initial properties

particles = SLatissima(; architecture,
x = on_architecture(architecture, ones(Float64, 2)),
x = on_architecture(architecture, ones(Float64, 2) .* .5),
y = on_architecture(architecture, ones(Float64, 2) .* .5),
z = on_architecture(architecture, - ones(Float64, 2) .* .5),
A = on_architecture(architecture, ones(Float64, 2) .* 5),
N = on_architecture(architecture, ones(Float64, 2)),
C = on_architecture(architecture, ones(Float64, 2)),
Expand Down Expand Up @@ -60,7 +63,7 @@ sum_tracer_carbon(tracers, redfield, organic_carbon_calcate_ratio) =
model.clock.time = 60days # get to a high growth phase

for _ in 1:10
time_step!(model, 1.0)
time_step!(model, 1)
end

final_tracer_N = sum_tracer_nitrogen(model.tracers)
Expand Down
2 changes: 1 addition & 1 deletion test/test_utils.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Test, OceanBioME, Oceananigans
include("dependencies_for_runtests.jl")

function test_negative_scaling(arch)
grid = RectilinearGrid(arch, size = (1, 1, 1), extent = (1, 1, 1))
Expand Down

2 comments on commit 9645c15

@jagoosw
Copy link
Collaborator

@jagoosw jagoosw commented on 9645c15 Jul 1, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/110157

Tip: Release Notes

Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.

@JuliaRegistrator register

Release notes:

## Breaking changes

- blah

To add them here just re-invoke and the PR will be updated.

Tagging

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.10.3 -m "<description of version>" 9645c154c80937d49ceb90027e5c2c0928828a01
git push origin v0.10.3

Please sign in to comment.