From 43a0617435dd267b0431b847f7ed0f3223d3a1c0 Mon Sep 17 00:00:00 2001 From: nefrathenrici Date: Fri, 31 May 2024 11:45:20 -0700 Subject: [PATCH] Update ClimaParams, set compat --- .../Project.toml | 5 ++++- .../run_single_column_simulation.jl | 15 +++++++-------- .../single_column_simulation.jl | 2 +- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/examples/OceananigansSingleColumnSimulation/Project.toml b/examples/OceananigansSingleColumnSimulation/Project.toml index 140a0892..8d5de5d3 100644 --- a/examples/OceananigansSingleColumnSimulation/Project.toml +++ b/examples/OceananigansSingleColumnSimulation/Project.toml @@ -1,6 +1,9 @@ [deps] -CLIMAParameters = "6eacf6c3-8458-43b9-ae03-caf5306d3d53" +ClimaParams = "5c42b081-d73a-476f-9059-fd94b934656c" CairoMakie = "13f3f980-e62b-5c42-98c6-ff1f3baf88f0" Oceananigans = "9e8cae18-63c1-5223-a75c-80ca9d6e9a09" SeawaterPolynomials = "d496a93d-167e-4197-9f49-d3af4ff8fe40" TOML = "fa267f1f-6049-4f14-aa54-33bafae1ed76" + +[compat] +Oceananigans = "0.91" diff --git a/examples/OceananigansSingleColumnSimulation/run_single_column_simulation.jl b/examples/OceananigansSingleColumnSimulation/run_single_column_simulation.jl index b21f073d..2fe07f26 100644 --- a/examples/OceananigansSingleColumnSimulation/run_single_column_simulation.jl +++ b/examples/OceananigansSingleColumnSimulation/run_single_column_simulation.jl @@ -1,22 +1,21 @@ using Oceananigans -using CLIMAParameters +using ClimaParams # In a "real" use case, we recommend implementing setups in source code. include("single_column_simulation.jl") +project_dir = dirname(Base.active_project()) -parameters = CLIMAParameters.create_toml_dict( +toml_dict = ClimaParams.create_toml_dict( Float64, - override_file = "my_parameters.toml", - default_file = "default_parameters.toml", - dict_type = "name", + override_file = joinpath(project_dir, "my_parameters.toml"), + default_file = joinpath(project_dir, "default_parameters.toml"), ) -parameters = CLIMAParameters.get_parameter_values!( - parameters, +parameters = ClimaParams.get_parameter_values( + toml_dict, "gravitational_acceleration", "Ocean", ) -parameters = NamedTuple(parameters...) output_filename = "single_column_simulation.jld2" simulation = single_column_simulation(; diff --git a/examples/OceananigansSingleColumnSimulation/single_column_simulation.jl b/examples/OceananigansSingleColumnSimulation/single_column_simulation.jl index e335df9d..164a036d 100644 --- a/examples/OceananigansSingleColumnSimulation/single_column_simulation.jl +++ b/examples/OceananigansSingleColumnSimulation/single_column_simulation.jl @@ -2,7 +2,7 @@ using Oceananigans using Oceananigans.Units using SeawaterPolynomials using SeawaterPolynomials.TEOS10: TEOS10EquationOfState -using CLIMAParameters +using ClimaParams using Printf