[mesa-users] center_entropy Run Termination Value

Josiah Schwab jwschwab at berkeley.edu
Mon Jun 3 16:48:58 EDT 2013

Hi Ryan,

> Thanks for the advice! I was wondering if you know of any way to save the run/profiles in increment steps of center_entropy. What I would like to do would be to take my planet and cool it all the while saving profiles at integer values of entropy (e.g. 15-6 s*mp/kb). Thanks again!

Take a look at the extras_finish_step function in run_star_extras.f.  (I have reproduced the source below.)  There are flags you can set that will ask MESA to save a profile.

I'll leave the implementation details of checking exactly when you want to trigger a profile up to you, though don't hesitate to ask if you have questions.

Let me add, that if the implementation you choose has a "state", make use of the s% xtra{1..30} variables or the s% extra_work array and then restarts, retries, and backups should work without you doing anything special.


P.S.  I've cc'd mesa-users for posterity & potentially other suggestions/advice.

      ! returns either keep_going or terminate.
      ! note: cannot request retry or backup; extras_check_model can do that.
      integer function extras_finish_step(s, id, id_extra)
         type (star_info), pointer :: s
         integer, intent(in) :: id, id_extra
         integer :: ierr
         extras_finish_step = keep_going
         call store_extra_info(s)

         ! to save a profile, 
            ! s% need_to_save_profiles_now = .true.
         ! to update the star log,
            ! s% need_to_update_logfile_now = .true.
      end function extras_finish_step

More information about the Mesa-users mailing list