Skip to content

Commit 0d5adc4

Browse files
committed
plotspict.retro : do not plot spin-up
1 parent d686d44 commit 0d5adc4

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

spict/R/plotting.R

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2571,14 +2571,15 @@ plotspict.retro <- function(rep, stamp=get.version(), add.mohn = TRUE, CI = 0.95
25712571
mr <- suppressMessages(mohns_rho(rep, what = c("FFmsy", "BBmsy")))
25722572
mrr <- round(mr, 3)
25732573
}
2574+
removeSpinupInds <- function(inds, x) setdiff(inds,which(x$inp$isspinup))
25742575
nruns <- length(rep$retro)
25752576
bs <- bbs <- fs <- ffs <- time <- conv <- list()
25762577
for (i in 1:nruns) {
2577-
bs[[i]] <- get.par('logB', rep$retro[[i]], exp=TRUE, CI = CI)[rep$retro[[i]]$inp$indest, 1:3]
2578-
bbs[[i]] <- get.par('logBBmsy', rep$retro[[i]], exp=TRUE, CI = CI)[rep$retro[[i]]$inp$indest, 1:3]
2579-
fs[[i]] <- get.par('logFnotS', rep$retro[[i]], exp=TRUE, CI = CI)[rep$retro[[i]]$inp$indest, 1:3]
2580-
ffs[[i]] <- get.par('logFFmsynotS', rep$retro[[i]], exp=TRUE, CI = CI)[rep$retro[[i]]$inp$indest, 1:3]
2581-
time[[i]] <- rep$retro[[i]]$inp$time[rep$retro[[i]]$inp$indest]
2578+
bs[[i]] <- get.par('logB', rep$retro[[i]], exp=TRUE, CI = CI)[removeSpinupInds(rep$retro[[i]]$inp$indest,rep$retro[[i]]), 1:3]
2579+
bbs[[i]] <- get.par('logBBmsy', rep$retro[[i]], exp=TRUE, CI = CI)[removeSpinupInds(rep$retro[[i]]$inp$indest,rep$retro[[i]]), 1:3]
2580+
fs[[i]] <- get.par('logFnotS', rep$retro[[i]], exp=TRUE, CI = CI)[removeSpinupInds(rep$retro[[i]]$inp$indest,rep$retro[[i]]), 1:3]
2581+
ffs[[i]] <- get.par('logFFmsynotS', rep$retro[[i]], exp=TRUE, CI = CI)[removeSpinupInds(rep$retro[[i]]$inp$indest,rep$retro[[i]]), 1:3]
2582+
time[[i]] <- rep$retro[[i]]$inp$time[removeSpinupInds(rep$retro[[i]]$inp$indest,rep$retro[[i]])]
25822583
conv[[i]] <- rep$retro[[i]]$opt$convergence
25832584
}
25842585
conv <- ifelse(unlist(conv) == 0, TRUE, FALSE)

0 commit comments

Comments
 (0)