This looks bad to me. //Ft for(i=1;i<=nyrs;i++) Ft(i)=Ft(i)*exp(F_devs(i)); I think you should have something like init_number log_avg_F //Ft for(i=1;i<=nyrs;i++) Ft(i)=exp(log_avf_F+F_devs(i));