Newer
Older
context("DCPP successfull retrieved for depends and across parameters.")
test_that("Chunks of DCPP files- Local execution", {
path <- '/esarchive/exp/CMIP6/dcppA-hindcast/hadgem3-gc31-mm/cmip6-dcppA-hindcast_i1p1/DCPP/MOHC/HadGEM3-GC31-MM/dcppA-hindcast/r1i1p1f2/Omon/tos/gn/v20200417/$var$_Omon_HadGEM3-GC31-MM_dcppA-hindcast_s$sdate$-r1i1p1f2_gn_$chunk$.nc'
sdates <- c('2017', '2018')
dat <- Start(dat = path,
var = 'tos',
sdate = sdates,
chunk = indices(3:5),
chunk_depends = 'sdate',
time = 'all',
i = indices(1:10),
j = indices(1:10),
time_across = 'chunk',
merge_across_dims = TRUE,
retrieve = TRUE,
return_vars = list(time = 'sdate'))
one <- Start(dat = '/esarchive/exp/CMIP6/dcppA-hindcast/hadgem3-gc31-mm/cmip6-dcppA-hindcast_i1p1/DCPP/MOHC/HadGEM3-GC31-MM/dcppA-hindcast/r1i1p1f2/Omon/tos/gn/v20200417/$var$_Omon_HadGEM3-GC31-MM_dcppA-hindcast_s2018-r1i1p1f2_gn_202201-202212.nc',
var = 'tos', time = 'all', i = indices(1:10), j = indices(1:10),
retrieve = TRUE)
expect_equal(dat[1,1,2,25:36,,], one[1,1,,,])
})