[Mesa-users] Modifying constants during the relaxation routine
Bill Paxton
paxton at kitp.ucsb.edu
Wed Jan 2 10:22:38 EST 2019
brilliant! good job. ;)
cheers
bill
> On Jan 2, 2019, at 6:17 AM, Earl Bellinger <earlbellinger at gmail.com> wrote:
>
> Dear Bill,
>
> Thanks! This led me to the solution.
>
> The steps within MESA for creating a PMS model are as follows:
>
> in before_evolve_loop (file star/job/run_star_support.f90) -
> 1. call starlib_init (-> do_starlib_init -> do_star_init -> stardata_init -> const_init)
> 2. call extras_controls
> 3. call do_load1_star (-> star_create_pre_ms_model -> create_pre_ms_model -> model_builder)
>
> This set of instructions does call extras_controls, but not extras_finish_step, where my code is contained.
> I was able to solve my issue by simply adding an additional call to my code at the end of the extras_controls subroutine.
>
> Best regards,
> Earl
>
>
> On Tue, Jan 1, 2019 at 4:59 PM Bill Paxton <paxton at kitp.ucsb.edu <mailto:paxton at kitp.ucsb.edu>> wrote:
> i see no reason why create_pre_main_sequence_model shouldn’t use s% cgrav as long as there has been a chance for your run_star_extras to set that by the time it is called.
>
> as you note, the value of standard_cgrav in const is a variable rather than a compile time constant.
>
> that is so that you can change it from run_star_extras at the start of the run.
>
> check the code to see when the const do_const_init is called. then check if that happens before your extras_controls is called. if so, then you can change cgrav in const_def there.
>
> if there isn’t currently a call on a run_star_extras routine after const is initialized and before create prems model, then we should add one.
>
> cheers
> bill
>
>> On Jan 1, 2019, at 7:42 AM, Earl Bellinger via Mesa-users <mesa-users at lists.mesastar.org <mailto:mesa-users at lists.mesastar.org>> wrote:
>>
>> Hello mesa-users,
>>
>> In the extras_finish_step routine of run_stars_extras.f, I can modify constants such as standard_cgrav. These modifications are then applied to the evolution of the star. However, it seems during the initial relaxation, i.e., when using create_pre_main_sequence_model, these values are not used.
>>
>> I can achieve this by changing the constants in the MESA source code, but this is less desirable. Is there a way to do this using run_stars_extras.f?
>>
>> Thanks for any help,
>> Earl
>>
>>
>> Earl Patrick Bellinger, Ph.D.
>> Postdoctoral Research Fellow
>> Stellar Astrophysics Centre
>> Aarhus University
>> Web: https://earlbellinger.com <https://earlbellinger.com/>
>>
>> _______________________________________________
>> mesa-users at lists.mesastar.org <mailto:mesa-users at lists.mesastar.org>
>> https://lists.mesastar.org/mailman/listinfo/mesa-users <https://lists.mesastar.org/mailman/listinfo/mesa-users>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.mesastar.org/pipermail/mesa-users/attachments/20190102/7d527325/attachment.html>
More information about the Mesa-users
mailing list