From e0af2c577325d3d68b49fedcd554abf9f26c0645 Mon Sep 17 00:00:00 2001 From: Matthew Thompson Date: Thu, 16 Oct 2025 14:13:51 -0400 Subject: [PATCH] v11: Updaates for GCC 15 and Moist --- .../GEOSmoist_GridComp/CMakeLists.txt | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSmoist_GridComp/CMakeLists.txt b/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSmoist_GridComp/CMakeLists.txt index 4374e909b..89ee4c7b1 100644 --- a/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSmoist_GridComp/CMakeLists.txt +++ b/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSmoist_GridComp/CMakeLists.txt @@ -23,14 +23,21 @@ endif () if (CMAKE_Fortran_COMPILER_ID MATCHES GNU AND CMAKE_BUILD_TYPE MATCHES Release) string (REPLACE "${FOPT3}" "${FOPT2}" CMAKE_Fortran_FLAGS_RELEASE ${CMAKE_Fortran_FLAGS_RELEASE}) - # There is some odd interaction between GCC 15 and the GF code. FPEs - # that do not occur with GCC 14 or earlier. For now, we compile GF + + # GCC 15+ workaround for some moist sources + # There is some odd interaction between GCC 15 and some moist code. FPEs + # that do not occur with GCC 14 or earlier. For now, we compile some # codes with -O1 which seems to avoid the bad instruction. Tests show # not much of a speed difference with GCC 14 - if (${CMAKE_Fortran_COMPILER_VERSION} VERSION_GREATER_EQUAL 15) - message (STATUS "[GCC15+] Setting GF Code to use -O1 for GCC 15") - set_source_files_properties(ConvPar_GF2020.F90 PROPERTIES COMPILE_OPTIONS ${FOPT1}) - set_source_files_properties(ConvPar_GF_GEOS5.F90 PROPERTIES COMPILE_OPTIONS ${FOPT1}) + if (CMAKE_Fortran_COMPILER_VERSION VERSION_GREATER_EQUAL 15) + message(STATUS "[GCC15+] Setting GF Code to use -O1 for GCC 15") + set(degrade_o1_sources + ConvPar_GF2020.F90 + ConvPar_GF_GEOS5.F90 + aer_actv_single_moment.F90 + ) + set_source_files_properties(${degrade_o1_sources} + PROPERTIES COMPILE_OPTIONS "${FOPT1}") endif() endif ()