From 17687b58ce6c69115f1b8aeed28654a4deab9cd7 Mon Sep 17 00:00:00 2001 From: Anna Jaruga Date: Wed, 9 Oct 2024 11:56:17 -0700 Subject: [PATCH] Fix rtol in ice calibration test --- test/Project.toml | 2 +- test/ice_nucleation_calibration.jl | 15 +++++++-------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/test/Project.toml b/test/Project.toml index c72d8eea0..ea1fbf19c 100644 --- a/test/Project.toml +++ b/test/Project.toml @@ -32,6 +32,6 @@ Thermodynamics = "b60c26fb-14c3-4610-9d3e-2d17fe7ff00c" [compat] ClimaParams = "0.10.6" EnsembleKalmanProcesses = "1.1.5" -MLJFlux = "0.4" KernelAbstractions = "0.9" +MLJFlux = "0.4" Optim = "<1.9.3" diff --git a/test/ice_nucleation_calibration.jl b/test/ice_nucleation_calibration.jl index a87204ce9..cf90f688d 100644 --- a/test/ice_nucleation_calibration.jl +++ b/test/ice_nucleation_calibration.jl @@ -28,22 +28,21 @@ function test_J_calibration(FT, IN_mode) run_calibrated_model(FT, IN_mode, calibrated_parameters, params, IC) true_soln = run_calibrated_model(FT, IN_mode, coeff_true, params, IC) - - # test that coeffs are close to "true" values + # test that coeffs are close to "true" values and that end ICNC are similar if IN_mode == "ABDINM" TT.@test calibrated_parameters[1] ≈ coeff_true[1] rtol = FT(0.3) - TT.@test calibrated_parameters[2] ≈ coeff_true[2] atol = FT(3) + TT.@test calibrated_parameters[2] ≈ coeff_true[2] rtol = FT(1.5) + TT.@test calibrated_soln[9, end] ≈ true_soln[9, end] rtol = FT(0.3) elseif IN_mode == "ABIFM" TT.@test calibrated_parameters[1] ≈ coeff_true[1] rtol = FT(0.3) - TT.@test calibrated_parameters[2] ≈ coeff_true[2] atol = FT(7) + TT.@test calibrated_parameters[2] ≈ coeff_true[2] rtol = FT(0.3) + TT.@test calibrated_soln[9, end] ≈ true_soln[9, end] rtol = FT(0.3) elseif IN_mode == "ABHOM" TT.@test calibrated_parameters[1] ≈ coeff_true[1] rtol = FT(0.3) - TT.@test calibrated_parameters[2] ≈ coeff_true[2] atol = FT(20) + TT.@test calibrated_parameters[2] ≈ coeff_true[2] rtol = FT(0.3) + TT.@test calibrated_soln[9, end] ≈ true_soln[9, end] rtol = FT(0.3) end - # test that resulting ICNC are similar - TT.@test (calibrated_soln[9, end] ./ (IC[7] + IC[8] + IC[9])) ≈ - (true_soln[9, end] ./ (IC[7] + IC[8] + IC[9])) rtol = FT(0.1) end @info "Ice Nucleation Calibration Test"