Skip to content
Snippets Groups Projects
Commit dcb9479f authored by Mauricio Zambrano-Bigiarini's avatar Mauricio Zambrano-Bigiarini
Browse files

lhoat: fixed bug that led to the following error message 'object...

lhoat: fixed bug that led to the following error message 'object 'model.out.text.fname' not found' when 'write2disk=FALSE'
parent 97fe1fd7
No related branches found
No related tags found
No related merge requests found
...@@ -13,9 +13,10 @@ NEWS/ChangeLog for hydroPSO ...@@ -13,9 +13,10 @@ NEWS/ChangeLog for hydroPSO
o 'plot_results' : 'main' argument is now (internally) passed to the 'plot_out' function. o 'plot_results' : 'main' argument is now (internally) passed to the 'plot_out' function.
o 'plot_particles' : 'main' argument is now omitted for the 3D dotty plots ('plot_NparOF' function), in order to avoid confusing (and sometimes o 'plot_particles' : 'main' argument is now omitted for the 3D dotty plots ('plot_NparOF' function), in order to avoid confusing (and sometimes
unnecessary) titles when 'main' is too long unnecessary) titles when 'main' is too long
o 'lhoat' : -) 'fn' argument now can be any R function or a character. In the latter case, it can be "hydromod" or the name of a o 'lhoat' : -) fixed bug that led to the following error message "object 'model.out.text.fname' not found" when 'write2disk=FALSE'
-) 'fn' argument now can be any R function or a character. In the latter case, it can be "hydromod" or the name of a
valid R function. In previous versions of 'lhoat' only a character type was accepted (Thanks to Rui Esteves !) valid R function. In previous versions of 'lhoat' only a character type was accepted (Thanks to Rui Esteves !)
o 'plot_NparOF' : 'main' argument was disabled, in order to avoid confusing text when 'main is a long text o 'plot_NparOF' : 'main' argument was disabled, in order to avoid confusing titles when 'main is a long text
0.3-0 19-Dec-2012 0.3-0 19-Dec-2012
o 'hydroPSO' : -) parallel capable (OS-independent) o 'hydroPSO' : -) parallel capable (OS-independent)
......
...@@ -307,10 +307,12 @@ lhoat <- function( ...@@ -307,10 +307,12 @@ lhoat <- function(
############################################################################## ##############################################################################
while (j <= N ) { while (j <= N ) {
# Opening the file 'LH_OAT-out.txt' for appending if (write2disk) {
model.out.text.file <- file(model.out.text.fname, "a") # Opening the file 'LH_OAT-out.txt' for appending
# Opening the file 'LH_OAT-gof.txt' for appending model.out.text.file <- file(model.out.text.fname, "a")
gof.text.file <- file(gof.text.fname, "a") # Opening the file 'LH_OAT-gof.txt' for appending
gof.text.file <- file(gof.text.fname, "a")
} # IF end
if (verbose) message(" | ") if (verbose) message(" | ")
if (verbose) message("==============================================================") if (verbose) message("==============================================================")
...@@ -409,10 +411,12 @@ lhoat <- function( ...@@ -409,10 +411,12 @@ lhoat <- function(
i <- 1 i <- 1
while(i <= P) { while(i <= P) {
# Opening the file 'LH_OAT-out.txt' for appending if (write2disk) {
model.out.text.file <- file(model.out.text.fname, "a") # Opening the file 'LH_OAT-out.txt' for appending
# Opening the file 'LH_OAT-gof.txt' for appending model.out.text.file <- file(model.out.text.fname, "a")
gof.text.file <- file(gof.text.fname, "a") # Opening the file 'LH_OAT-gof.txt' for appending
gof.text.file <- file(gof.text.fname, "a")
} # IF end
if (verbose) message(" | ") if (verbose) message(" | ")
if (verbose) message("==============================================================") if (verbose) message("==============================================================")
...@@ -462,7 +466,7 @@ lhoat <- function( ...@@ -462,7 +466,7 @@ lhoat <- function(
if ( fn.name == "hydromod" ) { if ( fn.name == "hydromod" ) {
model.FUN.args <- modifyList(model.FUN.args, list(param.values=Theta.New)) model.FUN.args <- modifyList(model.FUN.args, list(param.values=Theta.New))
hydromod.out <- do.call(model.FUN, as.list(model.FUN.args)) hydromod.out <- do.call(model.FUN, as.list(model.FUN.args))
} else hydromod.out <- do.call(fn, list(Theta.Zero)) } else hydromod.out <- do.call(fn, list(Theta.Zero))
########################################################################## ##########################################################################
# 7) Extracting simulated values # # 7) Extracting simulated values #
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment