MESAHub / mesa

Modules for Experiments in Stellar Astrophysics
http://mesastar.org
GNU Lesser General Public License v2.1
145 stars 39 forks source link

bugfix dP to d_P in create_initial_model #716

Closed pmocz closed 3 months ago

pmocz commented 3 months ago

This is a bug in the RK4 solver of create_initial_model that has been in Mesa since before the code was added to github. dP needs to be d_P. The variable dP was never defined, and got interpreted as dp because Fortran is case-insensitive.

Luckily this bug does not seem to have a large effect in the solver convergence. Tested here: https://testhub.mesastar.org/bugfix%2Fpmocz%2Fquickfixes/commits/1aec194

rhdtownsend commented 3 months ago

I wonder if this bug is the reason why MESA-Web doesn’t converge to a starting model for certain choices of the initial mass. I’ll do some digging...

On Aug 21, 2024, at 8:32 AM, Philip Mocz @.***> wrote:

This is a bug in the RK4 solver of create_initial_model that has been in Mesa since before the code was added to github. dP needs to be d_P. The variable dP was never defined, and got interpreted as dp because Fortran is case-insensitive. Luckily this bug does not seem to have a large effect in the solver convergence You can view, comment on, or merge this pull request online at: https://github.com/MESAHub/mesa/pull/716 Commit Summary • 1aec194 fix dP to d_P File Changes (1 file) • M star/private/create_initial_model.f90 (6) Patch Links: • https://github.com/MESAHub/mesa/pull/716.patchhttps://github.com/MESAHub/mesa/pull/716.diff — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because your review was requested.Message ID: @.***>

-- Rich Townsend • Professor of Astronomy Astronomy Department • University of Wisconsin-Madison Phone: 608-262-1752 • E-mail: @.***

pmocz commented 3 months ago

Thanks @rhdtownsend I'm curious to see what you find. It's part of the story. I'm also seeing I can sometimes get convergence for non converging models if I choose a different initial guess for the temperature. Is there a way to chose it more smartly? https://github.com/MESAHub/mesa/pull/716/files#diff-ed13c8f5578322afea3296aa7fab7414804b9a67c99c95a41b17e90a95cbc102R484

pmocz commented 3 months ago

I'll merge this into main so we can all start trying it out

Debraheem commented 3 months ago

A good time to try regenerating the zams models.

On Thu, Aug 22, 2024 at 9:48 AM Philip Mocz @.***> wrote:

Merged #716 https://urldefense.com/v3/__https://github.com/MESAHub/mesa/pull/716__;!!IKRxdwAv5BmarQ!eqVn1NzeASeK6JhUvV3YrfCNwjjD7jDMPpfbo_1pHeOdK1XsBn0hg_BWUi5a0IlpUh96RKOhY2gUoestEBaqGNTlTRoO$ into main.

— Reply to this email directly, view it on GitHub https://urldefense.com/v3/__https://github.com/MESAHub/mesa/pull/716*event-13977543163__;Iw!!IKRxdwAv5BmarQ!eqVn1NzeASeK6JhUvV3YrfCNwjjD7jDMPpfbo_1pHeOdK1XsBn0hg_BWUi5a0IlpUh96RKOhY2gUoestEBaqGD_HeMTU$, or unsubscribe https://urldefense.com/v3/__https://github.com/notifications/unsubscribe-auth/APBTKAHVXDCLV5QCDLDRRXTZSXT2PAVCNFSM6AAAAABM4BUDTCVHI2DSMVQWIX3LMV45UABCJFZXG5LFIV3GK3TUJZXXI2LGNFRWC5DJN5XDWMJTHE3TONJUGMYTMMY__;!!IKRxdwAv5BmarQ!eqVn1NzeASeK6JhUvV3YrfCNwjjD7jDMPpfbo_1pHeOdK1XsBn0hg_BWUi5a0IlpUh96RKOhY2gUoestEBaqGKHDuxV1$ . You are receiving this because your review was requested.Message ID: @.***>