[mesa-users] Suggesting run-time parameter update

Bill Paxton paxton at kitp.ucsb.edu
Sat Sep 15 13:51:58 EDT 2012


Hi,

I've pondered the option of run-time changes to &controls myself, 
but I've decided against doing it wholesale, and I don't want to
get into having controls that say which controls are run-time
and which are start-time only. 

So here's my suggestion for you -- do it yourself in your run_star_extras
in extras_finish_step with your own namelist file for things you
want to be able to modify at runtime.   E.g., your "runtime" namelist
could have values for mesh_delta_coeff and varcontrol_target.
Then at each step you read in that namelist and change
the values for s% mesh_delta_coeff and s% varcontrol_target.

Share it with us once you have it working!

Cheers,
Bill

p.s.

here's how you define your namelist (at the top of your run_star_extras)

real(dp) :: mesh_delta_coeff, varcontrol_target
namelist /runtime_controls/ mesh_delta_coeff, varcontrol_target

here's how you should open a namelist file (assuming the file name is inlist_runtime_controls)
unit = ... << get an iounit in your favorite way
open(unit=unit, file='inlist_runtime_controls', action='read', delim='quote', iostat=ierr)

here's how you should read it (assuming your namelist is called 'runtime_controls')
read(unit, nml= runtime_controls, iostat=ierr)  

after doing the read, check ierr to make sure it worked, then do
s% mesh_delta_coeff = mesh_delta_coeff
s% varcontrol_target = varcontrol_target

don't forget to close the file
close(unit)

the inlist_runtime_controls file should look something like this

&runtime_controls ! read these at each timestep
mesh_delta_coeff = 0.5
varcontrol_target  = 0.5d-4
/ ! end of runtime_controls namelist





On Sep 15, 2012, at 9:09 AM, Ehsan Moravveji wrote:

> Dear Bill,
> I came up with a minor suggestion, yet, it is yours to decide upon.
> 
> The &pgstar namelist is modifiable during the run-time. It means, once the
> user edits and saves the &pgstar namelist during the run-time, the effects
> are simultaneous.
> 
> The same idea could (probably and/or possibly) be pursued for some other
> parameters in &controls namelist. As we know, this is
> an-already-implemented capability for restarts photos.
> 
> Given the fact that the speed and precision of the evolution is partly
> (read critically) governed by
>         mesh_delta_coeff = 0.4
>         varcontrol_target = 1d-4
> what if these two parameters be also given the capability of run-time
> modification?
> 
> It is up to you and the MESA board to decide upon implementing this.
> 
> Best wishes.
> Ehsan.
> 
> 
> -- 
> This message has been scanned for viruses and
> dangerous content by MailScanner, and is
> believed to be clean.
> 





More information about the Mesa-users mailing list