Skip to content

Commit

Permalink
fix Γ and expand prior std dev
Browse files Browse the repository at this point in the history
  • Loading branch information
amylu00 committed Feb 4, 2025
1 parent c416188 commit a7c9729
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 12 deletions.
2 changes: 1 addition & 1 deletion papers/ice_nucleation_2024/AIDA_calibrations.jl
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ for (calib_index, plot_name) in enumerate(plot_names)

ff_max = maximum.(frozen_frac_moving_mean)
ff_min = minimum.(frozen_frac_moving_mean)
Γ = 0.01 * LinearAlgebra.I * (maximum(ff_max) - minimum(ff_min))
Γ = 0.01 / 9 * LinearAlgebra.I * (maximum(ff_max) - minimum(ff_min))

### Calibration.
EKI_output = calibrate_J_parameters_EKI(FT, nuc_mode, params_list, IC_list, y_truth, end_sim, Γ)
Expand Down
20 changes: 11 additions & 9 deletions papers/ice_nucleation_2024/calibration.jl
Original file line number Diff line number Diff line change
Expand Up @@ -157,21 +157,21 @@ function create_prior(FT, IN_mode, ; perfect_model = false, aerosol_type = nothi
# for perfect model calibration
if perfect_model == true
if IN_mode == "ABDINM"
m_stats = [FT(20), FT(8), FT(0), Inf]
c_stats = [FT(-1), FT(2), -Inf, Inf]
m_stats = [FT(20), FT(20), FT(0), Inf]
c_stats = [FT(-1), FT(20), -Inf, Inf]
elseif IN_mode == "ABIFM"
m_stats = [FT(50), FT(7), FT(0), Inf]
c_stats = [FT(-7), FT(4), -Inf, Inf]
m_stats = [FT(50), FT(20), FT(0), Inf]
c_stats = [FT(-7), FT(20), -Inf, Inf]
elseif IN_mode == "ABHOM"
m_stats = [FT(251), FT(6), FT(0), Inf]
c_stats = [FT(-66), FT(3), -Inf, Inf]
m_stats = [FT(251), FT(70), FT(0), Inf]
c_stats = [FT(-66), FT(20), -Inf, Inf]
end

elseif perfect_model == false
if IN_mode == "ABDINM"
if aerosol_type == CMP.ArizonaTestDust(FT)
m_stats = [FT(40), FT(20), FT(0), Inf]
c_stats = [FT(0.5), FT(20), FT(-2), Inf]
c_stats = [FT(0.5), FT(20), -Inf, Inf]
elseif aerosol_type == CMP.Illite(FT)
m_stats = [FT(30), FT(20), FT(0), Inf]
c_stats = [FT(0.7), FT(7), -Inf, Inf]
Expand All @@ -181,8 +181,8 @@ function create_prior(FT, IN_mode, ; perfect_model = false, aerosol_type = nothi
# c_stats = [FT(-7), FT(1), -Inf, Inf]
error("ABIFM calibrations not yet supported.")
elseif IN_mode == "ABHOM"
m_stats = [FT(260.927125), FT(25), FT(0), Inf]
c_stats = [FT(-68.553283), FT(10), FT(-70), Inf]
m_stats = [FT(260.927125), FT(70), FT(0), Inf]
c_stats = [FT(-68.553283), FT(20), -Inf, Inf]
end
end

Expand Down Expand Up @@ -226,6 +226,8 @@ function calibrate_J_parameters_EKI(FT, IN_mode, params, IC, y_truth, end_sim,
rng = rng,
verbose = true,
localization_method = EKP.Localizers.NoLocalization(), # no localization
scheduler = EKP.DataMisfitController(terminate_at = 1),
accelerator = EKP.DefaultAccelerator(), # no acceleration
)

# Carry out the EKI calibration
Expand Down
4 changes: 2 additions & 2 deletions papers/ice_nucleation_2024/perfect_calib.jl
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ for IN_mode in IN_mode_list
)[2]

# Plotting calibrated parameters per iteration
fig = MK.Figure(size = (800, 600))
fig = MK.Figure(size = (800, 600), fontsize = 24)
ax1 = MK.Axis(fig[1, 1], ylabel = "m coefficient [-]", xlabel = "iteration number", title = IN_mode)
ax2 = MK.Axis(fig[2, 1], ylabel = "c coefficient [-]", xlabel = "iteration number")

Expand All @@ -80,7 +80,7 @@ for IN_mode in IN_mode_list
MK.save(plot_name, fig)

# Plotting calibrated parcel's ICNC
fig2 = MK.Figure(size = (800, 600))
fig2 = MK.Figure(size = (800, 600), fontsize = 24)
ax3 = MK.Axis(fig2[1, 1], ylabel = "Frozen Fraction [-]", xlabel = "time [s]", title = IN_mode)

soln_EKI = run_model(params, IN_mode, calibrated_parameters_EKI, FT, IC, end_sim)
Expand Down

0 comments on commit a7c9729

Please sign in to comment.