wrf-model / WRF

The official repository for the Weather Research and Forecasting (WRF) model
Other
1.18k stars 658 forks source link

Add explicit casts to mismatched pointer types in rsl_lite #2062

Open islas opened 3 weeks ago

islas commented 3 weeks ago

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
weiwangncar commented 3 weeks ago

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
sayedmekhaimer commented 1 week ago

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.

islas commented 1 week ago

@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)

sayedmekhaimer commented 1 week ago

@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