diff --git a/ext/EmulatorModelsExt.jl b/ext/EmulatorModelsExt.jl index 62b65da9ec..2baa6c5de1 100644 --- a/ext/EmulatorModelsExt.jl +++ b/ext/EmulatorModelsExt.jl @@ -203,7 +203,7 @@ function AA.N_activated_per_mode( :initial_pressure => p, ) X = DF.DataFrame([merge(reduce(merge, per_mode_data), additional_data)]) - max(FT(0), min(FT(1), MLJ.predict(scheme.machine, X)[1])) * + max(FT(0), min(FT(1), MLJ.predict(ml.machine, X)[1])) * ad.Modes[i].N end end diff --git a/src/AerosolActivation.jl b/src/AerosolActivation.jl index 6b4e68d9d1..482a7bb783 100644 --- a/src/AerosolActivation.jl +++ b/src/AerosolActivation.jl @@ -26,7 +26,6 @@ export mean_hygroscopicity_parameter, total_M_activated """ - coeff_of_curvature(ap, T) - `ap` - a struct with aerosol activation parameters @@ -151,16 +150,6 @@ function max_supersaturation( p_vs::FT = TD.saturation_vapor_pressure(tps, T, TD.Liquid()) G::FT = CO.G_func(aip, tps, T, TD.Liquid()) / ap.ρ_w - # TODO - add a test with the overwritten params - # New values of parameters obtained through calibration. - # TODO: Do we want to swap them for defaults in CLIMAParameters? - #f1 = 0.26583888195264627 - #f2 = 2.3851515425961853 - #g1 = 0.779519468021862 - #g2 = 0.10571967167118024 - #p1 = 1.6523365679298359 - #p2 = 0.7578626397779737 - # eq 11, 12 in Razzak et al 1998 # but following eq 10 from Rogers 1975 α::FT = L * ap.g * ϵ / R_m / cp_m / T^2 - ap.g / R_m / T @@ -176,14 +165,13 @@ function max_supersaturation( mode_i = ad.Modes[i] - f::FT = ap.f1 * exp(ap.f2 * (log(mode_i.stdev))^2) - g::FT = ap.g1 + ap.g2 * log(mode_i.stdev) - η::FT = - (α * w / G)^FT(3 / 2) / (FT(2 * pi) * ap.ρ_w * γ * mode_i.N) + f::FT = 0.5 * exp(2.5 * (log(mode_i.stdev))^2) + g::FT = 1 + 0.25 * log(mode_i.stdev) + η::FT = (α * w / G)^FT(3 / 2) / (FT(2 * pi) * ap.ρ_w * γ * mode_i.N) tmp += 1 / (Sm[i])^2 * - (f * (ζ / η)^ap.p1 + g * (Sm[i]^2 / (η + 3 * ζ))^ap.p2) + (f * (ζ / η)^FT(3 / 2) + g * (Sm[i]^2 / (η + 3 * ζ))^FT(3 / 4)) end return FT(1) / sqrt(tmp) diff --git a/src/parameters/AerosolActivation.jl b/src/parameters/AerosolActivation.jl index 5c86839426..889891f865 100644 --- a/src/parameters/AerosolActivation.jl +++ b/src/parameters/AerosolActivation.jl @@ -20,18 +20,6 @@ Base.@kwdef struct AerosolActivationParameters{FT} <: ParametersType{FT} σ::FT "gravitational_acceleration [m/s2]" g::FT - "scaling coefficient in Abdul-Razzak and Ghan 2000 [-]" - f1::FT - "scaling coefficient in Abdul-Razzak and Ghan 2000 [-]" - f2::FT - "scaling coefficient in Abdul-Razzak and Ghan 2000 [-]" - g1::FT - "scaling coefficient in Abdul-Razzak and Ghan 2000 [-]" - g2::FT - "power of (zeta / eta) in Abdul-Razzak and Ghan 2000 [-]" - p1::FT - "power of (S_m^2 / (zeta + 3 * eta)) in Abdul-Razzak and Ghan 2000 [-]" - p2::FT end AerosolActivationParameters(::Type{FT}) where {FT <: AbstractFloat} = diff --git a/test/Project.toml b/test/Project.toml index c5bab2675f..63a215dc53 100644 --- a/test/Project.toml +++ b/test/Project.toml @@ -2,12 +2,12 @@ Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595" BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf" CLIMAParameters = "6eacf6c3-8458-43b9-ae03-caf5306d3d53" +CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba" ClimaComms = "3a4d1b5c-c61d-41fd-a00a-5873ba7a1b0d" CloudMicrophysics = "6a9e3e04-43cd-43ba-94b9-e8782df3c71b" KernelAbstractions = "63c18a36-062a-441e-b654-da1e3ab1ce7c" RootSolvers = "7181ea78-2dcb-4de3-ab41-2b8ab5a31e74" SpecialFunctions = "276daf66-3868-5448-9aa4-cd146d93841b" -StatsFuns = "4c63d2b9-4356-54db-8cca-17b64c39e42c" Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" Thermodynamics = "b60c26fb-14c3-4610-9d3e-2d17fe7ff00c" diff --git a/test/aerosol_activation_tests.jl b/test/aerosol_activation_tests.jl index 232d062c1f..0e2534afe7 100644 --- a/test/aerosol_activation_tests.jl +++ b/test/aerosol_activation_tests.jl @@ -16,8 +16,6 @@ function test_aerosol_activation(FT) aip = CMP.AirProperties(FT) ap = CMP.AerosolActivationParameters(FT) - #ARG2000 = CMT.ARG2000Type() - # Atmospheric conditions T = FT(294) # air temperature K p = FT(1e5) # air pressure Pa @@ -246,16 +244,12 @@ function test_aerosol_activation(FT) N_act_frac_κ[it] = AA.N_activated_per_mode(ap, AD_κ, aip, tps, T, p, w, q)[1] / N_1_paper - #@info("1 ", N_act_frac_B[it], N_act_obs[it]) - #@info("2 ", N_act_frac_κ[it], N_act_obs[it]) - # TODO - i think this has to do with using different parameters in ARG - TT.@test isapprox(N_act_frac_B[it], N_act_obs[it], rtol = 0.45)# TODO rtol 0.05 - TT.@test isapprox(N_act_frac_κ[it], N_act_obs[it], rtol = 0.45)# TODO rtol 0.1 it += 1 end - #TODO - #TT.@test all(isapprox(N_act_frac_B, N_act_obs, rtol = 0.05)) - #TT.@test all(isapprox(N_act_frac_κ, N_act_obs, rtol = 0.1)) + + TT.@test all(isapprox(N_act_frac_B, N_act_obs, rtol = 0.05)) + TT.@test all(isapprox(N_act_frac_κ, N_act_obs, rtol = 0.1)) + end end