Skip to content

Commit

Permalink
Prescribed thermo for AIDA calibrations
Browse files Browse the repository at this point in the history
  • Loading branch information
amylu00 committed Nov 22, 2024
1 parent ab82db5 commit 4451730
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 3 deletions.
7 changes: 5 additions & 2 deletions papers/ice_nucleation_2024/AIDA_calibrations.jl
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ start_time_list = [195, 180, 80] .+ 100 # AIDA time starts at -100 seconds. A
end_time_list = [290, 290, 170] .+ 100 # approximate time freezing stops
moving_average_n = 20 # average every n points
updrafts = [FT(1.5), FT(1.4), FT(5)] # updrafts matching AIDA cooling rate
cooling_rate_list = [FT(236.665-236.989)/20, FT(236.940-237.234)/20, FT(237.131-238.157)/20]
expansion_rate_list = [FT(8.25678 - 8.67310) * 1e4 / 80, FT(8.27100 - 8.78345) * 1e4 / 100, FT(6.76025-7.33069) * 1e4 / 70]

# Additional definitions
ips = CMP.IceNucleationParameters(FT)
Expand All @@ -42,6 +44,8 @@ for (exp_index, data_file_name) in enumerate(data_file_names)
### Unpacking experiment-specific variables.
plot_name = plot_names[exp_index]
w = updrafts[exp_index]
cooling_rate = cooling_rate_list[exp_index]
expansion_rate = expansion_rate_list[exp_index]
start_time = start_time_list[exp_index]
end_time = end_time_list[exp_index]

Expand All @@ -51,8 +55,7 @@ for (exp_index, data_file_name) in enumerate(data_file_names)
t_max =
(end_time - 100 - (moving_average_n / 2)) - # AIDA time starts at -100 seconds (t = 0 at index 101)
(start_time - 100 + (moving_average_n / 2 - 1)) # duration of simulation

params = AIDA_IN05_params(FT, w, t_max)
params = AIDA_IN05_params(FT, w, t_max, cooling_rate, expansion_rate)
IC = AIDA_IN05_IC(FT, data_file_name)

### Check for data file in AIDA_data folder.
Expand Down
20 changes: 20 additions & 0 deletions papers/ice_nucleation_2024/calibration.jl
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ include(joinpath(pkgdir(CM), "papers", "ice_nucleation_2024", "calibration_setup
function run_model(p, coefficients, IN_mode, FT, IC, end_sim)
# grabbing parameters
m_calibrated, c_calibrated = coefficients
(; prescribed_thermodynamics, cooling_rate, expansion_rate) = p
(; const_dt, w, t_max, aerosol_act, aerosol, r_nuc) = p
(; deposition_growth, condensation_growth) = p
(; dep_nucleation, heterogeneous, homogeneous) = p
Expand All @@ -39,6 +40,9 @@ function run_model(p, coefficients, IN_mode, FT, IC, end_sim)
# run parcel with new coefficients
local params = parcel_params{FT}(
const_dt = const_dt,
prescribed_thermodynamics = prescribed_thermodynamics,
cooling_rate = cooling_rate,
expansion_rate = expansion_rate,
w = w,
aerosol = overwrite,
deposition = dep_nucleation,
Expand All @@ -62,6 +66,9 @@ function run_model(p, coefficients, IN_mode, FT, IC, end_sim)
# run parcel with new coefficients
local params = parcel_params{FT}(
const_dt = const_dt,
prescribed_thermodynamics = prescribed_thermodynamics,
cooling_rate = cooling_rate,
expansion_rate = expansion_rate,
w = w,
aerosol = overwrite,
heterogeneous = heterogeneous,
Expand All @@ -86,6 +93,9 @@ function run_model(p, coefficients, IN_mode, FT, IC, end_sim)
local params = parcel_params{FT}(
const_dt = const_dt,
w = w,
prescribed_thermodynamics = prescribed_thermodynamics,
cooling_rate = cooling_rate,
expansion_rate = expansion_rate,
aerosol_act = aerosol_act,
aerosol = aerosol,
aero_σ_g = aero_σ_g,
Expand All @@ -107,6 +117,7 @@ end
function run_calibrated_model(FT, IN_mode, coefficients, p, IC)
# grabbing parameters
m_calibrated, c_calibrated = coefficients
(; prescribed_thermodynamics, cooling_rate, expansion_rate) = p
(; const_dt, w, t_max, aerosol_act, aerosol, r_nuc) = p
(; liq_size_distribution, ice_size_distribution, aero_σ_g) = p
(; deposition_growth, condensation_growth) = p
Expand All @@ -126,6 +137,9 @@ function run_calibrated_model(FT, IN_mode, coefficients, p, IC)
# run parcel with new coefficients
local params = parcel_params{FT}(
const_dt = const_dt,
prescribed_thermodynamics = prescribed_thermodynamics,
cooling_rate = cooling_rate,
expansion_rate = expansion_rate,
w = w,
aerosol_act = aerosol_act,
aerosol = overwrite,
Expand Down Expand Up @@ -153,6 +167,9 @@ function run_calibrated_model(FT, IN_mode, coefficients, p, IC)
# run parcel with new coefficients
local params = parcel_params{FT}(
const_dt = const_dt,
prescribed_thermodynamics = prescribed_thermodynamics,
cooling_rate = cooling_rate,
expansion_rate = expansion_rate,
w = w,
aerosol_act = aerosol_act,
aerosol = overwrite,
Expand Down Expand Up @@ -180,6 +197,9 @@ function run_calibrated_model(FT, IN_mode, coefficients, p, IC)
# run parcel with new coefficients
local params = parcel_params{FT}(
const_dt = const_dt,
prescribed_thermodynamics = prescribed_thermodynamics,
cooling_rate = cooling_rate,
expansion_rate = expansion_rate,
w = w,
aerosol_act = aerosol_act,
aerosol = aerosol,
Expand Down
4 changes: 3 additions & 1 deletion papers/ice_nucleation_2024/calibration_setup.jl
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,10 @@ function perf_model_pseudo_data(FT, IN_mode, params, IC)
return [y_truth, Γ, coeff_true]
end

function AIDA_IN05_params(FT, w, t_max)
function AIDA_IN05_params(FT, w, t_max, cooling_rate, expansion_rate)
IN_mode = "ABHOM"
const_dt = FT(1)
prescribed_thermodynamics = true
aerosol_act = "AeroAct"
aerosol = CMP.Sulfate(FT)
dep_nucleation = "None"
Expand All @@ -157,6 +158,7 @@ function AIDA_IN05_params(FT, w, t_max)
r_nuc = FT(1e-7) #FT(3.057e-6)

params = (; const_dt, w, t_max,
prescribed_thermodynamics, cooling_rate, expansion_rate,
aerosol_act, aerosol, r_nuc, aero_σ_g, # aerosol activation
condensation_growth, deposition_growth, # growth
liq_size_distribution, ice_size_distribution, # size distribution
Expand Down

0 comments on commit 4451730

Please sign in to comment.