Skip to content

Commit

Permalink
Fix CWD in "EcologicalDroughtMetrics2023"
Browse files Browse the repository at this point in the history
- CWD values were previously but incorrectly multiplied by 10
-> now they return the correct value in mm
  • Loading branch information
dschlaep committed Jul 12, 2023
1 parent e13d743 commit e9c782f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions R/Functions_Metrics_002_newRR.R
Original file line number Diff line number Diff line change
Expand Up @@ -2475,7 +2475,7 @@ get_EcologicalDroughtMetrics2023_annual <- function(


#--- Intermediate variables
tmp_cwd_monthly <- 10 * calc_CWD_mm(
tmp_cwd_monthly <- calc_CWD_mm(
pet_cm = sim_data[["mon"]][["values"]][["pet"]],
et_cm = sim_data[["mon"]][["values"]][["et"]]
)
Expand Down Expand Up @@ -2633,7 +2633,7 @@ get_EcologicalDroughtMetrics2023_annual <- function(
ET = 10 * sim_data[["yr"]][["values"]][["et"]],

# Climatic water deficit `[mm]` (where `CWD = PPT - ET`)
CWD = 10 * calc_CWD_mm(
CWD = calc_CWD_mm(
pet_cm = sim_data[["yr"]][["values"]][["pet"]],
et_cm = sim_data[["yr"]][["values"]][["et"]]
),
Expand All @@ -2642,7 +2642,7 @@ get_EcologicalDroughtMetrics2023_annual <- function(
# (where `CWDextreme10d` is the largest daily `CWD`
# averaged over 10-day periods)
CWDextreme010d = calc_extreme_funNday(
x = 10 * calc_CWD_mm(
x = calc_CWD_mm(
pet_cm = sim_data[["day"]][["values"]][["pet"]],
et_cm = sim_data[["day"]][["values"]][["et"]]
),
Expand Down

0 comments on commit e9c782f

Please sign in to comment.