Skip to content

Enforce that gridcomp modules only USE MAPL (not internal low-level modules) #4959

@tclune

Description

@tclune

Problem

Modules inside gridcomps/ currently bypass the top-level MAPL umbrella module and directly USE internal low-level MAPL modules (e.g. mapl_Base_mod, mapl_Comms_mod, mapl_Config_mod, mapl_Constants_mod, etc.).

This is incorrect. Gridcomp modules are conceptually at the top of the MAPL dependency hierarchy and should only USE:

  • The MAPL umbrella module (for anything from the MAPL library), and/or
  • Modules that are internal to the gridcomp itself (i.e. defined within gridcomps/).

Direct USE of internal low-level modules (those that would otherwise carry a _mod suffix) from within gridcomps/ violates the intended layering and creates a maintenance burden — changes to internal module names or structure require hunting down usages in gridcomps code that should be insulated from such details.

Examples of violations found

use mapl_Base_mod
use mapl_Comms_mod
use mapl_Config_mod
use mapl_Constants_mod
use mapl_AbstractGridFactory_mod
use mapl_AbstractRegridder_mod
use mapl_ApplicationSupport_mod

...and many more throughout gridcomps/.

Proposed Fix

Audit all .F90 files under gridcomps/ and replace direct USE of internal MAPL modules with USE MAPL (with appropriate ONLY clauses). Any entity not currently re-exported by the MAPL umbrella that is needed by a gridcomp should be added to MAPL.

Notes

  • This was discovered during the mapl_<Name>_mod module rename effort (Rename all internal modules to mapl_<Name>_mod convention #4958).
  • The CMake dependency graph is already correct (MAPL.cap etc. depend on MAPL.base, not on MAPL), so no circular dependency exists at the build level today — but the Fortran USE structure does not reflect the intended abstraction boundary.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    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