Skip to content

Commit

Permalink
working cloudy example
Browse files Browse the repository at this point in the history
  • Loading branch information
odunbar committed Aug 1, 2024
1 parent ec3ef6b commit 01c4fd8
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 12 deletions.
4 changes: 4 additions & 0 deletions docs/src/examples/Cloudy_example.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
!!! info "How do I run this code?"
The full code is found in the [`examples/`](https://github.com/CliMA/CalibrateEmulateSample.jl/tree/main/examples) directory of the github repository

!!! warn "version control for Cloudy"
Due to rapid developments in Cloudy, this example will not work with the latest version. It is known to work pinned to specific commit `b4fa7e3`, please add Cloudy to the example Project using command `add Cloudy#b4fa7e3` in `Pkg` to avoid errors.


This example is based on [Cloudy](https://github.com/CliMA/Cloudy.jl.git), a
microphysics model that simulates how cloud droplets collide and coalesce into
larger drops. Collision-coalescence is a crucial process for the formation of
Expand Down
13 changes: 8 additions & 5 deletions examples/Cloudy/Cloudy_calibrate.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Reference the in-tree version of CalibrateEmulateSample on Julias load path
include(joinpath(@__DIR__, "../", "ci", "linkfig.jl"))

@info "This experiment is very sensitive to the Cloudy version. It is known to work with Cloudy commit: b4fa7e3"

# Import modules
using Distributions
using StatsBase
Expand All @@ -18,11 +20,12 @@ using Cloudy.KernelTensors
# Import the module that runs Cloudy
include(joinpath(@__DIR__, "DynamicalModel.jl"))

# Import Ensemble Kalman Processes modules
using EnsembleKalmanProcesses
using EnsembleKalmanProcesses.ParameterDistributions
using EnsembleKalmanProcesses.DataContainers
using EnsembleKalmanProcesses.PlotRecipes
# Import Ensemble Kalman Processes modules via CES
using CalibrateEmulateSample
using CalibrateEmulateSample.EnsembleKalmanProcesses
using CalibrateEmulateSample.EnsembleKalmanProcesses.ParameterDistributions
using CalibrateEmulateSample.EnsembleKalmanProcesses.DataContainers
using CalibrateEmulateSample.EnsembleKalmanProcesses.PlotRecipes


################################################################################
Expand Down
3 changes: 1 addition & 2 deletions examples/Cloudy/Cloudy_emulate_sample.jl
Original file line number Diff line number Diff line change
Expand Up @@ -281,8 +281,7 @@ function main()
# Adding a vertical line for the true value
vlines!(ax, [ϕ_true[idx]], color = :indigo, linewidth = 2.6, label = "true " * param_names[idx])

xlims!(ax, xmin, xmax)
ylims!(ax, 0, nothing)


# Setting title and labels
ax.xlabel = "Value"
Expand Down
9 changes: 4 additions & 5 deletions examples/Cloudy/Project.toml
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
[deps]
CairoMakie = "13f3f980-e62b-5c42-98c6-ff1f3baf88f0"
CalibrateEmulateSample = "95e48a1f-0bec-4818-9538-3db4340308e3"
Cloudy = "9e3b23bb-e7cc-4b94-886c-65de2234ba87"
DifferentialEquations = "0c46a032-eb83-5123-abaf-570d42b7fbaa"
Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f"
DocStringExtensions = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae"
EnsembleKalmanProcesses = "aa8a2aa5-91d8-4396-bcef-d4f2ec43552d"
GaussianProcesses = "891a1506-143c-57d2-908e-e1f8e92e6de9"
JLD2 = "033835bb-8acc-5ee8-8aae-3f567f8a3819"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
PairPlots = "43a3c2be-4208-490b-832a-a21dcd55d7da"
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
StatsBase = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91"
StatsPlots = "f3b207a7-027a-5e70-b257-86293d7955fd"
CalibrateEmulateSample = "95e48a1f-0bec-4818-9538-3db4340308e3"
EnsembleKalmanProcesses = "aa8a2aa5-91d8-4396-bcef-d4f2ec43552d"
JLD2 = "033835bb-8acc-5ee8-8aae-3f567f8a3819"


[compat]
julia = "~1.6"
Cloudy = "0.3"
Cloudy = "0.2" # Known to work with commit: b4fa7e3

0 comments on commit 01c4fd8

Please sign in to comment.