Skip to content

Commit

Permalink
Use descriptive_name in HDF5Writer
Browse files Browse the repository at this point in the history
  • Loading branch information
Sbozzolo committed Sep 6, 2023
1 parent 89ef341 commit 6f06881
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/diagnostics/Writers.jl
Original file line number Diff line number Diff line change
Expand Up @@ -118,12 +118,15 @@ function HDF5Writer()
# and the integrator
function write_to_hdf5(value, diagnostic, integrator)
var = diagnostic.variable
time = lpad(integrator.t, 10, "0")
red = isnothing(diagnostic.reduction_time_func) ? "" : diagnostic.reduction_time_func
time = integrator.t

# diagnostic here is a ScheduledDiagnosticIteration. If we want to obtain a
# descriptive name (e.g., something with "daily"), we have to pass the timestep as
# well

output_path = joinpath(
integrator.p.simulation.output_dir,
"$(var.short_name)_$(red)_$(time).h5",
"$(descriptive_name(diagnostic, integrator.simulation.p.dt)).h5",
)

hdfwriter = InputOutput.HDF5Writer(output_path, integrator.p.comms_ctx)
Expand Down

0 comments on commit 6f06881

Please sign in to comment.