From d82ec976bb735d599958962820ab6541c9415e70 Mon Sep 17 00:00:00 2001 From: Delaigue Olivier <olivier.delaigue@irstea.priv> Date: Mon, 4 Mar 2019 15:14:07 +0100 Subject: [PATCH] v1.2.7.6 CLEAN: move code out of the loop on the layers --- DESCRIPTION | 2 +- NEWS.rmd | 4 +++- R/DataAltiExtrapolation_Valery.R | 9 ++++++++- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 197b5640..10451ead 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: airGR Type: Package Title: Suite of GR Hydrological Models for Precipitation-Runoff Modelling -Version: 1.2.7.5 +Version: 1.2.7.6 Date: 2019-03-04 Authors@R: c( person("Laurent", "Coron", role = c("aut", "trl"), comment = c(ORCID = "0000-0002-1503-6204")), diff --git a/NEWS.rmd b/NEWS.rmd index 137d9047..1f864f80 100644 --- a/NEWS.rmd +++ b/NEWS.rmd @@ -13,7 +13,7 @@ output: -### 1.2.7.5 Release Notes (2019-03-04) +### 1.2.7.6 Release Notes (2019-03-04) @@ -58,6 +58,8 @@ output: - Outputs of frun_GR2M Fortran subroutine were reordered. +- <code>DataAltiExtrapolation_Valery()</code> now returns named elements of lists relative to elevation layer + ____________________________________________________________________________________ diff --git a/R/DataAltiExtrapolation_Valery.R b/R/DataAltiExtrapolation_Valery.R index ce0a5c7c..6dee926d 100644 --- a/R/DataAltiExtrapolation_Valery.R +++ b/R/DataAltiExtrapolation_Valery.R @@ -527,7 +527,14 @@ DataAltiExtrapolation_Valery <- function(DatesR, } LayerFracSolidPrecip[[iLayer]] <- as.double(SolidFraction) } - + namesLayer <- sprintf("L%i", seq_along(LayerPrecip)) + names(LayerPrecip) <- namesLayer + names(LayerTempMean) <- namesLayer + if (!is.null(TempMin) & !is.null(TempMax)) { + names(LayerTempMin) <- namesLayer + names(LayerTempMax) <- namesLayer + } + names(LayerFracSolidPrecip) <- namesLayer -- GitLab