Getting started


Packages and libraries

COSIPY should run with any Python 3 version on any operating system. If you think the reason for a problem might be your specific Python 3 version or your operating system, please create a topic in the forum. The model is tested and developed on:

  • Anaconda Distribution on max OS

  • Python 3.6.5 on Ubuntu 18.04

  • Anaconda 3 64-bit (Python 3.6.3) on CentOS Linux 7.4

  • High-Performance Cluster Erlangen-Nuremberg University

The model requires the following libraries:

  • xarray

  • netcdf4

  • numba

  • dask_jobqueue

  • numpy (included in Anaconda)

  • pandas (included in Anaconda)

  • scipy (included in Anaconda)

  • distributed (included in Anaconda)

Additional packages (optional):

  • gdal (e.g. in Debian-based Linux distributions package called gdal-bin)

  • climate date operators (e.g. in Debian-based Linux distributions package called cdo)

  • netCDF Operators (e.g. in Debian-based Linux distritutions package called nco)

Quick tutorial


COSIPY requires a file with the corresponding meteorological and static input data. Various tools are available to create the file from simple text or geotiff files.

Create the static file

In the first step, topographic parameters are derived from the Digital Terrain Model (DEM) and written to a NetCDF file. A shape file is also required to delimit the glaciated areas. The DEM and the shapefile should be in lat/lon WGS84 (EPSG:4326) projection.


The DEM can be reprojected to EPSG:4326 using gdal:

> gdalwarp -t_srs EPSG:4326 dgm_hintereisferner.tif dgm_hintereisferner-lat_lon.tif

COSIPY comes with the script located in the utilities folder. This script runs some gdal routines in the command line. That’s is the reason that we can provide this script only for UNIX and MAC users at the moment. The script creates some intermediate NetCDF files (,, and that are automatically deleted after the static file is created.

Here we use the DEM n30_e090_3arc_v2.tif (SRTM) and the shapefile Zhadang_RGI6.shp provided in the /data/static folder. The static file is created using:


The command creates a new file in the /data/static folder. The file names and paths can be simply changed in the python script.

Create the COSIPY input file

The creation of the input file requires the static information (file) from section. To convert the data from an automatic weather station (AWS) we use the conversion script located in the folder /utilities/aws2cosipy. The script comes with a configuration file which defines the structure of the AWS file and other user-defined parameter. Since the input file provides point information, the data is interpolated via lapse rates for two-dimensional runs. The solar radiation fields is based on a model suggested by Wohlfahrt et al. (2016; doi: 10.1016/j.agrformet.2016.05.012). Other variables as wind velocity and cloud cover fraction are assumed to be constant over the domain.


The script only serves to illustrate how data can be prepared for COSIPY. For most applications it is recommended to develop your own routine for data interpolation.

The script is executed with

> python /
  -c ../../data/input/Zhadang/Zhadang_ERA5_2009_2018.csv /
  -o ../../data/input/Zhadang/ /
  -s ../../data/static/ /
  -b 20090101 -e 20091231




meteo file


output file


static file


start date


end date

If the script was executed successfully, the file /data/input/Zhadang/ should have been created.

Execute the COSIPY model:

To run Cosipy, run the following command in the root directory:

> python

The example should take about 3-5 minutes on a workstation with 4 cores.


The configuration and definitions of parameters/constants is done in and