source("/esarchive/scratch/nperez/git/cstools/R/CST_MergeDims.R")
library(testthat)
 exp <- 1 : 60
 dim(exp) <- c(time = 10, lat = 2, lon = 3)
 exp <- list(data = exp)
 class(exp) <- 's2dv_cube'
 dim(exp$data)
 new_data <- CST_MergeDims(data = exp, merge_dims = c('time', 'lat'))
 dim(new_data$data)
 new_data <- CST_MergeDims(data = exp, merge_dims = c('lat', 'time'))
 dim(new_data$data)
 new_data <- CST_MergeDims(data = exp, merge_dims = c('time', 'lat'),
                           drop = TRUE)
 dim(new_data$data)
 new_data <- CST_MergeDims(data = exp, merge_dims = c('lat', 'time'), 
                           drop = TRUE)
 dim(new_data$data)


exp <- 1 : 60
 dim(exp) <- c(lat = 10, time = 2, lon = 3)
 exp <- list(data = exp)
 class(exp) <- 's2dv_cube'
 dim(exp$data)
 new_data <- CST_MergeDims(data = exp, merge_dims = c('time', 'lat'), drop = TRUE)
 dim(new_data$data)


data <- exp$data



