[mesa-users] Bug: bad_num_history_columns in astero/work when adding history column

Warrick Ball wball at astro.physik.uni-goettingen.de
Mon Nov 14 07:12:15 EST 2016


Hi,

Just to follow up, I think the problem might simply be a check in the 
astero/work routines for the 5 extra columns that it adds. 
extras_support.f adds its own columns for chi2, delta_nu, delta_nu_model, 
correction_r and a_div_r to the history.  It seems to correctly add it's 
own data to whatever is added using run_star_extras.f, except for a check 
that the correct number of columns has been added.

Have a look at $MESA_DIR/star/astero/work/extras_support.f for context, 
but I think the bug is in lines 1669--1673:

          if (i /= num_extra_history_columns) then
             write(*,2) 'i', i
             write(*,2) 'num_extra_history_columns', num_extra_history_columns
             stop 'bad num_extra_history_columns'
          end if

This happens after it's written the extra history columns from 
run_star_extras.f and the five extra columns from astero.  If you've added 
columns in run_star_extras.f, the index i will be large than 
num_extra_history_columns, which is a parameter 5 (see astero_data.f). 
For me, everything works as expected if I replace the if statement with:

          if (i /= (num_extra_history_columns + num_extra)) then

where num_extra is the number of extra columns from run_star_extras.f, 
computed a few lines earlier.

Cheers,
Warrick




------------
Warrick Ball
Postdoc, Institut für Astrophysik Göttingen
wball at astro.physik.uni-goettingen.de
+49 (0) 551 39 5069

On Mon, 14 Nov 2016, Warrick Ball wrote:

> Hi all,
>
> Here's probably a relatively simple bug that I've stumbled upon.  To 
> reproduce it, I created a new astero/work directory in r8845 (e.g. cp -R 
> $MESA_DIR/star/astero/work ~/work/test_astero_column), then used 
> how_many_extra_history_columns and data_for_extra_history_columns to add one 
> extra history column (with name 'test' and value 0.0) in 
> src/run_star_extras.f (my buggy run_star_extras.f is attached).  When I 
> compile and run, I get
>
>                                        OMP_NUM_THREADS           4
>
>
>        540   6.613109   4506.158  -5.033526  -5.033526   1.310543   1.310543 
> 0.745981   0.000839   0.237376   0.745981  -4.525112   1216      0
>   3.983831  -0.071302   0.377258 -84.182503  -6.431321 -99.000000   0.000000 
> 0.237376   0.007772   0.016643   0.237376   0.057262      2      0
> 1.2926E+06  14.682537   0.323224 -99.000000   4.736375  -6.739390   0.000000 
> 0.002864   0.001616  1.664E-02  1.664E-02 -0.166E-08  max increase
>
>                                                      i           6
>                              num_extra_history_columns           5
> STOP bad num_extra_history_columns
> DATE: 2016-11-14
> TIME: 11:54:04
>
> My guess is that the mistake is when the extra columns in astero/work are 
> added to my extra column but nothing jumped out at me when I glanced at the 
> source.  For the record, this kind of modification to run_star_extras.f works 
> fine in a normal star/work directory.  The bug is only hitting me with 
> star/astero/work directories.
>
> Cheers,
> Warrick
>
>
> ------------
> Warrick Ball
> Postdoc, Institut für Astrophysik Göttingen
> wball at astro.physik.uni-goettingen.de
> +49 (0) 551 39 5069


More information about the Mesa-users mailing list