dedrizzle: Removes excess drizzle from model data.

Description Usage Arguments Details Value Examples

View source: R/dedrizzle.R

Description

Climate models typically generate too much drizzle. Given modeled and observational precipitation, dedrizzle finds a threshold value that will cause the wet/dry ratio in the model data to match the wet/dry ratio in the observations, then sets all model values below that threshold to zero.

Usage

1
dedrizzle(x, att = FALSE)

Arguments

x

A list of vectors named "obs", "cur", and "fut". The vectors do not need to be the same length.

att

Logical: whether to set attributes "pwet" and "threshold" on the returned list to record the wet/dry ratio and threshold value, respectively. (Defaults to FALSE.)

Details

dedrizzle takes two vectors of model data, one for the current period and one for the future period. It finds the threshold based on the current data, and floors data below the threshold for both current and future data. If the observational data has more wet (non-zero) values than the model data, the threshold will be zero.

Dedrizzle floors all its inputs at zero before calculation. It ignores NA values when calculating the wet/dry equalization threshold. The "fut" element of the input list is optional.

Value

A list containing obs, cur, and fut with drizzle removed.

Examples

1
2
3
4
5
obs <- c(rep(0,10), rep(1,10), rep(NA,3))
cur <- c(seq(10)/10, NA)
fut <- seq(15)/10
namelist(obs,cur,fut)
dedrizzle(namelist(obs, cur, fut))

sethmcg/climod documentation built on Nov. 19, 2021, 11:12 p.m.