Skip to content

Commit

Permalink
Remove unregistered package as dep
Browse files Browse the repository at this point in the history
  • Loading branch information
jbisits committed Jul 17, 2024
1 parent c0a19dc commit 30b0ab3
Show file tree
Hide file tree
Showing 5 changed files with 89 additions and 45 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
*.jld2
*.nc
*.vscode
/Manifest.toml
/deps/deps.jl
/docs/Manifest.toml
/docs/build/
Expand Down
40 changes: 1 addition & 39 deletions Manifest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

julia_version = "1.10.3"
manifest_format = "2.0"
project_hash = "84e7e50e5d4057af1ef14c11bd5d6c8b27b15b91"
project_hash = "9af3a1151dbb127cfac30d285458a33c201f9b7c"

[[deps.AbstractFFTs]]
deps = ["LinearAlgebra"]
Expand Down Expand Up @@ -323,18 +323,6 @@ git-tree-sha1 = "ab29216184312f99ff957b32cd63c2fe9c928b91"
uuid = "61eb1bfa-7361-4325-ad38-22787b887f55"
version = "0.26.7"

[[deps.GibbsSeaWater]]
deps = ["GibbsSeaWater_jll", "Libdl", "Test"]
git-tree-sha1 = "d1642ddc78d0754603d747d76fac0042a5a85104"
uuid = "9a22fb26-0b63-4589-b28e-8f9d0b5c3d05"
version = "0.1.3"

[[deps.GibbsSeaWater_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"]
git-tree-sha1 = "c91ca76546871efaa1aefdd2b19cc41c3ead2160"
uuid = "6727f6b2-98ea-5d0a-8239-2f72283ddb11"
version = "3.5.2+0"

[[deps.Glob]]
git-tree-sha1 = "97285bbd5230dd766e9ef6749b80fc617126d496"
uuid = "c27321d9-0574-5035-807b-f59d2c89b15c"
Expand Down Expand Up @@ -680,12 +668,6 @@ version = "0.91.4"
[deps.Oceananigans.weakdeps]
Enzyme = "7da242da-08ed-463a-9acd-ee780be4f1d9"

[[deps.Oceanostics]]
deps = ["DocStringExtensions", "Oceananigans", "Printf", "SeawaterPolynomials"]
git-tree-sha1 = "14415188022173b53a29753d6727ea489520d302"
uuid = "d0ccf422-c8fb-49b5-a76d-74acdde946ac"
version = "0.14.2"

[[deps.OffsetArrays]]
git-tree-sha1 = "1a27764e945a152f7ca7efa04de513d473e9542e"
uuid = "6fe1bfb0-de20-5000-8ca7-80f57d26f881"
Expand Down Expand Up @@ -974,12 +956,6 @@ git-tree-sha1 = "1ff449ad350c9c4cbc756624d6f8a8c3ef56d3ed"
uuid = "82ae8749-77ed-4fe6-ae5f-f523153014b0"
version = "1.7.0"

[[deps.StatsBase]]
deps = ["DataAPI", "DataStructures", "LinearAlgebra", "LogExpFunctions", "Missings", "Printf", "Random", "SortingAlgorithms", "SparseArrays", "Statistics", "StatsAPI"]
git-tree-sha1 = "5cf7606d6cef84b543b483848d4ae08ad9832b21"
uuid = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91"
version = "0.34.3"

[[deps.Strided]]
deps = ["LinearAlgebra", "StridedViews", "TupleTools"]
git-tree-sha1 = "bd9bd1c70cfc115cc3a30213fc725125a6b43652"
Expand Down Expand Up @@ -1088,20 +1064,6 @@ git-tree-sha1 = "41d61b1c545b06279871ef1a4b5fcb2cac2191cd"
uuid = "9d95972d-f1c8-5527-a6e0-b4b365fa01f6"
version = "1.5.0"

[[deps.TwoLayerDirectNumericalShenanigans]]
deps = ["CUDA", "GibbsSeaWater", "JLD2", "NCDatasets", "Oceananigans", "Oceanostics", "Printf", "Reexport", "SeawaterPolynomials", "SpecialFunctions", "StatsBase"]
git-tree-sha1 = "279d7771577a203f0ad13588cda0e2d5b87511e3"
repo-rev = "main"
repo-url = "https://github.com/jbisits/TwoLayerDirectNumericalShenanigans.jl"
uuid = "40aaee9f-3595-48be-b36c-f1067009652f"
version = "0.6.3"

[deps.TwoLayerDirectNumericalShenanigans.extensions]
TLDNSMakieExt = "CairoMakie"

[deps.TwoLayerDirectNumericalShenanigans.weakdeps]
CairoMakie = "13f3f980-e62b-5c42-98c6-ff1f3baf88f0"

[[deps.UUIDs]]
deps = ["Random", "SHA"]
uuid = "cf7118a7-6976-5b1a-9a39-7adc72f591a4"
Expand Down
4 changes: 1 addition & 3 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,12 @@ version = "0.0.1"
Oceananigans = "9e8cae18-63c1-5223-a75c-80ca9d6e9a09"
Reexport = "189a3867-3050-52da-a836-e630ba90ab69"
SeawaterPolynomials = "d496a93d-167e-4197-9f49-d3af4ff8fe40"
TwoLayerDirectNumericalShenanigans = "40aaee9f-3595-48be-b36c-f1067009652f"

[compat]
julia = "1.6.7"
Oceananigans = "0.91"
Reexport = "1.2"
SeawaterPolynomials = "0.3"
TwoLayerDirectNumericalShenanigans = "0.6"
julia = "1.6.7"

[extras]
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
Expand Down
3 changes: 0 additions & 3 deletions src/StaircaseShenanigans.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ using Oceananigans, Reexport
using SeawaterPolynomials.TEOS10
using SeawaterPolynomials.SecondOrderSeawaterPolynomials
using SeawaterPolynomials: BoussinesqEquationOfState
using TwoLayerDirectNumericalShenanigans: save_tracers!, save_velocities!, no_custom_output!,
simulation_progress, checkpointer_setup!
using TwoLayerDirectNumericalShenanigans: AbstractNoise, SalinityNoise, TemperatureNoise, perturb_tracer

@reexport using Oceananigans, SeawaterPolynomials.TEOS10,
SeawaterPolynomials.SecondOrderSeawaterPolynomials
Expand Down
86 changes: 86 additions & 0 deletions src/staircase_model.jl
Original file line number Diff line number Diff line change
Expand Up @@ -166,3 +166,89 @@ function output_directory(sdns::StaircaseDNS, stop_time::Number, output_path)
return output_dir

end
"""
function save_tracers!(simulation, model, save_schedule, save_file, output_dir, overwrite_saved_output)
Save `model.tracers` during a `Simulation` using an `OutputWriter`.
"""
function save_tracers!(simulation, model, save_schedule, save_file, output_dir,
overwrite_saved_output)

S, T = model.tracers.S, model.tracers.T
tracers = Dict("S" => S, "T" => T)

simulation.output_writers[:tracers] =
save_file == :netcdf ? NetCDFOutputWriter(model, tracers;
filename = "tracers",
dir = output_dir,
overwrite_existing = overwrite_saved_output,
schedule = TimeInterval(save_schedule)
) :
JLD2OutputWriter(model, tracers;
filename = "tracers",
dir = output_dir,
schedule = TimeInterval(save_schedule),
overwrite_existing = overwrite_saved_output)

return nothing

end
save_tracers!(simulation, model, save_info::Tuple) =
save_tracers!(simulation, model, save_info...)
"""
function save_velocities!(simulation, model, save_schedule, save_file, output_dir,
overwrite_saved_output)
Save `model.velocities` during a `Simulation` using an `OutputWriter`.
"""
function save_velocities!(simulation, model, save_schedule, save_file, output_dir,
overwrite_saved_output)

u, v, w = model.velocities
velocities = Dict("u" => u, "v" => v, "w" => w)

simulation.output_writers[:velocities] =
save_file == :netcdf ? NetCDFOutputWriter(model, velocities;
filename = "velocities",
dir = output_dir,
overwrite_existing = overwrite_saved_output,
schedule = TimeInterval(save_schedule)
) :
JLD2OutputWriter(model, velocities;
filename = "velocities",
dir = output_dir,
schedule = TimeInterval(save_schedule),
overwrite_existing = overwrite_saved_output)

return nothing

end
save_velocities!(simulation, model, save_info::Tuple) =
save_velocities!(simulation, model, save_info...)
"Default function for `save_custom_output!` in `TLDNS_simulation_setup`."
no_custom_output!(simulation, model, save_info...) = nothing
"""
function checkpointer_setup!(simulation, model, output_path, checkpointer_time_interval)
Setup a `Checkpointer` at `checkpointer_time_interval` for a `simulation`
"""
function checkpointer_setup!(simulation, model, output_dir,
checkpointer_time_interval::Number)

checkpoint_dir = joinpath(output_dir, "model_checkpoints/")
isdir(checkpoint_dir) ? nothing : mkdir(checkpoint_dir)
schedule = TimeInterval(checkpointer_time_interval)
cleanup = true
checkpointer = Checkpointer(model; schedule, dir = checkpoint_dir, cleanup)
simulation.output_writers[:checkpointer] = checkpointer

return nothing

end
checkpointer_setup!(simulation, model, output_dir, checkpointer_time_interval::Nothing) = nothing
"""
function simulation_progress(sim)
Useful progress messaging for simulation runs. This function is from an
[Oceananigans.jl example](https://clima.github.io/OceananigansDocumentation/dev/generated/horizontal_convection/#A-progress-messenger).
"""
simulation_progress(sim) = @printf("i: % 6d, sim time: % 1.3f, wall time: % 10s, Δt: % 1.4f, advective CFL: %.2e, diffusive CFL: %.2e\n",
iteration(sim), time(sim), prettytime(sim.run_wall_time),
sim.Δt, AdvectiveCFL(sim.Δt)(sim.model),
DiffusiveCFL(sim.Δt)(sim.model))

0 comments on commit 30b0ab3

Please sign in to comment.