Skip to content

Commit

Permalink
formatter
Browse files Browse the repository at this point in the history
  • Loading branch information
anastasia-popova committed Apr 10, 2024
1 parent e91c0ac commit bc0de28
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 9 deletions.
2 changes: 1 addition & 1 deletion docs/src/plots/P3TerminalVelocityPlots.jl
Original file line number Diff line number Diff line change
Expand Up @@ -252,4 +252,4 @@ function figure_2()
end

# Terminal Velocity figure
figure_2()
figure_2()
22 changes: 17 additions & 5 deletions src/P3Scheme.jl
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,7 @@ function terminal_velocity_mass(
for i in 1:2
if F_r == 0
# Velocity coefficients for small particles
(ai, bi, ci) = CO.Chen2022_vel_coeffs_small(Chen2022, ρ_a)
(ai, bi, ci) = CO.Chen2022_vel_coeffs_small(Chen2022, ρ_a)
v += integrate(
FT(0),
D_th,
Expand Down Expand Up @@ -547,7 +547,11 @@ function terminal_velocity_mass(
v += integrate(
th.D_gr,
cutoff,
FT(π) / 6 * th.ρ_g * ai[i] * N_0 * (p3.ρ_i / th.ρ_g)^(2 * κ),
FT(π) / 6 *
th.ρ_g *
ai[i] *
N_0 *
(p3.ρ_i / th.ρ_g)^(2 * κ),
bi[i] + μ + 3,
ci[i] + λ,
)
Expand All @@ -559,15 +563,23 @@ function terminal_velocity_mass(
v += integrate(
cutoff,
th.D_cr,
FT(π) / 6 * th.ρ_g * ai[i] * N_0 * (p3.ρ_i / th.ρ_g)^(2 * κ),
FT(π) / 6 *
th.ρ_g *
ai[i] *
N_0 *
(p3.ρ_i / th.ρ_g)^(2 * κ),
bi[i] + μ + 3,
ci[i] + λ,
)
else
v += integrate(
th.D_gr,
th.D_cr,
FT(π) / 6 * th.ρ_g * ai[i] * N_0 * (p3.ρ_i / th.ρ_g)^(2 * κ),
FT(π) / 6 *
th.ρ_g *
ai[i] *
N_0 *
(p3.ρ_i / th.ρ_g)^(2 * κ),
bi[i] + μ + 3,
ci[i] + λ,
)
Expand All @@ -594,7 +606,7 @@ function terminal_velocity_mass(
cutoff,
)
v += I

# Switch to large particles
(ai, bi, ci) = CO.Chen2022_vel_coeffs_large(Chen2022, ρ_a)
large = true
Expand Down
16 changes: 13 additions & 3 deletions test/performance_tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,19 @@ function benchmark_test(FT)

# P3 scheme
bench_press(P3.thresholds, (p3, ρ_r, F_r), 12e6, 2048, 80)
if FT == Float64
bench_press(P3.distribution_parameter_solver, (p3, q_ice, N, ρ_r, F_r), 1e5)
bench_press(P3.terminal_velocity_mass, (p3, ch2022.snow_ice, q_ice, N, ρ_r, F_r, ρ_air), 2e6, 4e4, 2e3)
if FT == Float64
bench_press(
P3.distribution_parameter_solver,
(p3, q_ice, N, ρ_r, F_r),
1e5,
)
bench_press(
P3.terminal_velocity_mass,
(p3, ch2022.snow_ice, q_ice, N, ρ_r, F_r, ρ_air),
2e6,
4e4,
2e3,
)
bench_press(P3.D_m, (p3, q_ice, N, ρ_r, F_r), 1e5)
end

Expand Down

0 comments on commit bc0de28

Please sign in to comment.