[mesa-users] run_star_extras quickie
Bill Paxton
paxton at kitp.ucsb.edu
Wed Jan 29 15:35:02 EST 2014
[Josiah, How about a subsection in the "using run_star_extras" on saving/restoring variables?]
On Jan 29, 2014, at 11:47 AM, Bill Wolf wrote:
> Here’s a small task I’m trying (but failing) to accomplish with run_star extras. I’m starting a run with a given accretion rate, but once a certain criterion is met, I’d like to shut off accretion (I can do this much pretty easily). However, once a separate turn-on criterion is later met, I’d like to turn accretion back on at the original accretion rate. I’m sure this can be done, but I don’t know how to do it in fortran. How do I either save the original accretion rate into a variable that survives an arbitrary number of timesteps, or re-read the accretion rate from the original inlist?
>
Hi,
There are several ways to do this -- the simplest is to use the "xtra" variables in the star_info structure.
you can save the original inlist value in your extras_controls routine by doing this:
s% xtra1 = s% mass_change
The value of this and other "xtra" vars are saved/restored in photos.
So at later steps you can access the original rate as s% xtra1.
Cheers,
Bill
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.mesastar.org/pipermail/mesa-users/attachments/20140129/34a217fd/attachment.html>
More information about the Mesa-users
mailing list