CST_Load_s2dv <- function (...) {
    library(s2dv) # Load
    library(utils)
    library(zeallot)
    library(CSTools) # as.s2dv_cube

        exp <- Load(...)
        result <- as.s2dv_cube(exp)
        result
}


# example of use 
#
# path_ERA5prlr_CDS <- list(path = '/esarchive/recon/ecmwf/era5land/$STORE_FREQ$_mean/$VAR_NAME$_f1h/$VAR_NAME$_$YEAR$$MONTH$.nc')
#
# year_in <- 2010
# year_fi <- 2013
# month_in <- 1
# month_fi <- 12
#
# sdates <- paste0(year_in:year_fi, '0101')
#
# source("https://earth.bsc.es/gitlab/nperez/Flor/-/raw/allabres-master-patch-42702/CST_Load_devel_from_s2dv.R")
#
# loaded_obs <- CST_Load_s2dv(var = 'prlr', 
#                            exp = NULL, 
#                            obs = list(path_ERA5prlr_CDS), 
#                            sdates = sdates,
#                            lonmax = 353, lonmin = 352.25,
#                            latmax = 41.75, latmin = 41, 
#                            storefreq = 'monthly', 
#                            leadtimemin = month_in, leadtimemax = month_fi, 
#                            output = "lonlat")
#
#> dim(loaded_obs$data)
#dataset  member   sdate   ftime     lat     lon
#      1       1       4      12       8       8
