diff --git a/R/Start.R b/R/Start.R index 56e9491e68bc689d8d0f1105ae2eb309dbc05130..ba01959a68970d2a35c09a917ce78a75d9df04cb 100644 --- a/R/Start.R +++ b/R/Start.R @@ -2538,7 +2538,9 @@ Start <- function(..., # dim = indices/selectors, print(file_dim) } } - #???????????????? + + # The inner dim selector is an array in which have file dim (e.g., time = [sdate = 2, time = 4], + # or the inner dim doesn't go across any file dim (e.g., no time_across = 'sdate') if ((!is.null(file_dim) && (file_dim %in% names(selector_file_dims))) || is.null(file_dim)) { if (length(sub_array_of_selectors) > 0) { if (debug) { @@ -3050,12 +3052,20 @@ Start <- function(..., # dim = indices/selectors, taken_chunks <- TRUE } } - } else { #???????????? + } else { + # The inner dim goes across a file dim (e.g., time_across = 'sdate') if (debug) { if (inner_dim %in% dims_to_check) { print("-> THE INNER DIMENSION GOES ACROSS A FILE DIMENSION.") } } + # If "_across = + merge_across_dims = FALSE + chunk over ", return error because this instance is not logically correct. + if (chunks[[inner_dim]]["n_chunks"] > 1 & inner_dim %in% inner_dims_across_files) { + stop("Chunk over dimension '", inner_dim, "' is not allowed because '", + inner_dim, "' is across '", + names(inner_dims_across_files)[which(inner_dim %in% inner_dims_across_files)], "'.") + } + if (inner_dim %in% names(dim(sub_array_of_selectors))) { if (is.null(var_with_selectors_name)) { if (any(na.omit(unlist(sub_array_of_selectors)) < 1) ||