From 5536dc071d02d156d7599183fccdeb37c6f910d6 Mon Sep 17 00:00:00 2001 From: amylu00 Date: Tue, 13 Feb 2024 22:20:59 -0800 Subject: [PATCH] suggestions --- docs/src/IceNucleationParcel0D.md | 6 ++-- docs/src/plots/activity_based_deposition.jl | 4 +-- parcel/Deposition_Nucleation.jl | 2 +- parcel/parcel.jl | 37 ++++++++++++--------- 4 files changed, 28 insertions(+), 21 deletions(-) diff --git a/docs/src/IceNucleationParcel0D.md b/docs/src/IceNucleationParcel0D.md index 47c5b7368e..bf70908a40 100644 --- a/docs/src/IceNucleationParcel0D.md +++ b/docs/src/IceNucleationParcel0D.md @@ -208,7 +208,7 @@ There are multiple ways of running deposition nucleation in the parcel. is calculated from ```math \begin{equation} - P_{ice} = \left[ \frac{dN_i}{dt} \right]_{dep0} = J_{depo}A_{aero}N_{aero} + P_{ice, depo} = \left[ \frac{dN_i}{dt} \right]_{depo} = J_{depo}\;A_{aero}\;N_{aero} \label{eq:ActivityBasedDeposition_P_ice} \end{equation} ``` @@ -223,7 +223,7 @@ Following the water activity based immersion freezing model (ABIFM), the ABIFM d per second via immersion freezing can then be calculating using ```math \begin{equation} - P_{ice} = \left[ \frac{dN_i}{dt} \right]_{immer} = J_{immer}A(N_{liq}) + P_{ice, immer} = \left[ \frac{dN_i}{dt} \right]_{immer} = J_{immer}A(N_{liq}) \label{eq:ABIFM_P_ice} \end{equation} ``` @@ -237,7 +237,7 @@ Homogeneous freezing follows the water-activity based model described in the The ice production rate from homogeneous freezing can then be determined: ```math \begin{equation} - P_{ice} = \left[ \frac{dN_i}{dt} \right]_{hom} = J_{hom}V(N_{liq}) + P_{ice, hom} = \left[ \frac{dN_i}{dt} \right]_{hom} = J_{hom}V(N_{liq}) \label{eq:hom_P_ice} \end{equation} ``` diff --git a/docs/src/plots/activity_based_deposition.jl b/docs/src/plots/activity_based_deposition.jl index 276ed8d41f..551e16467a 100644 --- a/docs/src/plots/activity_based_deposition.jl +++ b/docs/src/plots/activity_based_deposition.jl @@ -6,14 +6,14 @@ import CloudMicrophysics.Common as CO import CloudMicrophysics.HetIceNucleation as IN import CloudMicrophysics.Parameters as CMP -FT = Float64 +FT = Float32 const tps = TD.Parameters.ThermodynamicsParameters(FT) const feldspar = CMP.Feldspar(FT) const ferrihydrite = CMP.Ferrihydrite(FT) const kaolinite = CMP.Kaolinite(FT) # Initializing -Δa_w = range(0, stop = 0.32, length = 50) # difference in solution and ice water activity +Δa_w = range(FT(0), stop = FT(0.32), length = 50) # difference in solution and ice water activity J_feldspar = @. IN.deposition_J(feldspar, Δa_w) # J in SI units log10J_converted_feldspar = @. log10(J_feldspar * 1e-4) # converts J into cm^-2 s^-1 and takes log J_ferrihydrite = @. IN.deposition_J(ferrihydrite, Δa_w) diff --git a/parcel/Deposition_Nucleation.jl b/parcel/Deposition_Nucleation.jl index 12b633f17d..11cb530bae 100644 --- a/parcel/Deposition_Nucleation.jl +++ b/parcel/Deposition_Nucleation.jl @@ -6,7 +6,7 @@ import CLIMAParameters as CP # definition of the ODE problem for parcel model include(joinpath(pkgdir(CM), "parcel", "parcel.jl")) -FT = Float64 +FT = Float32 # get free parameters tps = TD.Parameters.ThermodynamicsParameters(FT) aps = CMP.AirProperties(FT) diff --git a/parcel/parcel.jl b/parcel/parcel.jl index afb64ac4a8..afd017719e 100644 --- a/parcel/parcel.jl +++ b/parcel/parcel.jl @@ -76,7 +76,7 @@ function parcel_model(dY, Y, p, t) dN_act_dt_depo = FT(0) dqi_dt_new_depo = FT(0) if "MohlerAF_Deposition" in ice_nucleation_modes - if S_i > ip.deposition.Sᵢ_max + if S_i >= ip.deposition.Sᵢ_max println("Supersaturation exceeds the allowed value. No dust will be activated.") AF = FT(0) else @@ -89,9 +89,8 @@ function parcel_model(dY, Y, p, t) end dN_act_dt_depo = max(FT(0), AF * N_aer - N_ice) / const_dt dqi_dt_new_depo = dN_act_dt_depo * 4 / 3 * FT(π) * r_nuc^3 * ρ_ice / ρ_air - end - if "MohlerRate_Deposition" in ice_nucleation_modes - if S_i > ip.deposition.Sᵢ_max + elseif "MohlerRate_Deposition" in ice_nucleation_modes + if S_i >= ip.deposition.Sᵢ_max println("Supersaturation exceeds the allowed value. No dust will be activated.") dN_act_dt_depo = FT(0) else @@ -294,45 +293,53 @@ function run_parcel(IC, t_0, t_end, p) print("Ice nucleation modes: ") if "MohlerAF_Deposition" in ice_nucleation_modes - print("Deposition on dust particles using AF ") + print("\n Deposition on dust particles using AF ") + print("(Note that this mode only runs for monodisperse size distributions.) ") timestepper = ODE.Euler() end if "MohlerRate_Deposition" in ice_nucleation_modes - print("Deposition nucleation based on rate eqn in Mohler 2006 ") + print("\n Deposition nucleation based on rate eqn in Mohler 2006 ") + print("(Note that this mode only runs for monodisperse size distributions.) ") timestepper = ODE.Euler() end if "ActivityBasedDeposition" in ice_nucleation_modes - print("Water activity based deposition nucleation ") + print("\n Water activity based deposition nucleation ") + print("(Note that this mode only runs for monodisperse size distributions.) ") end if "ImmersionFreezing" in ice_nucleation_modes - print("Immersion freezing ") + print("\n Immersion freezing ") + print("(Note that this mode only runs for monodisperse and gamma size distributions.) ") end if "HomogeneousFreezing" in ice_nucleation_modes - print("Homogeneous freezing ") + print("\n Homogeneous freezing ") end print("\n") print("Growth modes: ") if "Condensation" in growth_modes - print("Condensation on liquid droplets",) + print("\n Condensation on liquid droplets",) + print("(Note that this mode only runs for monodisperse and gamma size distributions.) ") end if "Condensation_DSD" in growth_modes - print("Condensation on liquid droplets") + print("\n Condensation on liquid droplets") end if "Deposition" in growth_modes - print("Deposition on ice crystals") + print("\n Deposition on ice crystals") end print("\n") print("Size distribution modes: ") if "Monodisperse" in droplet_size_distribution - print("Monodisperse size distribution") + print("\n Monodisperse size distribution") end if "Gamma" in droplet_size_distribution - print("Gamma size distribution") + print("\n Gamma size distribution") end if "Lognormal" in droplet_size_distribution - print("Lognormal size distribution") + print("\n Lognormal size distribution") + end + if "MohlerAF_Deposition" in ice_nucleation_modes || "MohlerRate_Deposition" in ice_nucleation_modes || "ActivityBasedDeposition" in ice_nucleation_modes + print("\nWARNING: Multiple deposition nucleation parameterizations chosen to run in one simulation. Parcel will only run MohlerAF_Deposition for now.") end println(" ")