From 23acff24fe1eb3c37b3371b1799a1c621108e9f0 Mon Sep 17 00:00:00 2001 From: Jago Strong-Wright Date: Fri, 20 Sep 2024 14:50:25 +0100 Subject: [PATCH 1/5] Update data_assimilation.jl --- examples/data_assimilation.jl | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/examples/data_assimilation.jl b/examples/data_assimilation.jl index c30212ea0..e17a66eb8 100644 --- a/examples/data_assimilation.jl +++ b/examples/data_assimilation.jl @@ -34,22 +34,26 @@ rng = Random.MersenneTwister(rng_seed) @inline PAR⁰(t) = 60 * (1 - cos((t + 15days) * 2π / year)) * (1 / (1 + 0.2 * exp(-((mod(t, year) - 200days) / 50days)^2))) + 2 z = -10 # nominal depth of the box for the PAR profile -@inline PAR(t) = PAR⁰(t) * exp(0.2z) # Modify the PAR based on the nominal depth and exponential decay +@inline PAR_func(t) = PAR⁰(t) * exp(0.2z) # Modify the PAR based on the nominal depth and exponential decay function run_box_simulation(initial_photosynthetic_slope, base_maximum_growth, nutrient_half_saturation, phyto_base_mortality_rate, j) + grid = BoxModelGrid() + clock = Clock(; time = zero(grid)) - biogeochemistry = NutrientPhytoplanktonZooplanktonDetritus(; grid = BoxModelGrid(), + PAR = FunctionField{Center, Center, Center}(PAR_func, grid; clock) + + biogeochemistry = NutrientPhytoplanktonZooplanktonDetritus(; grid, initial_photosynthetic_slope, base_maximum_growth, nutrient_half_saturation, phyto_base_mortality_rate, - light_attenuation_model = nothing) + light_attenuation_model = PrescribedPhotosyntheticallyActiveRadiation(PAR)) - model = BoxModel(; biogeochemistry, forcing = (; PAR)) + model = BoxModel(; biogeochemistry) set!(model, N = 10.0, P = 0.1, Z = 0.01) From bfaed62042a4ce2d1c3a1a3f6a03e1c409057e6a Mon Sep 17 00:00:00 2001 From: Jago Strong-Wright Date: Fri, 20 Sep 2024 16:47:57 +0100 Subject: [PATCH 2/5] Update data_assimilation.jl --- examples/data_assimilation.jl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/examples/data_assimilation.jl b/examples/data_assimilation.jl index e17a66eb8..b7ba6fc87 100644 --- a/examples/data_assimilation.jl +++ b/examples/data_assimilation.jl @@ -24,6 +24,8 @@ using Distributions using EnsembleKalmanProcesses using EnsembleKalmanProcesses.ParameterDistributions +using Oceananigans.Fields: FuncitonField + const year = years = 365day rng_seed = 41 From 8afa9ad58535291738efe342f8d7228bd9befdcc Mon Sep 17 00:00:00 2001 From: Jago Strong-Wright Date: Tue, 24 Sep 2024 11:26:57 +0100 Subject: [PATCH 3/5] Update data_assimilation.jl --- examples/data_assimilation.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/data_assimilation.jl b/examples/data_assimilation.jl index b7ba6fc87..fb2eb1022 100644 --- a/examples/data_assimilation.jl +++ b/examples/data_assimilation.jl @@ -24,7 +24,7 @@ using Distributions using EnsembleKalmanProcesses using EnsembleKalmanProcesses.ParameterDistributions -using Oceananigans.Fields: FuncitonField +using Oceananigans.Fields: FunctionField const year = years = 365day From 8c7bef76abb290a1ccb57da55007e8f880191a74 Mon Sep 17 00:00:00 2001 From: Jago Strong-Wright Date: Mon, 30 Sep 2024 13:54:53 +0100 Subject: [PATCH 4/5] oops --- examples/data_assimilation.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/data_assimilation.jl b/examples/data_assimilation.jl index fb2eb1022..d4ee7b0ab 100644 --- a/examples/data_assimilation.jl +++ b/examples/data_assimilation.jl @@ -55,7 +55,7 @@ function run_box_simulation(initial_photosynthetic_slope, phyto_base_mortality_rate, light_attenuation_model = PrescribedPhotosyntheticallyActiveRadiation(PAR)) - model = BoxModel(; biogeochemistry) + model = BoxModel(; biogeochemistry, clock) set!(model, N = 10.0, P = 0.1, Z = 0.01) From f8436e06cf9bad8c1406468dffb7af972f0ffcc4 Mon Sep 17 00:00:00 2001 From: Jago Strong-Wright Date: Tue, 1 Oct 2024 10:24:47 +0100 Subject: [PATCH 5/5] Bump patch So that stable docs update --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index 2c922e89b..f420f20f9 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "OceanBioME" uuid = "a49af516-9db8-4be4-be45-1dad61c5a376" authors = ["Jago Strong-Wright and contributors"] -version = "0.11.1" +version = "0.11.2" [deps] Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e"