From 364643d7fae44a8ade5c78282887f05cae1cc95c Mon Sep 17 00:00:00 2001 From: Anastasia Popova Date: Fri, 23 Feb 2024 11:15:26 -0800 Subject: [PATCH] passing tests? --- src/P3Scheme.jl | 2 +- test/p3_tests.jl | 67 ------------------------------------------------ 2 files changed, 1 insertion(+), 68 deletions(-) diff --git a/src/P3Scheme.jl b/src/P3Scheme.jl index a4fcf6798b..e0ce4aec46 100644 --- a/src/P3Scheme.jl +++ b/src/P3Scheme.jl @@ -19,7 +19,7 @@ import CloudMicrophysics.Parameters as CMP const PSP3 = CMP.ParametersP3 -export thresholds, p3_mass, distribution_parameter_solver +export thresholds, distribution_parameter_solver """ α_va_si(p3) diff --git a/test/p3_tests.jl b/test/p3_tests.jl index afe13c4f8a..3d0e5727bd 100644 --- a/test/p3_tests.jl +++ b/test/p3_tests.jl @@ -85,71 +85,6 @@ function test_p3_thresholds(FT) end end -#= function test_p3_mass(FT) - - p3 = CMP.ParametersP3(FT) - - TT.@testset "p3 mass_ functions" begin - - # Initialize test values - Ds = (FT(1e-5), FT(1e-4), FT(1e-3)) - ρs = (FT(400), FT(600), FT(800)) - F_rs = (FT(0.0), FT(0.5), FT(0.8)) - - # Test to see that the mass_ functions give positive, not NaN values - for D in Ds - for ρ in ρs - for F_r in F_rs - TT.@test P3.mass_s(D, ρ) >= 0 - TT.@test P3.mass_nl(p3, D) >= 0 - TT.@test P3.mass_r(p3, D, F_r) >= 0 - end - end - end - end - - # Test to see that p3_mass gives correct mass - TT.@testset "p3_mass() accurate values" begin - - # Initialize test values - Ds = (FT(1e-5), FT(1e-4), FT(1e-3)) - ρs = (FT(400), FT(600), FT(800)) - F_rs = (FT(0.0), FT(0.5), FT(0.8)) - eps = FT(1e-3) #TODO - this is very large for eps - - for ρ in ρs - for F_r in F_rs - D_th = P3.D_th_helper(p3) - D1 = D_th / 2 - th = P3.thresholds(p3, ρ, F_r) - - if (F_r > 0) - th = P3.thresholds(p3, ρ, F_r) - - D2 = (th.D_gr + D_th) / 2 - D3 = (th.D_cr + th.D_gr) / 2 - D4 = th.D_cr + eps - - TT.@test P3.p3_mass(p3, D1, F_r, th) == - P3.mass_s(D1, p3.ρ_i) - TT.@test P3.p3_mass(p3, D2, F_r, th) == P3.mass_nl(p3, D2) - TT.@test P3.p3_mass(p3, D3, F_r, th) == - P3.mass_s(D3, th.ρ_g) - TT.@test P3.p3_mass(p3, D4, F_r, th) == - P3.mass_r(p3, D4, F_r) - else - D2 = D1 + eps - TT.@test P3.p3_mass(p3, D1, F_r, th) == - P3.mass_s(D1, p3.ρ_i) - TT.@test P3.p3_mass(p3, D2, F_r, th) == P3.mass_nl(p3, D2) - end - - end - end - end - -end =# - function test_p3_shape_solver(FT) p3 = CMP.ParametersP3(FT) @@ -200,12 +135,10 @@ end println("Testing Float32") test_p3_thresholds(Float32) -#test_p3_mass(Float32) #TODO - only works for Float64 now. We should switch the units inside the solver # from SI base to something more managable test_p3_shape_solver(Float32) println("Testing Float64") test_p3_thresholds(Float64) -#test_p3_mass(Float64) test_p3_shape_solver(Float64)