Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…into al/default_J_aerosol
  • Loading branch information
amylu00 committed Nov 15, 2024
2 parents eef64dc + 1f53254 commit 2f57596
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ UnicodePlots = "b8865327-cd53-5732-bb35-84acbb429228"

[compat]
Documenter = "1.1"
DocumenterCitations = "1.2"
DocumenterCitations = "=1.3.3"
12 changes: 11 additions & 1 deletion parcel/ParcelModel.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ include(joinpath(pkgdir(CM), "parcel", "ParcelParameters.jl"))
Parcel simulation parameters
"""
Base.@kwdef struct parcel_params{FT} <: CMP.ParametersType{FT}
prescribed_thermodynamics = false
cooling_rate = 0
expansion_rate = 0
aerosol_act = "None"
deposition = "None"
heterogeneous = "None"
Expand Down Expand Up @@ -47,6 +50,7 @@ function parcel_model(dY, Y, p, t)
# Numerical precision used in the simulation
FT = eltype(Y)
# Simulation parameters
(; prescribed_thermodynamics, cooling_rate, expansion_rate) = p
(; wps, tps, r_nuc, w) = p
(; liq_distr, ice_distr) = p
(; aero_act_params, dep_params, imm_params, hom_params) = p
Expand Down Expand Up @@ -139,9 +143,12 @@ function parcel_model(dY, Y, p, t)
a1 * w * Sₗ - (a2 + a3) * Sₗ * dqₗ_dt_v2l -
(a2 + a4) * Sₗ * dqᵢ_dt_v2i - a5 * Sₗ * dqᵢ_dt_l2i

dp_air_dt = -p_air * grav / R_air / T * w
dp_air_dt =
prescribed_thermodynamics ? expansion_rate :
-p_air * grav / R_air / T * w

dT_dt =
prescribed_thermodynamics ? cooling_rate :
-grav / cp_air * w +
L_vap / cp_air * dqₗ_dt_v2l +
L_fus / cp_air * dqᵢ_dt_l2i +
Expand Down Expand Up @@ -301,6 +308,9 @@ function run_parcel(IC, t_0, t_end, pp)

# Parameters for the ODE solver
p = (
prescribed_thermodynamics = pp.prescribed_thermodynamics,
cooling_rate = pp.cooling_rate,
expansion_rate = pp.expansion_rate,
liq_distr = liq_distr,
ice_distr = ice_distr,
aero_act_params = aero_act_params,
Expand Down

0 comments on commit 2f57596

Please sign in to comment.