<a id="api-esmvaltool-diag-scripts-droughts-collect-drought"></a>

# Drought Metrics following Martin (2018)

Compares SPI/SPEI data from models with observations/reanalysis.

## Description

This diagnostic applies drought characteristics based on Martin (2018)
to data produced by spei.R. These characteristics and differences to
a reference dataset or between different time periods are plotted for each
dataset and multi-model mean. The calculated frequency, duration and severity
of drought events are saved to netcdf files for further use.
It expects multiple datasets for a particular index as input. The reference
dataset can be specified with `reference_dataset` and is not part of the
multi-model mean.

#### NOTE
Previous Version:
With ESMValTool v2.12 and previous, multiple collect_drought_\*.py
diagnostics and a collect_drought_func.py diagnostic existed in the
droughtindex folders. Those have been archived and replaced by this
diagnostic in v2.13.

## Configuration options

indexname: str
: The indexname is used to generate filenames, plot titles and captions.
  Should be `SPI` or `SPEI`.

reference_dataset: str
: Dataset name to use for comparison (excluded from MMM). With
  `compare_intervals=True` this option has no effect.

threshold: float, optional (default: -2.0)
: Threshold for an event to be considered as drought.

compare_intervals: bool, false
: If true, start and end of the time periods are compared instead of
  models and reference. The lengths of start and end period is given by
  `comparison_period`.

comparison_period: int
: Number of years from start and end of the full period to be compared.
  Should be < (end_year - start_year)/2.
  If `compare_intervals=False` this option has no effect.

plot_models: bool, false
: Save plots for each individual model, in addition to multi-model mean.

start_year: int
: This option is used to select the time slices for comparison if
  `compare_intervals=True`.

end_year: int
: This option is used to select the time slices for comparison if
  `compare_intervals=True`.
