Skip to content

Commit 843ba0e

Browse files
authored
Merge pull request #646 from CliMA/aj/rename
The Great Rename
2 parents 73e409c + 59f6da9 commit 843ba0e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+853
-817
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "CloudMicrophysics"
22
uuid = "6a9e3e04-43cd-43ba-94b9-e8782df3c71b"
33
authors = ["Climate Modeling Alliance"]
4-
version = "0.27.4"
4+
version = "0.28.0"
55

66
[deps]
77
ClimaParams = "5c42b081-d73a-476f-9059-fd94b934656c"

box/Alpert_Knopf_2016_forward.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ include(joinpath(pkgdir(CM), "box", "box.jl"))
2323
A_aero = FT(1e-5) * 1e-4 # INP surface area, m^2
2424
σg = 10
2525
N₀ = 1000
26-
N_ice = 0
26+
N_icl = 0
2727
T_initial = FT(256) # initial temperature, K
2828
cooling_rate = FT(0.5 / 60) # prescribed cooling rate K s^-1
2929
aerosol = CMP.Illite(FT) # aerosol free parameters
@@ -43,7 +43,7 @@ Aj_sorted = zeros(N₀)
4343
Aj_sorted = sort(Aj_unsorted, rev = true)
4444

4545
# initial condition for the ODE problem
46-
IC = [T_initial, A_sum, FT(N₀), FT(N_ice)]
46+
IC = [T_initial, A_sum, FT(N₀), FT(N_icl)]
4747
# additional model parameters
4848
p_def = (; tps, A_aero, aerosol, cooling_rate, N₀)
4949

box/box.jl

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -17,26 +17,26 @@ function box_model(dY, Y, p, t)
1717

1818
# Our state vector
1919
T = Y[1] # temperature
20-
N_liq = Y[3] # number concentration of existing water droplets
21-
N_ice = Y[4] # number concentration of activated ice crystals
20+
N_lcl = Y[3] # number concentration of existing water droplets
21+
N_icl = Y[4] # number concentration of activated ice crystals
2222

2323
Δa = FT(1) - CMO.a_w_ice(tps, T)
2424
J_immer = CMI_het.ABIFM_J(aerosol, Δa) # m^-2 s^-1
2525

2626
# Update the tendecies
2727
dT_dt = -cooling_rate
28-
dN_ice_dt = FT(0)
29-
dN_liq_dt = FT(0)
30-
if N_liq > 0
31-
dN_ice_dt = J_immer * N_liq * A_aero
32-
dN_liq_dt = -dN_ice_dt
28+
dN_icl_dt = FT(0)
29+
dN_lcl_dt = FT(0)
30+
if N_lcl > 0
31+
dN_icl_dt = J_immer * N_lcl * A_aero
32+
dN_lcl_dt = -dN_icl_dt
3333
end
3434

3535
# Set tendencies
3636
dY[1] = dT_dt # temperature
3737
dY[2] = FT(0) # not used here
38-
dY[3] = dN_liq_dt # number concentration of droplets
39-
dY[4] = dN_ice_dt # number concentration of ice crystals
38+
dY[3] = dN_lcl_dt # number concentration of droplets
39+
dY[4] = dN_icl_dt # number concentration of ice crystals
4040
end
4141

4242
"""
@@ -52,8 +52,8 @@ function box_model_with_probability(dY, Y, p, t)
5252
# Our state vector
5353
T = Y[1] # temperature
5454
A = Y[2] # available surface area for freezing
55-
N_liq = max(FT(0), Y[3]) # number concentration of existing water droplets
56-
N_ice = max(FT(0), Y[4]) # number concentration of activated ice crystals
55+
N_lcl = max(FT(0), Y[3]) # number concentration of existing water droplets
56+
N_icl = max(FT(0), Y[4]) # number concentration of activated ice crystals
5757

5858
# immersion freezing rate
5959
Δa = FT(1) - CMO.a_w_ice(tps, T)
@@ -62,9 +62,9 @@ function box_model_with_probability(dY, Y, p, t)
6262
# Update the tendecies
6363
dT_dt = -cooling_rate
6464
dAj_dt = FT(0)
65-
dN_ice_dt = FT(0)
66-
dN_liq_dt = FT(0)
67-
if N_liq > 0
65+
dN_icl_dt = FT(0)
66+
dN_lcl_dt = FT(0)
67+
if N_lcl > 0
6868
n_frz = 0
6969
for j in range(start = 1, stop = N₀, step = 1)
7070
# Sample from the surface area distribution
@@ -81,15 +81,15 @@ function box_model_with_probability(dY, Y, p, t)
8181
end
8282
Aj_sum = sum(Aj_sorted)
8383
dAj_dt = (Aj_sum - A) / const_dt
84-
dN_ice_dt = max(FT(0), n_frz / const_dt)
85-
dN_liq_dt = -dN_ice_dt
84+
dN_icl_dt = max(FT(0), n_frz / const_dt)
85+
dN_lcl_dt = -dN_icl_dt
8686
end
8787

8888
# Set tendencies
8989
dY[1] = dT_dt # temperature
9090
dY[2] = dAj_dt # total Aj
91-
dY[3] = dN_liq_dt # mumber concentration of droplets
92-
dY[4] = dN_ice_dt # number concentration of ice activated particles
91+
dY[3] = dN_lcl_dt # mumber concentration of droplets
92+
dY[4] = dN_icl_dt # number concentration of ice activated particles
9393

9494
end
9595

@@ -100,16 +100,16 @@ Returns the solution of an ODE probelm defined by the box model.
100100
101101
Inputs:
102102
- IC - A vector with the initial conditions for
103-
[T, A_sum, N_liq, N_ice]
103+
[T, A_sum, N_lcl, N_icl]
104104
- t_0 - simulation start time
105105
- t_end - simulation end time
106106
- p - a named tuple with simulation parameters.
107107
108108
Initial condition contains (all in base SI units):
109109
- T - temperature
110110
- A_sum - available surface area for freezing
111-
- N_liq - cloud droplet number concnentration
112-
- N_ice - ice crystal number concentration
111+
- N_lcl - cloud droplet number concnentration
112+
- N_icl - ice crystal number concentration
113113
114114
The named tuple p should contain:
115115
- tps - a struct with free parameters for Thermodynamics package,

docs/make.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ Guides = [
6363
pages = Any[
6464
"Home" => "index.md",
6565
"Parameterizations" => Parameterizations,
66+
"Thermodynamics interface" => "Thermodynamics.md",
6667
"How to guides" => Guides,
6768
"Models" => Models,
6869
"API" => "API.md",

docs/src/API.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ CurrentModule = CloudMicrophysics
88
```@docs
99
MicrophysicsNonEq
1010
MicrophysicsNonEq.τ_relax
11-
MicrophysicsNonEq.conv_q_vap_to_q_liq_ice
12-
MicrophysicsNonEq.conv_q_vap_to_q_liq_ice_MM2015
11+
MicrophysicsNonEq.conv_q_vap_to_q_lcl_icl
12+
MicrophysicsNonEq.conv_q_vap_to_q_lcl_icl_MM2015
1313
MicrophysicsNonEq.terminal_velocity
1414
```
1515

@@ -28,9 +28,9 @@ Microphysics1M.get_v0
2828
Microphysics1M.get_n0
2929
Microphysics1M.lambda_inverse
3030
Microphysics1M.terminal_velocity
31-
Microphysics1M.conv_q_liq_to_q_rai
32-
Microphysics1M.conv_q_ice_to_q_sno_no_supersat
33-
Microphysics1M.conv_q_ice_to_q_sno
31+
Microphysics1M.conv_q_lcl_to_q_rai
32+
Microphysics1M.conv_q_icl_to_q_sno_no_supersat
33+
Microphysics1M.conv_q_icl_to_q_sno
3434
Microphysics1M.accretion
3535
Microphysics1M.accretion_rain_sink
3636
Microphysics1M.accretion_snow_rain
@@ -63,17 +63,17 @@ Microphysics2M.get_size_distribution_bounds
6363

6464
## Rates
6565
```@docs
66-
Microphysics2M.LiqRaiRates
66+
Microphysics2M.LclRaiRates
6767
Microphysics2M.autoconversion
6868
Microphysics2M.accretion
69-
Microphysics2M.liquid_self_collection
70-
Microphysics2M.autoconversion_and_liquid_self_collection
69+
Microphysics2M.cloud_liquid_self_collection
70+
Microphysics2M.autoconversion_and_cloud_liquid_self_collection
7171
Microphysics2M.rain_self_collection
7272
Microphysics2M.rain_breakup
7373
Microphysics2M.rain_self_collection_and_breakup
7474
Microphysics2M.rain_terminal_velocity
7575
Microphysics2M.rain_evaporation
76-
Microphysics2M.conv_q_liq_to_q_rai
76+
Microphysics2M.conv_q_lcl_to_q_rai
7777
Microphysics2M.number_increase_for_mass_limit
7878
Microphysics2M.number_decrease_for_mass_limit
7979
```

docs/src/CloudDiagnostics.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ Available diagnostics are:
88
- Radar reflectivity
99
- Effective radius
1010

11-
Calculating these diagnostics make use of the physical moment equation for the
11+
Calculating these diagnostics make use of the physical moment equation for the
1212
generalized gamma distribution, as a function of particle mass. We denote the moment
13-
as ``M_x^n`` to emphasize that it is the moment with respect to the particle size
13+
as ``M_x^n`` to emphasize that it is the moment with respect to the particle size
1414
distribution written as a function of particle mass ``x``.
1515
```math
1616
\begin{equation}
17-
M_x^n(;N, ν, μ, B)
17+
M_x^n(;N, ν, μ, B)
1818
= ∫_0^∞ x^n ⋅ f(x) dx
1919
= N ⋅ B^{-\frac{n}{μ}} ⋅ \frac{Γ\left(\frac{ν+1+n}{μ}\right)}{Γ\left(\frac{ν+1}{μ}\right)}
2020
\end{equation}
@@ -106,8 +106,8 @@ We compute the total third and second moment as a sum of cloud condensate and
106106
precipitation moments:
107107
```math
108108
\begin{equation}
109-
r_{eff}
110-
= \frac{M^3_{r,c} + M^3_{r,r}}{M^2_{r,c} + M^2_{r,r}}
109+
r_{eff}
110+
= \frac{M^3_{r,c} + M^3_{r,r}}{M^2_{r,c} + M^2_{r,r}}
111111
= \frac{∫_0^∞ r^3 \, (n_c(r) + n_r(r)) \, dr}{∫_0^∞ r^2 \, (n_c(r) + n_r(r)) \, dr}.
112112
\label{eq:reff}
113113
\end{equation}
@@ -145,12 +145,12 @@ where:
145145
Where the volume-averaged radius is computed using
146146
```math
147147
\begin{equation}
148-
r_{vol} = \left(\frac{3}{4 \pi \rho_w}\right)^{\frac{1}{3}} \, \left(\frac{L}{N}\right)^{\frac{1}{3}} = \left(\frac{3 \rho (q_{liq} + q_{rai})}{4 \pi \rho_w (N_{liq} + N_{rai})}\right)^{\frac{1}{3}},
148+
r_{vol} = \left(\frac{3}{4 \pi \rho_w}\right)^{\frac{1}{3}} \, \left(\frac{L}{N}\right)^{\frac{1}{3}} = \left(\frac{3 \rho (q_{lcl} + q_{rai})}{4 \pi \rho_w (N_{lcl} + N_{rai})}\right)^{\frac{1}{3}},
149149
\end{equation}
150150
```
151151
where:
152-
- ``L = \rho q``, is the liquid water content,
153-
- ``N = N_{liq} + N_{rai}``.
152+
- ``L = \rho q``, is the liquid water content (cloud water and rain),
153+
- ``N = N_{lcl} + N_{rai}``.
154154

155155
By default for the 1-moment scheme we don't consider precipitation and assume
156156
a constant cloud droplet number concentration of 100 $cm^{-3}$.

docs/src/IceNucleation.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,14 @@ The parameterization for deposition on dust particles is an implementation of
2727
## Activated fraction for deposition freezing on dust
2828
There are 2 parameterizations from [Mohler2006](@cite) available: one
2929
which calculates the activated fraction and one which calculates nucleation
30-
rate.
30+
rate.
3131
The activated fraction parameterization follows eq. (3) in the paper.
3232
```math
3333
\begin{equation}
3434
f_i(S_i) = exp[a(S_i - S_0)] - 1
3535
\end{equation}
3636
```
37-
where
37+
where
3838
- ``f_i`` is the activated fraction
3939
(the ratio of aerosol particles acting as ice nuclei to the total number of aerosol particles),
4040
- ``a`` is a scaling parameter dependent on aerosol properties and temperature,
@@ -45,7 +45,7 @@ The other parameterization models the nucleation rate of ice
4545
see eq. (5) in [Mohler2006](@cite).
4646
```math
4747
\begin{equation}
48-
\frac{dn_{ice}}{dt} = N_{aer} a \frac{dS_i}{dt}
48+
\frac{dn_{icl}}{dt} = N_{aer} a \frac{dS_i}{dt}
4949
\end{equation}
5050
```
5151
where:
@@ -140,11 +140,11 @@ Once ``J_{ABIFM}`` is calculated, it can be used to determine the ice production
140140
per second via immersion freezing.
141141
```math
142142
\begin{equation}
143-
P_{ice} = J_{ABIFM}A(N_{aer} - N_{ice})
143+
P_{ice} = J_{ABIFM}A(N_{aer} - N_{icl})
144144
\end{equation}
145145
```
146146
where ``A`` is surface area of an individual ice nuclei, ``N_{aer}`` is total number
147-
of ice nuclei, and ``N_{ice}`` is number of ice crystals already in the system.
147+
of ice nuclei, and ``N_{icl}`` is number of ice crystals already in the system.
148148

149149
### ABIFM Example Figures
150150
The following plot shows ``J`` as a function of ``\Delta a_w`` as compared to
@@ -186,12 +186,12 @@ It is also important to note that this plot is reflective of cirrus clouds
186186

187187
### Bigg (1953) Volume and Time Dependent Heterogeneous Freezing
188188
Heterogeneous freezing in the P3 scheme as described in [MorrisonMilbrandt2015](@cite)
189-
follows the parameterization from [Bigg1953](@cite) with parameters from
189+
follows the parameterization from [Bigg1953](@cite) with parameters from
190190
[BarklieGokhale1959](@cite). The number of ice nucleated in a timestep via
191191
heterogeneous freezing is determined by
192192
```math
193193
\begin{equation}
194-
N_{ice} = N_{liq} \left[ 1 - exp(-B V_{l} \Delta t exp(aT_s)) \right]
194+
N_{icl} = N_{lcl} \left[ 1 - exp(-B V_{l} \Delta t exp(aT_s)) \right]
195195
\end{equation}
196196
```
197197
where `a` and `B` are parameters taken from [BarklieGokhale1959](@cite) for
@@ -276,7 +276,7 @@ For the activity based immersion freezing model (ABIFM):
276276
- Magenta corresponds to kaolinite.
277277
The P3 heterogeneous parameterization also shows much more ICNC than any of the ABIFM runs. It
278278
should be noted that the P3 parameterization does not distinguish between immersion freezing,
279-
contact freezing, etc.
279+
contact freezing, etc.
280280

281281
The P3 scheme allows homogeneous freezing to freeze all droplets at temperatures equal to or less than 233.15K. No homogeneous freezing occurs at warmer temperatures.
282282

@@ -302,7 +302,7 @@ where ``T`` is the temperature in degrees Celsius, ``INPC`` is the INP concentra
302302

303303
Our implementation uses base SI units and takes ``T`` in Kelvin.
304304

305-
The following plot shows the relative frequency distribution for INPCs, as a function of temperature (the same as figure 1 in [Frostenberg2023](@cite)).
305+
The following plot shows the relative frequency distribution for INPCs, as a function of temperature (the same as figure 1 in [Frostenberg2023](@cite)).
306306

307307
```@example
308308
include("plots/Frostenberg_fig1.jl")
@@ -311,4 +311,4 @@ include("plots/Frostenberg_fig1.jl")
311311

312312
The following plot shows the relative frequency distribution for INPCs at the temperature ``T=-16 C``.
313313

314-
![](Frostenberg_fig1_T16.svg)
314+
![](Frostenberg_fig1_T16.svg)

docs/src/IceNucleationParcel0D.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -271,11 +271,11 @@ Following the water activity based immersion freezing model (ABIFM), the ABIFM d
271271
per second via immersion freezing can then be calculating using
272272
```math
273273
\begin{equation}
274-
P_{ice, immer} = \left[ \frac{dN_i}{dt} \right]_{immer} = J_{immer}\;A_{aero}(N_{liq})
274+
P_{ice, immer} = \left[ \frac{dN_i}{dt} \right]_{immer} = J_{immer}\;A_{aero}(N_{lcl})
275275
\label{eq:ABIFM_P_ice}
276276
\end{equation}
277277
```
278-
where ``N_{liq}`` is total number of ice nuclei containing droplets and
278+
where ``N_{lcl}`` is total number of ice nuclei containing droplets and
279279
``A_{aero}`` is surface area of the ice nucleating particle.
280280

281281
### Homogeneous Freezing
@@ -285,11 +285,11 @@ Homogeneous freezing follows the water-activity based model described in the
285285
The ice production rate from homogeneous freezing can then be determined:
286286
```math
287287
\begin{equation}
288-
P_{ice, hom} = \left[ \frac{dN_i}{dt} \right]_{hom} = J_{hom}V(N_{liq})
288+
P_{ice, hom} = \left[ \frac{dN_i}{dt} \right]_{hom} = J_{hom}V(N_{lcl})
289289
\label{eq:hom_P_ice}
290290
\end{equation}
291291
```
292-
where ``N_{liq}`` is total number of ice nuclei containing droplets and
292+
where ``N_{lcl}`` is total number of ice nuclei containing droplets and
293293
``V`` is the volume of those droplets.
294294

295295
### P3 Ice Nucleation Parameterizations
@@ -459,8 +459,8 @@ and `stochastic` (solid lines) parameterization options. We show results for two
459459
Below, we show how the non-equilibrium formulation is able to represent the
460460
Wegener-Bergeron-Findeisen (WBF) regime in the parcel model.
461461
These plots show the liquid supersaturation, ice supersaturation,
462-
temperature, specific humidity `q_{vap}`, specific content of liquid `q_{liq}`,
463-
and specific content of ice `q_{ice}` over time.
462+
temperature, specific humidity `q_{vap}`, specific content of cloud liquid `q_{lcl}`,
463+
and specific content of cloud ice `q_{icl}` over time.
464464
When the supersaturation is negative evaporation/sublimation occurs,
465465
and when it is positive condensation/deposition occurs.
466466
In the example below, the water vapor pressure is smaller than the saturation water vapor pressure of liquid

docs/src/Microphysics0M.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,23 +25,23 @@ If based on maximum condensate specific content, the sink is defined as:
2525
``` math
2626
\begin{equation}
2727
\left. \frac{d \, q_{tot}}{dt} \right|_{precip} =-
28-
\frac{\max(0, q_{liq} + q_{ice} - q_{c0})}{\tau_{precip}}
28+
\frac{\max(0, q_{lcl} + q_{icl} - q_{c0})}{\tau_{precip}}
2929
\end{equation}
3030
```
3131
where:
32-
- ``q_{liq}``, ``q_{ice}`` are cloud liquid water and cloud ice specific contents,
32+
- ``q_{lcl}``, ``q_{icl}`` are cloud liquid water and cloud ice specific contents,
3333
- ``q_{c0}`` is the condensate specific content threshold above which water is removed,
3434
- ``\tau_{precip}`` is the relaxation timescale.
3535

3636
If based on saturation excess, the sink is defined as:
3737
```math
3838
\begin{equation}
3939
\left. \frac{d \, q_{tot}}{dt} \right|_{precip} =-
40-
\frac{\max(0, q_{liq} + q_{ice} - S_{0} \, q_{vap}^{sat})}{\tau_{precip}}
40+
\frac{\max(0, q_{lcl} + q_{icl} - S_{0} \, q_{vap}^{sat})}{\tau_{precip}}
4141
\end{equation}
4242
```
4343
where:
44-
- ``q_{liq}``, ``q_{ice}`` are cloud liquid water and cloud ice specific contents,
44+
- ``q_{lcl}``, ``q_{icl}`` are cloud liquid water and cloud ice specific contents,
4545
- ``S_{0}`` is the supersaturation threshold above which water is removed,
4646
- ``q_{vap}^{sat}`` is the saturation specific humidity,
4747
- ``\tau_{precip}`` is the relaxation timescale.

0 commit comments

Comments
 (0)