diff --git a/calibration/experiments/sphere_held_suarez_rhoe_equilmoist/model_interface.jl b/calibration/experiments/sphere_held_suarez_rhoe_equilmoist/model_interface.jl index 512e796e57b..35b080a29e7 100644 --- a/calibration/experiments/sphere_held_suarez_rhoe_equilmoist/model_interface.jl +++ b/calibration/experiments/sphere_held_suarez_rhoe_equilmoist/model_interface.jl @@ -46,7 +46,6 @@ function run_forward_model(atmos_config::CA.AtmosConfig) simulation = CA.get_simulation(atmos_config) sol_res = CA.solve_atmos!(simulation) if sol_res.ret_code == :simulation_crashed - !isnothing(sol_res.sol) && sol_res.sol .= NaN error( "The ClimaAtmos simulation has crashed. See the stack trace for details.", ) diff --git a/calibration/model_interface.jl b/calibration/model_interface.jl index e943dc042f0..93ea5fd63f6 100644 --- a/calibration/model_interface.jl +++ b/calibration/model_interface.jl @@ -1,3 +1,10 @@ +# When Julia 1.10+ is used interactively, stacktraces contain reduced type information to make them shorter. +# On the other hand, the full type information is printed when julia is not run interactively. +# Given that ClimaCore objects are heavily parametrized, non-abbreviated stacktraces are hard to read, +# so we force abbreviated stacktraces even in non-interactive runs. +# (See also Base.type_limited_string_from_context()) +redirect_stderr(IOContext(stderr, :stacktrace_types_limited => Ref(false))) + import ClimaAtmos as CA import YAML import ClimaComms @@ -61,7 +68,6 @@ function run_forward_model(atmos_config::CA.AtmosConfig) simulation = CA.get_simulation(atmos_config) sol_res = CA.solve_atmos!(simulation) if sol_res.ret_code == :simulation_crashed - !isnothing(sol_res.sol) && sol_res.sol .= NaN error( "The ClimaAtmos simulation has crashed. See the stack trace for details.", ) diff --git a/calibration/test/e2e_test.jl b/calibration/test/e2e_test.jl index 603cecf0ec4..f3ffee8042e 100644 --- a/calibration/test/e2e_test.jl +++ b/calibration/test/e2e_test.jl @@ -17,14 +17,14 @@ import Statistics: var, mean using Test # Paths and setup -experiment_dir = joinpath(pkgdir(CA), "calibration", "test") -model_interface = joinpath(pkgdir(CA), "calibration", "model_interface.jl") +const experiment_dir = joinpath(pkgdir(CA), "calibration", "test") +const model_interface = joinpath(pkgdir(CA), "calibration", "model_interface.jl") +const output_dir = joinpath("output", "calibration_end_to_end_test") include(model_interface) # Observation map function CAL.observation_map(iteration) ensemble_size = 10 - output_dir = "calibration_end_to_end_test" single_member_dims = (1,) G_ensemble = Array{Float64}(undef, single_member_dims..., ensemble_size) @@ -67,7 +67,6 @@ noise = 0.1 * I n_iterations = 3 ensemble_size = 10 prior = CAL.get_prior(joinpath(experiment_dir, "prior.toml")) -output_dir = "calibration_end_to_end_test" experiment_config = CAL.ExperimentConfig(; n_iterations, ensemble_size, @@ -94,7 +93,7 @@ if !(@isdefined backend) end @info "Running calibration E2E test" backend if backend <: CAL.SlurmBackend - slurm_kwargs = CAL.kwargs(time = 10) + slurm_kwargs = CAL.kwargs(time = 15) test_eki = CAL.calibrate( backend, experiment_config; diff --git a/calibration/test/model_config.yml b/calibration/test/model_config.yml index d36b49d5162..45272f69669 100644 --- a/calibration/test/model_config.yml +++ b/calibration/test/model_config.yml @@ -4,7 +4,7 @@ config: column h_elem: 1 insolation: timevarying job_id: calibration_end_to_end_test -output_dir: calibration_end_to_end_test +output_dir: output/calibration_end_to_end_test output_default_diagnostics: false dt_rad: 6hours rad: clearsky