ESMCI / ccs_config_cesm

CESM CIME Case Control System configuration files
3 stars 43 forks source link

Add -nan to NAG flags when debug is turned on #94

Closed cacraigucar closed 1 year ago

cacraigucar commented 1 year ago

The NAG compiler flag "-nan" which initializes all variables to NaN should be used when debug = TRUE.

cacraigucar commented 1 year ago

From @fvitt - the proposed change is:

Include -nan NAG compiler option for DEBUG:

diff --git a/machines/cmake_macros/nag.cmake b/machines/cmake_macros/nag.cmake
index 6a2d97c..4c5ebf0 100644
--- a/machines/cmake_macros/nag.cmake
+++ b/machines/cmake_macros/nag.cmake
@@ -10,7 +10,7 @@ if (NOT DEBUG)
   string(APPEND FFLAGS " -ieee=full -O2")
 endif()
 if (DEBUG)
-  string(APPEND FFLAGS " -C=all -g -time -f2003 -ieee=stop")
+  string(APPEND FFLAGS " -nan -C=all -g -time -f2003 -ieee=stop")
 endif()
 if (DEBUG AND NOT compile_threaded)
   string(APPEND FFLAGS " -gline")