Skip to content

[newchem-cpp] cleanup calc_tdust_3d_g#276

Merged
brittonsmith merged 13 commits into
grackle-project:newchem-cppfrom
mabruzzo:gen2024-cleanup_calc_tdust_3d_g
Jun 11, 2025
Merged

[newchem-cpp] cleanup calc_tdust_3d_g#276
brittonsmith merged 13 commits into
grackle-project:newchem-cppfrom
mabruzzo:gen2024-cleanup_calc_tdust_3d_g

Conversation

@mabruzzo

@mabruzzo mabruzzo commented Mar 20, 2025

Copy link
Copy Markdown
Collaborator

This PR was originally proposed as brittonsmith#20


While working on the PR now known as #275 (not required for this PR), I became aware that there were a bunch of extra unused arguments in calc_tdust_3d_g and variables that were defined with type R_PREC when they should be defined as real*8.1

This is EXTREMELY SIMPLE:

  • I convert the type of indixe from integer to integer*8
  • I convert the types of t1, t2, logtem, tdef, tgas, tdust, nh, gasgr, myisrf from R_PREC to REAL*8
  • there were a bunch of declarations copied from solve_rate_cool_g. In solve_rate_cool_g, these were arguments holding the metal species. But, in calc_tdust_3d_g they were effectively just local variables and they were converted to and from proper units (but they are never used for anything). I deleted all of this

Footnotes

  1. I became aware of these issues as I was trying to group together local variables into structs and searching through the codebase. At that point I became aware that a bunch of variables were declared, but unused in this file. This also made me aware of the typing mismatch.

this parallel clause is used when converting from comoving to proper
this parallel clause is used when converting from proper to comoving
Removed unused local variables from `calc_tdust_3d_g` that followed the
naming scheme used in solve_rate_cool for tracking the mass density for
the mass densities of various metal species used in dust chemistry.

There was logic to convert between proper and comoving units for each of
these variables, but they were not actually used for anything (which is
a good thing since they were never initialized).

These variable declarations were probably blindly copied from somewhere
else and were never removed.
Removed unused local variables from `calc_tdust_3d_g` that followed the
naming scheme used in solve_rate_cool for tracking the mass density for
tracking the mass densities of various metal species used in metal
chemistry.

There was logic to convert between proper and comoving units for each of
these variables, but they were not actually used for anything (which is
a good thing since they were never initialized).

These variable declarations were probably blindly copied from somewhere
else and were never removed.
@mabruzzo mabruzzo moved this from In Progress to Awaiting Review in New Chemistry and C++ Transcription Mar 20, 2025
@mabruzzo mabruzzo added the refactor internal reorganization or code simplification with no behavior changes label Mar 24, 2025
@brittonsmith brittonsmith changed the base branch from newchem-cpp to main June 11, 2025 13:59
@brittonsmith brittonsmith changed the base branch from main to newchem-cpp June 11, 2025 13:59
@brittonsmith brittonsmith merged commit 50f60a9 into grackle-project:newchem-cpp Jun 11, 2025
4 checks passed
@github-project-automation github-project-automation Bot moved this from Awaiting Review to Done in New Chemistry and C++ Transcription Jun 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactor internal reorganization or code simplification with no behavior changes trivial

Projects

Development

Successfully merging this pull request may close these issues.

2 participants