CMIP5fromESGF: Downloads CMIP5 climate simulations from the ESGF data portal

Description Usage Arguments Details Warning Note Author(s) References Examples

View source: R/CMIP5fromESGF.R


Downloads available monthly CMIP5 simulations from ESGF data portal. You need an account at any ESGF node (see This function creates subdirectories for each climate simulation in the specified folder, automatically recieves the bash scripts needed for the partiular simulation-variable-experiment combination and then executes the bash scripts one by one. An external PYTHON script is called for this task. If either data or bash-scripts exist, the download will be skipped. Use this function with care. You need a working internet connection for this function to work.


CMIP5fromESGF( = NULL, variables = NULL,
              experiments = NULL, models = NULL)


Directory location for downloading CMIP5 data and bash scripts. ATTENTION: subdirectories for each model-experiment combination will be created!


Short variable names for meteorological parameters of interest (e.g. "tas" for 2m air temperature or "pr" for precipitation amount). See e.g. the IPCC Standard Output from GCMs (


Experiment of the climate simulation (e.g. c("historical", "rcp45"), see Taylor (2012) for a detailed description.


Climate simulations to be downloaded. If no models are provided (default), all available simulations will be retrieved. See the "Model" column at for available simulations. ATTENTION: This is a considerable amount of data, so watch out for your diskspace!


Firstly you need an ESGF account. If you do not have any, start here:

This function calls an external python script which

  1. looks for the latest CMIP5 models at ESGF

  2. generates a local directory structure where the data will be stored

  3. receives the corresponding bash files from ESGF

  4. executes the bash files.

You can find the location of the script with system.file("exec", "", package="wux")

This function is an alternative to downloading the corresponding models by point-and-click on the ESGF node (as or, as it takes advantage of the ESGF search API mechanism for automated data screening and wget-script generation. For thei nterested user more information on downloading strategies is available at


This function automatically creates new directories on your system, downloads wget scripts, flags them execueable and runs them, which can download quite some data.


Use with care, your harddisk might get stuffed. This tools works on unix platforms only.


Thomas Mendlik [email protected]


Karl E. Taylor, Ronald J. Stouffer, and Gerald A. Meehl, 2012: An Overview of CMIP5 and the Experiment Design. Bull. Amer. Meteor. Soc., 93, 485-498. doi:


## Not run: 
## download temperature fields of two example GCMs (NorESM1-M and
## CanESM2) with the  RCP 8.5 and the historical run
## into your temporary directory. This command will create a folder
## "CMIP5" in "~/tmp" with two subfolders for each model again with
## two subfolders for each experiment.
CMIP5fromESGF( = "~/tmp/CMIP5/",
              models = c("NorESM1-M", "CanESM2"),
              variables = c("tas"),
              experiments= c("historical", "rcp85"))

## End(Not run)

Example output

Loading required package: sp
Loading required package: ncdf4
Loading required package: reshape
Loading required package: abind
Loading required package: fields
Loading required package: spam
Loading required package: dotCall64
Loading required package: grid
Spam version 2.1-1 (2017-07-02) is loaded.
Type 'help( Spam)' or 'demo( spam)' for a short introduction 
and overview of this package.
Help for individual functions is also obtained by adding the
suffix '.spam' to the function name, e.g. 'help( chol.spam)'.

Attaching package: 'spam'

The following objects are masked from 'package:base':

    backsolve, forwardsolve

Loading required package: maps

WUX runtime version: 2.2-1
sh: 1: python: Permission denied
sh: 1: python: Permission denied
sh: 1: python: Permission denied
sh: 1: python: Permission denied

wux documentation built on May 30, 2017, 8:22 a.m.