From: Warrick B. <wb...@bi...> - 2017-04-03 08:45:17
|
Hi, I'm not sure if I'm misusing something but I tried to use GYRE's non-adiabatic binary to calculate the mode frequencies for a GYRE-format file from MESA and ran into an error. I've attached an inlist for r9575 that I used to produce the attached GYRE input file (`inlist_project`), the GYRE-format stellar model file (`test.gyre`), and the GYRE inlist that I used to compute frequencies (`gyre_nad.in`, basically just a copy of $GYRE_DIR/test/nad/mesa/spb/gyre_nad.in). Using the version of GYRE distributed with MESA (i.e. I have GYRE_DIR=$MESA_DIR/gyre/gyre, which I presume is okay?), I tried to compute the mode frequencies with `gyre_nad gyre_nad.in` and got the error: Reading from MESA file test.gyre Detected new-variant file ASSERT 'k == k_chk' failed at line 303 <gyre_mesa_file:read_mesa_data:read_mesa_data_new_>: Index mismatch at which point the calculation halts. I followed the error message in GYRE and I think the problem is that the last integer in the first row of the GYRE file should be the number of columns (also, it's in the docs [1]). But in the file produced by MESA, I have 1046 2.9837999999999999E+34 3.5101730384066974E+11 6.9329640876084185E+37 100 Looking at the file, there are clearly not 100 columns, and if I change the last 100 to the correct number of columns (19), the calculation proceeds. So, using my standard MESA sleuthing methods (i.e. grep a relevant control and start following function calls), I found the the GYRE data is written by write_gyre_data in $MESA_DIR/star/private/pulse_gyre.f90:397-451. In particular, the subroutine writes the first line of the GYRE file on line 434 in the code: write(iounit, 100) nn, global_data, 100 So I think the bug is that hardcoded 100. I'm not so familiar with standard Fortran operations but I would guess that the 100 should be replaced with `SIZE(point_data, 1)+1`. (The extra column is the row number, which isn't in `point_data`.) Cheers, Warrick [1] $GYRE_DIR/doc/mesa-format.pdf ------------ Warrick Ball Postdoc, School of Physics and Astronomy University of Birmingham, Edgbaston, Birmingham B15 2TT wb...@bi... +44 (0)121 414 4552 |