Stacks

Locate where a behavior is implemented in Fortran with Atlas in 2026

Updated 7 min read

Atlas, the terminal-native AI coding agent, empowers Fortran developers in 2026 to precisely locate where a behavior is implemented within their codebase. By integrating with the Fortran Package Manager (fpm), fprettify for formatting, and gfortran diagnostics, Atlas provides a comprehensive approach to understanding complex Fortran applications, from legacy FIXED-form numerics to modern coarrays and explicit interfaces.

Confirming Fortran Code Locations with grep and File Access

After initial semantic identification, Atlas in 2026 confirms Fortran code locations using its powerful `grep` tool. This step provides exact text matching capabilities, crucial for verifying specific variable names, subroutine calls, or `COMMON` block references across your `fpm` project structure.

Once `codebase_search` provides potential Fortran files or symbols, the `grep` tool allows you to confirm the exact text. This is vital for Fortran developers who might be looking for specific `CALL` statements, `USE` module directives, or even legacy `COMMON` block declarations. Atlas's `grep` takes a real regex plus include and path filters, running through `ripgrep` for speed. For instance, you might use `grep --include='*.f90' 'CALL my_subroutine'` to pinpoint exact usage. Following confirmation, the `read` tool lets you open the best candidate Fortran source file, such as `src/calculations/matrix_ops.f90`. A wrong guess fails loudly with 'File not found' and a 'Did you mean' list, ensuring bad paths do not go unnoticed and you always access the correct Fortran source.

Reviewing and Approving Fortran Code Changes with Atlas

Atlas in 2026 ensures developer control and safety throughout the code location and modification process for Fortran projects. Every Atlas tool call is permission-gated, and any proposed file edits, such as moving a `COMMON` block into a module, are presented as a unified diff for explicit approval.

Atlas prioritizes safety and transparency for Fortran developers. Every Atlas tool call, including running `fpm test (test-drive)` or applying `fprettify`, is permission-gated against allow, ask, and deny rules before it runs. Atlas drafts a plan in a read-only plan agent and asks for your approval before switching to a build agent that can modify files. For any proposed changes, such as refactoring a `subroutine` in `src/legacy_code.f90` or adding new `test-drive` unit tests under `test/`, Atlas computes a unified diff for every file edit and surfaces it for your approval before writing. Atlas also connects to your Git repository, reading branches, status, and diffs, and can stage and create commits on your behalf. It even snapshots file changes as Git patches, so edits can be easily diffed and rolled back, providing robust version control for your Fortran codebase.

Step by step

  1. 01Initialize Atlas in your Fortran project by ensuring an `fpm.toml` file exists at the root, allowing Atlas to read your modules and explicit interfaces.
  2. 02Describe the Fortran behavior you want to locate to Atlas using `codebase_search`, for example: "Find where the `calculate_flux` subroutine is implemented within the `physics_module`."
  3. 03Review the candidate Fortran declarations returned by `codebase_search`, which might include `src/physics_module.f90` or `src/solver_routines.f90`.
  4. 04Confirm the exact text or pattern with `grep`, specifying Fortran-specific filters like `grep --include='*.f90' 'CALL calculate_flux'` or `grep --include='*.f90' 'MODULE my_data_types'`.
  5. 05Open the most promising Fortran source file, such as `src/physics_module.f90`, using the `read` tool to inspect its contents and verify the implementation.
  6. 06Use the `lsp` tool's `findReferences` operation on a specific Fortran symbol, like `calculate_flux`, to see all its callsites across your `fpm` project, including those from other modules via `USE` statements.
  7. 07Jump to the declaration of any related Fortran symbol, such as a module variable or an explicit interface, using `lsp workspaceSymbol 'my_data_type'` or `lsp workspaceSymbol 'my_interface_name'`.
  8. 08Summarize the identified Fortran call path and implementation details, including concrete file and line references, back to the user for documentation or further action.

Frequently asked questions

How does Atlas understand modern Fortran modules and interfaces?
Atlas indexes Fortran code using AST declarations via tree-sitter, allowing it to understand modules, explicit interfaces, and intent declarations on dummy arguments, providing a deep structural awareness of your `fpm` project and its `src/*.f90` files.
Can Atlas help me find Fortran code that uses COMMON blocks?
Yes, Atlas's `codebase_search` can semantically identify code related to `COMMON` blocks, and `grep` can precisely locate their declarations and uses across your Fortran source files. Atlas can even suggest moving a `COMMON` block into a modern Fortran module for better encapsulation.
What Fortran tools does Atlas integrate with for testing and formatting?
Atlas integrates directly with the Fortran Package Manager (`fpm`) for running `fpm test (test-drive)` behind a permission prompt, and it can run `fprettify` over changed Fortran sources before you approve a diff, ensuring consistent code style in your `src/` directory.
How does Atlas ensure I approve changes before they are written to my Fortran project?
Atlas operates with a read-only plan agent before switching to a build agent. It computes a unified diff for every proposed file edit in your Fortran project, such as refactoring a `subroutine` or `function`, and surfaces it for your explicit approval before writing any changes to `src/*.f90`.
Can Atlas find Fortran code even if I don't know the exact subroutine name?
Yes, Atlas's `codebase_search` uses hybrid semantic retrieval, meaning you can describe the behavior in natural language, for instance, 'find the routine that handles atmospheric pressure calculations,' and it will return candidate Fortran declarations even if your words do not appear verbatim in the `src/` code.
How does Atlas handle large Fortran codebases for search performance?
Atlas builds its code index with local Ollama embeddings, keeping your Fortran code off third-party servers. Its hybrid semantic and keyword retrieval, fused by reciprocal rank fusion, efficiently searches large Fortran codebases for relevant declarations, including those in legacy FIXED-form numerics and modern coarrays.
What if I make a mistake or want to revert changes Atlas made to my Fortran files?
Atlas snapshots file changes as git patches, allowing edits to be easily diffed and rolled back. It also reads git branches, status, and diffs, and can stage and create commits on your behalf for your Fortran project, providing robust version control for `src/` and `test/` directories.

Try Atlas in your terminal

The terminal-native AI coding agent. Free core, single binary.

Install Atlas

Related guides

Locate Where a Behavior Is Implemented with Atlas in 2026

How to locate where a behavior is implemented with Atlas in 2026: codebase_search for meaning, grep for exact text, and the lsp tool for the symbol graph.

Atlas for Fortran: fpm.toml, Explicit Interfaces, and fprettify in 2026

Atlas is a terminal-native AI coding agent for Fortran in 2026. It reads modules, explicit interfaces, and intent declarations, runs fpm test behind a prompt, and runs fprettify.

Plan a Multi-File Change in Fortran with Atlas Before Editing in 2026

Design and review complex Fortran code changes across multiple files using Atlas in 2026. Plan safely with fpm, fprettify, and gfortran integration before modifying a single line.

Automate GitHub Issue and Pull Request Triage in Fortran with Atlas in 2026

Automate GitHub issue and pull request triage for Fortran projects using Atlas. Safely respond to PRs and issues, run `fpm test`, and format with `fprettify` for trusted users in 2026, ensuring code quality and security.

Upgrade a Fortran Dependency and Fix Breakage with Atlas in 2026

Fortran developers in 2026 can use Atlas to upgrade dependencies, resolve compile errors, and fix test failures. Learn how Atlas integrates with fpm, gfortran, and fprettify for efficient migrations.

Trace a runtime bug from a stack trace in Fortran with Atlas in 2026

Pinpoint Fortran runtime bugs from production stack traces using Atlas in 2026. Leverage fpm and gfortran diagnostics to quickly identify and fix issues without a debugger attached.

Write Unit Tests for Untested Code in Fortran with Atlas in 2026

Boost your Fortran codebase in 2026 by adding robust unit tests with Atlas. Learn to use fpm test and fprettify to ensure code quality and maintainability.

Refactor a Legacy Fortran Module with Atlas in 2026

Modernize Fortran code in 2026. Use Atlas to refactor legacy modules, move COMMON blocks, and ensure no regressions with fpm test and fprettify.

Browse this resource hub