[Mesa-users] Giving MESA parameters from the command line

Josiah Schwab jwschwab at ucsc.edu
Thu Jan 30 12:10:11 EST 2020


Hi Jeremy,

1) Give MESA parameters form the command line rather than altering an inlist
>

I'm a little late to this party and others have given advice that is along
the lines of what I usually do.  But if you do want command line arguments,
there's nothing stopping you from doing this in run_star_extras.  The only
command line argument MESA uses by default is the 1st, which can be used to
specify the inlist file.

The extras_controls hook is your chance to set controls, so if you do

      subroutine extras_controls(id, ierr)
         integer, intent(in) :: id
         integer, intent(out) :: ierr
         type (star_info), pointer :: s
         character(len=32) :: arg

         ierr = 0
         call star_ptr(id, s, ierr)
         if (ierr /= 0) return

         call GET_COMMAND_ARGUMENT(2, arg)
         read(arg, *) s% initial_mass

...

Then you can invoke MESA and pick your mass by doing

./star inlist 3.14

Josiah
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.mesastar.org/pipermail/mesa-users/attachments/20200130/fe4d8b71/attachment.htm>


More information about the Mesa-users mailing list