[ADMB Users] Making a copy of an unallocated dvector

Luis Ridao luridao at gmail.com
Mon May 16 02:43:45 PDT 2011


Finally I got ADMB on openSUSE up and running.
Well I'm going through some models that used to work before.
So far there is one that does not seem to run properly (one with splines)

ridao at linux-kw78:~/admb/admb-10.1/myadmb> admb test_spline_2010

*** tpl2cpp test_spline_2010

*** adcomp test_spline_2010
g++ -c -O3 -Wno-deprecated -D__GNUDOS__ -Dlinux -DOPT_LIB -DUSE_LAPLACE
-fpermissive -I. -I/usr/local/admb/include test_spline_2010.cpp

*** adlink test_spline_2010
g++ -s -L/usr/local/admb/lib test_spline_2010.o -ldf1b2o -ladmod -ladt -lado
-ldf1b2o -ladmod -ladt -lado -o test_spline_2010

Done
----------------------------------------------------------------------------------------------------------
ridao at linux-kw78:~/admb/admb-10.1/myadmb> ./test_spline_2010
Making a copy of an unallocated dvector
Making a copy of an unallocated dvector
Making a copy of an unallocated dvector
Making a copy of an unallocated dvector
Making a copy of an unallocated dvector
Making a copy of an unallocated dvector
 OK to here1
----------------------------------------------------------------------------------------------------------
I have "cout" the code and the problem seem to arise in the
"get_mortality_and_survivial_rates()"
function which is using "splines"

DATA_SECTION
  ......
  init_int nNodes;                                    // SPLINES
  vector nodes(1,nNodes);                            // SPLINES
  !! nodes.fill_seqadd(1,1);
  vector ages(1,nages);                                      // ages of data
  vector ages4plus(1,nages-1);                               //
non-recruiting ages in the population
  vector years(1,nyrs);                                      // years of
data
  int pred_year;                                             // prediction
year
  vector yield_obs(1,nyrs);
  !! nyrs = nyrs - nyrs_r;
  !! nyrs_surv = nyrs_surv - nyrs_r;
  init_vector LO(1,nNodes)
  init_vector HI(1,nNodes)
  init_ivector PH(1,nNodes)
  init_vector parm(1,2)

PARAMETER_SECTION
....
  init_bounded_number_vector log_sel1(1,nNodes,LO,HI,PH)        // SPLINES
  init_bounded_number_vector log_sel2(1,nNodes,LO,HI,PH)        // SPLINES
  init_bounded_number_vector log_sel3(1,nNodes,LO,HI,PH)        // SPLINES
  vector predSel1(1,nages)    // SPLINES
  vector predSel2(1,nages)    // SPLINES
  vector predSel3(1,nages)    // SPLINES


PROCEDURE_SECTION
  cout << " OK to here1 " << endl;
  get_mortality_and_survivial_rates();
  cout << " OK to here2 " << endl;


FUNCTION get_mortality_and_survivial_rates
  int i, j;
   //calculate the selectivity from the sel_coffs ---------------------

  for (i=1;i<=nyrs;i++)
  {
  if (i<=16)
  {
    vcubic_spline_function qs(nodes,log_sel1,parm(1),parm(2));   // SPLINES
    predSel1.sub(1,9)=qs(ages.sub(1,9));
    predSel1(10)=0;
    predSel1(11)=0;
    predSel1(12)=0;

  }
  else
  {
  if (i<=35)
  {

.........
........


This code used to work under version admb-10 but not in the current
admb-10.1

Thanks in advance
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.admb-project.org/pipermail/users/attachments/20110516/fcc438f8/attachment.html>


More information about the Users mailing list