[Mesa-users] saving profiles when evolution stops

Ebraheem Farag ekfarag at asu.edu
Sun Apr 23 02:38:28 UTC 2023


Hello Ali,

Your current placement of 's% need_to_save_profiles_now = .true.' in
'extras_finish_step' is identical to setting 'profile_interval = 1' in the
&controls section of your inlist. This saves a profile for every timestep.

If you'd only like a profile at the termination point, you can try the
&starjob:
--
! this will save the last profile before the model terminates.
    write_profile_when_terminate = .true.
    filename_for_profile_when_terminate = 'final_profile.data'
--
or by placing  's% need_to_save_profiles_now = .true.' inside the
termination if statement 'if (extras_finish_step == terminate) s%
termination_code = t_extras_finish_step'


>"However, it doesn't seem to save anything. as the final profile produced
with and without this are identical"

My guess: Because your model is unable to finish the timestep, "solver is
unable to find an acceptable model", there is no profile to save. Instead,
you only have a saved profile for the last model timestep accepted by the
solver which is technically the timestep before the model terminates. This
should be sufficient for diagnosing whatever issue you are encountering, if
that is your goal?

If trying to diagnose the issue, the main question I would ask myself is
"why are the timesteps in my model so small as to cause my model to
terminate its evolution?", as the decrease in timesteps does not typically
occur in one model timestep. Perhaps making some history/profile plots, or
turning on pgstar plots of some known structural quantities during the
model evolution will help you diagnose.

Best of luck!

-EbF



On Sat, Apr 22, 2023 at 4:58 PM Ali Pourmand via Mesa-users <
mesa-users at lists.mesastar.org> wrote:

> Hello,
>
> I am having a simulation terminating with the following condition:
>
>  retry: max residual jumped -- give up in solver     696
>                                                      dt
>  7.0155661665216534D-07
>                                      min_timestep_limit
>  9.9999999999999995D-07
>  stopping because of problems dt < min_timestep_limit
>                                  WARNING: rel_run_E_err         696
>  1.8323459126673360D-02
> terminated evolution: cannot find acceptable model
> termination code: min_timestep_limit
> DATE: 2023-04-22
> TIME: 17:24:05
>
> I want to save the profile at the moment the simulation stopped.
> I have found the          s% need_to_save_profiles_now = .true. command,
> which should theoretically save the model if we write it in
> extras_finish_step:
>
>       integer function extras_finish_step(id)
>          integer, intent(in) :: id
>          integer :: ierr
>          type (star_info), pointer :: s
>          ierr = 0
>          call star_ptr(id, s, ierr)
>          if (ierr /= 0) return
>          extras_finish_step = keep_going
>          ! to save a profile,
>          s% need_to_save_profiles_now = .true.
>          if (extras_finish_step == terminate) s% termination_code =
> t_extras_finish_step
>
>       end function extras_finish_step
>
> However, it doesn't seem to save anything. as the final profile produced
> with and without this are identical.
>
> Can anyone help me with this command?
>
> If there is any better command that could help me save the profile when
> the code terminates, that would be more helpful.
>
>
> best
> Ali
>
> _______________________________________________
> mesa-users at lists.mesastar.org
>
> https://urldefense.com/v3/__https://lists.mesastar.org/mailman/listinfo/mesa-users__;!!IKRxdwAv5BmarQ!ZEuZDd0_s5rhnoJMVGWuL1QHEaWLKSe6o4pu6HYBW3pu6V5YA_JstRToNRev7eDBZkDeCcLEeE-u0McClcFqN0j6$
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.mesastar.org/pipermail/mesa-users/attachments/20230422/e7720ad0/attachment.htm>


More information about the Mesa-users mailing list