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 7
    • Merge requests 7
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • 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
  • Issues
  • #150
Closed
Open
Issue created May 06, 2022 by aho@ahoMaintainer

Error when return_vars is not used

A bug found in startR_2.2.0-1 when return_vars is not used.

ecmwf_path <- paste0('/esarchive/exp/ecmwf/s2s-monthly_ensforhc/',
                     'weekly_mean/$var$_f24h/$sdate$/$var$_$syear$.nc')
sdates.seq <- c("20160104", "20160107")

exp <- Start(dat = ecmwf_path, 
              var = 'tas',
              sdate = sdates.seq,
              syear = 'all',   
              time = 'all',
              ensemble = indices(1),
              latitude = indices(1),
              longitude = indices(1),
              syear_depends = 'sdate',
              return_vars = list(latitude = NULL,
                                 longitude = NULL,
                                 time = c('sdate', 'syear')), 
              retrieve = FALSE)

dates <- attr(exp, 'Variables')$common$time   
file_date <- sapply(dates, format, '%Y%m%d')
dim(file_date) <- dim(dates)

obs_path <- paste0("/esarchive/recon/ecmwf/era5/weekly_mean/",
                   "$var$_f1h-240x121/$var$_$file_date$.nc")

obs <- Start(dat = obs_path,
             var = 'tas',
             file_date = file_date,  
             latitude = indices(1),
             longitude = indices(1),
             split_multiselected_dims = TRUE,
 #            return_vars = list(time = 'file_date'),
             retrieve = FALSE)

If return_vars is not used, this error returns:

Error in which(unlist(lapply(picked_common_vars, tmp_fun, names(all_split_dims)))) : argument to 'which' is not logical

In startR_2.2.0, it works well.

FYI @nperez

Assignee
Assign to
Time tracking