Problem reading FGONG file

Bug/problem reports for any of the GYRE executables (gyre_ad, gyre_nad, etc)
Post Reply
stefano
Posts: 8
Joined: Sat Feb 09, 2019 5:24 pm

Problem reading FGONG file

Post by stefano » Tue Mar 12, 2019 10:59 am



I have been working with the MESA GYRE-format text file with no problems. This time I tried to run GYRE on an FGONG file and I got the error below. I believe it has to do the with the FGONG version or formatting but I am pretty new at GYRE.

I have attached the gyre.in as well as the FGONG file. Any help will be very appreciated.

Code: Select all

gyre [5.2]
----------

OpenMP Threads   : 4
Input filename   : gyre.in

Model Init
----------

Reading from FGONG file
   File name star.fgong
   File version 1300
At line 151 of file gyre_fgong_file.f90
Fortran runtime error: Bad value during floating point read

Error termination. Backtrace:
#0  0x7f8bce85ba60 in formatted_transfer_scalar_read
	at /root/mesasdk-src/gcc/libgfortran/io/transfer.c:1594
#1  0x7f8bce85d01c in formatted_transfer
	at /root/mesasdk-src/gcc/libgfortran/io/transfer.c:2270
#2  0x4fa258 in ???
#3  0x53e71a in ???
#4  0x40540f in ???
#5  0x404fc6 in ???
#6  0x7f8bcdd6609a in ???
#7  0x404ff9 in ???
#8  0xffffffffffffffff in ???
Attachments
gyre.in
(1.01 KiB) Downloaded 281 times

User avatar
rhtownsend
Site Admin
Posts: 397
Joined: Sun Mar 31, 2013 4:22 pm

Re: Problem reading FGONG file

Post by rhtownsend » Tue Mar 12, 2019 11:06 am

Hi Stefano --

Can you post the FGONG file as well, please?

cheers,

Rich

stefano
Posts: 8
Joined: Sat Feb 09, 2019 5:24 pm

Re: Problem reading FGONG file

Post by stefano » Tue Mar 12, 2019 11:21 am

Sure. I thought I did before.
Attachments
star.fgong
(1.96 MiB) Downloaded 330 times

User avatar
rhtownsend
Site Admin
Posts: 397
Joined: Sun Mar 31, 2013 4:22 pm

Re: Problem reading FGONG file

Post by rhtownsend » Tue Mar 12, 2019 2:01 pm

Hi Stefano --

It looks like your FGONG file has an invalid format. In the file header, the version number is given as 1300, indicating that your data should be readable using the Fortran format string

(1P,5(X,E26.18E3))

This means that the data should be contained in fields having width 26. However, looking at your data, I see that the field width is 16, not 26.

Can I ask where your FGONG file comes from? The header claims that it is written by MESA, but I'd like to know which version of MESA, and whether you have modified the files.

cheers,

Rich

User avatar
warrick
Posts: 84
Joined: Wed Aug 28, 2013 2:47 am

Re: Problem reading FGONG file

Post by warrick » Wed Mar 13, 2019 2:54 am

Hi Rich,

I'm responsible for producing this file, which I did with MESA r9575. I'm having a look through now and, though I can't find the modified inlist, I'm pretty sure I changed the MESA control `format_for_FGONG_data` to the old default ("1P5E16.9,x") to make the FGONG files play nicely with the version of ADIPLS I was using at the time. I note that in MESA r9575, it looks like the FGONG version variable is hardcoded to 1300, irrelevant of the format statement:

Code: Select all

$ grep "write(iounit" ~/mesa/9575/star/private/pulse_fgong.f90 
    write(iounit, *) 'FGONG file'
    write(iounit, *) 'Created by MESAstar'
    write(iounit, *)
    write(iounit, *)
    write(iounit,'(4I10)') nn, ICONST, IVAR, 1300
    write(iounit, s%format_for_fgong_data) (global_data(i), i=1,n_global)
       write(iounit, s%format_for_fgong_data) (point_data(j,k), j=1,n_point)
It sounds like this can probably be fixed by changing the FGONG version number to the appropriate value, which judging from MESA r7624 (which has the old width-16 default) is probably 300 instead of 1300.

Cheers,
Warrick

User avatar
rhtownsend
Site Admin
Posts: 397
Joined: Sun Mar 31, 2013 4:22 pm

Re: Problem reading FGONG file

Post by rhtownsend » Wed Mar 13, 2019 7:41 am

Yep, that sounds like the right fix. Going forward, we might want to add the option to override the FGONG version number in MESA.

cheers,

Rich

stefano
Posts: 8
Joined: Sat Feb 09, 2019 5:24 pm

Re: Problem reading FGONG file

Post by stefano » Wed Mar 20, 2019 10:28 am

I changed the version number from 1300 to 300 and now GYRE recognizes the model. Thank you, Rich and Warrick.

Post Reply