Learn R Programming

ClimDown (version 1.0.8)

qdm.netcdf.wrapper: High-level wrapper for Quantile Delta Mapping (QDM)

Description

This function performs the QDM algorithm on a cell-by-cell basis for each cell in the spatial domain of the inputted high-res gridded observations. It uses the gridded observations plus the GCM-based output of CI as input to the algorithm and then performs a quantile perturbation/quantile mapping bias correction. The output is written out to out.file.

Usage

qdm.netcdf.wrapper(obs.file, gcm.file, out.file, varname = "tasmax")

Arguments

obs.file

Filename of high-res gridded historical observations

gcm.file

Filename of GCM simulations interpolated to the obs.file grid

out.file

Filename to create (or overwrite) with the bias corrected outputs

varname

Name of the NetCDF variable to downscale (e.g. 'tasmax')

References

Cannon, A. J., Sobie, S. R., & Murdock, T. Q. (2015). Bias Correction of GCM Precipitation by Quantile Mapping: How Well Do Methods Preserve Changes in Quantiles and Extremes?. Journal of Climate, 28(17), 6938-6959. doi: 10.1175/JCLI-D-14-00754.1

Examples

Run this code
# NOT RUN {
ci.file <<- tempfile(fileext='.nc')
ClimDown::ci.netcdf.wrapper('./tiny_gcm.nc', './tiny_obs.nc', ci.file, 'tasmax')
out.nc <- tempfile(fileext='.nc')
options(
    calibration.end=as.POSIXct('1972-12-31', tz='GMT'),
    cend=as.POSIXct('1972-12-31', tz='GMT')
)
ClimDown::qdm.netcdf.wrapper('./tiny_obs.nc', ci.file, out.nc, 'tasmax')
unlink(ci.file)
unlink(out.nc)
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab