Skip to content

Commit

Permalink
Fix warning in thirtymin_insts
Browse files Browse the repository at this point in the history
  • Loading branch information
Sbozzolo committed Jan 31, 2024
1 parent 01e2561 commit c693763
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 6 deletions.
6 changes: 0 additions & 6 deletions src/diagnostics/default_diagnostics.jl
Original file line number Diff line number Diff line change
Expand Up @@ -238,9 +238,6 @@ function default_diagnostics(::PrognosticEDMFX, t_end; output_writer)
"lmix",
]

thirtymin_insts(short_names...; output_writer) =
common_diagnostics(30 * 60, nothing, output_writer, short_names...;)

edmfx_draft_diagnostics = [
"arup",
"rhoaup",
Expand Down Expand Up @@ -310,9 +307,6 @@ function default_diagnostics(::DiagnosticEDMFX, t_end; output_writer)
"lmix",
]

thirtymin_insts(short_names...; output_writer) =
common_diagnostics(30 * 60, nothing, output_writer, short_names...;)

diagnostic_edmfx_draft_diagnostics = [
"arup",
"rhoaup",
Expand Down
27 changes: 27 additions & 0 deletions src/diagnostics/standard_diagnostic_frequencies.jl
Original file line number Diff line number Diff line change
Expand Up @@ -218,3 +218,30 @@ Return a `ScheduledDiagnostics` that computes the hourly average for the given v
"""
hourly_average(short_names; output_writer) =
hourly_averages(short_names; output_writer)[1]

"""
thirtymin_insts(short_names...; output_writer)
Return a `ScheduledDiagnostics` that outputs the instantaneous value for the given variables
every 30 minutes.
"""
function thirtymin_insts(short_names...; output_writer)
period = 30 * 60
return [
ScheduledDiagnosticTime(
variable = get_diagnostic_variable(short_name),
compute_every = period,
output_every = period, # seconds
output_writer = output_writer,
) for short_name in short_names
]
end

"""
hourly_average(short_names...; output_writer)
Return a `ScheduledDiagnostics` that outputs the instantaneous value for the given variable
every 30 minutes.
"""
thirtymin_inst(short_names; output_writer) =
thirtymin_insts(short_names; output_writer)[1]

0 comments on commit c693763

Please sign in to comment.