index_KBDI: Keech-Byram Drought Index.

Usage Arguments Examples

View source: R/fire_index_functions.r

Usage

1
index_KBDI(Temperature, Rain, MAP = sum(Rain)/length(Rain/365.25))

Arguments

Temperature
Rain
MAP

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
##---- Should be DIRECTLY executable !! ----
##-- ==>  Define data, use random,
##--	or do  help(data=index)  for the standard data sets.

## The function is currently defined as
function (Temperature, Rain, MAP = sum(Rain)/length(Rain/365.25)) 
{
    KBDI <- 200
    KBDI_list <- c()
    llength <- length(Temperature)
    for (day in 1:llength) {
        pKBDI <- KBDI
        KBDI <- KBDI - Rain[day]
        if (KBDI < 0) {
            KBDI <- 0
        }
        todayET <- lookupET(pKBDI, Temperature[day], MAP)
        KBDI <- KBDI + todayET
        KBDI_list <- append(KBDI_list, KBDI)
    }
    KBDI_list
  }

ozjimbob/ecbtools documentation built on Jan. 18, 2021, 7:39 p.m.