From 8ff76e9cb7732bc4c1c86ce1d8beb6ea636e501f Mon Sep 17 00:00:00 2001 From: Zhaoyi Shen <11598433+szy21@users.noreply.github.com> Date: Fri, 6 Dec 2024 10:44:09 -0800 Subject: [PATCH] lower conservation error threshold --- examples/hybrid/driver.jl | 16 +++------------- src/utils/utilities.jl | 7 ------- 2 files changed, 3 insertions(+), 20 deletions(-) diff --git a/examples/hybrid/driver.jl b/examples/hybrid/driver.jl index b11af3bf27..9583bb778d 100644 --- a/examples/hybrid/driver.jl +++ b/examples/hybrid/driver.jl @@ -127,19 +127,9 @@ if config.parsed_args["check_conservation"] @info " Net mass change / total mass: $mass_conservation" @info " Net water change / total water: $water_conservation" - sfc = p.atmos.surface_model - - if CA.has_no_source_or_sink(config.parsed_args) - @test energy_conservation ≈ 0 atol = 50 * eps(FT) - @test mass_conservation ≈ 0 atol = 50 * eps(FT) - @test water_conservation ≈ 0 atol = 50 * eps(FT) - else - @test energy_conservation ≈ 0 atol = sqrt(eps(FT)) - @test mass_conservation ≈ 0 atol = sqrt(eps(FT)) - if sfc isa CA.PrognosticSurfaceTemperature - @test water_conservation ≈ 0 atol = sqrt(eps(FT)) - end - end + @test energy_conservation ≈ 0 atol = 100 * eps(FT) + @test mass_conservation ≈ 0 atol = 100 * eps(FT) + @test water_conservation ≈ 0 atol = 100 * eps(FT) end # Visualize the solution diff --git a/src/utils/utilities.jl b/src/utils/utilities.jl index 06a248bbae..7186d68ef8 100644 --- a/src/utils/utilities.jl +++ b/src/utils/utilities.jl @@ -16,13 +16,6 @@ is_tracer_var(symbol) = !( is_turbconv_var(symbol) ) -has_no_source_or_sink(parsed_args) = all(( - isnothing(parsed_args["forcing"]), - parsed_args["vert_diff"] == "false", - isnothing(parsed_args["turbconv"]), - isnothing(parsed_args["precip_model"]), -)) - # we may be hitting a slow path: # https://stackoverflow.com/questions/14687665/very-slow-stdpow-for-bases-very-close-to-1 fast_pow(x, y) = exp(y * log(x))