Skip to content

Tidy up after the LAI module split (#1729) #1811

Description

@sunt05

Follow-up housekeeping from the review of #1729, which moved update_GDDLAI into src/suews/src/suews_phys_lai.f95. None of these affects behaviour, so they did not hold that PR up.

1. Duplicate entry in src/supy/meson.build

suews_phys_lai.f95 is listed twice in src_f95_all (lines 258 and 267). That list only feeds depend_files: on the suews_objects custom target, so it is a rebuild-watch list rather than a compile list and the duplicate is inert. The second entry should still go; line 258 is the right slot, since it keeps the module ahead of suews_phys_dailystate.f95.

2. Imports stranded by the move

  • src/suews/src/suews_phys_lai.f95 imports supy_error_flag and never uses it.
  • src/suews/src/suews_phys_dailystate.f95 still imports set_supy_error and IEEE_IS_NAN; both left with the moved block. supy_error_flag is still used there and should stay.

gfortran does not warn on unused only: names, so nothing in CI catches these.

3. make format has been failing silently

src/suews/Makefile calls:

fprettify --config .fprettify.rc src/suews/src/*.f95 2>/dev/null || true

fprettify 0.3.7 has no --config option, so this exits with a usage error that 2>/dev/null || true swallows whole. fprettify already discovers .fprettify.rc by walking up from the file, so dropping the flag is the fix.

This is the root cause of item 4, and likely of drift elsewhere in the tree.

4. Formatting drift in suews_phys_lai.f95

With the config applied, fprettify src/suews/src/suews_phys_lai.f95 rewrites 145 of 489 lines, mostly four-space module-level indent against the configured indent = 3, and clears 17 lines of trailing whitespace. Most of this travelled with the block rather than starting in #1729: suews_phys_dailystate.f95 goes from 168 non-conforming lines to 58 once the block leaves. Worth a pass over both files once item 3 is fixed.

5. Reviewer routing is stale

dev-ref/SCIENTIFIC_REVIEWERS.md routes this code through the suews_phys_dailystate.f95 row, which no longer holds it. Needs a row for suews_phys_lai.f95.

Not in scope here

The helpers in the new module all stay nested inside update_gddlai under CONTAINS, so the module exposes one entry point. Promoting them to module-level procedures would make them independently testable, but that is a design question for whoever continues the LAI work rather than housekeeping.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    1-maintenanceCleanup, refactoring, dependency updates2-infra:buildBuild system (meson, setup.py, compilation)2-infra:code-refactorCode refactoring and cleanup3-P2Medium priority4-readyReady for work

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions