[Mesa-users] Request for helping solve MESA run star extras problem
Warrick Ball
W.H.Ball at bham.ac.uk
Fri Nov 11 08:36:58 UTC 2022
Hi Shafaat,
I haven't looked closely into this yet (and have little time to do so) but will hazard a quick guess at what's happening.
First, please don't attach screenshots of the terminal. Rather copy and paste small amounts of text into your message, or attach a plain text file with the output you want to share.
The first reported error is
Error: Cannot convert REAL(8) to TYPE(auto_diff_real_star_order1) at (1)
This is a typing issue. The compiler is trying to convert a real number (`REAL(8)`, which is almost certainly something declared as `real(dp)` in the source) to an `auto_diff` variable, which is one of the types used in MESA's new automatic differentiation module.
I've just checked that the tutorial you referred to was written for MESA r15140, and the variable `s% extra_heat` changed from being a `real(dp)` in that version to an `auto_diff` type sometime before r21.12.1.
The "solution" is to set `s% extra_heat` correctly. You'll find some documentation on how `auto_diff` works under the "Module documentation" section of the docs:
https://docs.mesastar.org/en/release-r22.05.1/modules.html
I'm not sure what your ultimate purpose is, but you can probably get things to run by assigning to `s% extra_heat(k)% val` instead of just `s% extra_heat(k)`. I don't promise this will work and you may have to experiment or dig around a bit more. I've only used `auto_diff` to refactor some existing derivative calculations myself.
The second error,
Error: 'vector_a' argument of 'dot_product' intrinsic at (1) must be numeric or LOGICAL
is because `dot_product` doesn't know what to do with the `auto_diff` type (or anything that isn't a number of boolean). You probably want to pass
s% extra_heat(1:s%nz)% val
as the first argument (unless there's a way to propagate the derivative information through `dot_product`?).
Cheers,
Warrick
___________
Warrick Ball
Postdoc, School of Physics and Astronomy
University of Birmingham, Edgbaston, Birmingham B15 2TT
W.H.Ball at bham.ac.uk
+44 (0)121 414 4552
On Fri, 11 Nov 2022, mesa-users at lists.mesastar.org wrote:
> Hello,
> I'm Shafaat, an Astrophysics research assistant studying at Colgate University. I have been trying to get used to using MESA for the past month and right now, I'm at a stage where I am trying to add an additional heating source to my star and run
> stellar models.
>
> I tried my first try from one of your GitHub guideline templates for MESA summer school 2021: https://jschwab.github.io/mesa-2021/
>
> Specifically, I was trying to solve part 3b where we try to change the input physics of our MESA simulation. For clarity, I looked up the solutions and quite literally followed every step to solve the problem. However, MESA throws out an error saying
> it cannot convert real(8) to TYPE(auto_deff_real_star_1) for s% extra_heat (Please refer to the figure showing the terminal snapshot). I understand the step requires differentials and that's exactly why I added s% dm. However, the error still
> persists. Is there a workaround for this? If so, what else can be done? (I made sure I added the use_other_energy = .true. command in the controls inlist and also added the s% other energy in my extras control routine.
>
> Thank you!
>
> Regards,
> Shafaat
>
>
More information about the Mesa-users
mailing list