From 58d57287fc8203f9a8e7ea4e875a74ab12522901 Mon Sep 17 00:00:00 2001 From: Caterina Croci Date: Thu, 2 May 2024 13:42:59 -0700 Subject: [PATCH] add sensitivity checks for r_eff and radarrefl 2M --- Project.toml | 2 +- docs/src/API.md | 3 +- docs/src/Microphysics2M.md | 6 +- docs/src/plots/RainEvapoartionSB2006.jl | 6 +- src/Microphysics2M.jl | 97 +++++++++++-------------- src/parameters/Microphysics2M.jl | 61 +++++++++++++--- test/Project.toml | 2 +- test/common_types_tests.jl | 3 +- test/microphysics2M_tests.jl | 26 +++---- test/performance_tests.jl | 4 +- 10 files changed, 122 insertions(+), 88 deletions(-) diff --git a/Project.toml b/Project.toml index 5103adf28..d77a02909 100644 --- a/Project.toml +++ b/Project.toml @@ -20,7 +20,7 @@ MLJ = "add582a8-e3ab-11e8-2d5e-e98b27df1bc7" EmulatorModelsExt = ["DataFrames", "MLJ"] [compat] -ClimaParams = "0.10.5" +ClimaParams = "0.10.6" DataFrames = "1.6" DocStringExtensions = "0.8, 0.9" ForwardDiff = "0.10" diff --git a/docs/src/API.md b/docs/src/API.md index 8c0083c1a..8b25a0711 100644 --- a/docs/src/API.md +++ b/docs/src/API.md @@ -176,7 +176,8 @@ Parameters.AccrTC1980 Parameters.LD2004 Parameters.VarTimescaleAcnv Parameters.SB2006 -Parameters.ParticlePDF_SB2006 +Parameters.RainParticlePDF_SB2006 +Parameters.CloudParticlePDF_SB2006 Parameters.AcnvSB2006 Parameters.AccrSB2006 Parameters.SelfColSB2006 diff --git a/docs/src/Microphysics2M.md b/docs/src/Microphysics2M.md index 96e9000d0..92337376d 100644 --- a/docs/src/Microphysics2M.md +++ b/docs/src/Microphysics2M.md @@ -62,7 +62,7 @@ where ``D`` is the drop diameter which is proportional to ``x^{1/3}``. Through this proportionality relation, we can express the raindrops exponential distribution as a gamma distribution function ```math \begin{align} - f_r(x)=A_rx^\nu_r e^{-B_rx^{\mu_r}}, + f_r(x)=A_rx^{-\nu_r}_r e^{-B_rx^{\mu_r}}, \end{align} ``` where ``\nu_r=-\frac{2}{3}``, and ``\mu_r=\frac{1}{3}``. @@ -103,7 +103,7 @@ where: The function ``\phi_{acnv}(\tau)`` is used to correct the autoconversion rate for the undeveloped cloud droplet spectrum and the early stage rain evolution assumptions. This is a universal function which is obtained by fitting to numerical results of the SCE: ```math \begin{equation} - \phi_{acnv}(\tau) = A \tau^b(1-\tau^b)^c, + \phi_{acnv}(\tau) = A \tau^a(1-\tau^a)^b, \end{equation} ``` where @@ -116,7 +116,7 @@ The default free parameter values are: |``\nu`` | ``2`` | |``A`` | ``400`` | |``a`` | ``0.7`` | -|``c`` | ``3`` | +|``b`` | ``3`` | The rate of change of raindrops number density is ``` math diff --git a/docs/src/plots/RainEvapoartionSB2006.jl b/docs/src/plots/RainEvapoartionSB2006.jl index 099c2ef3c..3ff2e49d1 100644 --- a/docs/src/plots/RainEvapoartionSB2006.jl +++ b/docs/src/plots/RainEvapoartionSB2006.jl @@ -26,11 +26,11 @@ function rain_evaporation_CPU(SB2006, aps, tps, q, q_rai, ρ, N_rai, T) (; ν_air, D_vapor) = aps (; av, bv, α, β, ρ0) = SB2006.evap - ρw = SB2006.pdf.ρw - x_star = SB2006.pdf.xr_min + ρw = SB2006.pdf_r.ρw + x_star = SB2006.pdf_r.xr_min G = CO.G_func(aps, tps, T, TD.Liquid()) - xr = CM2.raindrops_limited_vars(SB2006.pdf, q_rai, ρ, N_rai).xr + xr = CM2.raindrops_limited_vars(SB2006.pdf_r, q_rai, ρ, N_rai).xr Dr = (FT(6) / FT(π) / ρw)^FT(1 / 3) * xr^FT(1 / 3) t_star = (FT(6) * x_star / xr)^FT(1 / 3) diff --git a/src/Microphysics2M.jl b/src/Microphysics2M.jl index 408db2aed..ac737c879 100644 --- a/src/Microphysics2M.jl +++ b/src/Microphysics2M.jl @@ -46,9 +46,9 @@ end # mean terminal velocity of raindrops, and rain evaporation rates from Seifert and Beheng 2001 """ - raindrops_limited_vars(pdf, q_rai, ρ, N_rai) + raindrops_limited_vars(pdf_r, q_rai, ρ, N_rai) - - `pdf` - a struct with SB2006 size distribution parameters + - `pdf_r` - a struct with SB2006 raindrops size distribution parameters - `q_rai` - rain water specific humidity - `ρ` - air density - `N_rai` raindrops number density @@ -57,12 +57,12 @@ Returns a named tupple containing the mean mass of raindrops, xr, and the rate p size distribution of raindrops (based on drops diameter), λr, limited within prescribed ranges """ function raindrops_limited_vars( - pdf::CMP.ParticlePDF_SB2006{FT}, + pdf_r::CMP.RainParticlePDF_SB2006{FT}, q_rai::FT, ρ::FT, N_rai::FT, ) where {FT} - (; xr_min, xr_max, N0_min, N0_max, λ_min, λ_max, ρw) = pdf + (; xr_min, xr_max, N0_min, N0_max, λ_min, λ_max, ρw) = pdf_r L_rai = ρ * q_rai xr_0 = L_rai / N_rai @@ -231,7 +231,7 @@ Returns the raindrops number density tendency due to collisions of raindrops that produce larger raindrops (self-collection) for `scheme == SB2006Type` """ function rain_self_collection( - pdf::CMP.ParticlePDF_SB2006{FT}, + pdf::CMP.RainParticlePDF_SB2006{FT}, self::CMP.SelfColSB2006{FT}, q_rai::FT, ρ::FT, @@ -268,7 +268,7 @@ Returns the raindrops number density tendency due to breakup of raindrops that produce smaller raindrops for `scheme == SB2006Type` """ function rain_breakup( - pdf::CMP.ParticlePDF_SB2006{FT}, + pdf::CMP.RainParticlePDF_SB2006{FT}, brek::CMP.BreakupSB2006{FT}, q_rai::FT, ρ::FT, @@ -294,8 +294,8 @@ end """ rain_self_collection_and_breakup(SB2006, q_rai, ρ, N_rai) - - `SB2006` - a struct with SB2006 parameters for size distribution - self collection and breakup + - `SB2006` - a struct with SB2006 parameters for raindrops size + distribution, self collection, and breakup - `q_rai` - rain water specific humidity - `ρ` - air density - `N_rai` - raindrops number density @@ -304,14 +304,14 @@ Returns a named tupple containing the raindrops self-collection and breakup rate for `scheme == SB2006Type` """ function rain_self_collection_and_breakup( - (; pdf, self, brek)::CMP.SB2006{FT}, + (; pdf_r, self, brek)::CMP.SB2006{FT}, q_rai::FT, ρ::FT, N_rai::FT, ) where {FT} - sc = rain_self_collection(pdf, self, q_rai, ρ, N_rai) - br = rain_breakup(pdf, brek, q_rai, ρ, N_rai, sc) + sc = rain_self_collection(pdf_r, self, q_rai, ρ, N_rai) + br = rain_breakup(pdf_r, brek, q_rai, ρ, N_rai, sc) return (; sc, br) end @@ -332,7 +332,7 @@ Fall velocity of individual rain drops is parameterized: - following Chen et. al 2022, DOI: 10.1016/j.atmosres.2022.106171 for `velo_scheme == Chen2022Type` """ function rain_terminal_velocity( - (; pdf)::CMP.SB2006{FT}, + (; pdf_r)::CMP.SB2006{FT}, (; ρ0, aR, bR, cR)::CMP.SB2006VelType{FT}, q_rai::FT, ρ::FT, @@ -342,13 +342,13 @@ function rain_terminal_velocity( if q_rai < eps(FT) return (FT(0), FT(0)) end - λr = raindrops_limited_vars(pdf, q_rai, ρ, N_rai).λr + λr = raindrops_limited_vars(pdf_r, q_rai, ρ, N_rai).λr vt0 = max(FT(0), sqrt(ρ0 / ρ) * (aR - bR / (1 + cR / λr))) vt1 = max(FT(0), sqrt(ρ0 / ρ) * (aR - bR / (1 + cR / λr)^FT(4))) return (vt0, vt1) end function rain_terminal_velocity( - (; pdf)::CMP.SB2006{FT}, + (; pdf_r)::CMP.SB2006{FT}, vel::CMP.Chen2022VelTypeRain{FT}, q_rai::FT, ρ::FT, @@ -360,7 +360,7 @@ function rain_terminal_velocity( # coefficients from Table B1 from Chen et. al. 2022 aiu, bi, ciu = CO.Chen2022_vel_coeffs_small(vel, ρ) # size distribution parameter - λ = raindrops_limited_vars(pdf, q_rai, ρ, N_rai).λr + λ = raindrops_limited_vars(pdf_r, q_rai, ρ, N_rai).λr # eq 20 from Chen et al 2022 vt0 = sum(CO.Chen2022_vel_add.(aiu, bi, ciu, λ, 0)) @@ -401,7 +401,7 @@ specific humidity due to rain rain_evaporation, assuming a power law velocity re fall velocity of individual drops and an exponential size distribution, for `scheme == SB2006Type` """ function rain_evaporation( - (; pdf, evap)::CMP.SB2006{FT}, + (; pdf_r, evap)::CMP.SB2006{FT}, aps::CMP.AirProperties{FT}, tps::TDP.ThermodynamicsParameters{FT}, q::TD.PhasePartition{FT}, @@ -419,11 +419,11 @@ function rain_evaporation( (; ν_air, D_vapor) = aps (; av, bv, α, β, ρ0) = evap - x_star = pdf.xr_min - ρw = pdf.ρw + x_star = pdf_r.xr_min + ρw = pdf_r.ρw G = CO.G_func(aps, tps, T, TD.Liquid()) - xr = raindrops_limited_vars(pdf, q_rai, ρ, N_rai).xr + xr = raindrops_limited_vars(pdf_r, q_rai, ρ, N_rai).xr Dr = (FT(6) / FT(π) / ρw)^FT(1 / 3) * xr^FT(1 / 3) t_star = (FT(6) * x_star / xr)^FT(1 / 3) @@ -447,11 +447,12 @@ function rain_evaporation( return (; evap_rate_0, evap_rate_1) end -""" - radar_reflectivity(struct, q_liq, q_rai, N_liq, N_rai, ρ_air, ρ_w, τ_q, τ_N) +""" + radar_reflectivity(structs, q_liq, q_rai, N_liq, N_rai, ρ_air, ρ_w, τ_q, τ_N) - - `struct` - type for 2-moment rain autoconversion parameterization - - `q_liq` - cloud water specific humidity + - `structs` - structs with SB2006 cloud droplets and raindrops + size distributions parameters + - `q_liq` - cloud water specific humidity - `q_rai` - rain water specific humidity - `N_liq` - cloud droplet number density - `N_rai` - rain droplet number density @@ -465,7 +466,7 @@ size distribuions normalized by the reflectivty of 1 millimiter drop in a volume one meter cube """ function radar_reflectivity( - acnv::CMP.AcnvSB2006{FT}, + (; pdf_c, pdf_r)::CMP.SB2006{FT}, q_liq::FT, q_rai::FT, N_liq::FT, @@ -476,15 +477,8 @@ function radar_reflectivity( τ_N::FT, ) where {FT} - # we assume a cloud droplets gamma distribution, - # where the parameters are νc=2 and μc=1 - (; νc) = acnv - - # we assume a raindrops exponential distribution - # which can be seen as a gamma distribution with - # parameters νr=-2/3 and μr=1/3 - νr = FT(-2 / 3) - μr = FT(1 / 3) + (; νc, μc) = pdf_c + (; νr, μr) = pdf_r # change of units for N_liq and N_rai # from m^-3 to mm^-3 @@ -501,12 +495,12 @@ function radar_reflectivity( Bc = (xc == 0) ? FT(0) : - (SF.gamma(FT(νc + 1)) * xc / SF.gamma(FT(νc + 2)))^FT(-1) + (SF.gamma(FT(νc + 1) / μc) * xc / SF.gamma(FT(νc + 2) / μc))^(-μc) Br = (xr == 0) ? FT(0) : (SF.gamma(FT(νr + 1) / μr) * xr / SF.gamma(FT(νr + 2) / μr))^(-μr) - Ac = (N_liq * Bc^(FT(νc + 1))) / SF.gamma(FT(νc + 1)) - Ar = (μr * N_rai * Br^(FT(νr + 1) / μr)) / SF.gamma(FT(νr + 1) / μr) + Ac = μc * N_liq * Bc^(FT(νc + 1) / μc) / SF.gamma(FT(νc + 1) / μc) + Ar = μr * N_rai * Br^(FT(νr + 1) / μr) / SF.gamma(FT(νr + 1) / μr) Zc = (Bc == 0) ? FT(0) : (FT(24) * Ac / (Bc^FT(5) * C^FT(2))) Zr = (Br == 0) ? FT(0) : (FT(2160) * Ar / (Br^FT(7) * C^FT(2))) @@ -515,11 +509,12 @@ function radar_reflectivity( FT(10) * (log10((Zc + Zr) / Z₀) + log10(FT(1e-9))) end -""" - effective_radius(struct, q_liq, q_rai, N_liq, N_rai, ρ_air, ρ_w, τ_q, τ_N) +""" + effective_radius(structs, q_liq, q_rai, N_liq, N_rai, ρ_air, ρ_w, τ_q, τ_N) - - `struct` - type for 2-moment rain autoconversion parameterization - - `q_liq` - cloud water specific humidity + - `structs` - structs with SB2006 cloud droplets and raindrops + size distribution parameters + - `q_liq` - cloud water specific humidity - `q_rai` - rain water specific humidity - `N_liq` - cloud droplet number density - `N_rai` - rain droplet number density @@ -532,7 +527,7 @@ Returns effective radius using the 2-moment scheme cloud and rain particle size distributions """ function effective_radius( - acnv::CMP.AcnvSB2006{FT}, + (; pdf_c, pdf_r)::CMP.SB2006{FT}, q_liq::FT, q_rai::FT, N_liq::FT, @@ -543,15 +538,8 @@ function effective_radius( τ_N::FT, ) where {FT} - # we assume a cloud droplets gamma distribution, - # where the parameters are νc=2 and μc=1 - (; νc) = acnv - - # we assume a raindrops exponential distribution - # which can be seen as a gamma distribution with - # parameters νr=-2/3 and μr=1/3 - νr = FT(-2 / 3) - μr = FT(1 / 3) + (; νc, μc) = pdf_c + (; νr, μr) = pdf_r # change of units for N_liq and N_rai # from m^-3 to mm^-3 @@ -563,16 +551,17 @@ function effective_radius( xc = (N_liq < τ_N) ? FT(0) : ((q_liq * ρ_air) / N_liq) xr = (N_rai < τ_N) ? FT(0) : ((q_rai * ρ_air) / N_rai) + C = FT((4 / 3) * π * ρ_w) Bc = (xc == 0) ? FT(0) : - (SF.gamma(FT(νc + 1)) * xc / SF.gamma(FT(νc + 2)))^(-1) + (SF.gamma(FT(νc + 1) / μc) * xc / SF.gamma(FT(νc + 2) / μc))^(-μc) Br = (xr == 0) ? FT(0) : - ((SF.gamma(FT(νr + 1) / μr) * xr / SF.gamma(FT(νr + 2) / μr))^(-μr)) - Ac = (N_liq * Bc^(FT(νc + 1))) / SF.gamma(FT(νc + 1)) - Ar = (μr * N_rai * Br^(FT(νr + 1) / μr)) / SF.gamma(FT(νr + 1) / μr) + (SF.gamma(FT(νr + 1) / μr) * xr / SF.gamma(FT(νr + 2) / μr))^(-μr) + Ac = μc * N_liq * Bc^(FT(νc + 1) / μc) / SF.gamma(FT(νc + 1) / μc) + Ar = μr * N_rai * Br^(FT(νr + 1) / μr) / SF.gamma(FT(νr + 1) / μr) cloud_3moment = (Bc == 0) ? FT(0) : (FT(6) * Ac * C^3 / (Bc * C)^FT(4)) cloud_2moment = diff --git a/src/parameters/Microphysics2M.jl b/src/parameters/Microphysics2M.jl index 09bd61c34..2caa6a1e0 100644 --- a/src/parameters/Microphysics2M.jl +++ b/src/parameters/Microphysics2M.jl @@ -336,14 +336,18 @@ function VarTimescaleAcnv(td::CP.AbstractTOMLDict) end """ - ParticlePDF_SB2006 + RainParticlePDF_SB2006 Rain size distribution parameters from SB2006 # Fields $(DocStringExtensions.FIELDS) """ -Base.@kwdef struct ParticlePDF_SB2006{FT} <: ParametersType{FT} +Base.@kwdef struct RainParticlePDF_SB2006{FT} <: ParametersType{FT} + "Raindrop size distribution coefficient νr" + νr::FT + "Raindrop size distribution coefficient μr" + μr::FT "Raindrop minimal mass" xr_min::FT "Raindrop maximum mass" @@ -362,8 +366,10 @@ Base.@kwdef struct ParticlePDF_SB2006{FT} <: ParametersType{FT} ρ0::FT end -function ParticlePDF_SB2006(td::CP.AbstractTOMLDict) +function RainParticlePDF_SB2006(td::CP.AbstractTOMLDict) name_map = (; + :SB2006_rain_distribution_coeff_nu => :νr, + :SB2006_rain_distribution_coeff_mu => :μr, :SB2006_raindrops_min_mass => :xr_min, :SB2006_raindrops_max_mass => :xr_max, :SB2006_raindrops_size_distribution_coeff_N0_min => :N0_min, @@ -375,7 +381,32 @@ function ParticlePDF_SB2006(td::CP.AbstractTOMLDict) ) parameters = CP.get_parameter_values(td, name_map, "CloudMicrophysics") FT = CP.float_type(td) - return ParticlePDF_SB2006{FT}(; parameters...) + return RainParticlePDF_SB2006{FT}(; parameters...) +end + +""" + CloudParticlePDF_SB2006 + +Cloud droplets size distribution parameters from SB2006 + +# Fields +$(DocStringExtensions.FIELDS) +""" +Base.@kwdef struct CloudParticlePDF_SB2006{FT} <: ParametersType{FT} + "Cloud droplet size distribution coefficient νc" + νc::FT + "Cloud droplet size distribution coefficient μc" + μc::FT +end + +function CloudParticlePDF_SB2006(td::CP.AbstractTOMLDict) + name_map = (; + :SB2006_cloud_gamma_distribution_parameter => :νc, + :SB2006_cloud_gamma_distribution_coeff_mu => :μc, + ) + parameters = CP.get_parameter_values(td, name_map, "CloudMicrophysics") + FT = CP.float_type(td) + return CloudParticlePDF_SB2006{FT}(; parameters...) end """ @@ -554,9 +585,11 @@ DOI: 10.1007/s00703-005-0112-4 # Fields $(DocStringExtensions.FIELDS) """ -struct SB2006{FT, PD, AV, AR, SC, BR, EV} <: Precipitation2MType{FT} +struct SB2006{FT, PDc, PDr, AV, AR, SC, BR, EV} <: Precipitation2MType{FT} + "Cloud particle size distribution parameters" + pdf_c::PDc "Rain particle size distribution parameters" - pdf::PD + pdf_r::PDr "Autoconversion parameters" acnv::AV "Accretion parameters" @@ -572,18 +605,28 @@ end SB2006(::Type{FT}) where {FT <: AbstractFloat} = SB2006(CP.create_toml_dict(FT)) function SB2006(toml_dict::CP.AbstractTOMLDict) - pdf = ParticlePDF_SB2006(toml_dict) + pdf_c = CloudParticlePDF_SB2006(toml_dict) + pdf_r = RainParticlePDF_SB2006(toml_dict) acnv = AcnvSB2006(toml_dict) accr = AccrSB2006(toml_dict) self = SelfColSB2006(toml_dict) brek = BreakupSB2006(toml_dict) evap = EvaporationSB2006(toml_dict) FT = CP.float_type(toml_dict) - PD = typeof(pdf) + PDc = typeof(pdf_c) + PDr = typeof(pdf_r) AN = typeof(acnv) AR = typeof(accr) SE = typeof(self) BR = typeof(brek) EV = typeof(evap) - return SB2006{FT, PD, AN, AR, SE, BR, EV}(pdf, acnv, accr, self, brek, evap) + return SB2006{FT, PDc, PDr, AN, AR, SE, BR, EV}( + pdf_c, + pdf_r, + acnv, + accr, + self, + brek, + evap, + ) end diff --git a/test/Project.toml b/test/Project.toml index 5279cbee8..242ca35af 100644 --- a/test/Project.toml +++ b/test/Project.toml @@ -30,7 +30,7 @@ Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" Thermodynamics = "b60c26fb-14c3-4610-9d3e-2d17fe7ff00c" [compat] -ClimaParams = "0.10.5" +ClimaParams = "0.10.6" EnsembleKalmanProcesses = "1.1.5" KernelAbstractions = "0.9" Optim = "<1.9.3" diff --git a/test/common_types_tests.jl b/test/common_types_tests.jl index 7e3c92e10..77b894402 100644 --- a/test/common_types_tests.jl +++ b/test/common_types_tests.jl @@ -49,7 +49,8 @@ function test_common_types_broadcasts(FT) CMP.AccrTC1980{FT}, CMP.LD2004{FT}, CMP.VarTimescaleAcnv{FT}, - CMP.ParticlePDF_SB2006{FT}, + CMP.RainParticlePDF_SB2006{FT}, + CMP.CloudParticlePDF_SB2006{FT}, CMP.AcnvSB2006{FT}, CMP.AccrSB2006{FT}, CMP.SelfColSB2006{FT}, diff --git a/test/microphysics2M_tests.jl b/test/microphysics2M_tests.jl index 24422b507..0644cb88c 100644 --- a/test/microphysics2M_tests.jl +++ b/test/microphysics2M_tests.jl @@ -150,8 +150,8 @@ function test_microphysics2M(FT) for Nr in N_rai for qr in q_rai #action - λ = CM2.raindrops_limited_vars(SB2006.pdf, qr, ρ, Nr).λr - xr = CM2.raindrops_limited_vars(SB2006.pdf, qr, ρ, Nr).xr + λ = CM2.raindrops_limited_vars(SB2006.pdf_r, qr, ρ, Nr).λr + xr = CM2.raindrops_limited_vars(SB2006.pdf_r, qr, ρ, Nr).xr #test TT.@test λ_min <= λ <= λ_max @@ -296,20 +296,20 @@ function test_microphysics2M(FT) #action sc_rai = - CM2.rain_self_collection(SB2006.pdf, SB2006.self, q_rai, ρ, N_rai) + CM2.rain_self_collection(SB2006.pdf_r, SB2006.self, q_rai, ρ, N_rai) br_rai = - CM2.rain_breakup(SB2006.pdf, SB2006.brek, q_rai, ρ, N_rai, sc_rai) + CM2.rain_breakup(SB2006.pdf_r, SB2006.brek, q_rai, ρ, N_rai, sc_rai) sc_br_rai = CM2.rain_self_collection_and_breakup(SB2006, q_rai, ρ, N_rai) λr = - CM2.raindrops_limited_vars(SB2006.pdf, q_rai, ρ, N_rai).λr * + CM2.raindrops_limited_vars(SB2006.pdf_r, q_rai, ρ, N_rai).λr * FT(6 / π / 1000)^FT(1 / 3) dNrdt_sc = -krr * N_rai * ρ * q_rai * (1 + κrr / λr)^-5 * sqrt(ρ0 / ρ) Dr = ( - CM2.raindrops_limited_vars(SB2006.pdf, q_rai, ρ, N_rai).xr / + CM2.raindrops_limited_vars(SB2006.pdf_r, q_rai, ρ, N_rai).xr / 1000 / FT(π) * 6 )^FT(1 / 3) ΔDr = Dr - Deq @@ -322,7 +322,7 @@ function test_microphysics2M(FT) #test TT.@test sc_rai ≈ dNrdt_sc rtol = 1e-6 TT.@test CM2.rain_self_collection( - SB2006.pdf, + SB2006.pdf_r, SB2006.self, FT(0), ρ, @@ -338,9 +338,9 @@ function test_microphysics2M(FT) #action sc_rai = - CM2.rain_self_collection(SB2006.pdf, SB2006.self, q_rai, ρ, N_rai) + CM2.rain_self_collection(SB2006.pdf_r, SB2006.self, q_rai, ρ, N_rai) br_rai = - CM2.rain_breakup(SB2006.pdf, SB2006.brek, q_rai, ρ, N_rai, sc_rai) + CM2.rain_breakup(SB2006.pdf_r, SB2006.brek, q_rai, ρ, N_rai, sc_rai) sc_br_rai = CM2.rain_self_collection_and_breakup(SB2006, q_rai, ρ, N_rai) @@ -365,7 +365,7 @@ function test_microphysics2M(FT) #action vt_rai = CM2.rain_terminal_velocity(SB2006, SB2006Vel, q_rai, ρ, N_rai) - λr = CM2.raindrops_limited_vars(SB2006.pdf, q_rai, ρ, N_rai).λr + λr = CM2.raindrops_limited_vars(SB2006.pdf_r, q_rai, ρ, N_rai).λr vt0 = max(0, sqrt(ρ0 / ρ) * (aR - bR / (1 + cR / λr))) vt1 = max(0, sqrt(ρ0 / ρ) * (aR - bR / (1 + cR / λr)^4)) @@ -447,7 +447,7 @@ function test_microphysics2M(FT) G = CMC.G_func(aps, tps, T, TD.Liquid()) S = TD.supersaturation(tps, q, ρ, T, TD.Liquid()) - xr = CM2.raindrops_limited_vars(SB2006.pdf, q_rai, ρ, N_rai).xr + xr = CM2.raindrops_limited_vars(SB2006.pdf_r, q_rai, ρ, N_rai).xr Dr = FT(6 / π / 1000.0)^FT(1 / 3) * xr^FT(1 / 3) N_Re = α * xr^β * sqrt(ρ0 / ρ) * Dr / ν_air @@ -500,7 +500,7 @@ function test_microphysics2M(FT) #action rr = CM2.radar_reflectivity( - SB2006.acnv, + SB2006, q_liq, q_rai, N_liq, @@ -528,7 +528,7 @@ function test_microphysics2M(FT) #action reff = CM2.effective_radius( - SB2006.acnv, + SB2006, q_liq, q_rai, N_liq, diff --git a/test/performance_tests.jl b/test/performance_tests.jl index 20d5e3804..872832aa2 100644 --- a/test/performance_tests.jl +++ b/test/performance_tests.jl @@ -225,7 +225,7 @@ function benchmark_test(FT) bench_press( CM2.radar_reflectivity, ( - sb2006.acnv, + sb2006, q_liq, q_rai, N_liq, @@ -240,7 +240,7 @@ function benchmark_test(FT) bench_press( CM2.effective_radius, ( - sb2006.acnv, + sb2006, q_liq, q_rai, N_liq,