Skip to content

Fix WRFDA build failure caused by duplicate da_residual.inc - #2367

Open
the-1000th-summer wants to merge 2 commits into
wrf-model:release-v4.8.1from
the-1000th-summer:fix-wrfda-duplicate-da-residual
Open

Fix WRFDA build failure caused by duplicate da_residual.inc#2367
the-1000th-summer wants to merge 2 commits into
wrf-model:release-v4.8.1from
the-1000th-summer:fix-wrfda-duplicate-da-residual

Conversation

@the-1000th-summer

Copy link
Copy Markdown

TYPE: bug fix

KEYWORDS: WRFDA, build, symbolic link, duplicate filename, da_residual.inc

SOURCE: Deng Hao (Sun Yat-sen University)

DESCRIPTION OF CHANGES:

Problem:

The WRFDA source tree contains two files with the same basename:

  • var/da/da_minimisation/da_residual.inc
  • var/da/da_tools/da_residual.inc

The file under da_minimisation is empty, while the file under
da_tools contains the implementation used by da_tools.f90.

During the legacy WRFDA build process, files from the different
var/da/da_* directories are linked into the common var/build
directory. Both source files therefore map to:

var/build/da_residual.inc

With GNU ln, this causes the link-generation step to fail with:

ln: will not overwrite just-created './da_residual.inc'

The current da_minimisation.f90 uses
da_calculate_residual.inc and does not appear to use the empty
da_minimisation/da_residual.inc file.

Solution:

Removed the unused empty file:

var/da/da_minimisation/da_residual.inc

The implementation in var/da/da_tools/da_residual.inc is unchanged.

ISSUE:

Fixes #2364

LIST OF MODIFIED FILES:

D var/da/da_minimisation/da_residual.inc

TESTS CONDUCTED:

  1. Reproduced the duplicate-link failure before the change when
    compiling WRFDA 4D-Var.

  2. Removed the empty duplicate file, cleaned the source tree,
    reconfigured WRFDA, and rebuilt it using:

    ./clean -a
    ./configure wrfda
    ./compile all_wrfvar

  3. The duplicate da_residual.inc link error no longer occurred,
    and the WRFDA build completed successfully.

Test environment:

  • Operating system: Ubuntu Linux under WSL2
  • C compiler: GCC 15.2.0
  • Fortran compiler: GNU Fortran 15.2.0
  • Component: WRFDA / 4D-Var
  • Base branch: develop

The official Jenkins regression tests were not run locally.

RELEASE NOTE:

Removed an unused empty WRFDA include file that caused a duplicate
filename conflict during the legacy WRFDA build link-generation stage.

@the-1000th-summer
the-1000th-summer requested a review from a team as a code owner July 18, 2026 04:15
@weiwangncar

Copy link
Copy Markdown
Collaborator

The regression test results:

Test Type              | Expected  | Received |  Failed
= = = = = = = = = = = = = = = = = = = = = = = =  = = = =
Number of Tests        : 23           24
Number of Builds       : 60           57
Number of Simulations  : 158           150        0
Number of Comparisons  : 95           86        0

Failed Simulations are: 
None
Which comparisons are not bit-for-bit: 
None

@weiwangncar
weiwangncar changed the base branch from develop to release-v4.8.1 July 27, 2026 19:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants