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
  • #92
Closed
Open
Issue created Feb 25, 2021 by Carlos Delgado Torres@cdelgadoMaintainer

Error reading the calendar when using synonims

Hi @nperez and @aho,

I'm getting the following error when trying to read data with Start() using a synonym for the time dimension:

Error in if (calendar == "standard") calendar <- "gregorian": argument is of length zero

This is the simplified code I am using:

not_working <- Start(dataset = '/esarchive/exp/ecearth/a1ua/cmorfiles/DCPP/EC-Earth-Consortium/EC-Earth3/dcppA-hindcast/$member$/Omon/$var$/gr/v20190713/$var$_Omon_EC-Earth3_dcppA-hindcast_s$sdate$-$member$_gr_$fyear$.nc',
              var = 'tos',
              sdate = paste0(1960:1965),
              fmonth = c(1:122),
              lat = 'all', 
              lon = 'all',
              fyear = 'all', 
              member = 'all', 
              fyear_depends = 'sdate',
              fmonth_across = 'fyear', 
              merge_across_dims = TRUE,
              synonims = list(fmonth = c('fmonth','time')),
              return_vars = list(lat = 'dataset', lon = 'dataset'),
              num_procs = 1, retrieve = FALSE)

The same code without the synonym works (using time instead of fmonth):

working <- Start(dataset = '/esarchive/exp/ecearth/a1ua/cmorfiles/DCPP/EC-Earth-Consortium/EC-Earth3/dcppA-hindcast/$member$/Omon/$var$/gr/v20190713/$var$_Omon_EC-Earth3_dcppA-hindcast_s$sdate$-$member$_gr_$fyear$.nc',
              var = 'tos',
              sdate = paste0(1960:1965),
              time = c(1:122),
              lat = 'all', 
              lon = 'all',
              fyear = 'all', 
              member = 'all', 
              fyear_depends = 'sdate',
              time_across = 'fyear', 
              merge_across_dims = TRUE,
              # synonims = list(fmonth = c('fmonth','time')),
              return_vars = list(lat = 'dataset', lon = 'dataset'),
              num_procs = 1, retrieve = FALSE)

The error jumps in the line 202 of the NcDataReader.R (https://earth.bsc.es/gitlab/es/startR/-/blob/master/R/NcDataReader.R). I think it is because it tries to get the attributes of the time dimension, but there is not any dimension named time because of the use of the synonym. Could you please take a look?

Thank you very much,

Carlos

Assignee
Assign to
Time tracking