Name

c_GENEPLUIE — Function to calculate random daily rainfall time-series

Calling Sequence

R = c_GENEPLUIE(DateDep,RANDNB,PAR,Pini)

Parameters

R

Generated rainfall time series (matrix [Nx1] where N is the number of rows of RANDNB)

DateDep

Date of the first value of the generated daily rainfall time-series (format 199001010000)

RANDNB

Random numbers between 0 and 1 (Matrix [Nx2] where N is the length of the time-series to generate)

PAR

parameters of the generator (in mm/day, matrix [7x8], see c_GENEPAR)

Pini

Initial rainfall value of the time-series (in mm/day)

Description

  • WARNING : This function is written in C language and interfaced with SCILAB (HYDROGR.dll).

  • The generator has three states : null rainfall, low rainfall (under the average rainfall) and high rainfall (over the average rainfall). Eeach day, a new rainfall is generated based on the state of the generator on the preceeding day: the transition probability are known (parameter matrix) and the generator uses an exponential law and a random number to calculate the new value.

Examples

   // P is a vector containing daily rainfall values starting on the 1/1/1975
   P = max(0,exp(convol(1/3*ones(1,3),rand(4998,1)+0.2).^5)*10-12)'; // (fictious data on 5000 days)
   
   // Calculates the parameters
   PAR = c_GENEPAR(197501010000,P);

   RANDN = rand(365 * 10,2); // Random numbers for 10 years of simulation (3650 days)

   // Random rainfall values starting on 1/1/2010 with 0mm of rainfall
   Pr = c_GENEPLUIE(201001010000,RANDN,PAR,0);

  

See Also

c_GENEPAR

Authors

Julien Lerat (transcription of fortran code written by Claude Michel)

CEMAGREF Antony, HBAN Unit, julien.lerat@cemagref.fr