seacode / gmacs

A generic size-structured stock assessment model
https://seacode.github.io/gmacs
19 stars 14 forks source link

BBRKC 2017 Run error #195

Open adletaw opened 7 years ago

adletaw commented 7 years ago

+--------------------------+ | Beginning report section | +--------------------------+ Index bounds do not match in dvector elem_prod(const dvector&, const dvector&) Makefile:25: recipe for target 'run' failed make: *** [run] Error 1

adletaw commented 7 years ago

Error occurs when model reaches line 3947 of src/gmacs.tpl

get_all_sdnr_MAR();

Tracks back to line 3380 from within the get_all_sdnr_MAR() function:

Francis_weights = calc_Francis_weights();

In the calc_Francis_weights() function, the model fails when k = 2 and i = 1 at line 3439:

Obs = sum(elem_prod(d3_obs_size_comps(k,i), mid_points));

Error occurs again here when kk = 2 and ii = 1:

// Compute effective N's
for ( int kk = 1; kk <= nSizeComps; kk++ )
{
    for ( int ii = 1; ii <= nSizeCompRows(kk); ii++ )
    {
        double sdl_tmp     = Sd_length(d3_obs_size_comps(kk,ii));
        effN(kk,ii)        = Eff_N(d3_obs_size_comps(kk,ii), d3_pre_size_comps(kk,ii));
        effN2(kk,ii)       = Eff_N2(d3_obs_size_comps(kk,ii), d3_pre_size_comps(kk,ii));
        pre_mn_size(kk,ii) = mn_length(d3_pre_size_comps(kk,ii));
        obs_mn_size(kk,ii) = mn_length(d3_obs_size_comps(kk,ii));
        lb_mn_size(kk,ii)  = obs_mn_size(kk,ii) - sdl_tmp * 2.0 / sqrt(size_comp_sample_size(kk,ii));
        ub_mn_size(kk,ii)  = obs_mn_size(kk,ii) + sdl_tmp * 2.0 / sqrt(size_comp_sample_size(kk,ii));
        /*
        */
    }
}
quantifish commented 7 years ago

Ah I think I had this commented out - might be good to start by commenting out and I can take a look at it.

adletaw commented 7 years ago

It looks like a similar problem came up last year in #167

quantifish commented 7 years ago

Yes it did. I stopped working on trying to get the sdnr/MAR stuff working as it was of lower importance...

On Thu, Oct 26, 2017 at 9:56 AM, A.D. Letaw notifications@github.com wrote:

It looks like a similar problem came up last year in #167 https://github.com/seacode/gmacs/issues/167

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/seacode/gmacs/issues/195#issuecomment-339468716, or mute the thread https://github.com/notifications/unsubscribe-auth/AFTvp-JfkXLZfVUJCPuriETlGGTKAGBTks5sv6B4gaJpZM4QGXLG .

-- Dr. D'Arcy Webber Quantifish Limited Tauranga, New Zealand Email: darcy@quantifish.co.nz

adletaw commented 7 years ago

Ah okay. Good to know.