Skip to content

Commit

Permalink
cleaning
Browse files Browse the repository at this point in the history
  • Loading branch information
miquelcaceres committed Jun 1, 2024
1 parent 400db93 commit a8bb29d
Show file tree
Hide file tree
Showing 6 changed files with 95 additions and 8 deletions.
27 changes: 24 additions & 3 deletions R/RcppExports.R
Original file line number Diff line number Diff line change
Expand Up @@ -948,8 +948,6 @@ forest2belowground <- function(x, soil, SpParams) {
#'
#'
#' @references
#' Andrews, P. L. 2012. Modeling wind adjustment factor and midflame wind speed for Rothermel’s surface fire spread model. USDA Forest Service - General Technical Report RMRS-GTR:1–39.
#'
#' Prichard, S. J., D. V Sandberg, R. D. Ottmar, E. Eberhardt, A. Andreu, P. Eagle, and K. Swedin. 2013. Classification System Version 3.0: Technical Documentation.
#'
#' Reinhardt, E., D. Lutes, and J. Scott. 2006. FuelCalc: A method for estimating fuel characteristics. Pages 273–282.
Expand Down Expand Up @@ -4154,14 +4152,37 @@ wind_canopyTurbulence <- function(zmid, LAD, canopyHeight, u, windMeasurementHei
.Call(`_medfate_shelteredMidflameWindSpeed`, wind20H, crownFillProportion, topCanopyHeight)
}

#' @noRd
#' Wind adjustment factor for Rothermel's model
#'
#' Function fuel_windAdjustmentFactor determines the adjustment factor of wind for surface fires, according to Andrews (2012).
#'
#' @name fuel_windAdjustmentFactor
#'
#' @param topShrubHeight Shrub stratum top height (in m).
#' @param bottomCanopyHeight Canopy base height (in m).
#' @param topCanopyHeight Canopy top height (in m).
#' @param canopyCover Canopy percent cover.
#'
#' @returns A scalar value between 0 and 1
#'
#' @references
#' Andrews, P. L. 2012. Modeling wind adjustment factor and midflame wind speed for Rothermel’s surface fire spread model. USDA Forest Service - General Technical Report RMRS-GTR:1–39.
#'
#' @keywords internal
#'
#' @examples
#' #Load example plot plant data
#' data(exampleforest)
#'
#' #Default species parameterization
#' data(SpParamsMED)
#'
#' #Calculate fuel properties according to FCCS
#' fccs <- fuel_FCCS(exampleforest, SpParamsMED)
#'
#' # Estimate wind adjustment factor
#' fuel_windAdjustmentFactor(fccs$htc[2], fccs$hbc[1], fccs$htc[1], fccs$cover[1])
#'
fuel_windAdjustmentFactor <- function(topShrubHeight, bottomCanopyHeight, topCanopyHeight, canopyCover) {
.Call(`_medfate_windAdjustmentFactor`, topShrubHeight, bottomCanopyHeight, topCanopyHeight, canopyCover)
}
Expand Down
2 changes: 0 additions & 2 deletions man/fuel_properties.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

46 changes: 46 additions & 0 deletions man/fuel_windAdjustmentFactor.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions src/fuelstructure.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -210,8 +210,6 @@ double layerFuelAverageCrownLength(double minHeight, double maxHeight, NumericVe
//'
//'
//' @references
//' Andrews, P. L. 2012. Modeling wind adjustment factor and midflame wind speed for Rothermel’s surface fire spread model. USDA Forest Service - General Technical Report RMRS-GTR:1–39.
//'
//' Prichard, S. J., D. V Sandberg, R. D. Ottmar, E. Eberhardt, A. Andreu, P. Eagle, and K. Swedin. 2013. Classification System Version 3.0: Technical Documentation.
//'
//' Reinhardt, E., D. Lutes, and J. Scott. 2006. FuelCalc: A method for estimating fuel characteristics. Pages 273–282.
Expand Down
25 changes: 24 additions & 1 deletion src/windextinction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,37 @@ double shelteredMidflameWindSpeed(double wind20H, double crownFillProportion, do
* Midflame windspeed (for surface fire) adjustment factor
* Andrews, P.L., 2012. Modeling wind adjustment factor and midflame wind speed for Rothermel’s surface fire spread model. USDA For. Serv. - Gen. Tech. Rep. RMRS-GTR 1–39.
*/
//' @noRd
//' Wind adjustment factor for Rothermel's model
//'
//' Function fuel_windAdjustmentFactor determines the adjustment factor of wind for surface fires, according to Andrews (2012).
//'
//' @name fuel_windAdjustmentFactor
//'
//' @param topShrubHeight Shrub stratum top height (in m).
//' @param bottomCanopyHeight Canopy base height (in m).
//' @param topCanopyHeight Canopy top height (in m).
//' @param canopyCover Canopy percent cover.
//'
//' @returns A scalar value between 0 and 1
//'
//' @references
//' Andrews, P. L. 2012. Modeling wind adjustment factor and midflame wind speed for Rothermel’s surface fire spread model. USDA Forest Service - General Technical Report RMRS-GTR:1–39.
//'
//' @keywords internal
//'
//' @examples
//' #Load example plot plant data
//' data(exampleforest)
//'
//' #Default species parameterization
//' data(SpParamsMED)
//'
//' #Calculate fuel properties according to FCCS
//' fccs <- fuel_FCCS(exampleforest, SpParamsMED)
//'
//' # Estimate wind adjustment factor
//' fuel_windAdjustmentFactor(fccs$htc[2], fccs$hbc[1], fccs$htc[1], fccs$cover[1])
//'
// [[Rcpp::export("fuel_windAdjustmentFactor")]]
double windAdjustmentFactor(double topShrubHeight, double bottomCanopyHeight, double topCanopyHeight, double canopyCover){
double crownFillProportion = ((topCanopyHeight-bottomCanopyHeight)/topCanopyHeight)*(canopyCover/300.0);
Expand Down
1 change: 1 addition & 0 deletions vignettes/intro/PackageOverview.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ Sub-model functions are grouped by *subject*, which is included in the name of t
- `biophysics_*`: Physical and biophysical utility functions.
- `carbon_*`: Carbon balance.
- `fire_*`: Fire severity.
- `fuel_*`: Fuel properties.
- `hydraulics_*`: Plant hydraulics.
- `hydrology_*`: Canopy and soil hydrology (rainfall interception, soil evaporation, soil infiltration).
- `light_*`: Radiation extinction and absorption.
Expand Down

0 comments on commit a8bb29d

Please sign in to comment.