MESAHub / MESAHub/mesa

FPE with rotation and D_ST_start

Open
#448 1 comment 0 reactions 0 assignees View on GitHub
fpe
Dominant language
Fortran
Stars
249
Forks
82
Avg merge
1d 3h
Merged PRs (30d)
3

Description

See the many rotation failures https://testhub.mesastar.org/rf%2Ffpe/commits/9fae171

There are two problems, first set_rotation_mixing_info needs mstar_old however set_rotation_mixing_info is being called by set_start_of_step_info which is before new_generation() around https://github.com/MESAHub/mesa/blob/0d1f1bb5a471a0d1faeacc19c7b7e0be685d6550/star/private/evolve.f90#L1899

Now if we move the new_generation() call before set_rotation_mixing_info then that fixes the first issue.

Next, we then error when trying to use s% prev_mesh_D_ST_start. The problem is we are lying to ourselves, we have the flag s% prev_mesh_have_ST_start_info which we set to true at https://github.com/MESAHub/mesa/blob/0d1f1bb5a471a0d1faeacc19c7b7e0be685d6550/star/private/evolve.f90#L1891 but s% D_ST_start(k) isn't set. It got reset during an alloc() call during fill_star_info_arrays_with_NaNs https://github.com/MESAHub/mesa/blob/0d1f1bb5a471a0d1faeacc19c7b7e0be685d6550/star/private/evolve.f90#L68

So this might just be a problem with the NaN setting resetting arrays but not changing the s% prev_mesh_have_ST_start_info flag. Though it smells more like we need a better way to set s% prev_mesh_D_ST_start so that it doesn't matter if we set arrays to NaN.

Contributor guide

Open the contributing guide

Research direction

Reproduce the rotation failures from the linked testhub report, then read star/private/evolve.f90 around set_start_of_step_info, new_generation(), fill_star_info_arrays_with_NaNs, and the referenced lines. Trace when mstar_old, prev_mesh_have_ST_start_info, D_ST_start, and prev_mesh_D_ST_start are set or reset; done means the reported rotation and D_ST_start failures no longer occur with consistent flag and array state.

Written by the indexing model from the issue text.

Assessment

Tech stack
fortran
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.