Commit 4447886d authored by Delaigue Olivier's avatar Delaigue Olivier
Browse files

Version 0.8.1.2

parent 284f572d
......@@ -2,15 +2,17 @@ Package: airGR
Type: Package
Title: Modelling tools used at Irstea-HBAN (France), including GR4J and
CemaNeige
Version: 0.8.1.0
Date: 2015-10-27
Version: 0.8.1.2
Date: 2015-21-08
Author: Laurent CORON
Maintainer: Laurent CORON, Olivier DELAIGUE
<olivier.delaigue@irstea.fr>
Maintainer: Laurent CORON, Olivier DELAIGUE <airGR@irstea.fr>
Depends: R (>= 3.0.1)
Description: This package brings into R the hydrological modelling tools used at Irstea-HBAN (France).
The package includes several conceptual rainfall-runoff models and the associated functions
for their calibration and evaluation (GR4H, GR4J, GR5J, GR6J, GR2M, GR1A and CemaNeige).
Use help(airGR) for package description.
Description: This package brings into R the hydrological modelling tools used
at Irstea-HBAN (France). The package includes several conceptual
rainfall-runoff models and the associated functions for their calibration
and evaluation (GR4H, GR4J, GR5J, GR6J, GR2M, GR1A and CemaNeige). Use
help(airGR) for package description.
License: GPL-2
Packaged: 2015-10-27 18:41:47 UTC; H61970
RoxygenNote: 5.0.1
NeedsCompilation: yes
Packaged: 2015-12-08 18:06:18 UTC; H61970
# Generated by roxygen2 (4.1.1): do not edit by hand
# Generated by roxygen2: do not edit by hand
export(Calibration)
export(Calibration_HBAN)
......
......@@ -141,6 +141,7 @@ CreateInputsModel <- function(FUN_MOD,DatesR,Precip,PotEvap=NULL,TempMean=NULL,T
Precip <- Precip[Select]; PotEvap <- PotEvap[Select]; }
if("CemaNeige" %in% ObjectClass){
Precip <- Precip[Select]; TempMean <- TempMean[Select]; if(!is.null(TempMin) & !is.null(TempMax)){ TempMin <- TempMin[Select]; TempMax <- TempMax[Select]; } }
DatesR <- DatesR[Select];
WTxt <- paste(WTxt,"\t -> data were trunced to keep the most recent available time-steps \n",sep="");
WTxt <- paste(WTxt,"\t -> ",length(Select)," time-steps were kept \n",sep="");
if(!is.null(WTxt) & !quiet){ warning(WTxt); }
......
......@@ -5,7 +5,7 @@
#' @author Laurent Coron (June 2014)
#' @seealso \code{\link{ErrorCrit_RMSE}}, \code{\link{ErrorCrit_NSE}}, \code{\link{ErrorCrit_KGE}}
#' @example tests/example_ErrorCrit.R
#' @useDynLib airgr
#' @useDynLib airGR
#' @encoding UTF-8
#' @export
#_FunctionInputs__________________________________________________________________________________________________
......
......@@ -5,7 +5,7 @@
#' @author Laurent Coron (June 2014)
#' @seealso \code{\link{RunModel_GR4J}}, \code{\link{RunModel_CemaNeigeGR4J}}, \code{\link{CreateInputsModel}}, \code{\link{CreateRunOptions}}.
#' @example tests/example_RunModel.R
#' @useDynLib airgr
#' @useDynLib airGR
#' @encoding UTF-8
#' @export
#_FunctionInputs__________________________________________________________________________________________________
......
......@@ -15,7 +15,7 @@
#' 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_CemaNeigeGR4J}}, \code{\link{CreateInputsModel}}, \code{\link{CreateRunOptions}}.
#' @example tests/example_RunModel_CemaNeige.R
#' @useDynLib airgr
#' @useDynLib airGR
#' @encoding UTF-8
#' @export
#_FunctionInputs__________________________________________________________________________________________________
......@@ -78,7 +78,7 @@ RunModel_CemaNeige <- function(InputsModel,RunOptions,Param){
##Call_DLL_CemaNeige_________________________
for(iLayer in 1:NLayers){
StateStartCemaNeige <- RunOptions$IniStates[ (2*(iLayer-1)+1):(2*(iLayer-1)+2) ];
RESULTS <- .Fortran("frun_cemaneige",PACKAGE="airgr",
RESULTS <- .Fortran("frun_cemaneige",PACKAGE="airGR",
##inputs
LInputs=as.integer(length(IndPeriod1)), ### length of input and output series
InputsPrecip=InputsModel$LayerPrecip[[iLayer]][IndPeriod1], ### input series of total precipitation [mm/d]
......
......@@ -19,7 +19,7 @@
#' @seealso \code{\link{RunModel_CemaNeigeGR5J}}, \code{\link{RunModel_CemaNeigeGR6J}}, \code{\link{RunModel_GR4J}},
#' \code{\link{CreateInputsModel}}, \code{\link{CreateRunOptions}}.
#' @example tests/example_RunModel_CemaNeigeGR4J.R
#' @useDynLib airgr
#' @useDynLib airGR
#' @encoding UTF-8
#' @export
#_FunctionInputs__________________________________________________________________________________________________
......@@ -107,7 +107,7 @@ RunModel_CemaNeigeGR4J <- function(InputsModel,RunOptions,Param){
##Call_DLL_CemaNeige_________________________
for(iLayer in 1:NLayers){
StateStartCemaNeige <- RunOptions$IniStates[ (NStatesMod+2*(iLayer-1)+1):(NStatesMod+2*(iLayer-1)+2) ];
RESULTS <- .Fortran("frun_cemaneige",PACKAGE="airgr",
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/d]
......@@ -155,7 +155,7 @@ RunModel_CemaNeigeGR4J <- function(InputsModel,RunOptions,Param){
}
##Call_fortan
RESULTS <- .Fortran("frun_gr4j",PACKAGE="airgr",
RESULTS <- .Fortran("frun_gr4j",PACKAGE="airGR",
##inputs
LInputs=LInputSeries, ### length of input and output series
InputsPrecip=CatchMeltAndPliq, ### input series of total precipitation [mm/d]
......
......@@ -21,7 +21,7 @@
#' @seealso \code{\link{RunModel_CemaNeigeGR4J}}, \code{\link{RunModel_CemaNeigeGR6J}}, \code{\link{RunModel_GR5J}},
#' \code{\link{CreateInputsModel}}, \code{\link{CreateRunOptions}}.
#' @example tests/example_RunModel_CemaNeigeGR5J.R
#' @useDynLib airgr
#' @useDynLib airGR
#' @encoding UTF-8
#' @export
#_FunctionInputs__________________________________________________________________________________________________
......@@ -109,7 +109,7 @@ RunModel_CemaNeigeGR5J <- function(InputsModel,RunOptions,Param){
##Call_DLL_CemaNeige_________________________
for(iLayer in 1:NLayers){
StateStartCemaNeige <- RunOptions$IniStates[ (NStatesMod+2*(iLayer-1)+1):(NStatesMod+2*(iLayer-1)+2) ];
RESULTS <- .Fortran("frun_cemaneige",PACKAGE="airgr",
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/d]
......@@ -157,7 +157,7 @@ RunModel_CemaNeigeGR5J <- function(InputsModel,RunOptions,Param){
}
##Call_fortan
RESULTS <- .Fortran("frun_gr5j",PACKAGE="airgr",
RESULTS <- .Fortran("frun_gr5j",PACKAGE="airGR",
##inputs
LInputs=LInputSeries, ### length of input and output series
InputsPrecip=CatchMeltAndPliq, ### input series of total precipitation [mm/d]
......
......@@ -19,7 +19,7 @@
#' @seealso \code{\link{RunModel_CemaNeigeGR4J}}, \code{\link{RunModel_CemaNeigeGR5J}}, \code{\link{RunModel_GR6J}},
#' \code{\link{CreateInputsModel}}, \code{\link{CreateRunOptions}}.
#' @example tests/example_RunModel_CemaNeigeGR6J.R
#' @useDynLib airgr
#' @useDynLib airGR
#' @encoding UTF-8
#' @export
#_FunctionInputs__________________________________________________________________________________________________
......@@ -111,7 +111,7 @@ RunModel_CemaNeigeGR6J <- function(InputsModel,RunOptions,Param){
##Call_DLL_CemaNeige_________________________
for(iLayer in 1:NLayers){
StateStartCemaNeige <- RunOptions$IniStates[ (NStatesMod+2*(iLayer-1)+1):(NStatesMod+2*(iLayer-1)+2) ];
RESULTS <- .Fortran("frun_cemaneige",PACKAGE="airgr",
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/d]
......@@ -159,7 +159,7 @@ RunModel_CemaNeigeGR6J <- function(InputsModel,RunOptions,Param){
}
##Call_fortan
RESULTS <- .Fortran("frun_gr6j",PACKAGE="airgr",
RESULTS <- .Fortran("frun_gr6j",PACKAGE="airGR",
##inputs
LInputs=LInputSeries, ### length of input and output series
InputsPrecip=CatchMeltAndPliq, ### input series of total precipitation [mm/d]
......
......@@ -11,7 +11,7 @@
#' Mouelhi S. (2003),
#' Vers une chaîne cohérente de modèles pluie-débit conceptuels globaux aux pas de temps pluriannuel, annuel, mensuel et journalier,
#' PhD thesis (in French), ENGREF, Cemagref Antony, France. \cr
#' @useDynLib airgr
#' @useDynLib airGR
#' @encoding UTF-8
#' @export
#_FunctionInputs__________________________________________________________________________________________________
......@@ -56,7 +56,7 @@ RunModel_GR1A <- function(InputsModel,RunOptions,Param){
BOOL_Fortran <- FALSE; if(BOOL_Fortran){
##Call_fortan
RESULTS <- .Fortran("frun_gr1a",PACKAGE="airgr",
RESULTS <- .Fortran("frun_gr1a",PACKAGE="airGR",
##inputs
LInputs=LInputSeries, ### length of input and output series
InputsPrecip=InputsModel$Precip[IndPeriod1], ### input series of total precipitation [mm/y]
......
......@@ -14,7 +14,7 @@
#' Mouelhi, S., C. Michel, C. Perrin and V. Andréassian (2006),
#' Stepwise development of a two-parameter monthly water balance model,
#' Journal of Hydrology, 318(1-4), 200-214, doi:10.1016/j.jhydrol.2005.06.014.
#' @useDynLib airgr
#' @useDynLib airGR
#' @encoding UTF-8
#' @export
#_FunctionInputs__________________________________________________________________________________________________
......@@ -76,7 +76,7 @@ RunModel_GR2M <- function(InputsModel,RunOptions,Param){
}
##Call_fortan
RESULTS <- .Fortran("frun_gr2m",PACKAGE="airgr",
RESULTS <- .Fortran("frun_gr2m",PACKAGE="airGR",
##inputs
LInputs=LInputSeries, ### length of input and output series
InputsPrecip=InputsModel$Precip[IndPeriod1], ### input series of total precipitation [mm/month]
......
......@@ -13,7 +13,7 @@
#' Mathevet, T. (2005),
#' Quels modèles pluie-débit globaux pour le pas de temps horaire ? Développement empirique et comparaison de modèles sur un large échantillon de bassins versants,
#' PhD thesis (in French), ENGREF - Cemagref (Antony), Paris, France.
#' @useDynLib airgr
#' @useDynLib airGR
#' @encoding UTF-8
#' @export
#_FunctionInputs__________________________________________________________________________________________________
......@@ -77,7 +77,7 @@ RunModel_GR4H <- function(InputsModel,RunOptions,Param){
}
##Call_fortan
RESULTS <- .Fortran("frun_gr4h",PACKAGE="airgr",
RESULTS <- .Fortran("frun_gr4h",PACKAGE="airGR",
##inputs
LInputs=LInputSeries, ### length of input and output series
InputsPrecip=InputsModel$Precip[IndPeriod1], ### input series of total precipitation [mm/h]
......
......@@ -13,7 +13,7 @@
#' @seealso \code{\link{RunModel_GR5J}}, \code{\link{RunModel_GR6J}}, \code{\link{RunModel_CemaNeigeGR4J}},
#' \code{\link{CreateInputsModel}}, \code{\link{CreateRunOptions}}.
#' @example tests/example_RunModel_GR4J.R
#' @useDynLib airgr
#' @useDynLib airGR
#' @encoding UTF-8
#' @export
#_FunctionInputs__________________________________________________________________________________________________
......@@ -77,7 +77,7 @@ RunModel_GR4J <- function(InputsModel,RunOptions,Param){
}
##Call_fortan
RESULTS <- .Fortran("frun_gr4j",PACKAGE="airgr",
RESULTS <- .Fortran("frun_gr4j",PACKAGE="airGR",
##inputs
LInputs=LInputSeries, ### length of input and output series
InputsPrecip=InputsModel$Precip[IndPeriod1], ### input series of total precipitation [mm/d]
......
......@@ -15,7 +15,7 @@
#' @seealso \code{\link{RunModel_GR4J}}, \code{\link{RunModel_GR6J}}, \code{\link{RunModel_CemaNeigeGR5J}},
#' \code{\link{CreateInputsModel}}, \code{\link{CreateRunOptions}}.
#' @example tests/example_RunModel_GR5J.R
#' @useDynLib airgr
#' @useDynLib airGR
#' @encoding UTF-8
#' @export
#_FunctionInputs__________________________________________________________________________________________________
......@@ -80,7 +80,7 @@ RunModel_GR5J <- function(InputsModel,RunOptions,Param){
}
##Call_fortan
RESULTS <- .Fortran("frun_gr5j",PACKAGE="airgr",
RESULTS <- .Fortran("frun_gr5j",PACKAGE="airGR",
##inputs
LInputs=LInputSeries, ### length of input and output series
InputsPrecip=InputsModel$Precip[IndPeriod1], ### input series of total precipitation [mm/d]
......
......@@ -13,7 +13,7 @@
#' @seealso \code{\link{RunModel_GR4J}}, \code{\link{RunModel_GR5J}}, \code{\link{RunModel_CemaNeigeGR6J}},
#' \code{\link{CreateInputsModel}}, \code{\link{CreateRunOptions}}.
#' @example tests/example_RunModel_GR6J.R
#' @useDynLib airgr
#' @useDynLib airGR
#' @encoding UTF-8
#' @export
#_FunctionInputs__________________________________________________________________________________________________
......@@ -81,7 +81,7 @@ RunModel_GR6J <- function(InputsModel,RunOptions,Param){
}
##Call_fortan
RESULTS <- .Fortran("frun_gr6j",PACKAGE="airgr",
RESULTS <- .Fortran("frun_gr6j",PACKAGE="airGR",
##inputs
LInputs=LInputSeries, ### length of input and output series
InputsPrecip=InputsModel$Precip[IndPeriod1], ### input series of total precipitation [mm/d]
......
% Generated by roxygen2 (4.1.1): do not edit by hand
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/BasinData.R
\docType{data}
\encoding{UTF-8}
......@@ -15,7 +15,7 @@
R-object containing the code, station's name, area and hypsometric curve of the catchment.
}
\examples{
require(airGR)
require(airGR)
data(L0123001)
str(BasinInfo)
}
......
% Generated by roxygen2 (4.1.1): do not edit by hand
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/BasinData.R
\docType{data}
\encoding{UTF-8}
......@@ -16,7 +16,7 @@ Times series for L0123001 or L0123002 are at the daily time-step for use with da
Times series for L0123003 are at the hourly time-step for use with hourly models such as GR4H.
}
\examples{
require(airGR)
require(airGR)
data(L0123001)
str(BasinObs)
}
......
% Generated by roxygen2 (4.1.1): do not edit by hand
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/Calibration.R
\encoding{UTF-8}
\name{Calibration}
......@@ -90,7 +90,7 @@ Laurent Coron (June 2014)
\seealso{
\code{\link{Calibration_HBAN}}, \code{\link{Calibration_optim}},
\code{\link{RunModel}}, \code{\link{ErrorCrit}}, \code{\link{TransfoParam}},
\code{\link{CreateInputsModel}}, \code{\link{CreateRunOptions}},
\code{\link{CreateInputsModel}}, \code{\link{CreateRunOptions}},
\code{\link{CreateInputsCrit}}, \code{\link{CreateCalibOptions}}.
}
% Generated by roxygen2 (4.1.1): do not edit by hand
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/Calibration_HBAN.R
\encoding{UTF-8}
\name{Calibration_HBAN}
......@@ -42,22 +42,22 @@ Calibration_HBAN(InputsModel, RunOptions, InputsCrit, CalibOptions, FUN_MOD,
\description{
Calibration algorithm which minimises the error criterion. \cr
\cr
The algorithm is based on a local search procedure.
The algorithm is based on a local search procedure.
First, a screening is performed using either a rough predefined grid or a list of parameter sets
and then a simple steepest descent local search algorithm is performed.
}
\details{
A screening is first performed either from a rough predefined grid (considering various initial
A screening is first performed either from a rough predefined grid (considering various initial
values for each paramete) or from a list of initial parameter sets. \cr
The best set identified in this screening is then used as a starting point for the steepest
The best set identified in this screening is then used as a starting point for the steepest
descent local search algorithm. \cr
For this search, the parameters are used in a transformed version, to obtain uniform
For this search, the parameters are used in a transformed version, to obtain uniform
variation ranges (and thus a similar pace), while the true ranges might be quite different. \cr
At each iteration, we start from a parameter set of NParam values (NParam being the number of
free parameters of the chosen hydrological model) and we determine the 2*NParam-1 new candidates
At each iteration, we start from a parameter set of NParam values (NParam being the number of
free parameters of the chosen hydrological model) and we determine the 2*NParam-1 new candidates
by changing one by one the different parameters (+/- pace). \cr
All these candidates are tested and the best one kept to be the starting point for the next
iteration. At the end of each iteration, the pace is either increased or decreased to adapt
All these candidates are tested and the best one kept to be the starting point for the next
iteration. At the end of each iteration, the pace is either increased or decreased to adapt
the progression speed. A diagonal progress can occasionally be done. \cr
The calibration algorithm stops when the pace becomes too small. \cr
......@@ -122,7 +122,7 @@ Michel, C. (1991),
\seealso{
\code{\link{Calibration}}, \code{\link{Calibration_optim}},
\code{\link{RunModel_GR4J}}, \code{\link{TransfoParam_GR4J}}, \code{\link{ErrorCrit_RMSE}},
\code{\link{CreateInputsModel}}, \code{\link{CreateRunOptions}},
\code{\link{CreateInputsModel}}, \code{\link{CreateRunOptions}},
\code{\link{CreateInputsCrit}}, \code{\link{CreateCalibOptions}}.
}
% Generated by roxygen2 (4.1.1): do not edit by hand
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/Calibration_optim.R
\encoding{UTF-8}
\name{Calibration_optim}
......@@ -38,7 +38,7 @@ Calibration_optim(InputsModel, RunOptions, InputsCrit, CalibOptions, FUN_MOD,
\description{
Calibration algorithm which minimises the error criterion. \cr
\cr
The algorithm is based on the "optim" function from the "stats" R-package
The algorithm is based on the "optim" function from the "stats" R-package
(using method="L-BFGS-B", i.e. a local optimization quasi-Newton method).
}
\details{
......@@ -98,7 +98,7 @@ Laurent Coron (August 2013)
\seealso{
\code{\link{Calibration}}, \code{\link{Calibration_HBAN}},
\code{\link{RunModel_GR4J}}, \code{\link{TransfoParam_GR4J}}, \code{\link{ErrorCrit_RMSE}},
\code{\link{CreateInputsModel}}, \code{\link{CreateRunOptions}},
\code{\link{CreateInputsModel}}, \code{\link{CreateRunOptions}},
\code{\link{CreateInputsCrit}}, \code{\link{CreateCalibOptions}}.
}
Markdown is supported
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