
User Manual for AnaWEGE (v1.0, July 2013)


by Pascal Yiou, Laboratoire des Sciences du Climat et de l'Environnement, CE Saclay, l'Orme des Merisiers, 91191 Gif-sur-Yvette, France


The programs and input data files are provided "as is", with no guarantee of correct functionning. The user is warned that the author is not liable for any misuse of those programs. Please read the disclaimer document file.

The programs can be used freely for academic use. Pascal Yiou (pascal.yiou@lsce.ipsl.fr) must be contacted if a commercial use is envisaged.

This user manuel is an Appendix to Yiou (Geophys. Mod. Dev., submitted)

1. CONTENT
AnaWEGE is a weather generator based on analogues of atmospheric circulation. It is designed to work on the North Atlantic/European region, although it can be adapted to other regions, by using other observation and reanalysis data files.

AnaWEGE is composed of two R programs:
init_WG_seas.R: An initialization file that contains the weather generator definition
season_sim.R: A wrapper file that launches the initializations (read input files, run the weather generator, save the time series)
The programs contain many comments... in French.

AnaWEGE reads three input data files:
slpano-NA.analog30rms.all1948.dat: an ASCII file containing the analogues of SLP over the North Atlantic
TGanom_1948Eur.dat: an ASCII file containing time series of daily temperature anomalies computed from the ECA&D data set.
TGEur_info.txt: an ASCII file containing the station names and longitude-latitude coordinates of the ECA&D stations.
All files can be obtained at: http://www-lscedods.cea.fr/AnaWEGE/
TGEur_info.txt	17-Jul-2013 15:36 	14K
TGanom_1948Eur.dat	17-Jul-2013 15:36 	113M
slpano-NA.analog30rms.all1948.dat	19-Jul-2013 14:15 	20M

They need to be downloaded and stored in directories that will be accessed by AnaWEGE

2. RUNNING THE PROGRAM
2.1 PREPARATION
To run AnaWEGE, it is necessary to install the "snowfall" R library (from the R environment):
> install.packages("snowfall")

This necessary to run AnaWEGE on several processors. It has been tested on 1, up to 8 processors.

Environment variables (paths) are specified in the season_sim.R file. The NCEPdir, ECAdir and OUTdir need to be changed by the used (once and for all)

Simulation parameters are adjusted in the season_sim.R file.

2.2 WEATHER SIMULATIONS
AnaWEGE can be run in BATCH mode from a linux environment:
$ R CMD BATCH season_sim.R

It can also be run "line by line" and interactively in R in any environment (linux, MaxOSX, windows).

The program then reads the source code for the various functions of AnaWEGE in init_WG_seas.R. init.awege() initializes the weather generator (reads input files).

The user then needs to specify the features of the desired simulations:
idyn=TRUE is for dynamic weather generator (idyn=FALSE is for static weather generator)

nproc is the number of processors to be used (between 1 and 12, depending on the user's computing architecture)

season is the season to be simulated (="SUMMER", "WINTER", "SPRING", "FALL")

r.yr is the range of initialization years: typically 1948:2011 or a favourite extreme year like 2003
tag is a suffix for the output file. I put "norm" when r.yr=1948:2011 and "extr" when r.yr is a specific year.

nsim is the number of simulations.

The function for running the weather generator is:
XX.wg=simu.agewe(seas=season,Nd=90,alpha1=0.5,alpha2=4,nsim=nsim,r.yr=r.yr,
  npro=nproc,idyn=idyn)

Nd is the number of days in a season (by default: Nd=90 days)
alpha1 and alpha2 are the parameters of the weather generator, described in the paper (Yiou, GMD, 2013).

The XX.wg variable contains:
XX.wg=list(
dates=date.wg, # Simulated dates
wg=XX.wg, # Simulated temperatures
wg.pareto=XX.wg.pareto, # Pareto rectification (beta test: not described in the paper)
season=season, # Season
nsim=nsim, # Number of simulations
Nday=Nday, # Number of days in a season
alpha1=alpha1,alpha2=alpha2, # AnaWEGE parameters
r.year=r.year # Range of initial condition years
)

A simple save(XX.wg) should be done after a simulation.

