From 07be2168b6f14002aa184b832078a151f115fd64 Mon Sep 17 00:00:00 2001 From: "Alexandre A. Renchon" Date: Wed, 11 Sep 2024 10:21:00 -0700 Subject: [PATCH] WIP --- .../calibration/minimal_working_example/Project.toml | 1 + .../minimal_working_example/minimal_working_example.jl | 8 +++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/experiments/calibration/minimal_working_example/Project.toml b/experiments/calibration/minimal_working_example/Project.toml index 85ca6949ba..8e54ff04f3 100644 --- a/experiments/calibration/minimal_working_example/Project.toml +++ b/experiments/calibration/minimal_working_example/Project.toml @@ -1,3 +1,4 @@ [deps] +ClimaLand = "08f4d4ce-cf43-44bb-ad95-9d2d5f413532" ClimaLandSimulations = "348a0bd3-1299-4261-8002-d2cd97df6055" EnsembleKalmanProcesses = "aa8a2aa5-91d8-4396-bcef-d4f2ec43552d" diff --git a/experiments/calibration/minimal_working_example/minimal_working_example.jl b/experiments/calibration/minimal_working_example/minimal_working_example.jl index 0b915c5c1e..f6d1edca6e 100644 --- a/experiments/calibration/minimal_working_example/minimal_working_example.jl +++ b/experiments/calibration/minimal_working_example/minimal_working_example.jl @@ -16,6 +16,7 @@ # Packages import ClimaLandSimulations.Fluxnet as CLS # to run the model import EnsembleKalmanProcesses as EKP # to perform the calibration +import Random # we need it for ... # a function returning our model lhf output given the params to calibrate function ClimaLand_lhf(g1) @@ -37,14 +38,15 @@ lhf_target = ClimaLand_lhf(141.0) # our default for Ozark, in sqrt(Pa). This is # parameters prior prior_g1 = EKP.constrained_gaussian("g1", 221, 100, 0, Inf) # mean of 221 sqrt(Pa) = 7 sqrt(kPa), std of 100 (3 kPa) +# Ollie: why does it return μ=5.3, σ=0.4? Are the values transformed? # generate the initial ensemble and set up the ensemble Kalman inversion -N_ensemble = 5 -N_iterations = 5 +N_ensemble = 5 # Ollie: is this parameter set at each iteration? +N_iterations = 5 # Ollie: is this always equal to N_ensemble? rng_seed = 41 # Ollie: why 41? rng = Random.MersenneTwister(rng_seed) # Ollie: pseudo-random number? -initial_ensemble = EKP.construct_initial_ensemble(rng, prior_g1, N_ensemble) # Ollie: what does this do? +initial_ensemble = EKP.construct_initial_ensemble(rng, prior_g1, N_ensemble) # Ollie: what does this do? 5 random values of g1? ensemble_kalman_process = EKP.EnsembleKalmanProcess(initial_ensemble, y, Γ, Inversion(); rng = rng) # Ollie: do we need y and Γ?