Forti4D is calibrated for real-world F77/F90/F95 hybrid corpora — the kind of mixed fixed-form/free-form code found in scientific and HPC codebases where general-purpose parsers typically fail. The toolkit deliberately avoids external Fortran parsers (fparser, OFP) in favor of a custom logical-line reader and calibrated regex patterns, which makes it robust on legacy code at the cost of being out-of-scope for anything beyond Fortran 95. The sections below document what the toolkit does not analyze, what the consequences are, and what is planned for future releases.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/acdeveloper-sci/forti4d/llms.txt
Use this file to discover all available pages before exploring further.
Known Limitations
Fortran 2003+ features are not supported
Fortran 2003+ features are not supported
Forti4D fully supports FORTRAN 77, Fortran 90, and Fortran 95. Fortran 2003 and later are not supported.The following constructs are not detected or analyzed:
CLASSdeclarations and polymorphic variablesTYPE EXTENDS— derived type inheritance hierarchies- Procedure pointers (
PROCEDUREattribute, abstract interfaces withDEFERRED) BIND(C)interoperability declarations- Deferred-length character strings (
CHARACTER(LEN=:), ALLOCATABLE)
| Standard | Support |
|---|---|
| FORTRAN 77 (F77) | Full — fixed-form, COMMON, EQUIVALENCE, IMPLICIT, BLOCK DATA |
| Fortran 90 (F90) | Full — free-form, modules, USE, derived types, INTERFACE blocks |
| Fortran 95 (F95) | Full — FORALL, WHERE, PURE/ELEMENTAL attributes |
| Fortran 2003+ | Not supported |
C preprocessor directives are not evaluated
C preprocessor directives are not evaluated
Directives such as
#ifdef, #ifndef, #else, #endif, #define, and #include (cpp) are treated as unrecognized physical lines. They are never expanded, interpreted, or followed.This has several consequences for codebases that use conditional compilation — common in scientific and HPC Fortran code:-
Conditional dependencies are always captured. A
USEorCALLinside an#ifdefblock will appear in the dependency graph regardless of which compilation flags are active. The reported Fan-In and Fan-Out may be higher than what any single compiled configuration actually produces. -
#definemacros are not resolved. Macro-expanded identifiers, type aliases, and parameterized values are not recognized by the statement classifier. A variable whose type is defined via a#definemacro will appear undeclared. -
#include(cpp) is not followed. Only native FortranINCLUDEstatements are tracked and cross-referenced. Files pulled in via cpp#includeare invisible to the analysis.
INCLUDE files are tracked but not recursively analyzed
INCLUDE files are tracked but not recursively analyzed
Native Fortran
INCLUDE statements are detected and recorded in dep_06_include_files.csv with their existence status (found / not found on disk). Cross-references are maintained at the file level.However, included files are not recursively analyzed as independent program units. A .inc or .h file pulled in via INCLUDE is not scanned for unit boundaries, statement classifications, or dependency edges on its own. Its content is only visible to the analysis through the units that include it.Consequences:- If an
INCLUDEfile defines shared constants or common block layouts used across many source files, those definitions will not appear insymbol_variables.csvortype_definitions.csvas standalone entries. report_reachability.csvcannot classify an included file asREACHABLEorUNREACHABLEbecause it is not inventoried as a unit.
Assumed character lengths may not be fully captured
Assumed character lengths may not be fully captured
The
CHARACTER*(*) assumed-length syntax — used in F77 to declare a character argument whose length is inherited from the caller — may not be fully captured in symbol_signatures.csv.The formal argument will be recorded, but its length attribute may be missing or reported as a raw string rather than a resolved length. This affects symbol signature completeness for subroutines and functions with character arguments and does not affect any other metric.ENTRY statements are flagged but not modeled as callable units
ENTRY statements are flagged but not modeled as callable units
ENTRY statements — which define an additional named entry point into a subroutine or function — are flagged in the per-file audit/*_DEBUG.csv files and counted in the N_Entry_Stmts column of report_consolidated.csv.However, ENTRY names are not modeled as independent callable units in the inventory. They do not receive their own rows in inventory_report.csv, do not appear as nodes in the call graph, and are not tracked for Fan-In. Callers that invoke an ENTRY name will produce a dep_04_external_orphans.csv entry (unresolved external reference) rather than a resolved edge in dep_02_unit_graph.csv.Axis T (State Dimension) is only partially implemented
Axis T (State Dimension) is only partially implemented
The MI4D model on which forti4d is based defines four analysis axes: X (Physical), Y (Structural/Logical), Z (Scope), and T (State). Forti4D v0.7 fully implements X and Y, provides the foundational layer of Z, and only partially addresses T.What Axis T would cover: for each symbol, at each point in the control flow graph, is the variable’s value trustworthy? The full analysis detects:
- Use Before Define — reading a variable before it has been assigned
- Conditional Define — a variable is defined on some branches but not others, producing an ambiguous state at merge points
- INTENT violations — writing to an
INTENT(IN)argument or reading from anINTENT(OUT)argument before assignment
reachability.pydetects the extreme case of Axis T for entire units — units that are never reached from any entry point (dead code at the unit level).complexity.pymeasures CFG branching depth (McCabe CC) without tracking symbol states across branches.
report_consolidated.csv columns that will eventually carry Axis T data (N_Data_Stmts, N_Entry_Stmts) are present but represent only statement counts, not state-flow analysis.Future Work
Fortran 2003 support
CLASS hierarchy and polymorphic variables, TYPE EXTENDS inheritance, BIND(C) interoperability declarations, procedure pointers and deferred-type abstract interfaces, deferred-length character strings (
CHARACTER(LEN=:), ALLOCATABLE).Fortran 2008 support
Submodules (
SUBMODULE), the BLOCK construct, DO CONCURRENT parallelism, CRITICAL and SYNC primitives for coarray synchronization.Fortran 2018 support
Teams and events, collective subroutines, and the full Coarray Fortran synchronization model.
Deeper INCLUDE analysis
Recursive parsing of files pulled in via native Fortran
INCLUDE as first-class program units — inventoried, profiled, and visible in the call graph and all downstream reports.Full Axis T — symbol-state tracking
Use Before Define detection, Conditional Define detection (ambiguous state at branch merge points), INTENT(IN/OUT) validation, and SAVE attribute consistency checking.
PyPI packaging
pip install forti4d after the v1.0 GitHub release. The current alpha is distributed from source.The toolkit deliberately avoids general-purpose Fortran parsers (fparser, OFP) for reliability. Real-world legacy Fortran corpora routinely contain constructs that defeat standard parsers — mixed fixed/free form in a single file, non-standard continuation conventions, and comment characters in unusual positions. The custom
reader_logical.py and calibrated regex patterns in patterns_v1.py / patterns_v2.py are what make the toolkit usable on these corpora. Future standard support will extend these patterns rather than replace them with a parser.