diff --git a/RBBGCMuso/R/rungetMuso.R b/RBBGCMuso/R/rungetMuso.R index 9d59a0c..8923ecf 100644 --- a/RBBGCMuso/R/rungetMuso.R +++ b/RBBGCMuso/R/rungetMuso.R @@ -107,7 +107,7 @@ rungetMuso <- function(settings, timee="d", debugging=FALSE, logfilename=NULL, k 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! + ##If log or ERROR directory does not exists create it! dirName<-paste(inputloc,"LOG",sep="") dirERROR<-paste(inputloc,"ERROR",sep="") @@ -162,19 +162,37 @@ rungetMuso <- function(settings, timee="d", debugging=FALSE, logfilename=NULL, k if(debugging=="stamplog"){ stampnum<-stamp(dirName) - lapply( logfiles, function (x) file.rename(from=paste(inputloc,x, sep=""), to=paste(dirName, "/",(stampnum+1),"-",x,sep=""))) + if(inputloc==outputloc){ + lapply( logfiles, function (x) file.rename(from=paste(outputloc,x, sep=""), to=paste(dirName, "/",(stampnum+1),"-",x,sep=""))) + + } else { + lapply( logfiles, function (x) file.rename(from=paste(outputloc,x, sep="/"), to=paste(dirName, "/",(stampnum+1),"-",x,sep=""))) + } + if(errorsign==1){ lapply( logfiles, function (x) file.copy(from=paste(dirName, "/",(stampnum+1),"-",x,sep=""), to=dirERROR ))} } else { if(debugging){ if(is.null(logfilename)){ - lapply( logfiles, function (x) file.rename(from=paste(inputloc,x, sep=""), to=paste(dirName,"/", x, sep=""))) + + if(inputloc==outputloc){ + lapply( logfiles, function (x) file.rename(from=paste(outputloc,x, sep=""), to=paste(dirName,"/", x, sep=""))) + } else { + lapply( logfiles, function (x) file.rename(from=paste(outputloc,x, sep="/"), to=paste(dirName,"/", x, sep=""))) + } + if(errorsign==1){ lapply( logfiles, function (x) file.rename(from=paste(dirName,"/", x, sep=""), to=dirERROR)) } } else { - lapply( logfiles, function (x) file.rename(from=paste(inputloc,x, sep=""), to=paste(dirName, "/",logfilename,"-",x,sep=""))) + + if(inputloc==outputloc){#These are very ugly solutions for a string problem: inputloc: "./", if outputloc equalent of inputloc, it ends with "/", the string manipulation can not handle this. The better solution is easy, but I dont have enough time(Roland Hollo's) + lapply( logfiles, function (x) file.rename(from=paste(outputloc,x, sep=""), to=paste(dirName, "/",logfilename,"-",x,sep=""))) + } else { + lapply( logfiles, function (x) file.rename(from=paste(outputloc,x, sep="/"), to=paste(dirName, "/",logfilename,"-",x,sep=""))) + } + if(errorsign==1){ lapply( logfiles, function (x) file.rename(from=paste(dirName, "/",logfilename,"-",x,sep=""), to=dirERROR)) } diff --git a/RBBGCMuso/R/setupMuso.R b/RBBGCMuso/R/setupMuso.R index a9de92c..daa59fd 100644 --- a/RBBGCMuso/R/setupMuso.R +++ b/RBBGCMuso/R/setupMuso.R @@ -1,4 +1,4 @@ -y#' This runs the BBGC-MuSo model +#' This runs the BBGC-MuSo model #' @author Roland Hollós #' @param calibrationpar vector with line numbers #' @return No return, outputs are written to file diff --git a/RBBGCMuso_0.2.0.0-1.tar.gz b/RBBGCMuso_0.2.0.0-1.tar.gz index 237deb6..57d77eb 100644 Binary files a/RBBGCMuso_0.2.0.0-1.tar.gz and b/RBBGCMuso_0.2.0.0-1.tar.gz differ