diff --git a/DESCRIPTION b/DESCRIPTION index 42fc032d6b981b1a06a293314f7fa6dc45dd2b8f..8d6d60b3225b6a1b01a9d75adaf942dcd092e649 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,8 +1,8 @@ Package: airGR Type: Package Title: Suite of GR Hydrological Models for Precipitation-Runoff Modelling -Version: 1.2.15.7 -Date: 2019-05-03 +Version: 1.3.0.0 +Date: 2019-05-20 Authors@R: c( person("Laurent", "Coron", role = c("aut", "trl"), comment = c(ORCID = "0000-0002-1503-6204")), person("Olivier", "Delaigue", role = c("aut", "cre"), comment = c(ORCID = "0000-0002-7668-8468"), email = "airGR@irstea.fr"), diff --git a/NEWS.rmd b/NEWS.rmd index 7a0eb0ac57a29570e889222c53cb8c7c4d1c2f24..4e8aa74c6ba47e69ff88a4fd89aacda59b847196 100644 --- a/NEWS.rmd +++ b/NEWS.rmd @@ -13,8 +13,7 @@ output: - -### 1.2.15.7 Release Notes (2019-05-03) +3.0.02.15.7 Release Notes (2019-05-20) #### New features diff --git a/R/RunModel_CemaNeigeGR4H.R b/R/RunModel_CemaNeigeGR4H.R new file mode 100644 index 0000000000000000000000000000000000000000..6bd5feae81d4f5a8bc0d73d6adb61cc727743e1b --- /dev/null +++ b/R/RunModel_CemaNeigeGR4H.R @@ -0,0 +1,181 @@ +RunModel_CemaNeigeGR4H <- function(InputsModel,RunOptions,Param){ + + + ## Initialization of variables + IsHyst <- inherits(RunOptions, "hysteresis") + NParam <- ifelse(test = IsHyst, yes = 8L, no = 6L) + NStates <- 4L + FortranOutputs <- .FortranOutputs(GR = "GR4H", isCN = TRUE) + + + ##Arguments_check + if(!inherits(InputsModel,"InputsModel")){ stop("'InputsModel' must be of class 'InputsModel'") } + if(!inherits(InputsModel,"hourly" )){ stop("'InputsModel' must be of class 'hourly' ") } + if(!inherits(InputsModel,"GR" )){ stop("'InputsModel' must be of class 'GR' ") } + if(!inherits(InputsModel,"CemaNeige" )){ stop("'InputsModel' must be of class 'CemaNeige' ") } + if(!inherits(RunOptions,"RunOptions" )){ stop("'RunOptions' must be of class 'RunOptions' ") } + if(!inherits(RunOptions,"GR" )){ stop("'RunOptions' must be of class 'GR' ") } + if(!inherits(RunOptions,"CemaNeige" )){ stop("'RunOptions' must be of class 'CemaNeige' ") } + if(!is.vector(Param) | !is.numeric(Param)){ stop("'Param' must be a numeric vector") } + if(sum(!is.na(Param))!=NParam){ stop(paste("'Param' must be a vector of length ",NParam," and contain no NA",sep="")) } + Param <- as.double(Param); + + Param_X1X3_threshold <- 1e-2 + Param_X4_threshold <- 0.5 + if (Param[1L] < Param_X1X3_threshold) { + warning(sprintf("Param[1] (X1: production store capacity [mm]) < %.2f\n X1 set to %.2f", Param_X1X3_threshold, Param_X1X3_threshold)) + Param[1L] <- Param_X1X3_threshold + } + if (Param[3L] < Param_X1X3_threshold) { + warning(sprintf("Param[3] (X3: routing store capacity [mm]) < %.2f\n X3 set to %.2f", Param_X1X3_threshold, Param_X1X3_threshold)) + Param[3L] <- Param_X1X3_threshold + } + if (Param[4L] < Param_X4_threshold) { + warning(sprintf("Param[4] (X4: unit hydrograph time constant [d]) < %.2f\n X4 set to %.2f", Param_X4_threshold, Param_X4_threshold)) + Param[4L] <- Param_X4_threshold + } + + ##Input_data_preparation + if(identical(RunOptions$IndPeriod_WarmUp,as.integer(0))){ RunOptions$IndPeriod_WarmUp <- NULL; } + IndPeriod1 <- c(RunOptions$IndPeriod_WarmUp,RunOptions$IndPeriod_Run); + LInputSeries <- as.integer(length(IndPeriod1)) + IndPeriod2 <- (length(RunOptions$IndPeriod_WarmUp)+1):LInputSeries; + ParamCemaNeige <- Param[(length(Param)-1-2*as.integer(IsHyst)):length(Param)]; + NParamMod <- as.integer(length(Param)-(2+2*as.integer(IsHyst))); + ParamMod <- Param[1:NParamMod]; + NLayers <- length(InputsModel$LayerPrecip); + NStatesMod <- as.integer(length(RunOptions$IniStates)-NStates*NLayers); + ExportDatesR <- "DatesR" %in% RunOptions$Outputs_Sim; + ExportStateEnd <- "StateEnd" %in% RunOptions$Outputs_Sim; + + + ##SNOW_MODULE________________________________________________________________________________## + if(inherits(RunOptions,"CemaNeige")){ + if("all" %in% RunOptions$Outputs_Sim){ IndOutputsCemaNeige <- as.integer(1:length(FortranOutputs$CN)); + } else { IndOutputsCemaNeige <- which(FortranOutputs$CN %in% RunOptions$Outputs_Sim); } + CemaNeigeLayers <- list(); CemaNeigeStateEnd <- NULL; NameCemaNeigeLayers <- "CemaNeigeLayers"; + + + ##Call_DLL_CemaNeige_________________________ + for(iLayer in 1:NLayers){ + if (!IsHyst) { + StateStartCemaNeige <- RunOptions$IniStates[(7 + 20 + 40) + c(iLayer, iLayer+NLayers)] + } else { + StateStartCemaNeige <- RunOptions$IniStates[(7 + 20 + 40) + c(iLayer, iLayer+NLayers, iLayer+2*NLayers, iLayer+3*NLayers)] + } + RESULTS <- .Fortran("frun_CemaNeige",PACKAGE="airGR", + ##inputs + LInputs=LInputSeries, ### length of input and output series + InputsPrecip=InputsModel$LayerPrecip[[iLayer]][IndPeriod1], ### input series of total precipitation [mm/h] + InputsFracSolidPrecip=InputsModel$LayerFracSolidPrecip[[iLayer]][IndPeriod1], ### input series of fraction of solid precipitation [0-1] + InputsTemp=InputsModel$LayerTemp[[iLayer]][IndPeriod1], ### input series of air mean temperature [degC] + MeanAnSolidPrecip=RunOptions$MeanAnSolidPrecip[iLayer], ### value of annual mean solid precip [mm/y] + NParam=as.integer(NParam), ### number of model parameter = 2 + Param=as.double(ParamCemaNeige), ### parameter set + NStates=as.integer(NStates), ### number of state variables used for model initialising = 2 + StateStart=StateStartCemaNeige, ### state variables used when the model run starts + IsHyst = as.integer(IsHyst), ### use of hysteresis + NOutputs=as.integer(length(IndOutputsCemaNeige)), ### number of output series + IndOutputs=IndOutputsCemaNeige, ### indices of output series + ##outputs + Outputs=matrix(as.double(-999.999),nrow=LInputSeries,ncol=length(IndOutputsCemaNeige)), ### output series [mm] + StateEnd=rep(as.double(-999.999),as.integer(NStates)) ### state variables at the end of the model run (reservoir levels [mm] and HU) + ) + RESULTS$Outputs[ round(RESULTS$Outputs ,3)==(-999.999)] <- NA; + RESULTS$StateEnd[round(RESULTS$StateEnd,3)==(-999.999)] <- NA; + + ##Data_storage + CemaNeigeLayers[[iLayer]] <- lapply(seq_len(RESULTS$NOutputs), function(i) RESULTS$Outputs[IndPeriod2,i]); + names(CemaNeigeLayers[[iLayer]]) <- FortranOutputs$CN[IndOutputsCemaNeige]; + IndPliqAndMelt <- which(names(CemaNeigeLayers[[iLayer]]) == "PliqAndMelt"); + if(iLayer==1){ CatchMeltAndPliq <- RESULTS$Outputs[,IndPliqAndMelt]/NLayers; } + if(iLayer >1){ CatchMeltAndPliq <- CatchMeltAndPliq + RESULTS$Outputs[,IndPliqAndMelt]/NLayers; } + if(ExportStateEnd){ CemaNeigeStateEnd <- c(CemaNeigeStateEnd,RESULTS$StateEnd); } + rm(RESULTS); + } ###ENDFOR_iLayer + names(CemaNeigeLayers) <- sprintf("Layer%02i", seq_len(NLayers)) + } ###ENDIF_RunSnowModule + if(!inherits(RunOptions,"CemaNeige")){ + CemaNeigeLayers <- list(); CemaNeigeStateEnd <- NULL; NameCemaNeigeLayers <- NULL; + CatchMeltAndPliq <- InputsModel$Precip[IndPeriod1]; } + + + + ##MODEL______________________________________________________________________________________## + if("all" %in% RunOptions$Outputs_Sim){ IndOutputsMod <- as.integer(1:length(FortranOutputs$GR)); + } else { IndOutputsMod <- which(FortranOutputs$GR %in% RunOptions$Outputs_Sim); } + + ##Use_of_IniResLevels + if(!is.null(RunOptions$IniResLevels)){ + RunOptions$IniStates[1] <- RunOptions$IniResLevels[1]*ParamMod[1]; ### production store level (mm) + RunOptions$IniStates[2] <- RunOptions$IniResLevels[2]*ParamMod[3]; ### routing store level (mm) + } + + ##Call_fortan + RESULTS <- .Fortran("frun_GR4H",PACKAGE="airGR", + ##inputs + LInputs=LInputSeries, ### length of input and output series + InputsPrecip=CatchMeltAndPliq, ### input series of total precipitation [mm/h] + InputsPE=InputsModel$PotEvap[IndPeriod1], ### input series potential evapotranspiration [mm/h] + NParam=NParamMod, ### number of model parameter + Param=ParamMod, ### parameter set + NStates=NStatesMod, ### number of state variables used for model initialising + StateStart=RunOptions$IniStates[1:NStatesMod], ### state variables used when the model run starts + NOutputs=as.integer(length(IndOutputsMod)), ### number of output series + IndOutputs=IndOutputsMod, ### indices of output series + ##outputs + Outputs=matrix(as.double(-999.999),nrow=LInputSeries,ncol=length(IndOutputsMod)), ### output series [mm] + StateEnd=rep(as.double(-999.999),NStatesMod) ### state variables at the end of the model run + ) + RESULTS$Outputs[ round(RESULTS$Outputs ,3)==(-999.999)] <- NA; + RESULTS$StateEnd[round(RESULTS$StateEnd,3)==(-999.999)] <- NA; + if (ExportStateEnd) { + idNStates <- seq_len(NStates*NLayers) %% NStates + RESULTS$StateEnd <- CreateIniStates(FUN_MOD = RunModel_CemaNeigeGR4J, InputsModel = InputsModel, IsHyst = IsHyst, + ProdStore = RESULTS$StateEnd[1L], RoutStore = RESULTS$StateEnd[2L], ExpStore = NULL, + UH1 = RESULTS$StateEnd[(1:20)+7], UH2 = RESULTS$StateEnd[(1:40)+(7+20)], + GCemaNeigeLayers = CemaNeigeStateEnd[seq_len(NStates*NLayers)[idNStates == 3]], + eTGCemaNeigeLayers = CemaNeigeStateEnd[seq_len(NStates*NLayers)[idNStates == 2]], + GthrCemaNeigeLayers = CemaNeigeStateEnd[seq_len(NStates*NLayers)[idNStates == 1]], + GlocmaxCemaNeigeLayers = CemaNeigeStateEnd[seq_len(NStates*NLayers)[idNStates == 0]], + verbose = FALSE) + } + + if(inherits(RunOptions,"CemaNeige") & "Precip" %in% RunOptions$Outputs_Sim){ RESULTS$Outputs[,which(FortranOutputs$GR[IndOutputsMod]=="Precip")] <- InputsModel$Precip[IndPeriod1]; } + + ##Output_data_preparation + ##OutputsModel_only + if(!ExportDatesR & !ExportStateEnd){ + OutputsModel <- c( lapply(seq_len(RESULTS$NOutputs), function(i) RESULTS$Outputs[IndPeriod2,i]), + list(CemaNeigeLayers) ); + names(OutputsModel) <- c(FortranOutputs$GR[IndOutputsMod],NameCemaNeigeLayers); } + ##DatesR_and_OutputsModel_only + if( ExportDatesR & !ExportStateEnd){ + OutputsModel <- c( list(InputsModel$DatesR[RunOptions$IndPeriod_Run]), + lapply(seq_len(RESULTS$NOutputs), function(i) RESULTS$Outputs[IndPeriod2,i]), + list(CemaNeigeLayers) ); + names(OutputsModel) <- c("DatesR",FortranOutputs$GR[IndOutputsMod],NameCemaNeigeLayers); } + ##OutputsModel_and_SateEnd_only + if(!ExportDatesR & ExportStateEnd){ + OutputsModel <- c( lapply(seq_len(RESULTS$NOutputs), function(i) RESULTS$Outputs[IndPeriod2,i]), + list(CemaNeigeLayers), + list(RESULTS$StateEnd) ); + names(OutputsModel) <- c(FortranOutputs$GR[IndOutputsMod],NameCemaNeigeLayers,"StateEnd"); } + ##DatesR_and_OutputsModel_and_SateEnd + if( ExportDatesR & ExportStateEnd){ + OutputsModel <- c( list(InputsModel$DatesR[RunOptions$IndPeriod_Run]), + lapply(seq_len(RESULTS$NOutputs), function(i) RESULTS$Outputs[IndPeriod2,i]), + list(CemaNeigeLayers), + list(RESULTS$StateEnd) ); + names(OutputsModel) <- c("DatesR",FortranOutputs$GR[IndOutputsMod],NameCemaNeigeLayers,"StateEnd"); } + + ##End + rm(RESULTS); + + class(OutputsModel) <- c("OutputsModel","hourly","GR","CemaNeige"); + if(IsHyst) { + class(OutputsModel) <- c(class(OutputsModel), "hysteresis") + } + return(OutputsModel); + +} diff --git a/man/RunModel_CemaNeigeGR4H.Rd b/man/RunModel_CemaNeigeGR4H.Rd new file mode 100644 index 0000000000000000000000000000000000000000..decf15470424b44452e5c162a443403f6ce7761a --- /dev/null +++ b/man/RunModel_CemaNeigeGR4H.Rd @@ -0,0 +1,178 @@ +\encoding{UTF-8} + + +\name{RunModel_CemaNeigeGR4H} +\alias{RunModel_CemaNeigeGR4H} + + +\title{Run with the CemaNeigeGR4H hydrological model} + + +\usage{ +RunModel_CemaNeigeGR4H(InputsModel, RunOptions, Param) +} + + +\arguments{ +\item{InputsModel}{[object of class \emph{InputsModel}] see \code{\link{CreateInputsModel}} for details} + +\item{RunOptions}{[object of class \emph{RunOptions}] see \code{\link{CreateRunOptions}} for details} + +\item{Param}{[numeric] vector of 6 (or 8 parameters if \code{IsHyst = TRUE}, see \code{\link{CreateRunOptions}} for details) +\tabular{ll}{ +GR4H X1 \tab production store capacity [mm] \cr +GR4H X2 \tab intercatchment exchange coefficient [mm/h] \cr +GR4H X3 \tab routing store capacity [mm] \cr +GR4H X4 \tab unit hydrograph time constant [d] \cr +CemaNeige X1 \tab weighting coefficient for snow pack thermal state [-] \cr +CemaNeige X2 \tab degree-hour melt coefficient [mm/°C/h] \cr +CemaNeige X3 \tab (optional) accumulation threshold [mm] (needed if \code{IsHyst = TRUE}) \cr +CemaNeige X4 \tab (optional) percentage (between 0 and 1) of annual snowfall defining the melt threshold [-] (needed if \code{IsHyst = TRUE}) \cr +}} +} + + +\value{ +[list] list containing the function outputs organised as follows: + \tabular{ll}{ + \emph{$DatesR } \tab [POSIXlt] series of dates \cr + \emph{$PotEvap } \tab [numeric] series of input potential evapotranspiration [mm/h] \cr + \emph{$Precip } \tab [numeric] series of input total precipitation [mm/h] \cr + \emph{$Prod } \tab [numeric] series of production store level [mm] \cr + \emph{$Pn } \tab [numeric] series of net rainfall [mm/h] \cr + \emph{$Ps } \tab [numeric] series of the part of Pn filling the production store [mm/h] \cr + \emph{$AE } \tab [numeric] series of actual evapotranspiration [mm/h] \cr + \emph{$Perc } \tab [numeric] series of percolation (PERC) [mm/h] \cr + \emph{$PR } \tab [numeric] series of PR=Pn-Ps+Perc [mm/h] \cr + \emph{$Q9 } \tab [numeric] series of UH1 outflow (Q9) [mm/h] \cr + \emph{$Q1 } \tab [numeric] series of UH2 outflow (Q1) [mm/h] \cr + \emph{$Rout } \tab [numeric] series of routing store level [mm] \cr + \emph{$Exch } \tab [numeric] series of potential semi-exchange between catchments [mm/h] \cr + \emph{$AExch1 } \tab [numeric] series of actual exchange between catchments for branch 1 [mm/h] \cr + \emph{$AExch2 } \tab [numeric] series of actual exchange between catchments for branch 2 [mm/h] \cr + \emph{$AExch } \tab [numeric] series of actual exchange between catchments (1+2) [mm/h] \cr + \emph{$QR } \tab [numeric] series of routing store outflow (QR) [mm/h] \cr + \emph{$QD } \tab [numeric] series of direct flow from UH2 after exchange (QD) [mm/h] \cr + \emph{$Qsim } \tab [numeric] series of simulated discharge [mm/h] \cr + \emph{$CemaNeigeLayers} \tab [list] list of CemaNeige outputs (1 list per layer) \cr + \emph{$CemaNeigeLayers[[iLayer]]$Pliq } \tab [numeric] series of liquid precip. [mm/h] \cr + \emph{$CemaNeigeLayers[[iLayer]]$Psol } \tab [numeric] series of solid precip. [mm/h] \cr + \emph{$CemaNeigeLayers[[iLayer]]$SnowPack } \tab [numeric] series of snow pack [mm] \cr + \emph{$CemaNeigeLayers[[iLayer]]$ThermalState } \tab [numeric] series of snow pack thermal state [°C] \cr + \emph{$CemaNeigeLayers[[iLayer]]$Gratio } \tab [numeric] series of Gratio [0-1] \cr + \emph{$CemaNeigeLayers[[iLayer]]$PotMelt } \tab [numeric] series of potential snow melt [mm/h] \cr + \emph{$CemaNeigeLayers[[iLayer]]$Melt } \tab [numeric] series of actual snow melt [mm/h] \cr + \emph{$CemaNeigeLayers[[iLayer]]$PliqAndMelt } \tab [numeric] series of liquid precip. + actual snow melt [mm/h] \cr + \emph{$CemaNeigeLayers[[iLayer]]$Temp } \tab [numeric] series of air temperature [°C] \cr + \emph{$CemaNeigeLayers[[iLayer]]$Gthreshold } \tab [numeric] series of melt threshold [mm] \cr + \emph{$CemaNeigeLayers[[iLayer]]$Glocalmax } \tab [numeric] series of local melt threshold for hysteresis [mm] \cr + \emph{$StateEnd} \tab [numeric] states at the end of the run: \cr\tab store & unit hydrographs levels [mm], CemaNeige states [mm & °C], \cr\tab see \code{\link{CreateIniStates}} for more details \cr + } + (refer to the provided references or to the package source code for further details on these model outputs) +} + + +\description{ +Function which performs a single run for the CemaNeige-GR4H daily lumped model over the test period. +} + + +\details{ +The choice of the CemaNeige version is explained in \code{\link{CreateRunOptions}}. \cr +For further details on the model, see the references section. \cr +For further details on the argument structures and initialisation options, see \code{\link{CreateRunOptions}}. +} + + +\examples{ +library(airGR) + +## loading catchment data +data(L0123002) + +## preparation of the InputsModel object +InputsModel <- CreateInputsModel(FUN_MOD = RunModel_CemaNeigeGR4H, DatesR = BasinObs$DatesR, + Precip = BasinObs$P, PotEvap = BasinObs$E, TempMean = BasinObs$T, + ZInputs = median(BasinInfo$HypsoData), + HypsoData = BasinInfo$HypsoData, NLayers = 5) + +## run period selection +Ind_Run <- seq(which(format(BasinObs$DatesR, format = "\%Y-\%m-\%d")=="1990-01-01"), + which(format(BasinObs$DatesR, format = "\%Y-\%m-\%d")=="1999-12-31")) + + +## ---- original version of CemaNeige + +## preparation of the RunOptions object +RunOptions <- CreateRunOptions(FUN_MOD = RunModel_CemaNeigeGR4H, InputsModel = InputsModel, + IndPeriod_Run = Ind_Run) + +## simulation +Param <- c(X1 = 408.774, X2 = 2.646, X3 = 131.264, X4 = 1.174, + CNX1 = 0.962, CNX2 = 2.249) +OutputsModel <- RunModel_CemaNeigeGR4H(InputsModel = InputsModel, + RunOptions = RunOptions, Param = Param) + +## results preview +plot(OutputsModel, Qobs = BasinObs$Qmm[Ind_Run]) + +## efficiency criterion: Nash-Sutcliffe Efficiency +InputsCrit <- CreateInputsCrit(FUN_CRIT = ErrorCrit_NSE, InputsModel = InputsModel, + RunOptions = RunOptions, Obs = BasinObs$Qmm[Ind_Run]) +OutputsCrit <- ErrorCrit_NSE(InputsCrit = InputsCrit, OutputsModel = OutputsModel) + + +## ---- version of CemaNeige with the Linear Hysteresis + +## preparation of the RunOptions object +RunOptions <- CreateRunOptions(FUN_MOD = RunModel_CemaNeigeGR4H, InputsModel = InputsModel, + IndPeriod_Run = Ind_Run, IsHyst = TRUE) + +## simulation +Param <- c(X1 = 408.774, X2 = 2.646, X3 = 131.264, X4 = 1.174, + CNX1 = 0.962, CNX2 = 2.249, CNX3 = 100, CNX4 = 0.4) +OutputsModel <- RunModel_CemaNeigeGR4H(InputsModel = InputsModel, + RunOptions = RunOptions, Param = Param) + +## results preview +plot(OutputsModel, Qobs = BasinObs$Qmm[Ind_Run]) + +## efficiency criterion: Nash-Sutcliffe Efficiency +InputsCrit <- CreateInputsCrit(FUN_CRIT = ErrorCrit_NSE, InputsModel = InputsModel, + RunOptions = RunOptions, Obs = BasinObs$Qmm[Ind_Run]) +OutputsCrit <- ErrorCrit_NSE(InputsCrit = InputsCrit, OutputsModel = OutputsModel) +} + + +\author{ +Laurent Coron, Audrey Valéry, Claude Michel, Charles Perrin, Vazken Andréassian, Olivier Delaigue +} + + +\references{ +Perrin, C., C. Michel and V. Andréassian (2003). + Improvement of a parsimonious model for streamflow simulation. + Journal of Hydrology, 279(1-4), 275-289, doi:10.1016/S0022-1694(03)00225-7. +\cr\cr +Riboust, P., G. Thirel, N. Le Moine and P. Ribstein (2019). + Revisiting a simple degree-day model for integrating satellite data: implementation of SWE-SCA hystereses. + Journal of Hydrology and Hydromechanics. doi:10.2478/johh-2018-0004, 67, 1, 70–81. +\cr\cr +Valéry, A., V. Andréassian and C. Perrin (2014). + "As simple as possible but not simpler": what is useful in a temperature-based snow-accounting routine? + Part 1 - Comparison of six snow accounting routines on 380 catchments. + Journal of Hydrology. doi:10.1016/j.jhydrol.2014.04.059. +\cr\cr +Valéry, A., V. Andréassian and C. Perrin (2014). + "As simple as possible but not simpler": What is useful in a temperature-based snow-accounting routine? + Part 2 - Sensitivity analysis of the Cemaneige snow accounting routine on 380 catchments. + Journal of Hydrology. doi:10.1016/j.jhydrol.2014.04.058. +} + + +\seealso{ +\code{\link{RunModel_CemaNeige}}, \code{\link{RunModel_CemaNeigeGR4J}}, \code{\link{RunModel_CemaNeigeGR5J}}, +\code{\link{RunModel_CemaNeigeGR6J}}, \code{\link{RunModel_GR4H}}, +\code{\link{CreateInputsModel}}, \code{\link{CreateRunOptions}}, \code{\link{CreateIniStates}}. +} + diff --git a/src/frun_CEMANEIGE.f b/src/frun_CEMANEIGE.f index f58328e008b8fa0414ebab35add227dd43298471..ef866eb13014143476456acc5b5a4ea8d8787145 100644 --- a/src/frun_CEMANEIGE.f +++ b/src/frun_CEMANEIGE.f @@ -5,7 +5,7 @@ SUBROUTINE frun_CEMANEIGE( !inputs & LInputs , ! [integer] length of input and output series - & InputsPrecip , ! [double] input series of total precipitation [mm] + & InputsPrecip , ! [double] input series of total precipitation [mm/time step] & InputsFracSolidPrecip, ! [double] input series of fraction of solid precipitation [0-1] & InputsTemp , ! [double] input series of air mean temperature [degC] & MeanAnSolidPrecip , ! [double] value of annual mean solid precip [mm/y] @@ -153,14 +153,14 @@ c Outputs = -999.999 !initialisation made in R !Storage of outputs DO I=1,NOutputs - IF(IndOutputs(I).EQ.1) Outputs(k,I)=Pliq ! Pliq ! observed liquid precipitation [mm/day] - IF(IndOutputs(I).EQ.2) Outputs(k,I)=Psol ! Psol ! observed solid precipitation [mm/day] + IF(IndOutputs(I).EQ.1) Outputs(k,I)=Pliq ! Pliq ! observed liquid precipitation [mm/time step] + IF(IndOutputs(I).EQ.2) Outputs(k,I)=Psol ! Psol ! observed solid precipitation [mm/time step] IF(IndOutputs(I).EQ.3) Outputs(k,I)=G ! SnowPack ! snow pack [mm] IF(IndOutputs(I).EQ.4) Outputs(k,I)=eTG ! ThermalState ! thermal state [°C] IF(IndOutputs(I).EQ.5) Outputs(k,I)=Gratio ! Gratio ! Gratio [-] - IF(IndOutputs(I).EQ.6) Outputs(k,I)=PotMelt ! PotMelt ! potential snow melt [mm/day] - IF(IndOutputs(I).EQ.7) Outputs(k,I)=Melt ! Melt ! melt [mm/day] - IF(IndOutputs(I).EQ.8) Outputs(k,I)=PliqAndMelt ! PliqAndMelt ! liquid precipitation + melt [mm/day] + IF(IndOutputs(I).EQ.6) Outputs(k,I)=PotMelt ! PotMelt ! potential snow melt [mm/time step] + IF(IndOutputs(I).EQ.7) Outputs(k,I)=Melt ! Melt ! melt [mm/time step] + IF(IndOutputs(I).EQ.8) Outputs(k,I)=PliqAndMelt ! PliqAndMelt ! liquid precipitation + melt [mm/time step] IF(IndOutputs(I).EQ.9) Outputs(k,I)=InputsTemp(k) ! Temp ! air temperature [°C] IF(IndOutputs(I).EQ.10) Outputs(k,I)=Gthreshold ! Gthreshold ! melt threshold [mm] IF(IndOutputs(I).EQ.11) Outputs(k,I)=Glocalmax ! Glocalmax ! local melt threshold for hysteresis [mm]