Skip to content

Commit

Permalink
Fix precipitation test
Browse files Browse the repository at this point in the history
  • Loading branch information
trontrytel committed Feb 2, 2024
1 parent b38789c commit a9acb62
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 9 deletions.
6 changes: 3 additions & 3 deletions config/model_configs/single_column_precipitation_test.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
config: "column"
initial_condition: "PrecipitatingColumn"
surface_setup: "DefaultExchangeCoefficients"
surface_setup: "DefaultMoninObukhov"
z_elem: 200
z_max: 10000.0
z_stretch: false
Expand All @@ -11,9 +11,9 @@ dt_cloud_fraction: "60secs"
moist: "nonequil"
precip_model: "1M"
precip_upwinding: "first_order"
hyperdiff: "false"
vert_diff: "FriersonDiffusion"
implicit_diffusion: true
vert_diff: "true"
approximate_linear_solve_iters: 2
regression_test: false
check_precipitation: true
job_id: "single_column_precipitation_test"
Expand Down
19 changes: 14 additions & 5 deletions examples/hybrid/driver.jl
Original file line number Diff line number Diff line change
Expand Up @@ -170,18 +170,27 @@ if config.parsed_args["check_precipitation"]
# run some simple tests based on the output
FT = Spaces.undertype(axes(sol.u[end].c.ρ))
Yₜ = similar(sol.u[end])
@. Yₜ = 0

Yₜ_ρ = similar(Yₜ.c.ρq_rai)
Yₜ_ρqₚ = similar(Yₜ.c.ρq_rai)
Yₜ_ρqₜ = similar(Yₜ.c.ρq_rai)

CA.remaining_tendency!(Yₜ, sol.u[end], sol.prob.p, sol.t[end])

@. Yₜ_ρqₚ = -Yₜ.c.ρq_rai - Yₜ.c.ρq_sno
@. Yₜ_ρqₜ = Yₜ.c.ρq_tot
@. Yₜ_ρ = Yₜ.c.ρ

ClimaCore.Fields.bycolumn(axes(sol.u[end].c.ρ)) do colidx
CA.precipitation_tendency!(
Yₜ,
sol.u[end],
sol.prob.p,
sol.t[end],
colidx,
sol.prob.p.atmos.precip_model,
)
#CA.remaining_tendency!(Yₜ, sol.u[end], sol.prob.p, sol.t[end])

@. Yₜ_ρqₚ[colidx] = -Yₜ.c.ρq_rai[colidx] - Yₜ.c.ρq_sno[colidx]
@. Yₜ_ρqₜ[colidx] = Yₜ.c.ρq_tot[colidx]
@. Yₜ_ρ[colidx] = Yₜ.c.ρ[colidx]

# no nans
@assert !any(isnan, Yₜ.c.ρ[colidx])
Expand Down
2 changes: 1 addition & 1 deletion perf/flame.jl
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ allocs_limit = Dict()
allocs_limit["flame_perf_target"] = 275_800
allocs_limit["flame_perf_target_tracers"] = 305_776
allocs_limit["flame_perf_target_edmfx"] = 7_005_552
allocs_limit["flame_perf_diagnostics"] = 108_858_808
allocs_limit["flame_perf_diagnostics"] = 108_859_768
allocs_limit["flame_perf_target_diagnostic_edmfx"] = 531_000
allocs_limit["flame_sphere_baroclinic_wave_rhoe_equilmoist_expvdiff"] =
4_018_252_656
Expand Down

0 comments on commit a9acb62

Please sign in to comment.