Skip to content

Commit

Permalink
fix Ecov_re padding in projections with multiple Ecov diff lags
Browse files Browse the repository at this point in the history
  • Loading branch information
brianstock-NOAA committed Jun 17, 2021
1 parent 400510d commit a57f3b3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion R/prepare_projection.R
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,8 @@ prepare_projection = function(model, proj.opts)
if(any(data$Ecov_model > 0)){
if(any(end.beyond < proj.opts$n.yrs)){ # need to pad Ecov_re
for(j in 1:data$n_Ecov){
for(i in 1:(proj.opts$n.yrs-end.beyond[j])){
# for(i in 1:(proj.opts$n.yrs-end.beyond[j])){
for(i in 1:max(proj.opts$n.yrs-end.beyond)){
if(!is.null(proj.opts$use.last.ecov)) if(proj.opts$use.last.ecov){ # use last Ecov (pad Ecov_re but map to NA)
Ecov.proj[i,j] <- model$rep$Ecov_re[data$ind_Ecov_out_end[j]+1+end.beyond[j],j]
}
Expand Down

0 comments on commit a57f3b3

Please # to comment.