From 8f0f00029a073821cf914f983f7d7b12f07316cd Mon Sep 17 00:00:00 2001 From: Haakon Ludvig Langeland Ervik <45243236+haakon-e@users.noreply.github.com> Date: Tue, 29 Oct 2024 00:52:58 +0000 Subject: [PATCH 1/4] fix indivisible reduction periods warning --- src/solver/type_getters.jl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/solver/type_getters.jl b/src/solver/type_getters.jl index da5ea1128f..52c41d4f76 100644 --- a/src/solver/type_getters.jl +++ b/src/solver/type_getters.jl @@ -774,10 +774,12 @@ function get_simulation(config::AtmosConfig) if checkpoint_frequency != Inf if any( - x -> !CA.isdivisible(checkpoint_frequency, x), + x -> !CA.isdivisible(x, checkpoint_frequency), periods_reductions, ) - @warn "Some accumulated diagnostics might not be evenly divisible by the checkpointing frequency ($(CA.promote_period(checkpoint_frequency)))" + accum_str = join(CA.promote_period.(collect(periods_reductions)), ", ") + checkpt_str = CA.promote_period(checkpoint_frequency) + @warn "Diagnostics are accumulated at frequencies ($accum_str), which may not be evenly divisible by the checkpointing frequency (dt_save_state_to_disk = $checkpt_str)" end end else From 63815a1d5e7a0cf058d3bc867dc5f8e11cb5298c Mon Sep 17 00:00:00 2001 From: Haakon Ludvig Langeland Ervik <45243236+haakon-e@users.noreply.github.com> Date: Tue, 29 Oct 2024 01:01:14 +0000 Subject: [PATCH 2/4] format --- src/solver/type_getters.jl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/solver/type_getters.jl b/src/solver/type_getters.jl index 52c41d4f76..bcd3568922 100644 --- a/src/solver/type_getters.jl +++ b/src/solver/type_getters.jl @@ -777,7 +777,8 @@ function get_simulation(config::AtmosConfig) x -> !CA.isdivisible(x, checkpoint_frequency), periods_reductions, ) - accum_str = join(CA.promote_period.(collect(periods_reductions)), ", ") + accum_str = + join(CA.promote_period.(collect(periods_reductions)), ", ") checkpt_str = CA.promote_period(checkpoint_frequency) @warn "Diagnostics are accumulated at frequencies ($accum_str), which may not be evenly divisible by the checkpointing frequency (dt_save_state_to_disk = $checkpt_str)" end From 2dfe0b6b2c2f921eb4fd8fb197cd959c399a229f Mon Sep 17 00:00:00 2001 From: Haakon Ludvig Langeland Ervik <45243236+haakon-e@users.noreply.github.com> Date: Tue, 29 Oct 2024 01:03:51 +0000 Subject: [PATCH 3/4] format 2 --- src/solver/type_getters.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/solver/type_getters.jl b/src/solver/type_getters.jl index bcd3568922..ab25e4d643 100644 --- a/src/solver/type_getters.jl +++ b/src/solver/type_getters.jl @@ -777,7 +777,7 @@ function get_simulation(config::AtmosConfig) x -> !CA.isdivisible(x, checkpoint_frequency), periods_reductions, ) - accum_str = + accum_str = join(CA.promote_period.(collect(periods_reductions)), ", ") checkpt_str = CA.promote_period(checkpoint_frequency) @warn "Diagnostics are accumulated at frequencies ($accum_str), which may not be evenly divisible by the checkpointing frequency (dt_save_state_to_disk = $checkpt_str)" From d1833fa6772637deabd19a4ed9b71a315af38ad2 Mon Sep 17 00:00:00 2001 From: Haakon Ludvig Langeland Ervik <45243236+haakon-e@users.noreply.github.com> Date: Tue, 29 Oct 2024 01:31:15 +0000 Subject: [PATCH 4/4] warning wording --- src/solver/type_getters.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/solver/type_getters.jl b/src/solver/type_getters.jl index ab25e4d643..54e2398390 100644 --- a/src/solver/type_getters.jl +++ b/src/solver/type_getters.jl @@ -774,13 +774,13 @@ function get_simulation(config::AtmosConfig) if checkpoint_frequency != Inf if any( - x -> !CA.isdivisible(x, checkpoint_frequency), + x -> !CA.isdivisible(checkpoint_frequency, x), periods_reductions, ) accum_str = join(CA.promote_period.(collect(periods_reductions)), ", ") checkpt_str = CA.promote_period(checkpoint_frequency) - @warn "Diagnostics are accumulated at frequencies ($accum_str), which may not be evenly divisible by the checkpointing frequency (dt_save_state_to_disk = $checkpt_str)" + @warn "The checkpointing frequency (dt_save_state_to_disk = $checkpt_str) should be an integer multiple of all diagnostics accumulation periods ($accum_str) to simulations can be safely restarted from any checkpoint" end end else