diff --git a/src/diagnostics/diagnostic.jl b/src/diagnostics/diagnostic.jl index dfa3e83894..cf589e3736 100644 --- a/src/diagnostics/diagnostic.jl +++ b/src/diagnostics/diagnostic.jl @@ -152,8 +152,14 @@ function add_diagnostic_variable!(; comments = "", compute!, ) - haskey(ALL_DIAGNOSTICS, short_name) && - error("diagnostic $short_name already defined") + haskey(ALL_DIAGNOSTICS, short_name) && @warn( + "overwriting diagnostic `$short_name` entry containing fields\n" * + "$(map( + field -> "$(getfield(ALL_DIAGNOSTICS[short_name], field))", + filter(field -> field != :compute!, fieldnames(DiagnosticVariable)), + ))" + ) + ALL_DIAGNOSTICS[short_name] = DiagnosticVariable(; short_name,