Skip to content

Commit

Permalink
Fix rtol in ice calibration test
Browse files Browse the repository at this point in the history
  • Loading branch information
trontrytel committed Oct 9, 2024
1 parent 1501b09 commit 17687b5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion test/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
15 changes: 7 additions & 8 deletions test/ice_nucleation_calibration.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 17687b5

Please sign in to comment.