-
Notifications
You must be signed in to change notification settings - Fork 28
read_phantom.f90: Added Mdot for the case of fixed stellar parameters #147
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Summary of ChangesHello @JotaRata, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request primarily introduces the calculation of the stellar accretion rate ( Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request adds the update of the stellar accretion rate (Mdot) when using fixed stellar parameters. The change in src/read_phantom.f90 correctly uses xyzmh_ptmass(16,...) to get the accretion rate from the phantom file. However, it is missing a check for the force_Mdot flag, which is present in the other code path. The TODO comment indicates this was intended but not implemented. I've suggested adding this check for consistency and to respect manually forced accretion rates. The changes to .gitignore seem reasonable.
| ! TODO: Add conditions for forced Mdot | ||
| etoile(i_etoile)%Mdot = xyzmh_ptmass(16,i_etoile) * usolarmass / utime_scaled * year_to_s ! Accretion rate is in Msun/year |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's great that you're adding the Mdot update for the lfix_star case. As your TODO comment indicates, the condition to check for force_Mdot is missing. To maintain consistency with the else block (lines 1164-1166) and to ensure that manually set accretion rates are not overwritten, you should wrap this assignment in a check for etoile(i_etoile)%force_Mdot.
I've also noticed a minor indentation inconsistency. The new code is indented with 10 spaces, while surrounding assignments use 9. My suggestion corrects this for consistency.
if (.not.etoile(i_etoile)%force_Mdot) then
etoile(i_etoile)%Mdot = xyzmh_ptmass(16,i_etoile) * usolarmass / utime_scaled * year_to_s ! Accretion rate is in Msun/year
endif
|
Hi Jorge, |
Type of PR:
Bug fix
Description:
Fixes #146
Testing:
I haven't tested it yet
Did you run the botscheck that the code and comments follow the code of conduct? no
Did you update relevant documentation in the docs directory? no