[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?
Dan Patnaude
dpatnaude at cfa.harvard.edu
Tue Dec 5 11:59:38 EST 2017
Aldana-
You have a typo in your definition:
real(dp),alocatable,dimension(:) :: avg_charge_H
you have misspelled allocatable
-Dan
On Tue, Dec 5, 2017 at 11:42 AM, aldanag--- via Mesa-users <
mesa-users at lists.mesastar.org> wrote:
> Thank you.
>
>
> .that is pretty much what I did yet I still get the errors:
>
>
> I attach the run star extras. The relevant part is: *subroutine
> energy_routine(id, ierr**)*
>
>
> The errors I get are
>
>
> real(dp),alocatable,dimension(:) :: avg_charge_H
> 1
> Error: Invalid character in name at (1)
> ../src/run_star_extras.f:80:15:
>
> allocate(avg_charge_H(1:s%nz))
> 1
> Error: Allocate-object at (1) is neither a data pointer nor an allocatable
> variable
> ../src/run_star_extras.f:82:65:
>
> avg_charge_H(k)=star_get_profile_output(s,'avg_charge_H',k)
> 1
> Error: Unexpected STATEMENT FUNCTION statement at (1)
> ../src/run_star_extras.f:83:25:
>
> if (s% avg_charge_H(k) > 0.1d0 .and. s% avg_charge_H(k) < 0.9d0)
> then !ch
> 1
> Error: 'avg_charge_h' at (1) is not a member of the 'star_info' structure
> ../src/run_star_extras.f:85:9:
>
> end if
>
>
> FAILED
>
> Aldana.
>
> ------------------------------
> *מאת:* Rob Farmer <r.j.farmer at uva.nl>
> *נשלח:* יום שלישי 05 דצמבר 2017 04:17:08
>
> *אל:* 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
>
> 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/1e372c15/attachment.html>
More information about the Mesa-users
mailing list