From d806c1c21ded8fe64fa411e2675bb466c77c1eaa Mon Sep 17 00:00:00 2001 From: nefrathenrici Date: Wed, 25 Oct 2023 13:24:09 -0700 Subject: [PATCH] wip --- .gitignore | 2 -- examples/Manifest.toml | 6 +++--- examples/Project.toml | 1 + examples/driver.sbatch | 8 ++++---- .../ekp_config.yml | 2 +- .../observation_map.jl | 9 ++++----- .../sphere_held_suarez_rhoe_equilmoist/prior.toml | 2 +- .../sphere_held_suarez_rhoe_equilmoist/truth.jld2 | Bin 0 -> 980 bytes src/ekp_interface.jl | 5 +++-- 9 files changed, 17 insertions(+), 18 deletions(-) create mode 100644 examples/sphere_held_suarez_rhoe_equilmoist/truth.jld2 diff --git a/.gitignore b/.gitignore index 3544d64b..8ad88ded 100644 --- a/.gitignore +++ b/.gitignore @@ -1,9 +1,7 @@ # Simulation outputs and logs *.png -*.hdf5 output/* test/test_init/iteration* -*.jld2 *.out # System-specific files and directories generated by the BinaryProvider and BinDeps packages diff --git a/examples/Manifest.toml b/examples/Manifest.toml index b992bc73..e99362eb 100644 --- a/examples/Manifest.toml +++ b/examples/Manifest.toml @@ -2,7 +2,7 @@ julia_version = "1.9.3" manifest_format = "2.0" -project_hash = "b8938cc33d8dc71cf7438a209c304619eed646c3" +project_hash = "6821a0942148031affdbc8ba4d0cdb4edc3c958f" [[deps.ADTypes]] git-tree-sha1 = "5d2e21d7b0d8c22f67483ef95ebdc39c0e6b6003" @@ -266,9 +266,9 @@ version = "0.5.5" [[deps.ClimaCore]] deps = ["Adapt", "BandedMatrices", "BlockArrays", "CUDA", "ClimaComms", "CubedSphere", "DataStructures", "DocStringExtensions", "ForwardDiff", "GaussQuadrature", "GilbertCurves", "HDF5", "InteractiveUtils", "IntervalSets", "LinearAlgebra", "PkgVersion", "RecursiveArrayTools", "Requires", "RootSolvers", "SparseArrays", "Static", "StaticArrays", "Statistics", "UnPack"] -git-tree-sha1 = "8174265fe74081f378b11e36962c3b9cbb11c44f" +git-tree-sha1 = "4a5138604b65cfa2d30b90ddf5252106874940c3" uuid = "d414da3d-4745-48bb-8d80-42e94e092884" -version = "0.10.54" +version = "0.10.55" [[deps.ClimaTimeSteppers]] deps = ["CUDA", "ClimaComms", "Colors", "DataStructures", "DiffEqBase", "DiffEqCallbacks", "KernelAbstractions", "Krylov", "LinearAlgebra", "LinearOperators", "NVTX", "SciMLBase", "StaticArrays"] diff --git a/examples/Project.toml b/examples/Project.toml index 938667d1..fb02f617 100644 --- a/examples/Project.toml +++ b/examples/Project.toml @@ -2,6 +2,7 @@ CLIMAParameters = "6eacf6c3-8458-43b9-ae03-caf5306d3d53" CalibrateAtmos = "4347a170-ebd6-470c-89d3-5c705c0cacc2" ClimaAtmos = "b2c96348-7fb7-4fe0-8da9-78d88439e717" +ClimaCore = "d414da3d-4745-48bb-8d80-42e94e092884" Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f" EnsembleKalmanProcesses = "aa8a2aa5-91d8-4396-bcef-d4f2ec43552d" JLD2 = "033835bb-8acc-5ee8-8aae-3f567f8a3819" diff --git a/examples/driver.sbatch b/examples/driver.sbatch index 6657c7f1..c924c938 100644 --- a/examples/driver.sbatch +++ b/examples/driver.sbatch @@ -9,12 +9,12 @@ export JULIA_LOAD_PATH=":/examples/load_path" job_id=${1?Error: no job ID given} echo "Running job: $job_id" -julia --project=examples -e 'using Pkg; Pkg.develop(path="."); \ - Pkg.instantiate(;verbose=true)' +julia --project=examples -e 'using Pkg; Pkg.develop(path="."); + Pkg.instantiate(;verbose=true)' # This is a bit messy - could be file -julia --project=examples -e "import CalibrateAtmos; using Distributions; \ - using EnsembleKalmanProcesses.ParameterDistributions; \ +julia --project=examples -e "import CalibrateAtmos; using Distributions; + using EnsembleKalmanProcesses.ParameterDistributions; CalibrateAtmos.initialize(\"$job_id\")" echo 'Ensemble initialized for calibration.' diff --git a/examples/sphere_held_suarez_rhoe_equilmoist/ekp_config.yml b/examples/sphere_held_suarez_rhoe_equilmoist/ekp_config.yml index 6e5cb92c..1238088b 100644 --- a/examples/sphere_held_suarez_rhoe_equilmoist/ekp_config.yml +++ b/examples/sphere_held_suarez_rhoe_equilmoist/ekp_config.yml @@ -1,6 +1,6 @@ output_dir: output/sphere_held_suarez_rhoe_equilmoist prior_path: examples/sphere_held_suarez_rhoe_equilmoist/prior.toml -parameter_names: ["ΔT_y_wet"] +parameter_names: ["equator_pole_temperature_gradient_wet"] ensemble_size: 5 n_iterations: 5 obs_mean: examples/sphere_held_suarez_rhoe_equilmoist/truth.jld2 diff --git a/examples/sphere_held_suarez_rhoe_equilmoist/observation_map.jl b/examples/sphere_held_suarez_rhoe_equilmoist/observation_map.jl index 247149ed..e88046b8 100644 --- a/examples/sphere_held_suarez_rhoe_equilmoist/observation_map.jl +++ b/examples/sphere_held_suarez_rhoe_equilmoist/observation_map.jl @@ -39,16 +39,15 @@ end function observation_map(iteration, job_id) config = YAML.load_file("examples/$job_id/ekp_config.yml") output_dir = config["output_dir"] - # ensemble_size = config["ensemble_size"] - ensemble_size = 1 - filename = "ta_60.0d_average.nc" + ensemble_size = config["ensemble_size"] + model_output = "ta_60.0d_average.nc" dims = (19 - 2) - G_ens = Array{Float32}(undef, dims..., ensemble_size) + G_ens = Array{Float64}(undef, dims..., ensemble_size) for m in 1:ensemble_size member_path = TOMLInterface.path_to_ensemble_member(output_dir, iteration, m) - ta = ncread(joinpath(member_path, filename), "ta") + ta = ncread(joinpath(member_path, model_output), "ta") # Cut off first 120 days to get equilibrium, take second level slice level_slice = 2 diff --git a/examples/sphere_held_suarez_rhoe_equilmoist/prior.toml b/examples/sphere_held_suarez_rhoe_equilmoist/prior.toml index 4aedf155..1763d125 100644 --- a/examples/sphere_held_suarez_rhoe_equilmoist/prior.toml +++ b/examples/sphere_held_suarez_rhoe_equilmoist/prior.toml @@ -1,4 +1,4 @@ -["ΔT_y_wet"] +["equator_pole_temperature_gradient_wet"] prior = "Parameterized(Normal(65,20.0))" constraint = "[bounded_below(0)]" type = "float" diff --git a/examples/sphere_held_suarez_rhoe_equilmoist/truth.jld2 b/examples/sphere_held_suarez_rhoe_equilmoist/truth.jld2 new file mode 100644 index 0000000000000000000000000000000000000000..b604b8153e933b2c2cbc60c87ea8f030f8ce1224 GIT binary patch literal 980 zcmeZpaWmCTN-R!IQSd6w$xKvmNi0cJaLX^sO)Sw-C`&CW&dkqKFwis9Gh|TEfG9E4 zv(z(EFf-9j$}Cavan)oP1w%FjIz3$6c)6swm^e5X7?>d5_zwkFm?3;!MhM;dT6BrO zhf5F>!zWgtQf5v@9-tmZ21b3T_nAc)7!4KV8Cbx41qN{r2Jw0zo8tfjP;3u_flZNf z^Swgn{L6*Tx5JB^-!Cb0R@+qMd}n2mbNiYi=jjzi&IW-+&M96+&Jhts&LO@<&fGCY z&W^D_8YpK9q+R@roOkgTIlnP2axO|Ka()+G