In water resource management, climate change, hydrology and related disciplines long time series of precipitation/rainfall data is required. Since historical records are relatively short, typically 50 years or less, mathematical/statistical models are used to generate synthetic data of required length. This data generation process requires that the spatio-temporal statistics are preserved between the observations and the synthetic data. There are a number of procedures in the literature, largely beginning in the late 1990s with the work of Wilks (see references below). However, the code required to generate the synthetic data is typically not available.
I created R code for the computationally and conceptually simple implementation of the modified Wilks approach of Mhanna and Bauwens (2012). See my GitHub repo - https://github.com/RationShop/StochasticPrecipitation
There are also two R packages which have been made available recently (see links at the above GitHub site).
The R code, for the example dataset provided, takes only a few minutes or less. Someday I plan to make a package out of this.