Skip to content

Commit

Permalink
FMC update
Browse files Browse the repository at this point in the history
  • Loading branch information
BadgerOnABike committed Jan 8, 2025
1 parent a31c058 commit d544695
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions R/foliar_moisture_content.r
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,22 @@
#' @param LAT Latitude (decimal degrees)
#' @param LONG Longitude (decimal degrees)
#' @param ELV Elevation (metres)
#' @param DJ Day of year (offeren referred to as julian date)
#' @param DJ Day of year (julian date)
#' @param D0 Date of minimum foliar moisture content. _If D0, date of min
#' FMC, is not known then D0 = NULL._
#' @param FMCo Foliar Moisture Content Override - For use when outside of North
#' America
#'
#' @return FMC: Foliar Moisture Content value
#' @noRd

foliar_moisture_content <- function(LAT, LONG, ELV, DJ, D0) {
foliar_moisture_content <- function(LAT, LONG, ELV, DJ, D0,FMCo=NULL) {

if(!is.null(FMCo) & LAT < 0){FMC <- FMCo;
message("FMC Override provided, returning as FMC.");
return(FMC)
}
warning({if(LAT < 7 | LONG < 140 | LONG > 52){"Location outside of North America. Please define an FMC override in the FMCo variable."}})
D0 <- foliar_moisture_content_minimum(LAT, LONG, ELV, DJ, D0)

# Number of days between day of year and date of min FMC
Expand Down

0 comments on commit d544695

Please sign in to comment.