From 670b7b082614f9678883b002b181f1aa5fe2ae2c Mon Sep 17 00:00:00 2001 From: Johannes Keller Date: Fri, 24 Apr 2026 15:25:55 +0200 Subject: [PATCH 1/2] BuildPDAF: RELEASE with -fp-model=precise https://www.intel.com/content/www/us/en/docs/fortran-compiler/developer-guide-reference/2023-0/fp-model-fp.html Comparing LST-DA data assimilation experiments using the LESTKF with PDAF-OMI and PDAF-non-OMI, differences between the experiments in the RELEASE version were encountered. The DEBUG versions of the experiments were identical. ENKF experiments were also identical. Turning the `-fp-model=precise`, experiments with the LESTKF were identical. Assumption: Floating point optimization triggering wrong results in the localization routines of PDAF. --- cmake/BuildPDAF.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/cmake/BuildPDAF.cmake b/cmake/BuildPDAF.cmake index 5db30cd0..61d56364 100644 --- a/cmake/BuildPDAF.cmake +++ b/cmake/BuildPDAF.cmake @@ -105,6 +105,7 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL "Intel" if (CMAKE_BUILD_TYPE STREQUAL "RELEASE") # Release optimization flags list(APPEND PDAF_FOPT "-O2") + list(APPEND PDAF_FOPT "-fp-model=precise") elseif (CMAKE_BUILD_TYPE STREQUAL "DEBUG") # Debug optimization flags list(APPEND PDAF_FOPT "-O0") From 96c4b4cd2ef0708e6ff4d64fff8ee238c8651c7b Mon Sep 17 00:00:00 2001 From: Johannes Keller Date: Wed, 29 Apr 2026 15:38:46 +0200 Subject: [PATCH 2/2] Change `fp-model` to `source` https://www.intel.com/content/www/us/en/developer/articles/guide/porting-guide-for-ifort-to-ifx.html --- cmake/BuildPDAF.cmake | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cmake/BuildPDAF.cmake b/cmake/BuildPDAF.cmake index 61d56364..51d1d53d 100644 --- a/cmake/BuildPDAF.cmake +++ b/cmake/BuildPDAF.cmake @@ -105,7 +105,12 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL "Intel" if (CMAKE_BUILD_TYPE STREQUAL "RELEASE") # Release optimization flags list(APPEND PDAF_FOPT "-O2") - list(APPEND PDAF_FOPT "-fp-model=precise") + # Adding `-fp-model=source` to avoid precision changes between + # DEBUG and RELEASE simulations + # + # Background, why `source` is chosen over `precise`: + # https://www.intel.com/content/www/us/en/developer/articles/guide/porting-guide-for-ifort-to-ifx.html + list(APPEND PDAF_FOPT "-fp-model=source") elseif (CMAKE_BUILD_TYPE STREQUAL "DEBUG") # Debug optimization flags list(APPEND PDAF_FOPT "-O0")