Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexisRenchon committed Aug 29, 2024
1 parent 7b9a2dd commit 4be6996
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions test/diagnostics/diagnostics_tests.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using Test
using ClimaLand
using ClimaLand.Diagnostics: @with_error

@test isdefined(ClimaLand.Diagnostics, :compute_albedo!)

Expand All @@ -9,7 +10,22 @@ using ClimaLand
)

# Define some diagnostics for a DummyModel

@test ClimaLand.Diagnostics.ALL_DIAGNOSTICS isa Dict
@test length(ClimaLand.Diagnostics.ALL_DIAGNOSTICS) == 0
struct DummyModel end
ClimaLand.Diagnostics.@diagnostic_compute "albedo" DummyModel p.foo.bar

ClimaLand.Diagnostics.add_diagnostic_variable!(
short_name = "alpha",
long_name = "Albedo",
standard_name = "albedo",
units = "",
compute! = (out, Y, p, t) -> compute_albedo!(out, Y, p, t, land_model),
)

@test length(ClimaLand.Diagnostics.ALL_DIAGNOSTICS) == 1

ClimaLand.Diagnostics.define_diagnostics!(DummyModel())

# Just to trigger the error
Expand Down

0 comments on commit 4be6996

Please sign in to comment.