-
Notifications
You must be signed in to change notification settings - Fork 28
fast density #145
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?
fast density #145
Conversation
Summary of ChangesHello @cpinte, 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 introduces a significant refactoring of how dust density is managed and calculated throughout the simulation code. The primary change involves renaming the 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 introduces a significant and valuable refactoring by replacing densite_pouss with dust_density. This change effectively separates the spatial distribution of dust from its size distribution, which is a great improvement for code clarity and maintainability. The PR also includes performance enhancements and fixes related to OpenMP.
I've identified one critical bug in src/disk_physics.f90 where an incorrect loop index is used, which will lead to erroneous mass calculations. Additionally, there are some leftover debugging statements in src/density.f90 that should be removed before merging. Overall, this is a solid set of changes once these issues are addressed.
| ! 1 grain -> 100 grains | ||
|
|
||
| ! 0.37s -> 1.9s | ||
| write(*,*) "A" | ||
|
|
||
| call define_gas_density() | ||
| ! 0.8s after OpenMP -> 2.4s | ||
| write(*,*) "B" | ||
|
|
||
| call define_dust_density() | ||
| ! 1.4s -> 40.7s | ||
| write(*,*) "C" | ||
| !stop | ||
|
|
||
|
|
||
|
|
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.
- Correcting dust_density access: Replaced direct indexing with conditional logic or the p_k/p_l pointers in dust_prop.f90, thermal_emission.f90, output.f90, io_prodimo.f90, and read1d_models.f90. - Updating OpenMP directives: Ensured thread safety for the new pointers in thermal_emission.f90. - Fixing Normalization Logic: Corrected density.f90 to use volume integrals and properly handle grain size distributions when lvariable_dust is true.
…ust checks outside loops
aaff010 to
d36e11a
Compare
Type of PR:
Bug fix / new physics / modification to existing code / other
Description:
Give a short description of the change.
Testing:
Describe how you have tested the change
Did you run the botscheck that the code and comments follow the code of conduct? yes/no
Did you update relevant documentation in the docs directory? yes/no