Stacks

Migrate a deprecated API across every callsite in Fortran with Atlas in 2026

Updated 6 min read

Migrating a deprecated API across every callsite in a Fortran codebase in 2026 is a job Atlas handles by systematically enumerating callers, applying verified patches, and integrating directly with your Fortran toolchain, including fpm test and fprettify, to ensure a complete and correct transition without missing a single caller.

How to find all deprecated Fortran API calls with Atlas?

Atlas identifies every callsite of a deprecated Fortran API by leveraging its AST indexing and hybrid semantic search capabilities, ensuring no caller is missed in 2026. It combines lsp tool's findReferences for precise symbol usage with grep for dynamic or string-based invocations.

To ensure a complete migration, Atlas employs a two-pronged approach to enumerate all calls to a deprecated Fortran API. First, it utilizes the `lsp` tool's `findReferences` operation, which leverages Atlas's AST indexing built with tree-sitter. This method precisely identifies usages of modern Fortran constructs like modules, explicit interfaces, and coarrays. For instance, if you're deprecating a specific module procedure, `lsp findReferences` will pinpoint every location where that procedure is called. Second, Atlas cross-checks these findings with the `grep` tool. This is crucial for catching dynamic or string-based usages, especially prevalent in legacy FIXED-form numerics or scenarios where symbols might be referenced indirectly. By fusing these retrieval methods with reciprocal rank fusion, Atlas provides a comprehensive list of every callsite, ensuring that even in complex Fortran codebases, no caller is overlooked.

How does Atlas track Fortran API migration progress?

Atlas ensures no Fortran API callsite is silently skipped during migration by creating a todowrite entry for each identified caller. This provides a clear, visible record of partial progress, allowing developers in 2026 to manage hundreds of changes systematically.

Managing a large-scale API migration in Fortran, potentially involving hundreds of callsites, requires robust progress tracking. Atlas addresses this by creating one `todowrite` entry for each identified callsite of the deprecated Fortran API. This approach transforms the daunting task into a series of manageable, visible steps. As Atlas processes each callsite, updating the Fortran source file, it marks the corresponding `todowrite` entry. This visibility means that partial progress is always evident, preventing any callsite from being silently skipped or forgotten. Developers can see exactly which migrations are pending, in progress, or completed, providing a clear roadmap for the entire transition process within their Fortran project.

How to safely apply and verify Fortran code changes with Atlas?

Atlas applies Fortran code changes safely using apply_patch, which seeks the hunk's context and old_lines to prevent misapplication to drifted files, a critical feature for large codebases in 2026. After each file edit, Atlas runs fpm test to validate functionality.

Safety and verification are paramount when modifying Fortran code. Atlas employs the `apply_patch` tool to migrate each callsite. This tool is designed for robustness: it seeks the hunk's context and `old_lines` within the target Fortran source file. If the file has drifted or changed unexpectedly, `apply_patch` will throw a `Failed to find expected lines` error rather than guessing or misapplying a patch. This prevents unintended modifications and ensures the integrity of your Fortran codebase. Before any changes are written, Atlas operates through a read-only plan agent, drafting a plan and asking for permission. When switching to a build agent, every Atlas tool call is permission-gated against allow, ask, and deny rules. After each file modification, Atlas runs `atlas bash "fpm test"` to execute the affected unit tests, ensuring that the changes haven't introduced regressions. Atlas iterates on `gfortran` diagnostics, providing immediate feedback. Furthermore, Atlas runs `atlas bash "fprettify <file_path>"` over the changed Fortran sources before presenting a unified diff for your approval, maintaining code style and providing full transparency over every proposed edit. Atlas also snapshots file changes as git patches, allowing edits to be easily diffed and rolled back if needed.

How to finalize and clean up deprecated Fortran APIs?

To finalize a Fortran API migration, Atlas performs a final grep for the deprecated symbol, confirming zero remaining hits across the codebase in 2026. Only after this verification is complete, and all fpm test runs pass, does Atlas proceed to delete the old implementation.

The final stage of migrating a deprecated Fortran API involves a thorough cleanup and verification. Once all individual callsites have been migrated and their respective `todowrite` entries marked complete, Atlas performs a conclusive check. It executes a final `atlas grep "<deprecated_symbol>"` across the entire Fortran codebase. The objective here is to confirm zero remaining hits of the deprecated symbol, providing absolute assurance that the migration is complete. This step is critical for preventing lingering, unmigrated usages. Only after this final `grep` confirms a clean slate, and all `fpm test` runs have passed successfully, does Atlas proceed to delete the old implementation of the deprecated function or module. This systematic approach ensures a clean, verified transition, leaving your Fortran project free of the deprecated API.

Step by step

  1. 01Enumerate all deprecated Fortran API calls: Use `atlas lsp findReferences <deprecated_symbol>` to get a complete caller set from the language server, then cross-check with `atlas grep "<deprecated_symbol_string>"` for dynamic or string-based usages in your Fortran project.
  2. 02Create migration tasks for each callsite: For every identified callsite, Atlas creates a `todowrite` entry. This ensures partial progress is visible and no Fortran API migration is silently skipped.
  3. 03Migrate each Fortran callsite: Atlas uses `apply_patch` to migrate each callsite. This tool seeks the hunk's context and `old_lines`, throwing `Failed to find expected lines` rather than misapplying to a drifted Fortran source file.
  4. 04Run Fortran tests and format code: After each file modification, Atlas runs `atlas bash "fpm test"` to execute affected unit tests. Once tests pass, Atlas runs `atlas bash "fprettify <file_path>"` over the changed Fortran sources before presenting the unified diff for approval.
  5. 05Confirm complete migration and clean up: Atlas performs a final `atlas grep "<deprecated_symbol>"` to confirm zero remaining hits of the deprecated Fortran API. Once verified, Atlas deletes the old implementation, completing the migration.

Frequently asked questions

How does Atlas ensure it finds all Fortran API calls, even in older code?
Atlas combines `lsp findReferences` for modern Fortran modules and interfaces with `grep` for dynamic or string-based usages, including legacy FIXED-form numerics, ensuring comprehensive enumeration.
Can Atlas handle Fortran projects using fpm?
Yes, Atlas is designed to work within Fortran projects managed by `fpm`, reading `fpm.toml` and integrating with `fpm test` for unit testing.
What if my Fortran code changes while Atlas is working on a migration?
Atlas's `apply_patch` tool is context-anchored. If the target Fortran file has drifted, it will report `Failed to find expected lines` rather than applying a potentially incorrect patch, ensuring safety.
How does Atlas help me review the Fortran code changes?
Atlas computes a unified diff for every file edit and surfaces it for your approval before writing. It also drafts a plan in a read-only agent before executing changes.
Does Atlas run my Fortran tests automatically?
Yes, after each file modification, Atlas can run `atlas bash "fpm test"` to execute your Fortran unit tests and will only mark a `todowrite` entry complete once they pass.
Can Atlas format my Fortran code after making changes?
Absolutely. Atlas can run `atlas bash "fprettify <file_path>"` over changed Fortran sources before presenting the diff, ensuring your codebase remains consistently formatted.
Is my Fortran code sent to third-party servers for indexing?
No, Atlas can build its code index with local Ollama embeddings, keeping your Fortran code securely off third-party servers.

Try Atlas in your terminal

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

Install Atlas

Related guides

Migrate a Deprecated API Across Every Callsite with Atlas (2026 Workflow)

How to migrate a deprecated API across every callsite with Atlas in 2026: the lsp tool's findReferences enumerates callers, todowrite tracks them, apply_patch migrates each one.

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.

Onboard to an Unfamiliar Fortran Codebase in 2026 with Atlas

Quickly build a working mental model of any Fortran repository using Atlas. Leverage semantic search, `fpm` package layouts, and `fprettify` formatting for rapid understanding and safe code exploration in 2026.

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.

Run the Fortran Test Suite and Triage Failures with Atlas in 2026

In 2026, Fortran developers use Atlas to run fpm test suites, triage failures into distinct root causes, and track fixes. Streamline your Fortran debugging workflow.

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

Fortran developers in 2026 can use Atlas to pinpoint exact code implementations. Leverage semantic search, grep, and LSP tools to navigate modules, interfaces, and fpm projects, ensuring precise code discovery and

Audit a Fortran Repo with Parallel Subagents in 2026

Sweep your Fortran codebase for problems without context window limits. Atlas uses parallel subagents to audit fpm projects, leveraging fprettify and fpm test for comprehensive review in 2026.

Research a third-party API before integrating it in Fortran with Atlas in 2026

Fortran developers in 2026 can research third-party APIs efficiently with Atlas. Use `websearch` and `webfetch` for current docs, then integrate with confidence, verifying against `fpm` project conventions.

Browse this resource hub