From edd4fd843fb32f33a7e1ca9e848f99883b0cae08 Mon Sep 17 00:00:00 2001 From: Zhaoyi Shen <11598433+szy21@users.noreply.github.com> Date: Tue, 20 Aug 2024 13:49:59 -0700 Subject: [PATCH] use linear interpolation in leaderboard --- experiments/ClimaEarth/run_amip.jl | 5 +++-- experiments/ClimaEarth/user_io/leaderboard/utils.jl | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/experiments/ClimaEarth/run_amip.jl b/experiments/ClimaEarth/run_amip.jl index 5b13e7aacb..d70cb4c4a4 100644 --- a/experiments/ClimaEarth/run_amip.jl +++ b/experiments/ClimaEarth/run_amip.jl @@ -944,7 +944,7 @@ if ClimaComms.iamroot(comms_ctx) "pr" => (-5.0, 5.0), "rsut" => (-50.0, 50.0), "rlut" => (-50.0, 50.0), - "rsdt" => (-10.0, 10.0), + "rsdt" => (-2.0, 2.0), "rsutcs" => (-20.0, 20.0), "rlutcs" => (-20.0, 20.0), ) @@ -957,7 +957,8 @@ if ClimaComms.iamroot(comms_ctx) diagnostics_times = ClimaAnalysis.times(first_var) # Remove the first `spinup_months` months from the leaderboard spinup_months = 6 - spinup_cutoff = spinup_months * 30 * 86400.0 + # The monthly average output is at the end of the month, so this is safe + spinup_cutoff = spinup_months * 31 * 86400.0 if diagnostics_times[end] > spinup_cutoff filter!(x -> x > spinup_cutoff, diagnostics_times) end diff --git a/experiments/ClimaEarth/user_io/leaderboard/utils.jl b/experiments/ClimaEarth/user_io/leaderboard/utils.jl index 0a42b5d4c8..bf6472f75f 100644 --- a/experiments/ClimaEarth/user_io/leaderboard/utils.jl +++ b/experiments/ClimaEarth/user_io/leaderboard/utils.jl @@ -37,7 +37,7 @@ function resample( vec_to_range(v) = range(v[begin], v[end], length = length(v)) src_lonlat_ranges = vec_to_range.(src_lonlat) - itp = Interpolations.constant_interpolation( + itp = Interpolations.linear_interpolation( src_lonlat_ranges, data, extrapolation_bc = (Interpolations.Periodic(), Interpolations.Flat()),