bug in debugging tool is now fixed.

This commit is contained in:
hollorol 2017-07-17 19:21:31 +02:00
parent 450aefe9d2
commit 776f309517
3 changed files with 23 additions and 5 deletions

View File

@ -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 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((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="") dirName<-paste(inputloc,"LOG",sep="")
dirERROR<-paste(inputloc,"ERROR",sep="") dirERROR<-paste(inputloc,"ERROR",sep="")
@ -162,19 +162,37 @@ rungetMuso <- function(settings, timee="d", debugging=FALSE, logfilename=NULL, k
if(debugging=="stamplog"){ if(debugging=="stamplog"){
stampnum<-stamp(dirName) 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){ if(errorsign==1){
lapply( logfiles, function (x) file.copy(from=paste(dirName, "/",(stampnum+1),"-",x,sep=""), to=dirERROR ))} lapply( logfiles, function (x) file.copy(from=paste(dirName, "/",(stampnum+1),"-",x,sep=""), to=dirERROR ))}
} else { if(debugging){ } else { if(debugging){
if(is.null(logfilename)){ 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){ if(errorsign==1){
lapply( logfiles, function (x) file.rename(from=paste(dirName,"/", x, sep=""), to=dirERROR)) lapply( logfiles, function (x) file.rename(from=paste(dirName,"/", x, sep=""), to=dirERROR))
} }
} else { } 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){ if(errorsign==1){
lapply( logfiles, function (x) file.rename(from=paste(dirName, "/",logfilename,"-",x,sep=""), to=dirERROR)) lapply( logfiles, function (x) file.rename(from=paste(dirName, "/",logfilename,"-",x,sep=""), to=dirERROR))
} }

View File

@ -1,4 +1,4 @@
y#' This runs the BBGC-MuSo model #' This runs the BBGC-MuSo model
#' @author Roland Hollós #' @author Roland Hollós
#' @param calibrationpar vector with line numbers #' @param calibrationpar vector with line numbers
#' @return No return, outputs are written to file #' @return No return, outputs are written to file

Binary file not shown.