Skip to content

Remove unused module/local variables, dead assignments, and duplicate use/include statements #1488

Description

@sbryngelson

Cleanup of genuinely unused declarations and duplicate imports (each verified via grep that the symbol is never read).

  • src/common/m_chemistry.fpp:23-24 — module-level integer, dimension(3) :: offsets + $:GPU_DECLARE(create='[offsets]'). Shadowed by a function-local offsets declared at line 179; every read in the file resolves to the local. The module-level one is never read → delete both lines.
  • src/common/m_chemistry.fpp:178 — local n in integer :: x, y, z, i, n, eqn; grep shows only the declaration. Remove n.
  • src/pre_process/m_icpp_patches.fpp:37character(len=5) :: istr; grep shows only the declaration line. Remove.
  • src/pre_process/m_icpp_patches.fpp:21,23 — duplicate use m_mpi_common (identical). Remove one.
  • src/common/m_precision_select.f90:7 — commented ! use, intrinsic :: iso_c_binding. Remove.
  • src/post_process/m_data_input.f90:42 — dead commented decl ! type(scalar_field), public :: ib_markers !< directly above the live decl at line 43. Remove.
  • toolchain/mfc/run/input.py:216load.CACHED_MFCInputFile = None; grep shows it is assigned but never read. Remove.
  • toolchain/mfc/count.py:71 — commented personal path # MFC_COMPARE_DIR="/Users/spencer/Downloads/MFC-shbfork". Remove.
  • src/pre_process/m_check_patches.fpp:5,9 — duplicate #:include 'macros.fpp'. Remove one.

Verification notes (items NOT included):

  • src/simulation/m_start_up.fpp:23,31 was suspected as a duplicate use/#:include but is not — line 23 is use m_rhs, line 31 is use m_phase_change. No duplicate there; excluded.
  • toolchain/mfc/count.py:69 (print("compare dir", MFC_COMPARE_DIR)) is intentional informational output in a comparison utility, not stray debug; left out (or downgrade to logging if desired).

Output-neutrality: all removals are unused declarations / dead assignments / duplicate imports.


Filed from a repo-wide code-cleanliness review; verified against master @ 40dde5e.

Code references

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions