From 9e9314878329d2afeff1558fe2112cf9598e493a Mon Sep 17 00:00:00 2001 From: nefrathenrici Date: Tue, 5 Dec 2023 10:55:20 -0800 Subject: [PATCH 1/2] Add `SampleSuccGauss()` EKP failure handler --- src/ekp_interface.jl | 1 + 1 file changed, 1 insertion(+) diff --git a/src/ekp_interface.jl b/src/ekp_interface.jl index 51d477e5..dd0215a6 100644 --- a/src/ekp_interface.jl +++ b/src/ekp_interface.jl @@ -56,6 +56,7 @@ function initialize( Γ, EKP.Inversion(); rng = rng_ekp, + failure_handler_method = EKP.SampleSuccGauss(), ) save_parameter_ensemble( From 5f03aef4c127de463fcea6516b66629b8e5d56e4 Mon Sep 17 00:00:00 2001 From: nefrathenrici Date: Tue, 5 Dec 2023 13:31:54 -0800 Subject: [PATCH 2/2] Fill crashed simulation with NaNs --- src/atmos_interface.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/atmos_interface.jl b/src/atmos_interface.jl index cc843d34..196f544b 100644 --- a/src/atmos_interface.jl +++ b/src/atmos_interface.jl @@ -48,7 +48,7 @@ function run_forward_model(atmos_config::CA.AtmosConfig) integrator = CA.get_integrator(atmos_config) sol_res = CA.solve_atmos!(integrator) if sol_res.ret_code == :simulation_crashed - # TODO: Handle error properly - overwrite data + !isnothing(sol_res.sol) && sol_res.sol .= eltype(sol_res.sol)(NaN) error( "The ClimaAtmos simulation has crashed. See the stack trace for details.", )