WRF icon indicating copy to clipboard operation
WRF copied to clipboard

Add explicit casts to mismatched pointer types in rsl_lite

Open islas opened this issue 1 year ago • 4 comments

TYPE: bug fix

KEYWORDS: gcc14, compilation, c99

SOURCE: internal

DESCRIPTION OF CHANGES: Problem: #2047

Solution: Use explicit type casting

ISSUE: Fixes #2047

TESTS CONDUCTED:

  1. Tested on GCC 14.1.0

islas avatar Jun 10 '24 21:06 islas

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 avatar Jun 11 '24 15:06 weiwangncar

The modification to c_code.c, period.c, and rsl_lite.c solves the compilation error with GCC-14.1, but during the execution of wrf.exe using mpirun (dm) this modification causes an error (segmentation fault, reference to memory). The same configuration works well using GCC-13.3.

sayedmekhaimer avatar Jun 24 '24 12:06 sayedmekhaimer

@sayedmekhaimer Did you use commit https://github.com/wrf-model/WRF/pull/2062/commits/36d3c64aa3c956c1681fae0be33fd1a334790045 or later? The initial commit in this PR did have that issue which I thought I had fixed (tested locally with gcc14)

islas avatar Jun 24 '24 15:06 islas

@sayedmekhaimer Did you use commit 36d3c64 or later? The initial commit in this PR did have that issue which I thought I had fixed (tested locally with gcc14)

I am sorry that I used previous modification, Now the model is compiled and run in parallel mode with no errors using the the commit 36d3c64 . Thank you so much

sayedmekhaimer avatar Jun 25 '24 13:06 sayedmekhaimer

I don't recall whether WRF always uses the PR description as the merge commit message, but if so, perhaps it would be better to include a description of the code changes here rather than simply pointing to #2047? That would make the git log more self-contained.

mgduda avatar Sep 12 '24 19:09 mgduda

@islas Maybe you could make a concise message when merging?

weiwangncar avatar Sep 16 '24 21:09 weiwangncar

@weiwangncar Do you mean instead of the PR description?

islas avatar Sep 16 '24 21:09 islas