[Mesa-users] Is it possible to add a parameter to star.data.inc in order to use it in a computation in the run.star.extras?

Rob Farmer r.j.farmer at uva.nl
Tue Dec 5 11:17:08 EST 2017


Hi

The lines should be added to you other_energy subroutine. the line
real(dp),alocatable,dimension(:) :: avg_charge_H

should be near the top of the subroutine where the other variables are
declared (before any code in your subroutine is called). That said, its
alot easier to help debug your issues if you:
a) provide your run_star_extras file
and
b) provide the exact error messages you receive (as well as the exact
commands used)

Rob


On 5 December 2017 at 16:57, aldanag at campus.technion.ac.il <
aldanag at campus.technion.ac.il> wrote:

>   Hello,
>
>
> thank you for your reply. I tried to add the lines  to the relevant place
> in the energy subroutine in the run_star_extras,  yet the run still did not
> compile due to many errors, so I suspect I didn't uderstand where to add
> the lines.
>
> Where exactly do I need to add the lines in order to get asccess to
> "avarage_charge_H"? I declare a new function, I add them to a specific
> function  or I add them to the energy subroutine and try to slove the
> compiling errors?
>
> thank you,
>
> Aldana.
>
> ------------------------------
> *מאת:* Rob Farmer <r.j.farmer at uva.nl>
> *‏‏נשלח:* יום שלישי 05 דצמבר 2017 01:44:18
> *‏‏אל:* Aldana Grichener
> *עותק:* mesa-users at lists.mesastar.org
> *‏‏נושא:* Re: [Mesa-users] Is it possible to add a parameter to
> star.data.inc in order to use it in a computation in the run.star.extras?
>
> hi
> To get access to history or profile data in your run_star_extras then
> there are extra functions you can call from star_lib.f90
>
> For history data:
> star_get1_history_value(s,'history_column_name', value)
>
> For profile data:
> value=star_get_profile_output(s,'profile_column_name',zone)
>
> So in your case to get the avg_charge_H you would add to your
> run_star_extras:
>
> use star_lib ! at the top of the file
>
> then do something like:
> real(dp),alocatable,dimension(:) :: avg_charge_H
>
> allocate(avg_charge_H(1:s%nz))
>
> do k=1,s%nz
> avg_charge_H(k)=star_get_profile_output(s,'avg_charge_H',k)
> end do
>
> Rob
>
>
>
>
>
>
>
>
>
>
>
>
> On 5 December 2017 at 13:15, aldanag--- via Mesa-users <
> mesa-users at lists.mesastar.org> wrote:
>
> Hello,
>
>
>  I am trying to inject energy to a star via the"run_star_extras", and the
> subroutine I use has access
>
>
> to the srar_info pointer, so I can use only the quantites that are defined
> in star/public/star_data.inc to make the energy computations.
>
>
> However, one of the paramaters I need to use- *avg_charge_H *(which I can
> see at the output of the profiles) is not defined in
>
>
> star.data.inc in any way.
>
>
>  I found that this parameter is from the ionization module, and when it is
> passed to the star module via:
>
>  get_ion_info(ion_iZ_H,k), this is from:   star/private/profile_getval.f90  that
> contains the lines
>
>             case (p_avg_charge_H)
>                val = get_ion_info(ion_iZ_H,k)
>
> yet p_avg_charge_H also isn't defined in star.data.inc. I tried to add it
> manually and the runs still doesn't compile.
>
> My question is: Is it possible to add a parameter that exists in MESA to
> the star.data.inc, and if it is possible what is the right way to do that?
>
> Thanks in advance,
>
> Aldana.
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.mesastar.org/pipermail/mesa-users/attachments/20171205/850c7240/attachment.html>


More information about the Mesa-users mailing list