Scilab Function
Last update : 21/8/2006

c_GENEPLUIE - Function to calculate random daily rainfall time-series

Calling Sequence

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

Parameters

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
   PAR = c_GENEPAR(197501010000,P); // Calculates the parameters

   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