Skip to content

Commit

Permalink
find_met_files 23hr bug (#110)
Browse files Browse the repository at this point in the history
* modulo 24 for 23rd hour

* removed check for minutes greater than 0
  • Loading branch information
jmineau authored Mar 4, 2025
1 parent b7d9b6d commit 0f9ff18
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions r/src/find_met_files.r
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 0f9ff18

Please sign in to comment.