Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexisRenchon committed Jun 14, 2024
1 parent ca0e570 commit b63c8b5
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 5 deletions.
21 changes: 19 additions & 2 deletions src/Diagnostics/bucket_compute_methods.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,25 @@
error_diagnostic_variable(variable, land_model::T) where {T} =
error("Cannot compute $variable with model = $T")

#compute_soil_temperature!(_, _, _, _, model::T) where {T} =
# error_diagnostic_variable("soil_temperature", model)
macro generate_error_functions(function_names...)
functions = Expr[]
for function_name in function_names
function_name_sym = Symbol("compute_", function_name, "!")
body = quote
function $function_name_sym(_, _, _, _, land_model)
error_diagnostic_variable($(Symbol(function_name)), land_model)
end
end
push!(functions, body)
end
return quote
$(functions...)
end
end

@generate_error_functions "albedo" "net_radiation" "surface_temperature" "surface_specific_humidity" "latent_heat_flux" "aerodynamic_resistance" "sensible_heat_flux" "vapor_flux" "surface_air_density" "soil_temperature" "subsurface_water_storage" "surface_water_content" "snow_water_equivalent"

#=
compute_albedo!(_, _, _, _, land_model) =
error_diagnostic_variable("albedo", land_model)
compute_net_radiation!(_, _, _, _, land_model) =
Expand All @@ -31,6 +47,7 @@ compute_surface_water_content!(_, _, _, _, land_model) =
error_diagnostic_variable("surface_water_content", land_model)
compute_snow_water_equivalent!(_, _, _, _, land_model) =
error_diagnostic_variable("snow_water_equivalent", land_model)
=#

# stored in p

Expand Down
1 change: 0 additions & 1 deletion src/Diagnostics/diagnostic.jl
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ function add_diagnostic_variable!(;
))"
)


ALL_DIAGNOSTICS[short_name] = DiagnosticVariable(;
short_name,
long_name,
Expand Down
2 changes: 0 additions & 2 deletions src/Diagnostics/standard_diagnostic_frequencies.jl
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,6 @@ daily_maxs(short_names...; output_writer, t_start) = common_diagnostics(
"""
daily_max(short_names; output_writer, t_start)
Return a `ScheduledDiagnostics` that computes the daily max for the given variable.
"""
daily_max(short_names; output_writer, t_start) =
Expand Down Expand Up @@ -234,7 +233,6 @@ hourly_mins(short_names...; output_writer, t_start) = common_diagnostics(
"""
hourly_mins(short_names...; output_writer, t_start)
Return a `ScheduledDiagnostics` that computes the hourly min for the given variable.
"""
hourly_min(short_names; output_writer, t_start) =
Expand Down

0 comments on commit b63c8b5

Please sign in to comment.