diff --git a/src/InputOutput/writers.jl b/src/InputOutput/writers.jl index 29486ea897..673663477f 100644 --- a/src/InputOutput/writers.jl +++ b/src/InputOutput/writers.jl @@ -59,7 +59,9 @@ function HDF5Writer( else file = h5open(filename, mode, context.mpicomm) end - write_attribute(file, "ClimaCore version", string(VERSION)) + # Add an attribute to the file if it doesn't already exist + haskey(attributes(file), "ClimaCore version") || + write_attribute(file, "ClimaCore version", string(VERSION)) cache = Dict{String, String}() return HDF5Writer(file, context, cache) end