Skip to content

Commit 4c064fb

Browse files
author
kerim aydin
committed
Added functional but will be recalculated output to check.rpath.params
1 parent 0d243b1 commit 4c064fb

1 file changed

Lines changed: 12 additions & 5 deletions

File tree

R/param.R

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@ check.rpath.params <- function(Rpath.params) {
172172
Type <- Group <- Biomass <- EE <- PB <- QB <- ProdCons <- BioAcc <- Unassim <- DetInput <- NULL
173173

174174
w <- 0 #warning counter
175+
c <- 0 #Balance change counter
175176
#Check to make sure all types are represented
176177
if (nrow(Rpath.params$model[Type == 0, ]) == 0) {
177178
warning('Model must contain at least 1 consumer')
@@ -215,14 +216,15 @@ check.rpath.params <- function(Rpath.params) {
215216
)
216217
w <- w + 1
217218
}
218-
if (length(Rpath.params$model[!is.na(Biomass) &
219-
!is.na(EE) &
219+
if (length(Rpath.params$model[!is.na(Biomass) & !is.na(EE) &
220220
(!is.na(PB) | (is.na(PB) & !is.na(QB) & !is.na(ProdCons))) &
221221
Type < 2, Group]) > 0) {
222222
warning(
223223
paste(
224-
Rpath.params$model[!is.na(Biomass) & !is.na(EE) & Type < 2, Group],
225-
'have all of Biomass, EE, and PB entered... Note that Rpath does
224+
Rpath.params$model[!is.na(Biomass) & !is.na(EE) &
225+
(!is.na(PB) | (is.na(PB) & !is.na(QB) & !is.na(ProdCons))) &
226+
Type < 2, Group],
227+
'have all of Biomass, EE, and PB(or QB and ProdCons) entered... Note that Rpath does
226228
not calculate BA, please enter a value for BA if appropriate \n',
227229
sep = ' '
228230
)
@@ -330,6 +332,7 @@ check.rpath.params <- function(Rpath.params) {
330332
)
331333
)
332334
w <- w + 1
335+
c <- c + 1
333336
}
334337
}
335338

@@ -520,7 +523,11 @@ check.rpath.params <- function(Rpath.params) {
520523
if (w == 0) {
521524
cat('Rpath parameter file is functional. \n')
522525
} else {
523-
cat('Rpath parameter file needs attention! \n')
526+
if (w==c){
527+
cat('Rpath parameters functional, though some may be recalculated during balance. \n')
528+
} else {
529+
cat('Rpath parameter file needs attention! \n')
530+
}
524531
}
525532
}
526533

0 commit comments

Comments
 (0)