Skip to content

Commit

Permalink
Merge pull request #225 from OceanBioME/ali/upgrade-to-oceananigans-0…
Browse files Browse the repository at this point in the history
….92.1

Update to use Oceananigans v0.92.1
  • Loading branch information
ali-ramadhan authored Oct 24, 2024
2 parents ed9520d + 93d7a95 commit 54cfd8a
Show file tree
Hide file tree
Showing 7 changed files with 82 additions and 84 deletions.
82 changes: 39 additions & 43 deletions Manifest.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# This file is machine-generated - editing it directly is not advised

julia_version = "1.10.2"
julia_version = "1.10.5"
manifest_format = "2.0"
project_hash = "3c5ec406d66c67a7c97dba5d81a300057adf87ab"
project_hash = "12da5d1eabe1dd5798ee1a29e23ad2e10e287ad8"

[[deps.AbstractFFTs]]
deps = ["LinearAlgebra"]
Expand Down Expand Up @@ -45,9 +45,9 @@ version = "0.1.38"

[[deps.Adapt]]
deps = ["LinearAlgebra", "Requires"]
git-tree-sha1 = "6a55b747d1812e699320963ffde36f1ebdda4099"
git-tree-sha1 = "d80af0733c99ea80575f612813fa6aa71022d33a"
uuid = "79e6a3ab-5dfb-504d-930d-738a2a938a0e"
version = "4.0.4"
version = "4.1.0"
weakdeps = ["StaticArrays"]

[deps.Adapt.extensions]
Expand Down Expand Up @@ -77,15 +77,15 @@ uuid = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"

[[deps.Blosc_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Lz4_jll", "Zlib_jll", "Zstd_jll"]
git-tree-sha1 = "19b98ee7e3db3b4eff74c5c9c72bf32144e24f10"
git-tree-sha1 = "ef12cdd1c7fb7e1dfd6fa8fd60d4db6bc61d2f23"
uuid = "0b7ba130-8d10-5ba8-a3d6-c5182647fed9"
version = "1.21.5+0"
version = "1.21.6+0"

[[deps.Bzip2_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"]
git-tree-sha1 = "9e2a6b69137e6969bab0152632dcb3bc108c8bdd"
git-tree-sha1 = "8873e196c2eb87962a2048b3b8e08946535864a1"
uuid = "6e34b625-4abd-537c-b88f-471c36dfa7a0"
version = "1.0.8+1"
version = "1.0.8+2"

[[deps.CEnum]]
git-tree-sha1 = "389ad5c84de1ae7cf0e28e381131c98ea87d54fc"
Expand Down Expand Up @@ -168,7 +168,7 @@ weakdeps = ["Dates", "LinearAlgebra"]
[[deps.CompilerSupportLibraries_jll]]
deps = ["Artifacts", "Libdl"]
uuid = "e66e0078-7015-5450-92f7-15fbd957f2ae"
version = "1.1.0+0"
version = "1.1.1+0"

[[deps.CompositionsBase]]
git-tree-sha1 = "802bb88cd69dfd1509f6670416bd4434015693ad"
Expand Down Expand Up @@ -239,9 +239,9 @@ version = "0.3.23"

[[deps.Distances]]
deps = ["LinearAlgebra", "Statistics", "StatsAPI"]
git-tree-sha1 = "66c4c81f259586e8f002eacebc177e1fb06363b0"
git-tree-sha1 = "c7e3a542b999843086e2f29dac96a618c105be1d"
uuid = "b4f34e82-e78d-54a5-968a-f98e89d6e8f7"
version = "0.10.11"
version = "0.10.12"

[deps.Distances.extensions]
DistancesChainRulesCoreExt = "ChainRulesCore"
Expand Down Expand Up @@ -285,9 +285,9 @@ version = "3.3.10+1"

[[deps.FileIO]]
deps = ["Pkg", "Requires", "UUIDs"]
git-tree-sha1 = "82d8afa92ecf4b52d78d869f038ebfb881267322"
git-tree-sha1 = "62ca0547a14c57e98154423419d8a342dca75ca9"
uuid = "5789e2e9-d7fb-5bc7-8068-2c6fae9b9549"
version = "1.16.3"
version = "1.16.4"

[[deps.FileWatching]]
uuid = "7b1f6079-737a-58dc-b8bc-7a2ca5c1b5ee"
Expand Down Expand Up @@ -417,15 +417,15 @@ version = "1.0.0"

[[deps.JLD2]]
deps = ["FileIO", "MacroTools", "Mmap", "OrderedCollections", "PrecompileTools", "Requires", "TranscodingStreams"]
git-tree-sha1 = "a0746c21bdc986d0dc293efa6b1faee112c37c28"
git-tree-sha1 = "b464b9b461ee989b435a689a4f7d870b68d467ed"
uuid = "033835bb-8acc-5ee8-8aae-3f567f8a3819"
version = "0.4.53"
version = "0.5.6"

[[deps.JLLWrappers]]
deps = ["Artifacts", "Preferences"]
git-tree-sha1 = "f389674c99bfcde17dc57454011aa44d5a260a40"
git-tree-sha1 = "be3dc50a92e5a386872a493a10050136d4703f9b"
uuid = "692b3bcd-3c85-4b1f-b108-f13ce0eb3210"
version = "1.6.0"
version = "1.6.1"

[[deps.JuliaNVTXCallbacks_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"]
Expand All @@ -435,9 +435,9 @@ version = "0.2.1+0"

[[deps.KernelAbstractions]]
deps = ["Adapt", "Atomix", "InteractiveUtils", "MacroTools", "PrecompileTools", "Requires", "StaticArrays", "UUIDs", "UnsafeAtomics", "UnsafeAtomicsLLVM"]
git-tree-sha1 = "5126765c5847f74758c411c994312052eb7117ef"
git-tree-sha1 = "04e52f596d0871fa3890170fa79cb15e481e4cd8"
uuid = "63c18a36-062a-441e-b654-da1e3ab1ce7c"
version = "0.9.27"
version = "0.9.28"

[deps.KernelAbstractions.extensions]
EnzymeExt = "EnzymeCore"
Expand All @@ -450,10 +450,10 @@ version = "0.9.27"
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"

[[deps.LLVM]]
deps = ["CEnum", "LLVMExtra_jll", "Libdl", "Preferences", "Printf", "Requires", "Unicode"]
git-tree-sha1 = "4ad43cb0a4bb5e5b1506e1d1f48646d7e0c80363"
deps = ["CEnum", "LLVMExtra_jll", "Libdl", "Preferences", "Printf", "Unicode"]
git-tree-sha1 = "d422dfd9707bec6617335dc2ea3c5172a87d5908"
uuid = "929cbde3-209d-540e-8aea-75f648917ca0"
version = "9.1.2"
version = "9.1.3"
weakdeps = ["BFloat16s"]

[deps.LLVM.extensions]
Expand Down Expand Up @@ -486,9 +486,9 @@ weakdeps = ["Serialization"]
SerializationExt = ["Serialization"]

[[deps.LaTeXStrings]]
git-tree-sha1 = "50901ebc375ed41dbf8058da26f9de442febbbec"
git-tree-sha1 = "dda21b8cbd6a6c40d9d02a73230f9d70fed6918c"
uuid = "b964fa9f-0449-5b57-a5c2-d3ea65f4040f"
version = "1.3.1"
version = "1.4.0"

[[deps.LazyArtifacts]]
deps = ["Artifacts", "Pkg"]
Expand Down Expand Up @@ -574,9 +574,9 @@ version = "0.1.11"

[[deps.MPItrampoline_jll]]
deps = ["Artifacts", "CompilerSupportLibraries_jll", "JLLWrappers", "LazyArtifacts", "Libdl", "MPIPreferences", "TOML"]
git-tree-sha1 = "fde81c9f9c94fe5fbeaed7b3f1330305cf9a327c"
git-tree-sha1 = "70e830dab5d0775183c99fc75e4c24c614ed7142"
uuid = "f1f71cc9-e9ae-5b93-9b94-4fe0e1ad3748"
version = "5.5.0+0"
version = "5.5.1+0"

[[deps.MacroTools]]
deps = ["Markdown", "Random"]
Expand Down Expand Up @@ -648,9 +648,9 @@ version = "1.2.0"

[[deps.Oceananigans]]
deps = ["Adapt", "CUDA", "Crayons", "CubedSphere", "Dates", "Distances", "DocStringExtensions", "FFTW", "Glob", "IncompleteLU", "InteractiveUtils", "IterativeSolvers", "JLD2", "KernelAbstractions", "LinearAlgebra", "Logging", "MPI", "NCDatasets", "OffsetArrays", "OrderedCollections", "Pkg", "Printf", "Random", "Rotations", "SeawaterPolynomials", "SparseArrays", "Statistics", "StructArrays"]
git-tree-sha1 = "cac4f28778a22404724ba667368f071047b513c1"
git-tree-sha1 = "d32e4de90d49d0613c589dfa8d423b5c4f2248ca"
uuid = "9e8cae18-63c1-5223-a75c-80ca9d6e9a09"
version = "0.92.0"
version = "0.92.1"

[deps.Oceananigans.extensions]
OceananigansEnzymeExt = "Enzyme"
Expand Down Expand Up @@ -856,9 +856,9 @@ version = "1.10.0"

[[deps.StaticArrays]]
deps = ["LinearAlgebra", "PrecompileTools", "Random", "StaticArraysCore"]
git-tree-sha1 = "eeafab08ae20c62c44c8399ccb9354a04b80db50"
git-tree-sha1 = "777657803913ffc7e8cc20f0fd04b634f871af8f"
uuid = "90137ffa-7385-5640-81b9-e52037218182"
version = "1.9.7"
version = "1.9.8"

[deps.StaticArrays.extensions]
StaticArraysChainRulesCoreExt = "ChainRulesCore"
Expand Down Expand Up @@ -932,20 +932,16 @@ version = "1.10.0"

[[deps.TaylorSeries]]
deps = ["LinearAlgebra", "Markdown", "Requires", "SparseArrays"]
git-tree-sha1 = "90c9bc500f4c5cdd235c81503ec91b2048f06423"
git-tree-sha1 = "abc13c4d3cccd1703335ba03abdaf0dc8ecc97e2"
uuid = "6aa5eb33-94cf-58f4-a9d0-e4b2c4fc25ea"
version = "0.17.8"
version = "0.17.3"

[deps.TaylorSeries.extensions]
TaylorSeriesIAExt = "IntervalArithmetic"
TaylorSeriesJLD2Ext = "JLD2"
TaylorSeriesRATExt = "RecursiveArrayTools"
TaylorSeriesSAExt = "StaticArrays"

[deps.TaylorSeries.weakdeps]
IntervalArithmetic = "d1acc4aa-44c8-5952-acd4-ba5d80a2a253"
JLD2 = "033835bb-8acc-5ee8-8aae-3f567f8a3819"
RecursiveArrayTools = "731186ca-8d62-57ce-b412-fbd966d074cd"
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"

[[deps.Test]]
Expand All @@ -954,14 +950,14 @@ uuid = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[[deps.TimerOutputs]]
deps = ["ExprTools", "Printf"]
git-tree-sha1 = "5a13ae8a41237cff5ecf34f73eb1b8f42fff6531"
git-tree-sha1 = "3a6f063d690135f5c1ba351412c82bae4d1402bf"
uuid = "a759f4b9-e2f1-59dc-863e-4aeb61b1ea8f"
version = "0.5.24"
version = "0.5.25"

[[deps.TranscodingStreams]]
git-tree-sha1 = "e84b3a11b9bece70d14cce63406bbc79ed3464d2"
git-tree-sha1 = "0c45878dcfdcfa8480052b6ab162cdd138781742"
uuid = "3bb67fe8-82b1-5028-8e26-92a6c54297fa"
version = "0.11.2"
version = "0.11.3"

[[deps.UUIDs]]
deps = ["Random", "SHA"]
Expand Down Expand Up @@ -1019,13 +1015,13 @@ version = "1.1.2+0"
[[deps.libblastrampoline_jll]]
deps = ["Artifacts", "Libdl"]
uuid = "8e850b90-86db-534c-a0d3-1478176c7d93"
version = "5.8.0+1"
version = "5.11.0+0"

[[deps.libzip_jll]]
deps = ["Artifacts", "Bzip2_jll", "GnuTLS_jll", "JLLWrappers", "Libdl", "XZ_jll", "Zlib_jll", "Zstd_jll"]
git-tree-sha1 = "3282b7d16ae7ac3e57ec2f3fa8fafb564d8f9f7f"
git-tree-sha1 = "668ac0297e6bd8f4d53dfdcd3ace71f2e00f4a35"
uuid = "337d8026-41b4-5cde-a456-74a10e5b31d1"
version = "1.10.1+0"
version = "1.11.1+0"

[[deps.nghttp2_jll]]
deps = ["Artifacts", "Libdl"]
Expand Down
4 changes: 2 additions & 2 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.13.0"
version = "0.13.1"

[deps]
Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e"
Expand All @@ -24,7 +24,7 @@ EnsembleKalmanProcesses = "1"
GibbsSeaWater = "0.1"
JLD2 = "0.4, 0.5"
KernelAbstractions = "0.9"
Oceananigans = "0.91.9, 0.92"
Oceananigans = "^0.92.1"
OffsetArrays = "1.14"
Roots = "2"
SeawaterPolynomials = "0.3"
Expand Down
4 changes: 2 additions & 2 deletions docs/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7"
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"

[compat]
CairoMakie = "0.11"
CairoMakie = "0.11, 0.12"
Documenter = "1"
DocumenterCitations = "1"
EnsembleKalmanProcesses = "1"
JLD2 = "0.4"
Literate = "≥2.9.0"
Oceananigans = "0.91"
Oceananigans = "^0.92.1"
julia = "1.10"
16 changes: 8 additions & 8 deletions src/Models/Sediments/Sediments.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ using OceanBioME: DiscreteBiogeochemistry, ContinuousBiogeochemistry, BoxModelGr
using Oceananigans
using Oceananigans.Architectures: device, architecture, on_architecture
using Oceananigans.Utils: launch!
using Oceananigans.Advection: advective_tracer_flux_z, TracerAdvection
using Oceananigans.Advection: advective_tracer_flux_z, FluxFormAdvection
using Oceananigans.Units: day
using Oceananigans.Fields: ConstantField
using Oceananigans.Biogeochemistry: biogeochemical_drift_velocity
Expand Down Expand Up @@ -38,13 +38,13 @@ function update_tendencies!(bgc, sediment::FlatSediment, model)

launch!(arch, model.grid, :xy,
calculate_sediment_tendencies!,
sediment, biogeochemistry, model.grid,
sinking_advection(biogeochemistry, model.advection),
required_tracers(sediment, biogeochemistry, model.tracers),
required_tendencies(sediment, biogeochemistry, model.timestepper.Gⁿ),
sediment, biogeochemistry, model.grid,
sinking_advection(biogeochemistry, model.advection),
required_tracers(sediment, biogeochemistry, model.tracers),
required_tendencies(sediment, biogeochemistry, model.timestepper.Gⁿ),
sediment.tendencies.Gⁿ,
model.clock.time)

return nothing
end

Expand Down Expand Up @@ -72,9 +72,9 @@ end

@inline advection_scheme(advection, val_tracer) = advection
@inline advection_scheme(advection::NamedTuple, val_tracer::Val{T}) where T = advection_scheme(advection[T], val_tracer)
@inline advection_scheme(advection::TracerAdvection, val_tracer) = advection.z
@inline advection_scheme(advection::FluxFormAdvection, val_tracer) = advection.z

@inline function sinking_flux(i, j, k, grid, advection, val_tracer::Val{T}, bgc, tracers) where T
@inline function sinking_flux(i, j, k, grid, advection, val_tracer::Val{T}, bgc, tracers) where T
return - advective_tracer_flux_z(i, j, k, grid, advection_scheme(advection, val_tracer), biogeochemical_drift_velocity(bgc, val_tracer).w, tracers[T]) /
volume(i, j, k, grid, Center(), Center(), Center())
end
Expand Down
28 changes: 15 additions & 13 deletions src/Models/Sediments/coupled_timesteppers.jl
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,15 @@ const BGC_WITH_FLAT_SEDIMENT = Union{<:DiscreteBiogeochemistry{<:Any, <:Any, <:F

# This is definitly type piracy
@inline function ab2_step!(model::NonhydrostaticModel{<:Any, <:Any, <:Any, <:Any, <:Any, <:Any, <:Any, <:Any, <:Any, <:Any, <:Any, <:Any, <:Any, <:Any, <:Any, <:Any, <:Any, <:BGC_WITH_FLAT_SEDIMENT}, Δ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)

workgroup, worksize = work_layout(model.grid, :xyz, location(field))
step_field_kernel! = ab2_step_field!(device(arch), workgroup, worksize)

step_field_kernel!(field, Δt, χ,
model.timestepper.Gⁿ[i],
model.timestepper.G⁻[i])
Expand All @@ -40,9 +41,9 @@ const BGC_WITH_FLAT_SEDIMENT = Union{<:DiscreteBiogeochemistry{<:Any, <:Any, <:F
sediment = model.biogeochemistry.sediment

for (i, field) in enumerate(sediment_fields(sediment))
launch!(arch, model.grid, :xy, ab2_step_flat_field!,
field, Δt, χ,
sediment.tendencies.Gⁿ[i],
launch!(arch, model.grid, :xy, ab2_step_flat_field!,
field, Δt, χ,
sediment.tendencies.Gⁿ[i],
sediment.tendencies.G⁻[i])

end
Expand All @@ -61,12 +62,12 @@ 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!,
field, Δt, χ,
sediment.tendencies.Gⁿ[i],
launch!(arch, model.grid, :xy, ab2_step_flat_field!,
field, Δt, χ,
sediment.tendencies.Gⁿ[i],
sediment.tendencies.G⁻[i])

end
Expand All @@ -83,12 +84,13 @@ end
end

function rk3_substep!(model::NonhydrostaticModel{<:Any, <:Any, <:Any, <:Any, <:Any, <:Any, <:Any, <:Any, <:Any, <:Any, <:Any, <:Any, <:Any, <:Any, <:Any, <:Any, <:Any, <:BGC_WITH_FLAT_SEDIMENT}, Δt, γⁿ, ζⁿ)
workgroup, worksize = work_layout(model.grid, :xyz)
arch = model.architecture
substep_field_kernel! = rk3_substep_field!(device(arch), workgroup, worksize)
model_fields = prognostic_fields(model)

for (i, field) in enumerate(model_fields)
workgroup, worksize = work_layout(model.grid, :xyz, location(field))
substep_field_kernel! = rk3_substep_field!(device(arch), workgroup, worksize)

substep_field_kernel!(field, Δt, γⁿ, ζⁿ,
model.timestepper.Gⁿ[i],
model.timestepper.G⁻[i])
Expand All @@ -108,9 +110,9 @@ function rk3_substep!(model::NonhydrostaticModel{<:Any, <:Any, <:Any, <:Any, <:A
sediment = model.biogeochemistry.sediment

for (i, field) in enumerate(sediment_fields(sediment))
launch!(arch, model.grid, :xy, rk3_step_flat_field!,
launch!(arch, model.grid, :xy, rk3_step_flat_field!,
field, Δt, γⁿ, ζⁿ,
sediment.tendencies.Gⁿ[i],
sediment.tendencies.Gⁿ[i],
sediment.tendencies.G⁻[i])
end

Expand Down
Loading

2 comments on commit 54cfd8a

@ali-ramadhan
Copy link
Collaborator Author

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/117984

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.13.1 -m "<description of version>" 54cfd8a7754728ca3aa1c477ab418e331c401712
git push origin v0.13.1

Please sign in to comment.