From aa55f4069624b575c1a3da2032dd9a8a2fcd8929 Mon Sep 17 00:00:00 2001 From: aho Date: Fri, 21 Aug 2020 20:35:18 +0200 Subject: [PATCH 1/5] Create use case for using existing masks to do analysis --- inst/doc/usecase/ex2_10_existing_masks.R | 140 +++++++++++++++++++++++ 1 file changed, 140 insertions(+) create mode 100644 inst/doc/usecase/ex2_10_existing_masks.R diff --git a/inst/doc/usecase/ex2_10_existing_masks.R b/inst/doc/usecase/ex2_10_existing_masks.R new file mode 100644 index 0000000..d8757ca --- /dev/null +++ b/inst/doc/usecase/ex2_10_existing_masks.R @@ -0,0 +1,140 @@ +# Apply an existing mask file on data +# Author: An-Chi Ho +# ------------------------------------------------------------------ + + + +# A) Load mask file +mask_path <- '/esarchive/autosubmit/con_files/land_sea_mask_1x1_c3s.nc' + +mask <- Start(dat = mask_path, + var = 'LSM', + lat = 'all', + lon = 'all', + return_vars = list(var_names = NULL, + lat = NULL, lon = NULL), + var_var = 'var_names', + retrieve = F) + + +# B) Load data +data_path <- '/esarchive/exp/ecmwf/system5c3s/monthly_mean/$var$_f6h/$var$_$sdate$.nc' + +data <- Start(dat = data_path, + var = 'tos', + sdate = paste0(1991:2010, '0101'), + ensemble = 'all', + time = indices(1), + lat = 'all', + lon = 'all', + synonims = list(lat = c('lat', 'latitude'), + lon = c('lon', 'longitude')), + return_vars = list(lat = NULL, + lon = NULL, + time = 'sdate'), + retrieve = FALSE) + +# C) Build the workflow +reg_mask <- function(data, mask) { + # data: [sdate = 20, ensemble = 25] + # mask: [dat = 1] + if (mask == 1) { + trend <- s2dv::Trend(data, time_dim = 'sdate')$trend[2, , , ] + ind <- mean(data) + } else { + ind <- NA + } + return(ind) + +} + +step_mask <- Step(fun = reg_mask, + target_dims = list(data = c('dat', 'sdate', 'ensemble', 'time'), + mask = c('dat')), + output_dim = NULL) + +wf_mask <- AddStep(list(data, mask), step_mask) + +res <- Compute(workflow = wf_mask, + chunks = list(lat = 4, + lon = 4)) + + + +#================= Case 2 ================== +# A) Load mask file +mask_path <- '/esarchive/autosubmit/con_files/mask.regions.HadISST.nc' + +mask1 <- Start(dat = mask_path, + var = 'Baffin_Bay', # c('Grnland', 'Baffin_Bay'), + lat = 'all', + lon = 'all', + synonims = list(lat = c('lat', 'y'), + lon = c('lon', 'x')), + return_vars = list(var_names = NULL, + lat = NULL, lon = NULL), + var_var = 'var_names', + retrieve = F) + +mask2 <- Start(dat = mask_path, + var = 'Grnland', + lat = 'all', + lon = 'all', + synonims = list(lat = c('lat', 'y'), + lon = c('lon', 'x')), + return_vars = list(var_names = NULL, + lat = NULL, lon = NULL), + var_var = 'var_names', + retrieve = F) + + +# B) Load data +data_path <- '/esarchive/exp/gfdl-cm4/cmip6-piControl/monthly_mean/sic-lonlat/sic_$sdate$.nc' + +data <- Start(dat = data_path, + var = 'siconc', + sdate = paste0('0', 521:540, '0101'), + ensemble = 'all', + time = indices(1), + lat = 'all', + lon = 'all', + synonims = list(lat = c('lat', 'latitude'), + lon = c('lon', 'longitude')), + return_vars = list(lat = NULL, + lon = NULL, + time = 'sdate'), + retrieve = FALSE) + + +# C) Build the workflow +reg_mask <- function(data, mask1, mask2) { + # data: [sdate = 20, ensemble = 25] + # mask: [var = 2] +#--------Remove when s2dv::Trend is updated ------- + source('/esarchive/scratch/aho/Trend_tmp.R') +#----------------------------------------------- + + if (mask == 1 & mask2 == 1) { +#------------- Change when s2dv::Trend is updated ---------------- + trend <- Trend(data, time_dim = 'sdate')$trend[2, , , ] +# trend <- s2dv::Trend(data, time_dim = 'sdate')$trend[2, , , ] +#----------------------------------------------------------------- + ind <- mean(data) + } else { + ind <- NA + } + return(ind) + +} + +step_mask <- Step(fun = reg_mask, + target_dims = list(data = c('dat', 'sdate', 'ensemble', 'time'), + mask1 = c('dat'), + mask2 = c('dat')), + output_dim = NULL) + +wf_mask <- AddStep(list(data, mask1, mask2), step_mask) + +res <- Compute(workflow = wf_mask, + chunks = list(lat = 2, + lon = 2)) -- GitLab From cb13e04b4c18c57cd059281a74f60b2c40ea28b7 Mon Sep 17 00:00:00 2001 From: aho Date: Fri, 21 Aug 2020 20:35:52 +0200 Subject: [PATCH 2/5] Bugfix for metadata when retrieving two vars from one file --- R/Start.R | 14 +++++++-- tests/testthat/test-Start-metadata_dims.R | 36 +++++++++++++++++++++++ 2 files changed, 47 insertions(+), 3 deletions(-) diff --git a/R/Start.R b/R/Start.R index 6bf9e9e..8243fda 100644 --- a/R/Start.R +++ b/R/Start.R @@ -4218,9 +4218,17 @@ Start <- function(..., # dim = indices/selectors, } else { #(1) var_backup <- attr(data_array, 'Variables') - var_backup_name <- lapply(var_backup, names) - var_backup <- lapply(var_backup, '[[', 1) - names(var_backup) <- unlist(var_backup_name) + var_backup_names <- unlist(lapply(var_backup, names)) + new_list <- vector('list', length = length(var_backup_names)) + count <- 1 + for (kk in 1:length(var_backup)) { + for (jj in 1:length(var_backup[[kk]])) { + new_list[[count]] <- var_backup[[kk]][[jj]] + count <- count + 1 + } + } + names(new_list) <- var_backup_names + var_backup <- new_list } } attr(data_array, 'Variables') <- NULL diff --git a/tests/testthat/test-Start-metadata_dims.R b/tests/testthat/test-Start-metadata_dims.R index 00edd5d..b4ef3cf 100644 --- a/tests/testthat/test-Start-metadata_dims.R +++ b/tests/testthat/test-Start-metadata_dims.R @@ -291,5 +291,41 @@ test_that("5. Specify metadata_dims with another file dimension", { 12 ) +}) + + +test_that("6. One data set, two vars from one file", { +mask_path <- '/esarchive/autosubmit/con_files/mask.regions.Ec3.0_O1L46.nc' + +data <- Start(repos = mask_path, + var = c('nav_lon', 'nav_lat'), + t = 'first', + z = 'first', + x = 'all', + y = 'all', + return_vars = list(var_names = NULL), + var_var = 'var_names', + retrieve = T) + + expect_equal( + length(attr(data, 'Variables')), + 2 + ) + expect_equal( + names(attr(data, 'Variables')), + c("common", "dat1") + ) + expect_equal( + names(attr(data, 'Variables')$common), + c("var_names", "nav_lon", "nav_lat") + ) + expect_equal( + is.null(attr(data, 'Variables')$dat1), + TRUE + ) + expect_equal( + length(attr(data, 'Variables')$common$nav_lat), + 8 + ) }) -- GitLab From 4e12ffe0f88610c25fc521ed3058bb509133cda4 Mon Sep 17 00:00:00 2001 From: aho Date: Mon, 24 Aug 2020 12:22:29 +0200 Subject: [PATCH 3/5] Create use case for existing mask file --- inst/doc/usecase.md | 7 +- inst/doc/usecase/ex2_10_existing_mask.R | 171 +++++++++++++++++++++++ inst/doc/usecase/ex2_10_existing_masks.R | 140 ------------------- 3 files changed, 176 insertions(+), 142 deletions(-) create mode 100644 inst/doc/usecase/ex2_10_existing_mask.R delete mode 100644 inst/doc/usecase/ex2_10_existing_masks.R diff --git a/inst/doc/usecase.md b/inst/doc/usecase.md index e049eb7..4e44631 100644 --- a/inst/doc/usecase.md +++ b/inst/doc/usecase.md @@ -61,8 +61,11 @@ You can find more explanation in FAQ [How-to-20](inst/doc/faq.md#20-use-metadata Use `SpecsVerification::EnsCrps` to calculate the ensemble-adjusted Continuous Ranked Probability Score (CRPS) for ECWMF experimental data, and do ensemble mean. Use `s2dverification::PlotEquiMap` to plot the CRPS map. 8. [Use CSTools Calibration function](inst/doc/usecase/ex2_8_calibration.R) Use `CSTools:::.cal`, the interior function of `CSTools::CST_Calibration`, to do the bias adjustment for ECMWF experimental monthly mean data. - 9. [Use a mask to apply different methods to different gridpoints](inst/doc/usecase/ex2_9_mask.R) If you need to apply your analysis in a few gridpoints, you may want to consider use case 1.6, but if you need to load a lot of grid points, maybe this a better solution. - + 9. [Use a mask to apply different methods to different gridpoints](inst/doc/usecase/ex2_9_mask.R) + If you need to apply your analysis in a few gridpoints, you may want to consider use case 1.6, but if you need to load a lot of grid points, maybe this a better solution. + 10. [Apply an existing mask on data](inst/doc/usecase/ex2_10_existing_mask.R) + This use case shows you how to apply the existing mask file on your data. +If you need to create the mask file on your own, go to ex2_9_mask.R. diff --git a/inst/doc/usecase/ex2_10_existing_mask.R b/inst/doc/usecase/ex2_10_existing_mask.R new file mode 100644 index 0000000..fb41e17 --- /dev/null +++ b/inst/doc/usecase/ex2_10_existing_mask.R @@ -0,0 +1,171 @@ +# Author: An-Chi Ho +# Date: 24th Aug. 2020 +# ------------------------------------------------------------------ +# This use case shows you how to apply the existing mask file on your data. +# Case 1 is a land-sea mask, and case 2 is a mask file containing several +# region's mask. +# If you need to create the mask file on your own, go to ex2_9_mask.R + + +#================= Case 1 ================== +# Goal: Apply a land-sea mask on tas data. Because the mask is tailored for +# system5c3s data, the latitude and longitude of the mask and data +# have matched already. + +# A) Load mask file +mask_path <- '/esarchive/autosubmit/con_files/land_sea_mask_1x1_c3s.nc' + +mask <- Start(dat = mask_path, + var = 'LSM', + lat = 'all', + lon = 'all', + return_vars = list(var_names = NULL, + lat = NULL, lon = NULL), + var_var = 'var_names', + retrieve = F) + + +# B) Load data +data_path <- '/esarchive/exp/ecmwf/system5c3s/monthly_mean/$var$_f6h/$var$_$sdate$.nc' + +data <- Start(dat = data_path, + var = 'tas', + sdate = paste0(1991:2010, '0101'), + ensemble = 'all', + time = indices(1), + lat = 'all', + lon = 'all', + synonims = list(lat = c('lat', 'latitude'), + lon = c('lon', 'longitude')), + return_vars = list(lat = NULL, + lon = NULL, + time = 'sdate'), + retrieve = FALSE) + +# C) Build the workflow +reg_mask <- function(data, mask) { + # data: [dat = 1, sdate = 20, ensemble = 25, time = 1] + # mask: [dat = 1] + if (mask == 1) { + ind <- s2dv::MeanDims(data, c('dat', 'ensemble', 'time')) + } else { + ind <- array(rep(NA, dim(data)[2]), dim = c(sdate = dim(data)[2])) + } + return(ind) + +} + +step_mask <- Step(fun = reg_mask, + target_dims = list(data = c('dat', 'sdate', 'ensemble', 'time'), + mask = c('dat')), + output_dim = 'sdate') + +wf_mask <- AddStep(list(data, mask), step_mask) + +res <- Compute(workflow = wf_mask, + chunks = list(lat = 2, + lon = 2)) + +# Check with plotting +library(s2dv) +s2dv::PlotLayout(PlotEquiMap, c('lat', 'lon'), res$output1[ , 1, , ], + lon = seq(0, 359, 1), lat = seq(90, -90, -1)) + + +#================= Case 2 ================== +# Goal: Apply analysis only on Baffin Bay and Greenland region. +# The mask of the two regions is from the same file, while we have to read them +# seperately because the dimensions have to be in line with the data. That is, +# the length of 'var' can only be 1. +# Another way is read data with repetitive "var = c('siconc', 'siconc')" and read mask +# as one object with "var = c('Baffin_Bay', 'Grnland')". The following workflow need +# to adjust accordingly. + +# A) Load mask file +mask_path <- '/esarchive/autosubmit/con_files/mask.regions.HadISST.nc' + +mask1 <- Start(dat = mask_path, + var = 'Baffin_Bay', + lat = 'all', + lon = 'all', + synonims = list(lat = c('lat', 'y'), + lon = c('lon', 'x')), + return_vars = list(var_names = NULL, + lat = NULL, lon = NULL), + var_var = 'var_names', + retrieve = F) + +mask2 <- Start(dat = mask_path, + var = 'Grnland', + lat = 'all', + lon = 'all', + synonims = list(lat = c('lat', 'y'), + lon = c('lon', 'x')), + return_vars = list(var_names = NULL, + lat = NULL, lon = NULL), + var_var = 'var_names', + retrieve = F) + + +# B) Load data +# The original longitude range is [0, 360]. Reorder to [-180, 180] to be in line with masks. +data_path <- '/esarchive/exp/gfdl-cm4/cmip6-piControl/monthly_mean/sic-lonlat/sic_$sdate$.nc' +lons.min <- -179.5 +lons.max <- 179.5 +lats.min <- -90 +lats.max <- 90 + +data <- Start(dat = data_path, + var = 'siconc', + sdate = paste0('0', 521:540, '0101'), + ensemble = 'all', + time = indices(1), + lat = values(list(lats.min, lats.max)), + lat_reorder = Sort(), + lon = values(list(lons.min, lons.max)), + lon_reorder = CircularSort(-180, 180), + synonims = list(lat = c('lat', 'latitude'), + lon = c('lon', 'longitude')), + return_vars = list(lat = NULL, + lon = NULL, + time = 'sdate'), + retrieve = FALSE) + + +# C) Build the workflow +reg_mask <- function(data, mask1, mask2) { + # data: [var = 1, sdate = 20, ensemble = 1, time = 1] + # mask1 and mask2: [var = 1] +#--------Remove when s2dv::Trend is updated ------- + source('/esarchive/scratch/aho/Trend_tmp.R') +#----------------------------------------------- + + if (mask1 == 1 | mask2 == 1) { +#------------- Change when s2dv::Trend is updated ---------------- + trend <- Trend(data, time_dim = 'sdate')$trend[2, , , ] +# trend <- s2dv::Trend(data, time_dim = 'sdate')$trend[2, , , ] +#----------------------------------------------------------------- + ind <- mean(data) + } else { + ind <- NA + } + return(ind) +} + +# The necessary target dim of data for the function is 'sdate' only, but those not +# in mask dimensions are needed to be included here to make chunking work. +step_mask <- Step(fun = reg_mask, + target_dims = list(data = c('var', 'sdate', 'ensemble', 'time'), + mask1 = c('var'), + mask2 = c('var')), + output_dim = NULL) + +wf_mask <- AddStep(list(data, mask1, mask2), step_mask) + +res <- Compute(workflow = wf_mask, + chunks = list(lat = 2, + lon = 2)) + +# Check with plotting. Only the two regions have values +s2dv::PlotEquiMap(res$output1[1, , ], lon = seq(-179.5, 179.5, 1), lat = seq(-89.5, 89.5, 1)) + diff --git a/inst/doc/usecase/ex2_10_existing_masks.R b/inst/doc/usecase/ex2_10_existing_masks.R deleted file mode 100644 index d8757ca..0000000 --- a/inst/doc/usecase/ex2_10_existing_masks.R +++ /dev/null @@ -1,140 +0,0 @@ -# Apply an existing mask file on data -# Author: An-Chi Ho -# ------------------------------------------------------------------ - - - -# A) Load mask file -mask_path <- '/esarchive/autosubmit/con_files/land_sea_mask_1x1_c3s.nc' - -mask <- Start(dat = mask_path, - var = 'LSM', - lat = 'all', - lon = 'all', - return_vars = list(var_names = NULL, - lat = NULL, lon = NULL), - var_var = 'var_names', - retrieve = F) - - -# B) Load data -data_path <- '/esarchive/exp/ecmwf/system5c3s/monthly_mean/$var$_f6h/$var$_$sdate$.nc' - -data <- Start(dat = data_path, - var = 'tos', - sdate = paste0(1991:2010, '0101'), - ensemble = 'all', - time = indices(1), - lat = 'all', - lon = 'all', - synonims = list(lat = c('lat', 'latitude'), - lon = c('lon', 'longitude')), - return_vars = list(lat = NULL, - lon = NULL, - time = 'sdate'), - retrieve = FALSE) - -# C) Build the workflow -reg_mask <- function(data, mask) { - # data: [sdate = 20, ensemble = 25] - # mask: [dat = 1] - if (mask == 1) { - trend <- s2dv::Trend(data, time_dim = 'sdate')$trend[2, , , ] - ind <- mean(data) - } else { - ind <- NA - } - return(ind) - -} - -step_mask <- Step(fun = reg_mask, - target_dims = list(data = c('dat', 'sdate', 'ensemble', 'time'), - mask = c('dat')), - output_dim = NULL) - -wf_mask <- AddStep(list(data, mask), step_mask) - -res <- Compute(workflow = wf_mask, - chunks = list(lat = 4, - lon = 4)) - - - -#================= Case 2 ================== -# A) Load mask file -mask_path <- '/esarchive/autosubmit/con_files/mask.regions.HadISST.nc' - -mask1 <- Start(dat = mask_path, - var = 'Baffin_Bay', # c('Grnland', 'Baffin_Bay'), - lat = 'all', - lon = 'all', - synonims = list(lat = c('lat', 'y'), - lon = c('lon', 'x')), - return_vars = list(var_names = NULL, - lat = NULL, lon = NULL), - var_var = 'var_names', - retrieve = F) - -mask2 <- Start(dat = mask_path, - var = 'Grnland', - lat = 'all', - lon = 'all', - synonims = list(lat = c('lat', 'y'), - lon = c('lon', 'x')), - return_vars = list(var_names = NULL, - lat = NULL, lon = NULL), - var_var = 'var_names', - retrieve = F) - - -# B) Load data -data_path <- '/esarchive/exp/gfdl-cm4/cmip6-piControl/monthly_mean/sic-lonlat/sic_$sdate$.nc' - -data <- Start(dat = data_path, - var = 'siconc', - sdate = paste0('0', 521:540, '0101'), - ensemble = 'all', - time = indices(1), - lat = 'all', - lon = 'all', - synonims = list(lat = c('lat', 'latitude'), - lon = c('lon', 'longitude')), - return_vars = list(lat = NULL, - lon = NULL, - time = 'sdate'), - retrieve = FALSE) - - -# C) Build the workflow -reg_mask <- function(data, mask1, mask2) { - # data: [sdate = 20, ensemble = 25] - # mask: [var = 2] -#--------Remove when s2dv::Trend is updated ------- - source('/esarchive/scratch/aho/Trend_tmp.R') -#----------------------------------------------- - - if (mask == 1 & mask2 == 1) { -#------------- Change when s2dv::Trend is updated ---------------- - trend <- Trend(data, time_dim = 'sdate')$trend[2, , , ] -# trend <- s2dv::Trend(data, time_dim = 'sdate')$trend[2, , , ] -#----------------------------------------------------------------- - ind <- mean(data) - } else { - ind <- NA - } - return(ind) - -} - -step_mask <- Step(fun = reg_mask, - target_dims = list(data = c('dat', 'sdate', 'ensemble', 'time'), - mask1 = c('dat'), - mask2 = c('dat')), - output_dim = NULL) - -wf_mask <- AddStep(list(data, mask1, mask2), step_mask) - -res <- Compute(workflow = wf_mask, - chunks = list(lat = 2, - lon = 2)) -- GitLab From d55ed34fbd28de91ce7fce06132517eaeb682c58 Mon Sep 17 00:00:00 2001 From: aho Date: Mon, 24 Aug 2020 12:22:43 +0200 Subject: [PATCH 4/5] Add author and date --- inst/doc/usecase/ex1_10_metadata_dims.R | 2 ++ inst/doc/usecase/ex1_9_path_glob_permissive.R | 2 ++ 2 files changed, 4 insertions(+) diff --git a/inst/doc/usecase/ex1_10_metadata_dims.R b/inst/doc/usecase/ex1_10_metadata_dims.R index cba3022..b5909d7 100644 --- a/inst/doc/usecase/ex1_10_metadata_dims.R +++ b/inst/doc/usecase/ex1_10_metadata_dims.R @@ -1,3 +1,5 @@ +# Author: An-Chi Ho +# Date: 20th Aug. 2020 #--------------------------------------------------------------------- # This script tells you how to use the parameter 'metadata_dims' in Start() # to get the complete variable metadata. You will see four difference cases diff --git a/inst/doc/usecase/ex1_9_path_glob_permissive.R b/inst/doc/usecase/ex1_9_path_glob_permissive.R index f52f7e0..e2f25d1 100644 --- a/inst/doc/usecase/ex1_9_path_glob_permissive.R +++ b/inst/doc/usecase/ex1_9_path_glob_permissive.R @@ -1,3 +1,5 @@ +# Author: An-Chi Ho +# Date: 17th Aug. 2020 #--------------------------------------------------------------------- # This script shows you how to use glob expression '*' and the parameter 'path_glob_permissive' of Start(). # The regular way to define the path for Start() is using the tags, i.e., '$$'. -- GitLab From e5eb4a1e26e964952d6f750d03b378b0e37e6780 Mon Sep 17 00:00:00 2001 From: aho Date: Mon, 24 Aug 2020 20:59:55 +0200 Subject: [PATCH 5/5] Add Compute() on Nord3, result checking --- inst/doc/usecase/ex2_10_existing_mask.R | 71 ++++++++++++++++++++++++- 1 file changed, 69 insertions(+), 2 deletions(-) diff --git a/inst/doc/usecase/ex2_10_existing_mask.R b/inst/doc/usecase/ex2_10_existing_mask.R index fb41e17..20d2db7 100644 --- a/inst/doc/usecase/ex2_10_existing_mask.R +++ b/inst/doc/usecase/ex2_10_existing_mask.R @@ -62,16 +62,50 @@ step_mask <- Step(fun = reg_mask, wf_mask <- AddStep(list(data, mask), step_mask) +# run locally res <- Compute(workflow = wf_mask, chunks = list(lat = 2, lon = 2)) +# Submit to Nord3 +#-------------------user-defined--------------------- + queue_host <- 'nord1' + temp_dir <- '/gpfs/scratch/bsc32/bsc32734/startR_hpc/' + ecflow_suite_dir <- '/home/Earth/aho/startR_local/' +#---------------------------------------------------- + res <- Compute(wf_mask, + chunks = list(lat = 2, + lon = 2),#$output1 + threads_load = 2, + threads_compute = 4, + cluster = list(queue_host = queue_host, + queue_type = 'lsf', + temp_dir = temp_dir, + cores_per_job = 2, + job_wallclock = '05:00', + max_jobs = 4, + extra_queue_params = list('#BSUB -q bsc_es'), + bidirectional = FALSE, + polling_period = 10 + ), + ecflow_suite_dir = ecflow_suite_dir, + wait = TRUE + ) + +#-------- See the result ----------- +str(res$output1) +# num [1:20, 1, 1:181, 1:360] 249 245 247 245 247 ... +summary(res$output1) +# Min. 1st Qu. Median Mean 3rd Qu. Max. NA's +# 236.8 273.9 286.5 282.4 297.1 304.4 441960 + # Check with plotting library(s2dv) s2dv::PlotLayout(PlotEquiMap, c('lat', 'lon'), res$output1[ , 1, , ], lon = seq(0, 359, 1), lat = seq(90, -90, -1)) + #================= Case 2 ================== # Goal: Apply analysis only on Baffin Bay and Greenland region. # The mask of the two regions is from the same file, while we have to read them @@ -162,9 +196,42 @@ step_mask <- Step(fun = reg_mask, wf_mask <- AddStep(list(data, mask1, mask2), step_mask) +# Run locally res <- Compute(workflow = wf_mask, - chunks = list(lat = 2, - lon = 2)) + chunks = list(lat = 2, + lon = 2)) + +# Submit to Nord3 +#-------------------user-defined--------------------- + queue_host <- 'nord1' + temp_dir <- '/gpfs/scratch/bsc32/bsc32734/startR_hpc/' + ecflow_suite_dir <- '/home/Earth/aho/startR_local/' +#---------------------------------------------------- + res <- Compute(wf_mask, + chunks = list(lat = 2, + lon = 2),#$output1 + threads_load = 2, + threads_compute = 4, + cluster = list(queue_host = queue_host, + queue_type = 'lsf', + temp_dir = temp_dir, + cores_per_job = 2, + job_wallclock = '05:00', + max_jobs = 4, + extra_queue_params = list('#BSUB -q bsc_es'), + bidirectional = FALSE, + polling_period = 10 + ), + ecflow_suite_dir = ecflow_suite_dir, + wait = TRUE + ) + +#--------Check the result ------------ +str(res$output1) +# num [1, 1:180, 1:360] NA NA NA NA NA NA NA NA NA NA ... +summary(res$output1) +# Min. 1st Qu. Median Mean 3rd Qu. Max. NA's +# 0.00 78.83 95.44 80.00 97.60 99.91 64093 # Check with plotting. Only the two regions have values s2dv::PlotEquiMap(res$output1[1, , ], lon = seq(-179.5, 179.5, 1), lat = seq(-89.5, 89.5, 1)) -- GitLab