Skip to content

Commit

Permalink
adapted to climaparameter suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
amylu00 committed Feb 17, 2024
1 parent a35f8c6 commit 20945d8
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 6 deletions.
12 changes: 9 additions & 3 deletions src/IceNucleation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,8 @@ function P3_deposition_N_i(ip::CMP.MorrisonMilbrandt2014, T::FT) where {FT}

Nᵢ = ifelse(
T < T_thres,
max(FT(0), FT(0.005 * exp(0.304 * (T₀ - T_thres)))),
max(FT(0), FT(0.005 * exp(0.304 * (T₀ - T)))),
max(FT(0), FT(ip.c₁ * exp(ip.c₂ * (T₀ - T_thres)))),
max(FT(0), FT(ip.c₁ * exp(ip.c₂ * (T₀ - T)))),
)
return Nᵢ * 1e3 # converts L^-1 to m^-3
end
Expand All @@ -148,7 +148,13 @@ Returns the number of ice nucleated within Δt via heterogeneous freezing
with units of m^-3. From Pruppacher & Klett 1997 eqn (9-51) as used in
Morrison & Milbrandt 2015.
"""
function P3_het_N_i(ip::CMP.MorrisonMilbrandt2014, T::FT, N_l::FT, V_l::FT, Δt::FT) where {FT}
function P3_het_N_i(
ip::CMP.MorrisonMilbrandt2014,
T::FT,
N_l::FT,
V_l::FT,
Δt::FT
) where {FT}

a = ip.het_a # (celcius)^-1
B = ip.het_b # cm^-3 s^-1 for rain water
Expand Down
16 changes: 13 additions & 3 deletions src/parameters/IceNucleation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,12 @@ DOI: 10.1175/JAS-D-14-0065.1
$(DocStringExtensions.FIELDS)
"""
Base.@kwdef struct MorrisonMilbrandt2014{FT} <: ParametersType{FT}
"deposition nucleation threshold T [K]"
"Cutoff temperature for deposition nucleation [K]"
T_dep_thres::FT
"coefficient [-]"
c₁::FT
"coefficient [-]"
c₂::FT
"T₀"
T₀::FT
"heterogeneous freezing parameter a [°C^-1]"
Expand All @@ -87,7 +91,9 @@ end

function MorrisonMilbrandt2014(td::CP.AbstractTOMLDict)
name_map = (;
:Thompson2004_T_threshold_Cooper => :T_dep_thres,
:temperature_homogenous_nucleation => :T_dep_thres,
:Thompson2004_c1_Cooper => :c₁
:Thompson2004_c1_Cooper => :c₂
:temperature_water_freeze => :T₀,
:BarklieGokhale1959_a_parameter => :het_a,
:BarklieGokhale1959_B_parameter => :het_B,
Expand Down Expand Up @@ -122,7 +128,11 @@ function IceNucleationParameters(toml_dict::CP.AbstractTOMLDict)
HOM = typeof(homogeneous)
P3_type = typeof(p3)
FT = CP.float_type(toml_dict)
return IceNucleationParameters{FT, DEP, HOM, P3_type}(deposition, homogeneous, p3)
return IceNucleationParameters{FT, DEP, HOM, P3_type}(
deposition,
homogeneous,
p3
)
end


Expand Down

0 comments on commit 20945d8

Please sign in to comment.