-
Notifications
You must be signed in to change notification settings - Fork 6
/
AerosolSeasalt.jl
41 lines (36 loc) · 978 Bytes
/
AerosolSeasalt.jl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
export Seasalt
"""
Seasalt{FT}
Parameters for seasalt
# Fields
$(DocStringExtensions.FIELDS)
"""
Base.@kwdef struct Seasalt{FT} <: AerosolType{FT}
"molar mass [kg/mol]"
M::FT
"density [kg/m3]"
ρ::FT
"osmotic coefficient [-]"
ϕ::FT
"ion number [-]"
ν::FT
"water soluble mass fraction [-]"
ϵ::FT
"hygroscopicity parameter [-]"
κ::FT
end
Seasalt(::Type{FT}) where {FT <: AbstractFloat} =
Seasalt(CP.create_toml_dict(FT))
function Seasalt(td::CP.AbstractTOMLDict)
name_map = (;
:seasalt_aerosol_molar_mass => :M,
:seasalt_aerosol_density => :ρ,
:seasalt_aerosol_osmotic_coefficient => :ϕ,
:seasalt_aerosol_ion_number => :ν,
:seasalt_aerosol_water_soluble_mass_fraction => :ϵ,
:seasalt_aerosol_kappa => :κ,
)
parameters = CP.get_parameter_values(td, name_map, "CloudMicrophysics")
FT = CP.float_type(td)
return Seasalt{FT}(; parameters...)
end