diff --git a/RBBGCMuso/R/calibMuso.R b/RBBGCMuso/R/calibMuso.R index 10f8820..5a96941 100644 --- a/RBBGCMuso/R/calibMuso.R +++ b/RBBGCMuso/R/calibMuso.R @@ -130,8 +130,11 @@ calibMuso <- function(settings,parameters=NULL, timee="d", debugging=FALSE, logf ############################################### #############LOG SECTION####################### ############################################### + + + + perror<-as.numeric(as.vector(lapply(paste(outputloc,logfiles,sep="/"),function(x) tail(readLines(x,-1),1)))) #vector of spinup and normalrun error - perror<-as.numeric(as.vector(lapply(paste(outputloc,logfiles,sep="/"),function(x) tail(readLines(x,-1),1)))) #vector of spinup and normalrun error if((debugging=="stamplog")|(debugging==TRUE)){#If debugging option turned on #If log or ERROR directory does not exists create it! @@ -208,7 +211,7 @@ calibMuso <- function(settings,parameters=NULL, timee="d", debugging=FALSE, logf } if(errorsign==1){ - lapply( logfiles, function (x) file.rename(from=paste(dirName,"/", x, sep=""), to=dirERROR)) + lapply( logfiles, function (x) file.copy(from=paste(dirName,"/", x, sep=""), to=dirERROR)) } } else { @@ -220,7 +223,7 @@ calibMuso <- function(settings,parameters=NULL, timee="d", debugging=FALSE, logf } if(errorsign==1){ - lapply( logfiles, function (x) file.rename(from=paste(dirName, "/",logfilename,"-",x,sep=""), to=dirERROR)) + lapply( logfiles, function (x) file.copy(from=paste(dirName, "/",logfilename,"-",x,sep=""), to=dirERROR)) } } diff --git a/RBBGCMuso/R/otherUsefullFunctions.R b/RBBGCMuso/R/otherUsefullFunctions.R index ddbe61f..8508918 100644 --- a/RBBGCMuso/R/otherUsefullFunctions.R +++ b/RBBGCMuso/R/otherUsefullFunctions.R @@ -113,3 +113,20 @@ corrigMuso <- function(settings, data){ } return(data) } + +#' genMusoMapping +#' +#' This function leapyear-corrigate the output of the modell +#' @author Roland Hollos +#' @param settings This is the output of the setupMuso() function. It contains all of the RBBGCMuso settings +#' @param data the models outputdata +#' @return It returns the modells leapyear-corrigated output data. +#' @export +#' @usage corrigMuso(settings, data) + +genMusoMapping<-function(output_map_init="output_map_init.c"){ + + outputRaw<-grep("\\[",readLines("output_map_init",-1),value=TRUE) + + +} diff --git a/RBBGCMuso/R/rungetMuso.R b/RBBGCMuso/R/rungetMuso.R index 67996a4..0c9faa7 100644 --- a/RBBGCMuso/R/rungetMuso.R +++ b/RBBGCMuso/R/rungetMuso.R @@ -204,7 +204,7 @@ rungetMuso <- function(settings, timee="d", debugging=FALSE, logfilename=NULL, k } if(errorsign==1){ - lapply( logfiles, function (x) file.rename(from=paste(dirName,"/", x, sep=""), to=dirERROR)) + lapply( logfiles, function (x) file.copy(from=paste(dirName, "/",logfilename,"-",x,sep=""), to=dirERROR)) } } else { @@ -216,7 +216,7 @@ rungetMuso <- function(settings, timee="d", debugging=FALSE, logfilename=NULL, k } if(errorsign==1){ - lapply( logfiles, function (x) file.rename(from=paste(dirName, "/",logfilename,"-",x,sep=""), to=dirERROR)) + lapply( logfiles, function (x) file.copy(from=paste(dirName, "/",logfilename,"-",x,sep=""), to=dirERROR)) } } diff --git a/RBBGCMuso_0.3.1.0-1.tar.gz b/RBBGCMuso_0.3.1.0-1.tar.gz index 5f46b53..2da23a1 100644 Binary files a/RBBGCMuso_0.3.1.0-1.tar.gz and b/RBBGCMuso_0.3.1.0-1.tar.gz differ