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

Jeremy Sakstein sakstein at hawaii.edu
Thu Jan 30 12:34:41 EST 2020


Sorry everyone, I took the following off-thread by mistake.

Also, can I use this technique with RSP controls e.g. s % RSP_mass = ...
rsp_alfa=...

---------- Forwarded message ---------
From: Jeremy Sakstein <sakstein at hawaii.edu>
Date: Thu, Jan 30, 2020 at 7:30 AM
Subject: Re: [Mesa-users] Giving MESA parameters from the command line
To: Josiah Schwab <jwschwab at ucsc.edu>


Thanks Josiah,

This is exactly what we are looking for!

Do I need to set something like other_controls = .true. in the inlist or is
this always read?

Cheers,

Jeremy

On Thu, Jan 30, 2020 at 7:10 AM Josiah Schwab <jwschwab at ucsc.edu> wrote:

> 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/c3686648/attachment.htm>


More information about the Mesa-users mailing list