Skip to content

Commit

Permalink
Allow accumulators to take Vector values
Browse files Browse the repository at this point in the history
.= does not work with Vector Fields, but parent() returns the underlying
data, so we can directly fill the array with the desired value
  • Loading branch information
Sbozzolo committed Sep 15, 2023
1 parent b6a9bda commit dbc5891
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/diagnostics/diagnostic.jl
Original file line number Diff line number Diff line change
Expand Up @@ -579,7 +579,7 @@ function reset_accumulator!(diag_accumulator, reduction_time_func)
identity = identity_of_reduction(reduction_time_func)
float_type = Spaces.undertype(axes((diag_accumulator)))
identity_ft = convert(float_type, identity)
diag_accumulator .= identity_ft
fill!(parent(diag_accumulator, identity_ft))
end

# When the reduction is nothing, we do not need to accumulate anything
Expand Down

0 comments on commit dbc5891

Please sign in to comment.