Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
name = "CloudMicrophysics"
uuid = "6a9e3e04-43cd-43ba-94b9-e8782df3c71b"
authors = ["Climate Modeling Alliance"]
version = "0.32"
authors = ["Climate Modeling Alliance"]

[deps]
ClimaParams = "5c42b081-d73a-476f-9059-fd94b934656c"
DocStringExtensions = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae"
ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210"
InteractiveUtils = "b77e0a4c-d291-57a0-90e8-8db25a27a240"
LazyArtifacts = "4af54fe1-eca0-43a8-85a7-787d91b784e3"
LogExpFunctions = "2ab3a3ac-af41-5b50-aa03-7779005ae688"
RootSolvers = "7181ea78-2dcb-4de3-ab41-2b8ab5a31e74"
Expand All @@ -27,6 +28,7 @@ ClimaParams = "1"
DataFrames = "1.6"
DocStringExtensions = "0.8, 0.9"
ForwardDiff = "0.10, 1"
InteractiveUtils = "1"
LazyArtifacts = "1"
LogExpFunctions = "0.3.29"
MLJ = "0.20"
Expand Down
11 changes: 8 additions & 3 deletions docs/src/API.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,7 @@ P3Scheme
## Construct parameterization set

```@docs
CMP.ParametersP3{Float64}
CMP.ParametersP3(::Float64)
CMP.ParametersP3(::Parameters.CP.ParamDict)
CMP.ParametersP3
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

got some doc errors with this, so simplifying for now, will return improve this in a later PR

```

### Sub-parameterizations
Expand Down Expand Up @@ -432,3 +430,10 @@ Parameters.Microphysics2MParams
PrecipitationSusceptibility.precipitation_susceptibility_autoconversion
PrecipitationSusceptibility.precipitation_susceptibility_accretion
```


# Developer docs

```@autodocs
Modules = [ShowMethods]
```
Comment on lines +435 to +439
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The additional method signatures can be viewed in the doc preview

2 changes: 1 addition & 1 deletion docs/src/plots/CloudDiagnostics.jl
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ override_file = joinpath(
)
toml_dict = CP.create_toml_dict(FT; override_file)
SB = CMP.SB2006(toml_dict)
SB_no_limiters = CMP.SB2006(toml_dict, false)
SB_no_limiters = CMP.SB2006(toml_dict; is_limited = false)

ρ_air = FT(1)

Expand Down
2 changes: 1 addition & 1 deletion docs/src/plots/TerminalVelocity.jl
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const ice = CMP.CloudIce(FT)
const snow = CMP.Snow(FT)

const SB2006 = CMP.SB2006(FT)
const SB2006_no_lim = CMP.SB2006(FT, false)
const SB2006_no_lim = CMP.SB2006(FT; is_limited = false)

const Chen2022 = CMP.Chen2022VelType(FT)
const STVel = CMP.StokesRegimeVelType(FT)
Expand Down
2 changes: 1 addition & 1 deletion docs/src/plots/TerminalVelocity2M.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ FT = Float64

const rain = CMP.Rain(FT)
const SB2006 = CMP.SB2006(FT)
const SB2006_no_lim = CMP.SB2006(FT, false)
const SB2006_no_lim = CMP.SB2006(FT; is_limited = false)
const SB2006Vel = CMP.SB2006VelType(FT)

ρ_air = 1.2
Expand Down
6 changes: 3 additions & 3 deletions parcel/ParcelDistributions.jl
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import CloudMicrophysics.Parameters as CMP

struct Monodisperse{FT} <: CMP.ParametersType{FT} end
struct Monodisperse <: CMP.ParametersType end

struct MonodisperseMix{FT} <: CMP.ParametersType{FT} end
struct MonodisperseMix <: CMP.ParametersType end

struct Gamma{FT} <: CMP.ParametersType{FT} end
struct Gamma <: CMP.ParametersType end

#! format: off
# Size distributiom moments
Expand Down
28 changes: 14 additions & 14 deletions parcel/ParcelModel.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ include(joinpath(pkgdir(CM), "parcel", "ParcelParameters.jl"))
"""
Parcel simulation parameters
"""
Base.@kwdef struct parcel_params{FT} <: CMP.ParametersType{FT}
Base.@kwdef struct parcel_params{FT} <: CMP.ParametersType
prescribed_thermodynamics = false
t_profile = []
T_profile = []
Expand All @@ -21,7 +21,7 @@ Base.@kwdef struct parcel_params{FT} <: CMP.ParametersType{FT}
deposition_growth = "None"
liq_size_distribution = "Monodisperse"
ice_size_distribution = "Monodisperse"
aerosol = Empty{FT}()
aerosol = Empty()
aero_σ_g = FT(0)
wps = CMP.WaterProperties(FT)
aps = CMP.AirProperties(FT)
Expand Down Expand Up @@ -102,7 +102,7 @@ function parcel_model(dY, Y, p, t)
qₗ_mode1 = Y[11]
Nₗ_mode1 = Y[12]
_tmp_state = merge(state, (; qₗ = qₗ_mode1, Nₗ = Nₗ_mode1))
PSD_liq_mode1 = distribution_moments(Monodisperse{FT}(), qₗ_mode1, Nₗ_mode1, ρₗ, ρ_air)
PSD_liq_mode1 = distribution_moments(Monodisperse(), qₗ_mode1, Nₗ_mode1, ρₗ, ρ_air)
dqₗ_mode1_dt = condensation(ce_params, PSD_liq_mode1, _tmp_state, ρ_air)
dNₗ_mode1_dt =
dqₗ_mode1_dt < FT(0) && qₗ_mode1 > FT(0) && qₗ_mode1 < FT(1e-6) ? Nₗ_mode1 * dqₗ_mode1_dt / qₗ_mode1 : FT(0)
Expand Down Expand Up @@ -231,20 +231,20 @@ function run_parcel(IC, t_0, t_end, pp)

info = "\nSize distribution (liq): $(pp.liq_size_distribution)\n"
if pp.liq_size_distribution == "Monodisperse"
liq_distr = Monodisperse{FT}()
liq_distr = Monodisperse()
elseif pp.liq_size_distribution == "Gamma"
liq_distr = Gamma{FT}()
liq_distr = Gamma()
elseif pp.liq_size_distribution == "MonodisperseMix"
liq_distr = MonodisperseMix{FT}()
liq_distr = MonodisperseMix()
else
throw("Unrecognized size distribution")
end

info *= "Size distribution (ice): $(pp.ice_size_distribution)\n"
if pp.ice_size_distribution == "Monodisperse"
ice_distr = Monodisperse{FT}()
ice_distr = Monodisperse()
elseif pp.ice_size_distribution == "Gamma"
ice_distr = Gamma{FT}()
ice_distr = Gamma()
else
throw("Unrecognized size distribution")
end
Expand All @@ -253,7 +253,7 @@ function run_parcel(IC, t_0, t_end, pp)

info *= "Aerosol Activation: $(pp.aerosol_act)\n"
if pp.aerosol_act == "None"
aero_act_params = Empty{FT}()
aero_act_params = Empty()
elseif pp.aerosol_act == "AeroAct"
aero_act_params =
AeroAct{FT}(pp.aap, pp.aerosol, pp.aero_σ_g, pp.r_nuc, pp.const_dt, pp.Nₐ)
Expand All @@ -263,7 +263,7 @@ function run_parcel(IC, t_0, t_end, pp)

info *= "Deposition: $(pp.deposition)\n"
if pp.deposition == "None"
dep_params = Empty{FT}()
dep_params = Empty()
elseif pp.deposition == "MohlerAF"
dep_params = MohlerAF{FT}(pp.ips, pp.aerosol, pp.tps, pp.const_dt)
elseif pp.deposition == "MohlerRate"
Expand All @@ -278,7 +278,7 @@ function run_parcel(IC, t_0, t_end, pp)

info *= "Heterogeneous: $(pp.heterogeneous)\n"
if pp.heterogeneous == "None"
imm_params = Empty{FT}()
imm_params = Empty()
elseif pp.heterogeneous == "ABIFM"
imm_params = ABIFM{FT}(pp.tps, pp.aerosol, pp.A_aer, pp.const_dt)
elseif pp.heterogeneous == "P3_het"
Expand All @@ -296,7 +296,7 @@ function run_parcel(IC, t_0, t_end, pp)

info *= "Homogeneous: $(pp.homogeneous)\n"
if pp.homogeneous == "None"
hom_params = Empty{FT}()
hom_params = Empty()
elseif pp.homogeneous == "ABHOM"
hom_params = ABHOM{FT}(pp.tps, pp.ips, pp.const_dt)
elseif pp.homogeneous == "P3_hom"
Expand All @@ -307,7 +307,7 @@ function run_parcel(IC, t_0, t_end, pp)

info *= "Condensation growth: $(pp.condensation_growth)\n"
if pp.condensation_growth == "None"
ce_params = Empty{FT}()
ce_params = Empty()
elseif pp.condensation_growth == "Condensation"
ce_params = CondParams{FT}(pp.aps, pp.tps, pp.const_dt)
elseif pp.condensation_growth == "NonEq_Condensation_simple"
Expand All @@ -320,7 +320,7 @@ function run_parcel(IC, t_0, t_end, pp)

info *= "Deposition growth: $(pp.deposition_growth)\n"
if pp.deposition_growth == "None"
ds_params = Empty{FT}()
ds_params = Empty()
elseif pp.deposition_growth == "Deposition"
ds_params = DepParams{FT}(pp.aps, pp.tps, pp.const_dt)
elseif pp.deposition_growth == "NonEq_Deposition_simple"
Expand Down
70 changes: 35 additions & 35 deletions parcel/ParcelParameters.jl
Original file line number Diff line number Diff line change
@@ -1,111 +1,111 @@
import CloudMicrophysics.Parameters as CMP
import CloudMicrophysics.ThermodynamicsInterface.TD.Parameters as TDP

struct Empty{FT} <: CMP.ParametersType{FT} end
struct Empty <: CMP.ParametersType end

struct AeroAct{FT} <: CMP.ParametersType{FT}
aap::CMP.ParametersType{FT}
aerosol::CMP.AerosolType{FT}
struct AeroAct{FT} <: CMP.ParametersType
aap::CMP.ParametersType
aerosol::CMP.AerosolType
aero_σ_g::FT
r_nuc::FT
const_dt::FT
Nₐ::FT
end

struct MohlerAF{FT} <: CMP.ParametersType{FT}
ips::CMP.ParametersType{FT}
aerosol::CMP.AerosolType{FT}
struct MohlerAF{FT} <: CMP.ParametersType
ips::CMP.ParametersType
aerosol::CMP.AerosolType
tps::TDP.ThermodynamicsParameters{FT}
const_dt::FT
end

struct MohlerRate{FT} <: CMP.ParametersType{FT}
ips::CMP.ParametersType{FT}
aerosol::CMP.AerosolType{FT}
struct MohlerRate{FT} <: CMP.ParametersType
ips::CMP.ParametersType
aerosol::CMP.AerosolType
tps::TDP.ThermodynamicsParameters{FT}
const_dt::FT
end

struct ABDINM{FT} <: CMP.ParametersType{FT}
struct ABDINM{FT} <: CMP.ParametersType
tps::TDP.ThermodynamicsParameters{FT}
aerosol::CMP.AerosolType{FT}
aerosol::CMP.AerosolType
r_nuc::FT
const_dt::FT
end

struct P3_dep{FT} <: CMP.ParametersType{FT}
ips::CMP.ParametersType{FT}
struct P3_dep{FT} <: CMP.ParametersType
ips::CMP.ParametersType
const_dt::FT
end

struct ABIFM{FT} <: CMP.ParametersType{FT}
struct ABIFM{FT} <: CMP.ParametersType
tps::TDP.ThermodynamicsParameters{FT}
aerosol::CMP.AerosolType{FT}
aerosol::CMP.AerosolType
A_aer::FT
const_dt::FT
end

struct P3_het{FT} <: CMP.ParametersType{FT}
ips::CMP.ParametersType{FT}
struct P3_het{FT} <: CMP.ParametersType
ips::CMP.ParametersType
const_dt::FT
end

struct Frostenberg_random{FT} <: CMP.ParametersType{FT}
ip::CMP.ParametersType{FT}
struct Frostenberg_random{FT} <: CMP.ParametersType
ip::CMP.ParametersType
sampling_interval::FT
const_dt::FT
end

struct Frostenberg_stochastic{FT} <: CMP.ParametersType{FT}
ip::CMP.ParametersType{FT}
struct Frostenberg_stochastic{FT} <: CMP.ParametersType
ip::CMP.ParametersType
γ::FT
const_dt::FT
end

struct Frostenberg_mean{FT} <: CMP.ParametersType{FT}
ip::CMP.ParametersType{FT}
struct Frostenberg_mean{FT} <: CMP.ParametersType
ip::CMP.ParametersType
const_dt::FT
end

struct ABHOM{FT} <: CMP.ParametersType{FT}
struct ABHOM{FT} <: CMP.ParametersType
tps::TDP.ThermodynamicsParameters{FT}
ips::CMP.ParametersType{FT}
ips::CMP.ParametersType
const_dt::FT
end

struct P3_hom{FT} <: CMP.ParametersType{FT}
struct P3_hom{FT} <: CMP.ParametersType
const_dt::FT
end

struct CondParams{FT} <: CMP.ParametersType{FT}
aps::CMP.ParametersType{FT}
struct CondParams{FT} <: CMP.ParametersType
aps::CMP.ParametersType
tps::TDP.ThermodynamicsParameters{FT}
const_dt::FT
end

struct NonEqCondParams_simple{FT} <: CMP.ParametersType{FT}
struct NonEqCondParams_simple{FT} <: CMP.ParametersType
tps::TDP.ThermodynamicsParameters{FT}
liquid::CMP.CloudLiquid{FT}
end

struct NonEqCondParams{FT} <: CMP.ParametersType{FT}
struct NonEqCondParams{FT} <: CMP.ParametersType
tps::TDP.ThermodynamicsParameters{FT}
liquid::CMP.CloudLiquid{FT}
dt::FT
end

struct DepParams{FT} <: CMP.ParametersType{FT}
aps::CMP.ParametersType{FT}
struct DepParams{FT} <: CMP.ParametersType
aps::CMP.ParametersType
tps::TDP.ThermodynamicsParameters{FT}
const_dt::FT
end

struct NonEqDepParams_simple{FT} <: CMP.ParametersType{FT}
struct NonEqDepParams_simple{FT} <: CMP.ParametersType
tps::TDP.ThermodynamicsParameters{FT}
ice::CMP.CloudIce{FT}
end

struct NonEqDepParams{FT} <: CMP.ParametersType{FT}
struct NonEqDepParams{FT} <: CMP.ParametersType
tps::TDP.ThermodynamicsParameters{FT}
ice::CMP.CloudIce{FT}
dt::FT
Expand Down
Loading
Loading