Skip to content

ACCESS_NORA3: time axis subsetting fails for lead times 6-9 of the final run #39

Description

@ninaschuhen1

Description of the bug

The current subsetting of the time axis has a fixed upper boundary of 6 hours after DateStop, the initial time of the last run. This means that lead times 6-9 of the last run aren't being downloaded, as the file's time axis refers to the valid time of the data.

Reproducing the bug

library(ClimHub)
foo <- Access_NORA3(variable="wind_direction", dateStart="2026-01-01 00", dateStop="2026-01-01 00", extent=c(9.5, 10, 58.5, 59), leadTimeHour=9)
# Fails with "Error in x$find_by_name(i) : attempt to apply non-function"

Expected behavior

The returned value should be a CFDataset containing values for the time "2026-01-01 09". The upper boundary should be changed to 9 hours instead of 6, plus perhaps a small increment, as CFVariable$subset assumes an open right boundary.

Session Information

R version 4.5.2 (2025-10-31 ucrt)
Platform: x86_64-w64-mingw32/x64
Running under: Windows 11 x64 (build 26200)

Matrix products: default
  LAPACK version 3.12.1

locale:
[1] LC_COLLATE=English_Europe.utf8  LC_CTYPE=English_Europe.utf8   
[3] LC_MONETARY=English_Europe.utf8 LC_NUMERIC=C                   
[5] LC_TIME=English_Europe.utf8    

time zone: Europe/Oslo
tzcode source: internal

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] ClimHub_0.1.11

loaded via a namespace (and not attached):
 [1] viridis_0.6.5      tidyr_1.3.2        generics_0.1.4     class_7.3-23      
 [5] xml2_1.5.2         KernSmooth_2.23-26 stringi_1.8.7      hms_1.1.4         
 [9] magrittr_2.0.4     grid_4.5.2         timechange_0.4.0   RColorBrewer_1.1-3
[13] iterators_1.0.14   fastmap_1.2.0      foreach_1.5.2      jsonlite_2.0.0    
[17] progress_1.2.3     e1071_1.7-17       DBI_1.3.0          doSNOW_1.0.20     
[21] gridExtra_2.3      httr_1.4.8         rvest_1.0.5        selectr_0.5-1     
[25] purrr_1.2.1        viridisLite_0.4.3  scales_1.4.0       ncdfCF_0.8.2.9000 
[29] codetools_0.2-20   RNetCDF_2.11-1     abind_1.4-8        cli_3.6.5         
[33] rlang_1.1.7        crayon_1.5.3       units_1.0-1        cachem_1.1.0      
[37] otel_0.2.0         tools_4.5.2        parallel_4.5.2     ecmwfr_2.0.3      
[41] memoise_2.0.1      dplyr_1.2.0        ncdf4_1.24         ggplot2_4.0.2     
[45] curl_7.0.0         vctrs_0.7.2        R6_2.6.1           proxy_0.4-29      
[49] lifecycle_1.0.5    lubridate_1.9.5    classInt_0.4-11    stringr_1.6.0     
[53] pkgconfig_2.0.3    terra_1.9-1        pillar_1.11.1      gtable_0.3.6      
[57] glue_1.8.0         Rcpp_1.1.1         CFtime_1.7.2       sf_1.1-0          
[61] tibble_3.3.1       tidyselect_1.2.1   rstudioapi_0.18.0  farver_2.1.2      
[65] tidyterra_1.1.0    snow_0.4-4         compiler_4.5.2     prettyunits_1.2.0 
[69] S7_0.2.1          

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Fields

No fields configured for Bug.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions