|
|
|
|
|
see [code](https://github.com/Ibasam/IBASAM/blob/master/IBASAM/R/river_climate_model.R)
|
|
|
|
|
|
The climate in the simulated river was described by daily water temperature and flow. As explained in the input section, the time series of temperature and flow of a real river can be used for parameterization purpose or specific simulations. However, for further simulations and to obtain realistic replicates of time series of these two environmental factors, a random autore- gressive sinusoidal function was used for each of these factors. The mathematical form of these two functions was:
|
|
|
The climate in the simulated river was described by daily water temperature and flow. As explained in the [input](howtouse) section, the time series of temperature and flow of a real river can be used for parameterization purpose or specific simulations.
|
|
|
|
|
|
However, for further simulations and to obtain realistic replicates of time series of these two environmental factors, a random autoregressive sinusoidal function was used for each of these factors:
|
|
|
``` R
|
|
|
sinus_model_resid_ar <-
|
|
|
function (m, a, cs, alp, bet, d, nbd)
|
... | ... | @@ -17,12 +18,48 @@ function (m, a, cs, alp, bet, d, nbd) |
|
|
return(tm)
|
|
|
}
|
|
|
```
|
|
|
where *m* and *a* were the mean and amplitude of the environmental parameter (temperature or flow) over a year, *d* was the Julian day, *cs* was a shifting parameter to adjust the sinusoidal signal and *error(dd)* was an autoregressive random error with *alp* was a non-zero parameter and *esp* was a normal random number centered on 0 and of variance *bet*.
|
|
|
where *m* and *a* were the mean and amplitude of the environmental parameter (temperature or flow) over a year, *d* was the Julian day, *cs* was a shifting parameter to adjust the sinusoidal signal and *error(dd)* was an autoregressive random error with *alp* as a non-zero parameter and *esp* as a normal random number centered on 0 and of variance *bet*.
|
|
|
|
|
|
The Scorff River data series (over 15 yrs) allowed a parameterization of these two functions:
|
|
|
(1) for the river water temperature (T(t));
|
|
|
(2) for the logarithm of the flow (flow(t) in m3 /s) divided by the module of the river (5.03 m3 /s).
|
|
|
(2) for the logarithm of the flow (flow(t) in m~3/s) divided by the module of the river (5.03 m~3/s).
|
|
|
|
|
|
``` R
|
|
|
river_climate_model <- function (nYears, CC_Temp, CC_Amp)
|
|
|
{
|
|
|
#Scorff parameters T°C: ADJUSTED on 1970-2007 data from Scorff 5/03/2010
|
|
|
if(missing(CC_Temp)) {
|
|
|
mT <- 12.674299
|
|
|
} else {
|
|
|
mT<-seq(12.674299,12.674299+ CC_Temp,length=365*nYears) #MeanT
|
|
|
}
|
|
|
aT <- 5.909091
|
|
|
csT <- 114.780948
|
|
|
alpT <- 0.95184170929478
|
|
|
betT <- 0.449967327959108
|
|
|
|
|
|
#Scorff parameters Flow: ADJUSTED on 1970-2007 data from Scorff 5/03/2010
|
|
|
mF <- -0.02
|
|
|
if(missing(CC_Amp)) {
|
|
|
aF <- 1.010139
|
|
|
} else {
|
|
|
aF <- seq(1.010139,1.010139* CC_Amp,length=365*nYears)
|
|
|
}
|
|
|
csF <- 327.836285
|
|
|
alpF <- 0.964034622660953
|
|
|
betF <- 0.118343974744226
|
|
|
|
|
|
#compute water temperature
|
|
|
temperatures <- sinus_model_resid_ar(mT, aT, csT, alpT, betT, 1:(365 * nYears), 365)
|
|
|
#compute flow
|
|
|
logrelflow <- sinus_model_resid_ar(mF, aF, csF, alpF, betF, 1:(365 * nYears), 365) - 0.2 #correction due to residuals not centered on 0
|
|
|
|
|
|
temperatures[temperatures < 0] <- 0.01
|
|
|
logrelflow[logrelflow > 3] <- 3
|
|
|
logrelflow[logrelflow < -3] <- -3
|
|
|
return(list(temperatures = temperatures, logrelflow = logrelflow))
|
|
|
}
|
|
|
```
|
|
|
|
|
|
For further studies simulating climate change, a temporal trend either on the mean and amplitude parameters ( *m* and *a* respectively) could be easily set up. For example, using the [river_climate_model](https://github.com/Ibasam/IBASAM/blob/master/IBASAM/R/river_climate_model.R) function and *m=3* for water temperature (i.e. increase of 3°C over 50 years) and *a=1.25* for water flow (i.e. increase of 25% of amplitude over 50 years), we obtain:
|
|
|
|
... | ... | |