coreModel | R Documentation |
This is the core function to calculate the (air parcel) trajectories in a backward mode (i.e. backward-in-time).
coreModel(u, v, w, zSens, ustar, L, Zo, bw, sigmaUustar, sigmaVustar,
kv, C0, alpha, MaxFetch)
u |
numeric vector. Instantaneous velocity of the individual air parcels at time 0 in alongwind direction (given in m/s). |
v |
instantaneous velocity of air parcel at time 0 in crosswind direction (given in m/s). |
w |
instantaneous velocity of air parcel at time 0 in vertical direction (given in m/s). |
zSens |
sensor height in m above ground level. |
ustar |
friction velocity in m/s. |
L |
Obukhov length in m. |
Zo |
roughness length in m. |
bw |
parameter defining the vertical profile of the variance in the vertical velocity component sigmaW. |
sigmaUustar |
variance of the alongwind velocity devided by |
sigmaVustar |
variance of the crosswind velocity devided by |
kv |
von Ka'rma'n constant (usually = 0.4). |
C0 |
Kolmogorov constant. |
alpha |
Fraction of the velocity decorrelation time scale as given in Flesch et al., 2004 to choose the time increment. |
MaxFetch |
maximum tracking distance of trajectories (in m). |
A list with following items:
Traj_IDOut |
ID of the corresponding trajectory. This ID is identical to the indexing position of the initial velocities |
TimeOut |
Time until touchdown in seconds. |
xOut |
x position of touchdown. |
yOut |
y position of touchdown. |
wTDOut |
Touchdown velocity. |
Christoph Haeni
Flesch, T. K., J. D. Wilson, et al. (1995). “Backward-time Lagrangian stochastic dispersion models and their application to estimate gaseous emissions.” Journal of Applied Meteorology 34(6): 1320-1332.
Flesch, T. K., J. D. Wilson, et al. (2004). “Deducing ground-to-air emissions from observed trace gas concentrations: A field trial.” Journal of Applied Meteorology 43(3): 487-502.
runbLS
, bLSmodelR-package
.
## Not run:
## set up model parameters
zSigmaWu <- 2
zSens <- 2
Ustar <- 0.25
L <- -600
Zo <- 0.001
SigmaUu <- 4.5
SigmaVu <- 4
SigmaWu <- 1.7
kv <- 0.4
alpha <- 0.02
MaxFetch <- 500
A <- 0.5
bw <- calcbw(SigmaWu, zSigmaWu/L)
SigmaWm <- calcsigmaW(Ustar, zSens/L, bw)
U <- calcU(Ustar, Zo, L, zSens, kv)
C0 <- calcC0(bw, kv)
## initial velocities
N0 <- 1000
set.seed(1234)
TDcat <- initializeCatalog(N0, Ustar, SigmaUu, SigmaVu, bw,
zSens, L, Zo, A, alpha, MaxFetch, kv)
uvw <- uvw0(TDcat)
## run trajectory calculation
TDList <- coreModel(uvw[,"u0"], uvw[,"v0"], uvw[,"w0"], zSens, Ustar,
L, Zo, bw, SigmaUu, SigmaVu, kv, C0, alpha, MaxFetch)
## assign touchdowns to initalized Catalog:
assignCat(TDcat,TDList)
## Calculate C/E and w'C'/E ratios of entire domain with homogeneous
## emission rate:
Ci <- data.table(ID=1:N0,CE=0,u=uvw[,"u0"],v=uvw[,"v0"],w=uvw[,"w0"],key="ID")
Ci[TDcat[,sum(2/wTD),by=Traj_ID],CE:=V1]
stats <- Ci[,cbind(
round(rbind(ce <- mean(CE),se <- sd(CE)/sqrt(N0),ce - 1.96*se,ce + 1.96*se),1),
round(rbind(wce <- mean(w*(cs <- CE-ce)),wse <- sd(w*cs)/sqrt(N0)
,wce - 1.96*wse,wce + 1.96*wse),2))]
dimnames(stats) <- list(c("E(X)","SE","Lower-CI95%","Upper-CI95%"),c("C/E","w'C'/E"))
print(stats)
## look at Catalog:
TDcat
plot(TDcat,pch=20)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.