Skip to content

Commit

Permalink
optional arg for default diagnostics
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexisRenchon committed Aug 5, 2024
1 parent 5197e47 commit eb00eba
Show file tree
Hide file tree
Showing 2 changed files with 147 additions and 63 deletions.
18 changes: 14 additions & 4 deletions src/diagnostics/default_diagnostics.jl
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ function default_diagnostics(land_model::BucketModel, t_start; output_writer)
"wsoil",
"wsfc",
"ssfc",
] # TO DO: would it be helpful to return this list?
]

default_outputs =
hourly_averages(bucket_diagnostics...; output_writer, t_start)
Expand All @@ -75,6 +75,7 @@ function default_diagnostics(
t_start;
output_writer,
output_vars = :long,
average_period = :hourly,
)

define_diagnostics!(land_model)
Expand All @@ -96,7 +97,7 @@ function default_diagnostics(
"gs",
"mt",
"trans",
"rain", # do we want?
"rain",
"an",
"gpp",
"rd",
Expand All @@ -118,8 +119,17 @@ function default_diagnostics(
soilcanopy_diagnostics = ["gpp", "ct", "ai", "slw", "si"]
end

default_outputs =
hourly_averages(soilcanopy_diagnostics...; output_writer, t_start)
if average_period == :hourly
default_outputs =
hourly_averages(soilcanopy_diagnostics...; output_writer, t_start)
elseif average_period == :daily
default_outputs =
daily_averages(soilcanopy_diagnostics...; output_writer, t_start)
elseif average_period == :monthly # !! this is currently 30 days, not exact month
default_outputs =
monthly_averages(soilcanopy_diagnostics...; output_writer, t_start)
end

return [default_outputs...]
end

Expand Down
Loading

0 comments on commit eb00eba

Please sign in to comment.