Skip to content

Read coupled components from output_active to avoid stale-file stitch error#68

Merged
AlexisRenchon merged 1 commit into
mainfrom
fix/coupler-output-active-stitch
Jun 15, 2026
Merged

Read coupled components from output_active to avoid stale-file stitch error#68
AlexisRenchon merged 1 commit into
mainfrom
fix/coupler-output-active-stitch

Conversation

@AlexisRenchon

Copy link
Copy Markdown
Member

Problem

The /amip coupled dashboard crashed on load with:

Time dimension is not in non-decreasing order after aggregating datasets.

discover_components built each component's SimDir from the component root (e.g. clima_atmos/). Because ClimaAnalysis.SimDir enumerates files with walkdir (recursing the whole tree), a component folder that held both the current run's output_active/output_NNNN subfolder and stale loose .nc files left at the top level from an earlier run picked up each variable twice and tried to stitch their overlapping time axes — failing in _get_time_name_from_mfds.

In the affected run, clima_atmos/ had 80 leftover top-level .nc files (older runs) alongside the current run in output_0000/. Components that write loose files with no output_* subdir (land/ocean/coupler) were never affected, which is why /land_longrun worked.

Fix

Add _resolve_sim_path, which points each component's SimDir at output_active (or, failing that, the highest-numbered output_NNNN) when present, and otherwise reads the folder itself. The component path field stays the folder root, so the .climaviz_cache location is unchanged.

Tests

  • _resolve_sim_path: loose-files / output_active symlink / numbered-dirs cases
  • discover_components: asserts stale top-level files are ignored when output_active exists

All coupler + summary tests pass locally.

🤖 Generated with Claude Code

… error

`discover_components` built each component's `SimDir` from the component root
(e.g. `clima_atmos/`). Because `ClimaAnalysis.SimDir` enumerates files with
`walkdir`, a component folder that held both the current run's
`output_active`/`output_NNNN` subfolder and stale loose `.nc` files left at the
top level from an earlier run picked up each variable twice and tried to stitch
their overlapping time axes, failing with "Time dimension is not in
non-decreasing order after aggregating datasets".

Add `_resolve_sim_path`, which points the `SimDir` at `output_active` (or the
highest-numbered `output_NNNN`) when present and otherwise reads the folder
itself (land/ocean write loose files with no `output_*` subdir). The component
`path` field stays the folder root so the `.climaviz_cache` location is
unchanged.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@AlexisRenchon
AlexisRenchon force-pushed the fix/coupler-output-active-stitch branch from 71315d3 to 51e6a2f Compare June 15, 2026 17:14
@AlexisRenchon
AlexisRenchon merged commit 8c7a875 into main Jun 15, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant