Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in
  • startR startR
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 29
    • Issues 29
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 6
    • Merge requests 6
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Artifacts
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Earth SciencesEarth Sciences
  • startRstartR
  • Merge requests
  • !248

Update Use Cases 1.13 and 2.6 to fix error in time addition

  • Review changes

  • Download
  • Patches
  • Plain diff
Merged vagudets requested to merge fix-usecase_1_13 into master Apr 10, 2025
  • Overview 0
  • Commits 2
  • Pipelines 2
  • Changes 2

The generation of the times array in use case 1.13 case 1 was returning an error:

library(lubridate)

# Case 1: 'time' depends on 'sdate'
repos <- '/esarchive/exp/ecmwf/system4_m1/daily_mean/$var$_f24h/$var$_$sdate$.nc'

sdates <- ymd("20010501") + rep(years(0:2), each = 1)
times <- array(ymd("20010501") + days(0:30) + rep(years(0:2), each = 31),
               dim = c(time = 31, sdate = 3))
# Error in C_time_add(out, periods, roll_month, roll_dst) : 
#   time_add: length of datetime vector must be 1 or match the length of updating vectors

This has now been changed to use sapply to generate the times array with the correct dimensions.

The data has also been updated to use a more recent system.

A similar fix was needed in use case 2.6.

Edited Apr 10, 2025 by vagudets
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: fix-usecase_1_13