[Mesa-users] Modify close_gaps subroutine

Rob Farmer robert.j.farmer37 at gmail.com
Thu Nov 10 16:07:21 UTC 2022


Hi Simon,

We would need to add some infrastructure to enable an "other_close_gaps"
hook. Once we have that code in MESA then your specific version of an
"other_close_gaps"  routine can live in mesa-contrib.

If you're feeling adventurous I can help guide you through what's needed to
add the infrastructure for a hook.

The best place to look is at when we added a previous hook, in this case I
added a other_split_burn hook in commits a5f8dbd90c0 and 1840cb9fe60

These commits should show you all the places you need to add code to add a
hook.

You'd probably want to replace each of the different close_something_gaps:

      subroutine close_convection_gaps(s, ierr)
         type (star_info), pointer :: s
         integer, intent(out) :: ierr
         call close_gaps(s, convective_mixing, s% min_convective_gap, ierr)
      end subroutine close_convection_gaps

with something like:

      subroutine close_convection_gaps(s, ierr)
         type (star_info), pointer :: s
         integer, intent(out) :: ierr
         if(s% use_other_close_gaps) then
               call s% other_close_gaps(s, convective_mixing, s%
min_convective_gap, ierr)
         else
               call close_gaps(s, convective_mixing, s% min_convective_gap,
ierr)
         end if
      end subroutine close_convection_gaps

Rob


On Thu, 10 Nov 2022 at 00:06, Simon Guichandut via Mesa-users <
mesa-users at lists.mesastar.org> wrote:

> Hello MESA users,
>
> There is a simple modification that I would like to do to the "close_gaps" subroutine
> in star/private/mix_info.f90.  In particular, I want to limit the
> application of this routine to some user-defined range of pressures.  This
> would be easy enough to do in the source code itself, but I would prefer
> doing it cleanly by using a "hook" to call my modified version in
> run_star_extras.  As far as I can tell though, there is no existing hook
> for this specific function.
>
> What would be the easiest way to create such a hook?  I see that people
> have created their own hooks in mesa-contrib, but it's not clear to me how
> these are set up, and when those routines are called.  Crucially, I would
> want my "other_close_gaps" to be called instead of "close_gaps", but at the
> same time during the step (and not e.g. at the end of the step).
>
> Thank you,
> Simon Guichandut
>
> _______________________________________________
> mesa-users at lists.mesastar.org
> https://lists.mesastar.org/mailman/listinfo/mesa-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.mesastar.org/pipermail/mesa-users/attachments/20221110/a6734061/attachment.htm>


More information about the Mesa-users mailing list