Skip to content
Snippets Groups Projects
Commit 09e5f66f authored by Clara Anton Fernandez's avatar Clara Anton Fernandez
Browse files

volumem equations

parent f90d0262
Branches
Tags
No related merge requests found
## modified volume equation for Norway
volume.norway.underbak <-
function (dbh.mm, height.dm, tree.sp)
{
nvl <- function(...) {
for (e in eval(substitute(alist(...)))) {
x <- eval(e, parent.frame())
if (!is.null(x))
break
}
x
}
if (any(dbh.mm < 50))
stop("all dbh.mm should be at least 50mm")
i.tree.sp.1 <- num.species %in% c("Norway spruce")
i.tree.sp.2 <- num.species %in% c("Scots Pine")
i.tree.sp.3 <- num.species %in% c("Other Conif")
i.tree.sp.4 <- num.species %in% c("Hardwoods")
if ((sum(i.tree.sp.1) + sum(i.tree.sp.2) + sum(i.tree.sp.3) +
sum(i.tree.sp.4)) != length(num.species)) {
print(num.species[which(!i.tree.sp.1 & !i.tree.sp.2 &
!i.tree.sp.3 & !i.tree.sp.4)])
stop("some species are not recognized")
}
vol.wo.bark.l <- rep(NA, length(dbh.mm))
## under bark
vol.wo.bark.l[ i.tree.sp.1] <- picea.abies.vol(dbh = dbh.mm[i12],
trh = height.dm[i12], bark = "ub", units = "l") *
(1 - (nvl(vol.reduksjon[i12], 0)/100))
vol.wo.bark.l[i.tree.sp.2] <- sitka.vol(dbh = dbh.mm[i.tree.sp.2],
trh = height.dm[i.tree.sp.2], bark = "ub", units = "l") *
(1 - (nvl(vol.reduksjon[i.tree.sp.2], 0)/100))
vol.wo.bark.l[i.tree.sp.3] <- pinus.sylvestris.vol(dbh = dbh.mm[i32],
trh = height.dm[i32], bark = "ub", units = "l") *
(1 - (nvl(vol.reduksjon[i32], 0)/100))
vol.wo.bark.l[i.tree.sp.4] <- harw.nor.vol(tsl = as.integer(tree.sp[i.tree.sp.4]),
dbh = dbh.mm[i.tree.sp.4], trh = height.dm[i.tree.sp.4],
bark = "ub", units = "l") * (1 - (nvl(vol.reduksjon[i.tree.sp.4],
0)/100))
volume.norway <- list()
vol.wo.tr.m3 <- vol.wo.bark.l/1000
return(vol.wo.tr.m3)
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment