Skip to content

Commit

Permalink
adding a test while im at it
Browse files Browse the repository at this point in the history
  • Loading branch information
amylu00 committed Sep 11, 2024
1 parent 7b33069 commit cacf4b1
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion test/ice_nucleation_calibration.jl
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,11 @@ function test_J_calibration(FT, IN_mode)
perfect_model = true,
)
calibrated_parameters = [output[1], output[2]]
calibrated_soln = run_calibrated_model(FT, IN_mode, calibrated_parameters, params, IC)
true_soln = run_calibrated_model(FT, IN_mode, coeff_true, params, IC)

TT.@test calibrated_parameters[1] coeff_true[1] rtol = FT(0.2)

# test that coeffs are close to "true" values
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)
Expand All @@ -36,6 +39,9 @@ function test_J_calibration(FT, IN_mode)
TT.@test calibrated_parameters[1] coeff_true[1] rtol = FT(0.3)
TT.@test calibrated_parameters[2] coeff_true[2] atol = FT(20)
end

# test that resulting ICNC are similar
TT.@test calibrated_soln[end] true_soln[end] rtol = FT(0.1)
end

@info "Ice Nucleation Calibration Test"
Expand Down

0 comments on commit cacf4b1

Please sign in to comment.