Skip to content

Commit

Permalink
Merge #174
Browse files Browse the repository at this point in the history
174: Adding p3 mass and thresholds (updated) r=trontrytel a=rorlija1


This PR adds the non-linear solver for mass(size) relationship for the P3 scheme 

Co-authored-by: Rowan Orlijan-Rhyne <rowan@Rowans-MBP-2.home>
  • Loading branch information
bors[bot] and Rowan Orlijan-Rhyne authored Aug 22, 2023
2 parents c0d616d + 67b44b7 commit 3d9df6a
Show file tree
Hide file tree
Showing 13 changed files with 926 additions and 5 deletions.
1 change: 1 addition & 0 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ CUDAKernels = "72cfdca4-0801-4ab0-bf6a-d52aa10adc57"
DocStringExtensions = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae"
ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210"
KernelAbstractions = "63c18a36-062a-441e-b654-da1e3ab1ce7c"
NonlinearSolve = "8913a72c-1f9b-4ce2-8d82-65094dcecaec"
SpecialFunctions = "276daf66-3868-5448-9aa4-cd146d93841b"
Thermodynamics = "b60c26fb-14c3-4610-9d3e-2d17fe7ff00c"

Expand Down
66 changes: 66 additions & 0 deletions docs/bibliography.bib
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,17 @@ @article{Beheng1994
doi = {10.1016/0169-8095(94)90020-5}
}

@article{BrownFrancis1995,
title = {Improved Measurements of the Ice Water Content in Cirrus Using a Total-Water Probe},
author = {Philip R. A. Brown and Peter N. Francis},
journal = {Journal of Atmospheric and Oceanic Technology},
volume = {12},
number = {2},
pages = {410--414},
year = {1995},
doi = {10.1175/1520-0426(1995)012<0410:IMOTIW>2.0.CO;2}
}

@article{Chen2022,
title={Accurate parameterization of precipitation particles' fall speeds for bulk cloud microphysics schemes},
author={Chen, Jen-Ping and Hsieh, Ting-Wei and Lin, Chiu-Yi and Yu, Cheng-Ku},
Expand Down Expand Up @@ -114,6 +125,17 @@ @article{Harrington1995
year = {1995}
}

@article{Heymsfield2003,
title = {Properties of Tropical and Midlatitude Ice Cloud Particle Ensembles. Part II: Applications for Mesoscale and Climate Models},
author = {Andrew J. Heymsfield},
journal = {Journal of the Atmospheric Sciences},
volume = {60},
number = {21},
doi = {10.1175/1520-0469(2003)060%3C2592:POTAMI%3E2.0.CO;2},
pages = {2592--2611},
year = {2003}
}

@article{Karcher2006,
author = {Kärcher, B. and Hendricks, J. and Lohmann, U.},
title = {Physically based parameterization of cirrus cloud formation for use in global atmospheric models},
Expand Down Expand Up @@ -301,6 +323,28 @@ @book{Mason2010
publisher = {Clarendon Press}
}

@article{Mitchell1996,
author = {David L. Mitchell},
title = {Use of mass- and area-dimensional power laws for determining precipitation particle terminal velocities},
journal = {Journal of the Atmospheric Sciences},
year = {1996},
volume = {53},
number = {12},
doi = {10.1175/1520-0469(1996)053<1710:UOMAAD>2.0.CO;2},
pages= {1710--1723}
}

@article{MitchellHeymsfield2005,
author = {David L. Mitchell and Andrew J. Heymsfield},
title = {Refinements in the Treatment of Ice Particle Terminal Velocities, Highlighting Aggregates},
journal = {Journal of the Atmospheric Sciences},
year = {2005},
volume = {62},
number = {5},
doi = {https://doi.org/10.1175/JAS3413.1},
pages= {1637--1644}
}

@article{Mohler2006,
title = {Efficiency of the deposition mode ice nucleation on mineral dust particles},
author = {Möhler, O. and Field, P. R. and Connolly, P. and Benz, S. and Saathoff, H. and Schnaiter, M. and Wagner, R. and Cotton, R. and Krämer, M. and Mangold, A. and Heymsfield, A. J.},
Expand All @@ -323,6 +367,28 @@ @article{Morrison2008
year = {2008}
}

@article{MorrisonGrabowski2008,
title = {A Novel Approach for Representing Ice Microphysics in Models: Description and Tests Using a Kinematic Framework},
author = {Morrison, Hugh and Grabowski, Wojciech W.},
journal = {Journal of the Atmospheric Sciences},
volume = {65},
number = {5},
doi = {10.1175/2007JAS2491.1},
pages = {1528--1548},
year = {2008}
}

@article{MorrisonMilbrandt2015,
author = {Hugh Morrison and Jason A. Milbrandt},
title = {Parameterization of Cloud Microphysics Based on the Prediction of Bulk Ice Particle Properties. Part I: Scheme Description and Idealized Tests},
journal = {Journal of the Atmospheric Sciences},
year = {2015},
volume = {72},
number = {1},
doi = {10.1175/JAS-D-14-0065.1},
pages= {287--311}
}

@article{MurphyKoop2005,
author = {Murphy, D. M. and Koop, T.},
title = {Review of the vapour pressures of ice and supercooled water for atmospheric applications},
Expand Down
1 change: 1 addition & 0 deletions docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ pages = Any[
"0-moment precipitation microphysics" => "Microphysics0M.md",
"1-moment precipitation microphysics" => "Microphysics1M.md",
"2-moment precipitation microphysics" => "Microphysics2M.md",
"P3 Scheme" => "P3Scheme.md",
"Non-equilibrium cloud formation" => "MicrophysicsNonEq.md",
"Smooth transition at thresholds" => "ThresholdsTransition.md",
"Aerosol activation" => "AerosolActivation.md",
Expand Down
9 changes: 9 additions & 0 deletions docs/src/API.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,15 @@ Microphysics2M.rain_evaporation
Microphysics2M.conv_q_liq_to_q_rai
```

# P3 scheme

```@docs
P3Scheme
P3Scheme.α_va
P3Scheme.D_th
P3Scheme.thresholds
```

# Aerosol model

```@docs
Expand Down
109 changes: 109 additions & 0 deletions docs/src/P3Scheme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
# P3 Scheme

The `P3Scheme.jl` module implements the predicted particle properties
(P3) scheme for ice-phase microphysics developed by [MorrisonMilbrandt2015](@cite)
The P3 scheme is a 2-moment, bulk scheme involving a
single ice-phase category with 4 degrees of freedom: total mass,
rime mass, rime volume, and number mixing ratios.
Traditionally, cloud ice microphysics schemes use various predefined
categories (such as ice, graupel, or hail) to represent ice modes, but the P3 scheme sidesteps the
problem of prescribing transitions between ice categories by adopting
a single ice category and evolving its properties. This simplification
aids in attempts to constrain the scheme's free parameters.

The prognostic variables are:
- ``N_{ice}`` - number concentration 1/m3
- ``q_{ice}`` - ice mass density kg/m3
- ``q_{rim}`` - rime mass density kg/m3
- ``B_{rim}`` - rime volume - (volume of rime per total air volume: dimensionless)

!!! note
TODO - At some point we should switch to specific humidities...

## Assumed particle size distribution (PSD)

Following [MorrisonMilbrandt2015](@cite), the scheme assumes a
gamma distribution for the concentration of particles per unit volume
based on particle size measurements obtained by [Heymsfield2003](@cite)
in tropical and midlatitude ice clouds and implemented by
[MorrisonGrabowski2008](@cite):

```math
N'(D) = N_{0} D^\mu \, e^{-\lambda \, D}
```
where:
- ``N'`` is the number concentration in ``m^{-4}``
- ``D`` is the maximum particle dimension in ``m``,
- ``N_0`` is the intercept parameter in ``m^{-4}``,
- ``\mu`` is the shape parameter (dimensionless),
- ``\lambda`` is the slope parameter in ``m^{-1}``.

We assume ``\mu \ = 0.00191 \; \lambda \ ^{0.8} - 2``.
Following [MorrisonGrabowski2008](@cite) we limit ``\mu \ \in (0,6)``.
A negative ``\mu`` can occur only for very small mean particle sizes``\frac{1}{\lambda} < ~0.17 mm``.
``N_0`` and ``\lambda`` can be found using different moments of the PSD,
namely the total number concentration ``N`` and mass mixing ratio ``q``, where

```math
N = \int_{0}^{\infty} \! N'(D) \mathrm{d}D
```

```math
q = \int_{0}^{\infty} \! m(D) N'(D) \mathrm{d}D
```

For liquid droplets, these equations are solved without issue, but for ice, the third moment of the size distribution listed above (i.e. ``\int_{0}^{\infty} \! m(D) N'(D) \mathrm{d}D``) varies as the mass relation varies across the PSD (see below for the mass regime documentation). On the other hand, the first moment of the PSD, the number concentration, does not vary across the PSD and yields ``N = \frac{N_0}{\lambda}``.

!!! note
TODO - The scheme uses a mean particle size value ``D_m`` for each time step to determine which mass relation to employ. In other words, ``N_0`` and ``\lambda`` must be calculated for the five different mass relations below to accommodate ranges of ``D_m`` corresponding to each mass relation. For mean particle sizes that employ the mass relations characterized by graupel and by partially rimed ice, the mass relations are time-dependent due to the presence of ``\rho_g`` and ``F_r``. This complicates the scheme's use of the PSD, and as a result, writing analytical formulas for the PSD parameters is challenging.

## Assumed particle mass relationships

The mass ``m`` of particles as a function of maximum particle dimension ``D``
is a piecewise function with variable thresholds described
by the following table.

| particle properties | condition(s) | m(D) relation |
|:-------------------------------------|:---------------------------------------------|:---------------------------------------------|
|small, spherical ice | ``D < D_{th}`` | ``\frac{\pi}{6} \rho_i \ D^3`` |
|large, unrimed ice | ``q_{rim} = 0`` and ``D > D_{th}`` | ``\alpha_{va} \ D^{\beta_{va}}`` |
|dense nonspherical ice | ``q_{rim} > 0`` and ``D_{th} < D < D_{gr}`` | ``\alpha_{va} \ D^{\beta_{va}}`` |
|graupel (completely rimed, spherical) | ``q_{rim} > 0`` and ``D_{gr} < D < D_{cr}`` | ``\frac{\pi}{6} \rho_g \ D^3`` |
|partially rimed ice | ``q_{rim} > 0`` and ``D > D_{cr}`` | ``\frac{\alpha_{va}}{1-F_r} D^{\beta_{va}}`` |

where:
- ``D_{th}``, ``D_{gr}``, ``D_{cr}`` are particle size thresholds in ``m``,
- ``\rho_i`` is cloud ice density in ``kg m^{-3}``,
- ``\beta_{va} = 1.9`` is a dimensionless parameter from [BrownFrancis1995](@cite) (based on measurements of vapor diffusion and aggregation in midlatitude cirrus),
- ``\alpha_{va} = 7.38 \; 10^{-11} \; 10^{6 \beta_{va} - 3}`` in ``kg m^{-β_{va}}`` is a parameter modified for units from [BrownFrancis1995](@cite) in base SI units (also based on measurements of vapor diffusion and aggregation in midlatitude cirrus),
- ``\rho_g`` is the bulk density of graupel in ``kg m^{-3}``.

The first threshold is solely determined by the free parameters:
``D_{th} = (\frac{\pi \rho_i}{6\alpha_{va}})^{\frac{1}{\beta_{va} - 3}}``.
The remaining thresholds: ``D_{gr}``, ``D_{cr}``, as well as the
bulk density of graupel ``\rho_{g}``,
and the bulk density of the unrimed part ``\rho_d``
form a nonlinear system:
- ``D_{gr} = (\frac{6\alpha_{va}}{\pi \rho_g})^{\frac{1}{3 - \beta_{va}}}``
- ``D_{cr} = [ (\frac{1}{1-F_r}) \frac{6 \alpha_{va}}{\pi \rho_g} ]^{\frac{1}{3 - \beta_{va}}}``
- ``\rho_g = \rho_r F_r + (1 - F_r) \rho_d``
- ``\rho_d = \frac{6\alpha_{va}(D_{cr}^{\beta{va} \ - 2} - D_{gr}^{\beta{va} \ - 2})}{\pi \ (\beta_{va} \ - 2)(D_{cr}-D_{gr})}``
where
- ``F_r = \frac{q_{rim}}{q_{ice}}`` is the rime mass fraction,
- ``\rho_{r} = \frac{q_{rim}}{B_{rim}}`` is the predicted rime density.
The system is solved using [`NonlinearSolve.jl`](https://docs.sciml.ai/NonlinearSolve/stable/).

!!! note
TODO - The use of NonlinearSolve.jl is not ideal because of its runtime and memory allocation requirements. Currently, there is also a look-up table NetCDF file which could be used to look up values of the quantities which form the nonlinear system. However, the look-up table is not GPU-compatible and would require too much memory in an Earth System Model. The current approach may be of use for testing and for visualization of the system, but other options, such as using RootSolvers.jl or using a simpler fit that approximates the solver output, are more suitable long term solutions which do not require outside packages which employ auto-differentiation or use memory, both of which do not suit the needs of CliMA.

Below we show the m(D) regime, replicating Figures 1 (a) and (b) from [MorrisonMilbrandt2015](@cite).

```@example
include("P3SchemePlots.jl")
p3_m_plot1(["cyan2", "cyan4", "midnightblue"], ["hotpink", "magenta3", "purple4"])
p3_m_plot2(["cyan2", "cyan4", "midnightblue"], ["hotpink", "magenta3", "purple4"])
```

![](MorrisonandMilbrandtFig1a.svg)

![](MorrisonandMilbrandtFig1b.svg)
Loading

0 comments on commit 3d9df6a

Please sign in to comment.