pcad: Calculates cold air drainage potential

View source: R/cadtools.R

pcadR Documentation

Calculates cold air drainage potential

Description

pcad calculates the expected temperature differences resulting from cold air drainage.

Usage

pcad(dem, basins, fa, tc, h, p = 101300, out = "cadp")

Arguments

dem

a raster object of elevation (m).

basins

a raster object, two-dimensional array or matrix with basins numbered as integers as returned by basindelin().

fa

a raster object of accumulated flow, as returned by flowacc()

tc

a single numeric value, raster object, two-dimensional array or matrix of values with the dimensions as dem of temperature (ºC).

h

a single numeric value, raster object, two-dimensional array or matrix of values with the dimensions as dem of specific humidity (kg kg-1 ).

p

an optional single numeric value, raster object, two-dimensional array or matrix of values with the dimensions as dem of atmospheric pressure (Pa).

out

specifies the type of output to provide (see details). Possible values are "cadp", "tempdif" and "pflow".

Details

To derive expected temperature differences, pcad calculates the difference difference in elevation between each point and the highest in the basin and multiplies this by the lapse rate. Accumulated flow is calculated using flowacc(), logarithmically transformed and expressed as proportion of the maximum in each basin as an indication of each locations potential to experience cold air drainage. Cold air flow is possible over shallow boundaries, basins is best derived using basinmerge(). Warning: function is quite slow on large datasets.

Value

a raster object:

if out = "tempdif"

the expected temperature difference (ºC).

if out = "pflow"

the accumulated flow logairthmically transformed expressed as a proportion of the maximum in each basin.

if out = "cadp" (the default)

the expected temperature difference x the proportion of accumulated flow.

Examples

library(raster)
basins <- basinmerge(dtm100m, basins100m, 2)
h <- humidityconvert(50, intype = "relative", 20)$specific
fa <- flowacc(dtm100m, basins)
cp1 <- pcad(dtm100m, basins, fa, 20, h)
cp2 <- pcad(dtm100m, basins, fa, 20, h, out = "tempdif")
cp3 <- pcad(dtm100m, basins, fa, 20, h, out = "pflow")
par(mfrow=c(1, 3))
plot(cp3, main = "Accumulated flow proportion")
plot(cp2, main = "Expected temperature difference")
plot(cp1, main = "Cold air drainage potential")

ilyamaclean/microclima documentation built on Oct. 31, 2023, 11:41 p.m.