[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?
aldanag at campus.technion.ac.il
aldanag at campus.technion.ac.il
Tue Dec 5 14:53:05 EST 2017
I fixed it and it worked, thank you very much fou your help.
Aldana.
________________________________
מאת: Aaron Dotter <aaron.dotter at gmail.com>
נשלח: יום שלישי 05 דצמבר 2017 07:31:50
אל: Aldana Grichener
עותק: Rob Farmer; 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?
The following line still has a typo in it:
real(dp),alocatable,dimension(:) :: avg_charge_H
It should read "allocatable".
On Tue, Dec 5, 2017 at 12:23 PM, aldanag--- via Mesa-users <mesa-users at lists.mesastar.org<mailto:mesa-users at lists.mesastar.org>> wrote:
Helllo,
I am sorry to bother you yet making these changes, I still get the same errors, except the last one has changed to:
if (avg_charge_H(k) > 0.1d0 .and. avg_charge_H(k) < 0.9d0) then !changed
1
Error: Function 'avg_charge_h' at (1) has no IMPLICIT type
/home/noam/MESA/mesa-r9575/star/work_standard_makefile:38: recipe for target 'run_star_extras.o' failed
make: *** [run_star_extras.o] Error 1
I attach the updated run_star_extras
Aldana.
________________________________
מאת: Rob Farmer <r.j.farmer at uva.nl<mailto:r.j.farmer at uva.nl>>
נשלח: יום שלישי 05 דצמבר 2017 04:59:45
אל: Aldana Grichener
עותק: mesa-users at lists.mesastar.org<mailto: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?
These lines:
ierr = 0
real(dp),alocatable,dimension(:) :: avg_charge_H
should be:
real(dp),alocatable,dimension(:) :: avg_charge_H
ierr=0
This:
if (s% avg_charge_H(k) > 0.1d0 .and. s% avg_charge_H(k) < 0.9d0)
should be:
if (avg_charge_H(k) > 0.1d0 .and. avg_charge_H(k) < 0.9d0)
The allocation line has declared a local array of the avg_charge_H, so should be accessed as avg_charge_H(index) it is not stored inside the s% derived type so should not have the s% in front of it.
Rob
On 5 December 2017 at 17:42, aldanag at campus.technion.ac.il<mailto:aldanag at campus.technion.ac.il> <aldanag at campus.technion.ac.il<mailto:aldanag at campus.technion.ac.il>> 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<mailto:r.j.farmer at uva.nl>>
נשלח: יום שלישי 05 דצמבר 2017 04:17:08
אל: Aldana Grichener
עותק: mesa-users at lists.mesastar.org<mailto: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<mailto:aldanag at campus.technion.ac.il> <aldanag at campus.technion.ac.il<mailto: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<mailto:r.j.farmer at uva.nl>>
נשלח: יום שלישי 05 דצמבר 2017 01:44:18
אל: Aldana Grichener
עותק: mesa-users at lists.mesastar.org<mailto: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<mailto: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/a782116b/attachment.html>
More information about the Mesa-users
mailing list