library(startR)

var = "siextentn"
reg= "Northern_Hemisphere"
chunk_list_HISTORICAL = c()
        for (year in YEAR1:YEAR2) {
          year_2 = year + 1
          chunk_list_HISTORICAL = c(chunk_list_HISTORICAL, paste(year,'01','-',year_2,'12',sep=''))
        }
        
        if (year2 == 2012) {
          chunk_list_HISTORICAL = c(chunk_list_HISTORICAL, "201301-201412")
        }

YEAR1 = 1988 
  YEAR2 = 2012
path_INI_a22q = paste(
  '/esarchive/exp/ecearth/a22q/cmorfiles/EC-Earth-Consortium/EC-Earth3-LR/historical/S19700101/',
  'day/seaIce/$var$/$member$/v20190201/$var$_day_EC-Earth3-LR_historical_$sdate$_$member$_$chunk$.nc',sep='')

path_INI_a22q = paste0(
 '/esarchive/exp/ecearth/a22q/cmorfiles/EC-Earth-Consortium/EC-Earth3-LR/historical/S19700101/day/',
 'day/seaIce/$var$/$member$/v20190201/$var$_day_EC-Earth3-LR_historical_$sdate$_$member$_$chunk$.nc')
Data_INI_a22q = Start(dataset = path_INI_a22q,
                                #region = c(reg), 
                                #region_var = 'region',
                                var = var, 
                                member = paste0('r', 5, 'i1p1'),  #1:5
                                sdate = '19700101',
                                time = 'all',
                                chunk = chunk_list_HISTORICAL,
                                chunk_depends = 'sdate', 
                                time_across = 'chunk',
                                return_vars = list(region = NULL),
                                retrieve = TRUE,
                                path_glob_permissive = TRUE)


