diff --git a/inst/doc/faq.md b/inst/doc/faq.md index 0b3bc53e56e09a5e36e768f53738ef93e21c5100..1ce2616a4f2ec3c1f18bbd887722f76b747ba8b3 100644 --- a/inst/doc/faq.md +++ b/inst/doc/faq.md @@ -11,6 +11,7 @@ This document intends to be the first reference for any doubts that you may have 5. [Do interpolation in Start() (using parameter 'transform')](#5-do-interpolation-in-start-using-parameter-transform) 6. [Get data attributes without retrieving data to workstation](#6-get-data-attributes-without-retrieving-data-to-workstation) 7. [Avoid or specify a node from cluster in Compute()](#7-avoid-or-specify-a-node-from-cluster-in-compute) + 8. [Define a path with multiple dependencies](#8-define-a-path-with-multiple-dependencies) 2. **Something goes wrong...** @@ -333,6 +334,54 @@ Look at the position of `extra_queue_params` parameter in a full call of Compute wait = TRUE) ``` +### 8. Define a path with multiple dependencies + +The structure of the BSC Earth data repository 'esarchive' allows us to create a path pattern to the data by using different variables (between dollar symbol), such as `$var$`, for the variable name, or `$sdates$`, for the start date of the simulation. Here is an example for loading monthly simulations of system4_m1 data: + +`path <- '/esarchive/exp/ecmwf/system4_m1/monthly_mean/$var$_f6h/$var$_$sdate$.nc'` + +The function Start() will require two parameters 'var' and 'sdate' to load the desired data. + +In some cases, the creation of the path could be a little bit more complicated. Some researchers create their own EC-Earth experiments which are identified by an experiment ID (`$expid$`) and with different model version (`$version`), even for different members (`$member$`): + +| expid | member | version | +|-------|----------|---------| +| a1st | r7i1p1f1 |v20190302| +| a1sx |r10i1p1f1 |v20190308| + +In this case, the variable member and version have different value depending on the expid (the member r10i1p1f1 does not exist for expid a1st). The path will include this varibles: + +`path <- '/esarchive/exp/ecearth/$expid$/diags/CMIP/EC-Earth-Consortium/EC-Earth3/historical/$member$/Omon/$var$/gn/$version$/$var$_Omon_EC-Earth3_historical_$member$_gn_$year$.nc'` + +However, the following parameters are mandatory to make Start() aware of that they are not independent variables: + +``` + member_depends = 'expid', + version_depends = 'expid', +``` + +The final Start() call will look like: + +``` +yrh1 = 1960 +yrh2 = 2014 +years <- paste0(c(yrh1 : yrh2), '01-', c(yrh1 : yrh2), '12') +data <- Start(dat = repos, + var = 'tosmean', + expid = c('a1st','a1sx'), + member = 'all', + version = 'all', + member_depends = 'expid', + version_depends = 'expid', + year = years, + time = 'all', + region = indices(1 : 4), + return_vars = list(time = NULL, region = NULL), + retrieve = TRUE) +``` + + + ## Something goes wrong... ### 1. No space left on device