library(easyNCDF)

  path <- paste0('/esarchive/exp/ecearth/i00k/monthly_mean/prc_f3h/',
                 'prc_Amon_EC-EARTH_decadal_S19771101_r5i1p1_198611-198702.nc')

  fnc <- NcOpen(path)
  fnc_dims <- NcReadDims(fnc)
  #var_names <- NcReadVarNames(fnc)
  #fnc_arr <- NcToArray(fnc, vars_to_read = 'prc')

  a <- NcToArray(fnc, dim_indices = list(time = c(1:4), var = 'prc',
                                         lat = c(1:29), lon = c(1:19)))
  dim(a)

  b <- NcToArray(fnc, dim_indices = list(lon = c(1:19), lat = c(1:29), 
                                         time = c(1:4), var = 'prc'))
  dim(b)


#-------------------------------
library(startR)

  repos <- "/esarchive/exp/ecmwf/system5_m1/monthly_mean/tas_f6h/$var$_$sdate$.nc"
  var <- 'tas'
  sdate <- c('20170101', '20170201')
  data <- Start(dat = repos,
                var = var, #c('tas', 'latitude', 'longitude'), #lat and lon are NANs
#                sdate = indices(1), #sdate,
                ensemble = indices(1),
#                time = indices(1), #'all',
                latitude = 'all', #indices(1:100),
                longitude = 'all', #indices(1:100),
                sdate = indices(1), #sdate,
                time = indices(1), #'all',
                return_vars = list(time = c('sdate'), longitude = NULL, latitude = NULL),
                retrieve = TRUE
               )

 lons <- unique(as.vector(attr(data, 'Variables')$common[["longitude"]]))
 lats <- unique(as.vector(attr(data, 'Variables')$common[["latitude"]]))
 PlotEquiMap(data, lons, lats)

