Commit 8466b872 authored by Marco De Lucia's avatar Marco De Lucia
Browse files

Fixed n/nval in Distribute

parent afcae1e4
### Utility functions for RedModRphree
### Marco De Lucia, delucia@gfz-potsdam.de, 2009-2021
### Time-stamp: "Last modified 2021-04-29 20:17:47 delucia"
### Time-stamp: "Last modified 2021-05-06 16:05:40 delucia"
##' Replicates an input buffer containing only one SOLUTION, taking
##' care of SOLUTION/KINETICS/PURE identifiers. Eventually insert a
......@@ -176,7 +176,7 @@ Distribute <- function(input, prop, values, newname=NULL, first=NULL, wholeline=
## check how many lines contain the property we want to distribute
nsim <- length(proplines <- grep(paste0("^", reg, " "),input))
if (n != nsim && nsim != 1) {
if (nval != nsim && nsim != 1) {
stopmsg("Lengths of simulation and values do not agree")
}
......@@ -189,7 +189,7 @@ Distribute <- function(input, prop, values, newname=NULL, first=NULL, wholeline=
linesave <- paste(dum[3:length(dum)],collapse=" ")
}
## if the simulation is just 1, then repeat it n times (adding "first")
newinp <- RepSol(input, n)
newinp <- RepSol(input, nval)
nsim <- length(proplines <- grep(paste0("^", reg, " "), newinp))
} else {
newinp <- input
......
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