LTmodel: Run the Linear Theory model. THis is the function that calls...

Description Usage Arguments Details

View source: R/LTmodel.R

Description

Run the Linear Theory model. THis is the function that calls the others.

Usage

1
2
LTmodel(h, dx, dy, Pinf, tauc, tauf, windspeed, winddir, trunc = TRUE,
  method = "smith", trunc_value = 0, saveInt = FALSE, Intfn = NULL)

Arguments

h

matrix of elevation

dx

horizontal resolution (m)

dy

vertical resolution (m)

Pinf

background precip (mm/hr)

tauc

condensation time delay (s)

tauf

fallout time delay (s)

windspeed

windspeed (m/s)

winddir

wind direction (m/s)

trunc

should the result truncate negative values (default=TRUE)

method

default = 'smith' (as the method is described in Smith and Barstad 2004); decides whether truncation should happen before or after adding background precip. If 'smith', truncation happens after adding background precip. If otherwise, truncation happens before adding background precip. For 'smith', you will have a lot of zeros if background precip is low whereas with the other method those grid cells will have the value of the background precip

trunc_value

value below which modeled precip rates should go to zero. This will only make a difference if 'method=LEM'

saveInt

logical. save fft of dem to 'int' directory of your project. speeds up parameter search 2x-3x

Intfn

filename (relative to wd) where to save intermediate FFT matrix

Details

returns a matrix the same size as h with precip mm/hr Prepare Fourier transform of the topography —- Do 2D FFT of Topography —- Prepare precipitation transfer function relating the Fourier transforms of the terrain hhat(k,l) and the precipitiation field Phat(k,l) (Eq 49) Transfer function relating the Fourier transforms of the terrain hhat(k,l) and the precipitiation field Phat(k,l) (Eq 49) Perform the inverse Fourier transform on Phat Should background precip be added before or after truncation (if truncation happens)? Add the background precipitation rate Apply the positive cutoff Apply the positive cutoff Add the background precipitation rate library(tidyverse) tbl <- tibble(x=as.numeric(dem_list$x),y=as.numeric(dem_list$y),p=Ppad) Return to matrix


dschneiderch/LinearTheoryOrographicPrecip documentation built on May 19, 2019, 1:43 a.m.