qm.doqm: Wrapper function for application of QM

Description Usage Arguments Value Author(s) Examples

View source: R/qm.doqm.R

Description

qm.doqm wraps up all necessary functions to apply QM. For precipitation: internal wet day threshold is applied before and after actual QM (and resulting negative values are set to 0 implicitly in case that FA==TRUE). Day-of-year (DOY) dependency versus bulk QM is controlled by argument w.width ('none' for bulk QM).

Usage

1
2
3
4
5
qm.doqm(series.mod.cal, series.obs.cal, series.mod.all,
  year.cal.begin = -999, year.cal.end = -999, year.scen.begin = -999,
  year.scen.end = -999, w.width, minq = 0.01, maxq = 0.99,
  incq = 0.01, var, pr.wet = 0.01, FA = FALSE,
  qm.method = "linear", output.diag = FALSE)

Arguments

series.mod.cal

Modelled time series (calibration period), vector.

series.obs.cal

Observed (reference) time series (calibration period), vector.

series.mod.all

Modelled time series (entire period for which QM should be applied), vector.

year.cal.begin

First year of calibration period (only required if DOY QM; default: -999).

year.cal.end

Last year of calibration period (only required if DOY QM; default: -999).

year.scen.begin

First year of entire period which should be corrected (start year of series.mod.all; only required if DOY QM; default: -999).

year.scen.end

Last year of entire period which should be corrected (end year of series.mod.all; only required if DOY QM; default: -999).

w.width

Full width of moving window (has to be an uneven number) in [days]; e.g. 91 for moving window of 91 days; if w.width='none': bulk QM (no DOY dependence).

minq

Minimum quantile for correction function [0.01 .. 0.99], default: 0.01; note: should not be 0 (for correct handling of extremes)!

maxq

Maximum quantile for correction function [0.01 .. 0.99], default: 0.99; note: should not be 1 (for correct handling of extremes)!

incq

Quantile increment for correction function (bin size); default: 0.01.

var

Variable that is considered. List of allowed values (to be extended): tas: daily mean temperature tasmin: daily minimum temperature tasmax: daily maximum temperature pr: daily precipitation sum huss: daily mean specific humidity sfcWind: daily mean 10m wind speed hurs: daily mean relative humidity rsds: daily mean global radiation (surface shortwave downwelling).

pr.wet

Internal precipitation wet day threshold [mm/day]; will be applied prior to QM; default: 0.1 mm/day.

FA

Carry out frequency adaptation for precipitation (TRUE, default) or not (FALSE).

qm.method

QM method ("linear" or "bin"); default: linear.

output.diag

Diagnostic QM console output (TRUE) or not (FALSE); default: FALSE.

Value

List of 6: $obs.series: Series of original reference values (observations) over calibration period (series.obs.cal; no wet day threshold applied yet). $raw.series: Series of original values over entire period (series.mod.all; no wet day threshold applied yet). $qm.input.series: Input series to QM over entire period (=series.mod.all but possibly wet day threshold applied). $qm.corrected.series: Series of corrected values over entire period (after QM). $quantile.index: Series of quantile indices, wrt calibration period. $corr.fun: Correction function for each quantile and DOY (matrix[365,nquantiles]).

Author(s)

Jan Rajczak (ETH Zurich), Sven Kotlarski (MeteoSwiss)

Examples

1
2
3
4
5
6
7
8
9
## Not run: 
# Carry out DOY-dependent QM. Calibration period: 1981 to 2010. Entire period
# to be quantile-mapped: 1981 to 2099. 91-day moving window. Standard quantiles.
# Variable: precipitation. Wet-day treshold of 0.1 mm/day. Frequency
# adaptation carried out, linear QM, diagnostic terminal output.
qm.doqm(series.mod.cal, series.obs.cal, series.mod.all, 1981, 2010, 1981,
2099, 91, 0.01, 0.99, 0.01, 'pr', 0.01, TRUE, 'linear', TRUE)

## End(Not run)

SvenKotlarski/qmCH2018 documentation built on July 14, 2019, 7:39 p.m.