From 4f272a7b59339f19ff01c44e381df220741ea9c4 Mon Sep 17 00:00:00 2001
From: Delaigue Olivier <olivier.delaigue@irstea.priv>
Date: Mon, 4 Mar 2019 15:15:45 +0100
Subject: [PATCH] v1.2.7.7 CLEAN: add names to elementq of lists of layers in
 DataAltiExtrapolation_Valery

---
 DESCRIPTION                      |  2 +-
 NEWS.rmd                         |  2 +-
 R/DataAltiExtrapolation_Valery.R | 19 ++++++++++---------
 3 files changed, 12 insertions(+), 11 deletions(-)

diff --git a/DESCRIPTION b/DESCRIPTION
index 10451ead..a004ffb1 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.6
+Version: 1.2.7.7
 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 1f864f80..2d514bcc 100644
--- a/NEWS.rmd
+++ b/NEWS.rmd
@@ -13,7 +13,7 @@ output:
 
 
 
-### 1.2.7.6 Release Notes (2019-03-04) 
+### 1.2.7.7 Release Notes (2019-03-04) 
 
 
 
diff --git a/R/DataAltiExtrapolation_Valery.R b/R/DataAltiExtrapolation_Valery.R
index 6dee926d..e75850b0 100644
--- a/R/DataAltiExtrapolation_Valery.R
+++ b/R/DataAltiExtrapolation_Valery.R
@@ -460,8 +460,7 @@ DataAltiExtrapolation_Valery <- function(DatesR,
   
   ##Temperature_extrapolation____________________________________________________________________
   ##Initialisation
-    LayerTempMean <-
-      list()
+    LayerTempMean <- list()
     LayerTempMin <- list()
     LayerTempMax <- list()
     
@@ -499,15 +498,17 @@ DataAltiExtrapolation_Valery <- function(DatesR,
     ##Thresold_of_inputs_median_elevation
     Zthreshold <- 1500
     
+    ##Option
+    Option <- "USACE"
+    if (!is.na(ZInputs)) {
+      if (ZInputs < Zthreshold & !is.null(TempMin) & !is.null(TempMax)) {
+        Option <- "Hydrotel"
+      }
+    }
+    
     ##On_each_elevation_layer...
     for (iLayer in 1:NLayers) {
-      Option <- "USACE"
-      
-      if (!is.na(ZInputs)) {
-        if (ZInputs < Zthreshold & !is.null(TempMin) & !is.null(TempMax)) {
-          Option <- "Hydrotel"
-        }
-      }
+
       ##Turcotte_formula_from_Hydrotel
       if (Option == "Hydrotel") {
         TempMin <- LayerTempMin[[iLayer]]
-- 
GitLab