From 0f9ff18b7fbba7e4bde00c679676cd3a35a61024 Mon Sep 17 00:00:00 2001 From: James Mineau <60365712+jmineau@users.noreply.github.com> Date: Tue, 4 Mar 2025 00:08:40 -0700 Subject: [PATCH] find_met_files 23hr bug (#110) * modulo 24 for 23rd hour * removed check for minutes greater than 0 --- r/src/find_met_files.r | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/r/src/find_met_files.r b/r/src/find_met_files.r index 732aff7..87d85fc 100644 --- a/r/src/find_met_files.r +++ b/r/src/find_met_files.r @@ -31,8 +31,7 @@ find_met_files <- function(t_start, n_hours, met_path, met_end <- max(sim_start, sim_end) met_end_ceil <- ceiling_date(met_end, unit = met_file_tres) if (n_hours < 0 - && hour(met_end) == hour(met_end_ceil) - 1 - && minute(met_end) > 0) { + && (hour(met_end) + 1) %% 24 == hour(met_end_ceil)) { # If the end time is at the end of a met file, # add an hour to the end time to include the next file. # This is necessary to interpolate the last hour of data.