Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/CreateInputsPert.R

Function which perturbs the model inputs to generate probabilistic meteorological forcings required to perform ensemble-based data assimilation.

1 2 3 4 5 6 7 8 9 10 11 12 | ```
CreateInputsPert(FUN_MOD, DatesR, Precip = NULL,
PotEvap = NULL, TempMean = NULL,
ZInputs = NULL, HypsoData = NULL, NLayers = 5,
NbMbr = 50, Seed = NULL)
## S3 method for class 'InputsPert'
x[i]
## S3 method for class 'InputsPert'
plot(x, which = "all", main = NULL,
ColPrecip = "royalblue", ColPotEvap = "green3",
ask = prod(par("mfcol")) < length(which) && dev.interactive(), ...)
``` |

`FUN_MOD` |
[function] hydrological model function (e.g. |

`DatesR` |
[POSIXct] vector of dates |

`Precip` |
(optional) [numeric] time series of total precipitation to perturb [mm/d] |

`PotEvap` |
(optional) [numeric] time series of potential evapotranspiration to perturb [mm/d] |

`TempMean` |
(optional) [numeric] time series of mean air temperature [°C] (not perturbed), required to create the CemaNeige module inputs |

`ZInputs` |
(optional) [numeric] real giving the mean elevation of the Precip and Temp series (before extrapolation) [m], possibly used to create the CemaNeige module inputs |

`HypsoData` |
(optional) [numeric] vector of 101 reals: min, q01 to q99 and max of catchment elevation distribution [m], if not defined a single elevation is used for CemaNeige |

`NLayers` |
(optional) [numeric] integer giving the number of elevation layers requested [-], required to create CemaNeige module inputs, default=5 |

`NbMbr` |
(optional) [numeric] number of ensemble members (minimum of 20 recommanded for the EnKF scheme and of 30 for the PF scheme) |

`Seed` |
(optional) [numeric] seed of random number generator |

`x` |
[InputsPert] containing the vector of dates ( |

`i` |
[integer] of the indices to subset a time series or [character] names of the elements to extract |

`which` |
(optional) [character] choice of plots (e.g. |

`main` |
(optional) [character] an overall title for the plot (see |

`ColPrecip, ColPotEvap` |
(optional) [character] color to be used for perturbed precipitation and perturbed potential evapotransipration (in any format that |

`ask` |
(optional) [logical] if |

`...` |
other parameters to be passed through to plotting functions |

The function generates an ensemble of precipitation or/and potential evapotranspiration time series, from data provided as function argument/s. The mean air temperature required to create CemaNeige inputs is not perturbed.

Probabilistic forcing/s is/are generated by stochastically perturbing the meteorological variable/s through a multiplicative stochastic noise, according to the methodology proposed by Clark et al. (2008).

The random perturbations are provided through a first-order autoregressive model relying on a fractional error parameter equal to 0.65 and a temporal decorrelation length of 1 day for rainfall and 2 days for potential evapotranspiration.

In order to ensure reproducible results, *Seed* can be set to fix the randomness in the generation of perturbations.

For further details, see the references section.

Nota: The function can be applied when using GR4J, GR5J and GR6J models (i.e. daily model time step), with or withouth the CemaNeige module.

On the graphical outputs:

- solid line: medians of the input values

- polygon: minima and maxima of the input values

*InputsPert*[list] object of class *InputsModel* containing the ensembles of perturbed model inputs required to perform data assimilation:

$DatesR | [POSIXlt] vector of dates |

$Precip | [numeric] matrix (dim(NbTime, NbMbr)) of ensemblist time series of perturbed total precipitation [mm/d] (with NbTime the length of the period; generated only if the precipitation time series is provided as a function argument) |

$PotEvap | [numeric] matrix (dim(NbTime, NbMbr)) of ensemblist time series of perturbed potential evapotranspiration [mm/d] (generated only if the time series of potential evapotranspiration is provided as a function argument) |

$NbMbr | [integer] atomic vector of number of ensemble members |

Gaia Piazzi, Olivier Delaigue

- Clark, M. P., Rupp, D. E., Woods, R. A., Zheng, X., Ibbitt, R. P., Slater, A. G. et al. (2008). Hydrological data assimilation with the ensemble Kalman filter: Use of streamflow observations to update states in a distributed hydrological model. Advances in Water Resources, 31(10), 1309-1324, doi: 10.1016/j.advwatres.2008.06.005

- Piazzi, G., Thirel, G., Perrin, C. and Delaigue, O. (accepted). Sequential data assimilation for streamflow forecasting: assessing the sensitivity to uncertainties and updated variables of a conceptual hydrological model. Water Resources Research, doi: 10.1029/2020WR028390.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | ```
library(airGRdatassim)
## loading catchment data
data(L0123001, package = "airGR")
## preparation of the InputsModel object
InputsModel <- CreateInputsModel(FUN_MOD = RunModel_GR5J, DatesR = BasinObs$DatesR,
Precip = BasinObs$P, PotEvap = BasinObs$E)
## run period selection
IndRun <- seq(which(format(BasinObs$DatesR, format = "%Y-%m-%d")=="2006-01-01"),
which(format(BasinObs$DatesR, format = "%Y-%m-%d")=="2006-01-31"))
## preparation of perturbed meteorological ensemble
InputsPert <- CreateInputsPert(FUN_MOD = RunModel_GR5J,
DatesR = BasinObs$DatesR,
Precip = BasinObs$P,
PotEvap = BasinObs$E,
NbMbr = 100L)
str(InputsPert)
## results preview
oldpar <- par(mfrow = c(2, 1))
plot(InputsPert)
par(oldpar)
## results preview on a subset on one perturbed variable
oldpar <- par(mfrow = c(1, 1))
plot(InputsPert[IndRun], which = "PotEvap")
par(oldpar)
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.