Stacks

Upgrade a Fortran Dependency and Fix Breakage with Atlas in 2026

Updated 6 min read

In 2026, Fortran developers use Atlas to efficiently upgrade dependencies and resolve all resulting compile and test failures by integrating directly with the Fortran Package Manager (`fpm`), the `gfortran` compiler, and the `fpm test (test-drive)` runner.

How does Atlas upgrade Fortran dependencies using `fpm`?

Atlas streamlines Fortran dependency upgrades by directly invoking `fpm` through its `bash` tool. In 2026, this process begins with Atlas running `fpm update` or `fpm add` with a specific version, capturing the full output, even if it exceeds 1000 lines, to a file for later review.

Atlas initiates the dependency upgrade by using its `bash` tool to execute `fpm` commands, such as `fpm update <dependency_name>` or `fpm add <dependency_name>@<new_major_version>`. This direct interaction with the Fortran Package Manager ensures that the upgrade process follows the standard Fortran toolchain. Atlas captures the complete output from `fpm`, which is crucial for diagnosing any initial conflicts or warnings. If the output is extensive, exceeding typical terminal buffer limits, Atlas saves it to a file, which can then be reviewed using the `read` tool. Before attempting fixes, Atlas can use `webfetch` to pull the release notes or changelog for the upgraded Fortran library, providing essential context about breaking changes. This proactive step ensures that subsequent fixes align with the actual migration requirements, rather than relying on guesswork.

How does Atlas fix Fortran compile errors from `gfortran`?

Atlas efficiently resolves Fortran compile errors by reading `gfortran` diagnostics directly after a `fpm build` command. The agent uses its `edit` tool to modify source files like `src/my_module.f90`, leveraging `lsp` to inspect new signatures from the upgraded dependency, often fixing 5-10 errors in a single pass.

Once the dependency is upgraded, Atlas runs `fpm build` via its `bash` tool to compile the Fortran project. It then meticulously parses the `gfortran` compiler output, identifying every compile error. Instead of guessing, Atlas uses these concrete diagnostics to guide its repairs. For each error, Atlas employs its `edit` tool to modify the relevant Fortran source files, such as `src/my_program.f90` or `src/data_types.f90`. When a breaking change involves a module interface or a procedure signature, Atlas utilizes the `lsp` tool's `goToDefinition` operation. This allows it to inspect the new explicit interfaces and `intent` declarations within the upgraded package, ensuring that callsites are correctly adapted. Atlas can also address common Fortran modernization tasks, such as moving a `COMMON` block into a module, as part of the fix process, iterating on `gfortran` diagnostics until the project compiles cleanly.

How does Atlas repair Fortran test failures with `fpm test`?

After resolving compile errors, Atlas addresses Fortran test failures by repeatedly executing `fpm test (test-drive)` via its `bash` tool. The agent analyzes the test runner's output, identifies failing tests within `test/`, and uses `edit` to adjust logic or data structures, often iterating through 2-3 cycles of fix and re-test.

With the Fortran project compiling successfully, Atlas shifts its focus to ensuring functional correctness. It runs the project's unit tests by executing `fpm test (test-drive)` through its `bash` tool. Atlas then reads and analyzes the output from the test runner, pinpointing specific failing tests located in the `test/` directory. For each test failure, Atlas uses its `edit` tool to modify the Fortran source code, whether it's adjusting logic in `src/calculations.f90` or updating test assertions in `test/test_suite.f90`. This process is iterative: Atlas fixes a set of failures, re-runs `fpm test (test-drive)`, and continues until all tests pass. This ensures that the upgraded dependency integrates direct and that the application's behavior remains correct, even with significant underlying library changes.

How does Atlas ensure safe Fortran code changes and commits?

Atlas ensures safety and control throughout the Fortran dependency upgrade process, presenting a unified diff for every file edit before writing. In 2026, before committing, Atlas can run `fprettify` over changed sources like `src/my_program.f90`, ensuring adherence to coding standards, and then stages and commits changes to a new `git` branch.

User control and safety are paramount when Atlas performs Fortran code modifications. Every tool call made by Atlas is permission-gated, requiring explicit allow, ask, or deny rules before execution. Atlas drafts its entire plan in a read-only agent, seeking approval before switching to a build agent that can make changes. Crucially, for every file edit, Atlas computes a unified diff and surfaces it for your approval before writing any changes to disk. This allows Fortran developers to review every line of code modified by Atlas. Before the final commit, Atlas can run `fprettify` over all changed Fortran source files, ensuring that the code adheres to established formatting standards. Atlas then leverages its `git` integration to stage the approved changes, create a new commit, and even manage branches on your behalf, providing a complete and transparent workflow from upgrade to commit.

Step by step

  1. 01Atlas drafts a plan to upgrade the Fortran dependency, asking for your approval before proceeding.
  2. 02Atlas runs `fpm update <dependency_name>@<new_version>` using its `bash` tool and captures the full output, saving it to a file if extensive.
  3. 03Atlas uses `webfetch` to retrieve the release notes or changelog for the upgraded Fortran library to understand breaking changes.
  4. 04Atlas runs `fpm build` with its `bash` tool to compile the Fortran project and captures all `gfortran` diagnostics.
  5. 05Atlas uses its `edit` tool and `lsp`'s `goToDefinition` to fix compile errors in Fortran source files (e.g., `src/my_module.f90`), inspecting new module interfaces.
  6. 06Atlas repeatedly runs `fpm build` and `fpm test (test-drive)` with `bash` to identify and fix remaining compile or test failures in `test/` files.
  7. 07Atlas runs `fprettify` over all changed Fortran source files using `bash` to ensure consistent formatting.
  8. 08Atlas presents a unified diff of all Fortran code changes for your review and approval before staging and committing them to `git`.

Frequently asked questions

How does Atlas handle Fortran dependency version conflicts?
Atlas uses its `bash` tool to run `fpm update` or `fpm add` with specific versions, allowing it to directly interact with `fpm`'s dependency resolution mechanisms and capture any reported conflicts for user review.
Can Atlas fix Fortran `COMMON` block issues during upgrades?
Yes, Atlas can move a `COMMON` block into a module, as specified in its capabilities, helping modernize legacy Fortran code and resolve potential issues during dependency upgrades.
How does Atlas ensure Fortran code quality after an upgrade?
Atlas can run `fprettify` over all changed Fortran source files using its `bash` tool before presenting the final diff for approval, ensuring that formatting standards are maintained throughout the project.
What Fortran toolchain does Atlas support for testing?
Atlas fully supports the `fpm test (test-drive)` runner, allowing it to execute unit tests located in the `test/` directory and iterate on failures until all tests pass.
How does Atlas know what changed in a new Fortran library version?
Atlas uses its `webfetch` tool to retrieve the library's release notes or changelog, providing crucial context for the breaking changes before attempting any fixes in the Fortran codebase.
Is Atlas safe to use with my Fortran codebase?
Yes, Atlas operates with permission-gated tool calls, drafts plans in a read-only agent, and presents a unified diff for every file edit for your approval, ensuring full control and transparency over all Fortran code changes.
Can Atlas work with legacy Fortran code?
Atlas is designed to work with modern Fortran, from legacy FIXED-form numerics to modules, explicit interfaces, and coarrays, making it suitable for a wide range of Fortran projects, including those with older codebases.

Try Atlas in your terminal

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

Install Atlas

Related guides

Upgrade a Dependency and Fix the Breakage with Atlas (2026 Workflow)

How to upgrade a dependency and fix the breakage with Atlas in 2026: bash drives the package manager, webfetch pulls the release notes, edit fixes each compiler error.

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.

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.

Extract a Shared Helper from Duplicated Fortran Code with Atlas in 2026

Refactor your Fortran codebase in 2026 by extracting shared helpers from duplicated logic. Atlas uses semantic search to find copies and automates the creation of new modules and replacement of calls, all while

Diagnose a Hanging or Long-Running Fortran Command with Atlas in 2026

Fortran developers in 2026 can use Atlas to diagnose hanging or slow fpm builds and scripts. Identify if commands are blocked on input or genuinely slow, and get them unstuck efficiently.

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

Streamline Fortran API migrations in 2026 with Atlas. Enumerate all callers, apply context-anchored patches, and validate changes with fpm test and fprettify for a complete, verified transition.

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.

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

Browse this resource hub