Commit 6a23e019 authored by unknown's avatar unknown
Browse files

v1.0.9.3 bug fixed in DataAltiExtrapolation_Valery when PrecipScale = FALSE #4521

Showing with 4 additions and 4 deletions
+4 -4
Package: airGR
Type: Package
Title: Suite of GR Hydrological Models for Precipitation-Runoff Modelling
Version: 1.0.9.2
Date: 2017-06-22
Version: 1.0.9.3
Date: 2017-06-26
Authors@R: c(
person("Laurent", "Coron", role = c("aut", "trl")),
person("Charles", "Perrin", role = c("aut", "ths")),
......
......@@ -433,7 +433,7 @@ DataAltiExtrapolation_Valery <- function(DatesR,
##Extrapolation
##Thresold_of_inputs_median_elevation
Zthreshold <- 4000
LayerPrecip_df <- sapply(1:NLayers, function(iLayer) {
LayerPrecip_mat <- sapply(1:NLayers, function(iLayer) {
##If_layer_elevation_smaller_than_Zthreshold
if (ZLayers[iLayer] <= Zthreshold) {
prcp <- as.double(Precip * exp(TabGradP * (ZLayers[iLayer] - ZInputs)))
......@@ -450,7 +450,7 @@ DataAltiExtrapolation_Valery <- function(DatesR,
return(prcp)
})
if (PrecipScale) {
LayerPrecip_mat <- LayerPrecip_df / rowMeans(LayerPrecip_df) * Precip
LayerPrecip_mat <- LayerPrecip_mat / rowMeans(LayerPrecip_mat) * Precip
LayerPrecip_mat[is.nan(LayerPrecip_mat)] <- 0
}
LayerPrecip <- as.list(as.data.frame(LayerPrecip_mat))
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment