From 5fb62309d4f287fbe91374770b5a68d04f396271 Mon Sep 17 00:00:00 2001 From: Michael Levy Date: Fri, 11 Oct 2024 15:47:37 -0600 Subject: [PATCH] Change gfortran compile flags gfortran now compiles with same flags CESM uses when DEBUG=TRUE, except I added -Werror to elevate warnings to errors and then also turned on -Wno-maybe-uninitialized to avoid failing tests because the compiler thinks there's a chance we are accessing uninitialized memory (the one failure caught by this in CI was initializing an allocatable array element-by-element inside a loop: this was a false-positive, as the loop covered all indices) --- bld/CompileFlags.mak | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bld/CompileFlags.mak b/bld/CompileFlags.mak index e0615875..0221e055 100644 --- a/bld/CompileFlags.mak +++ b/bld/CompileFlags.mak @@ -20,7 +20,7 @@ else endif ifeq ($(FC_TMP),gfortran) - FCFLAGS = -O2 -ffree-form -J $(OBJ_DIR) -cpp -Wall -Werror + FCFLAGS = -g -Og -Wall -Wno-maybe-uninitialized -Werror -fbacktrace -ffpe-trap=zero,overflow -fcheck=bounds -J $(OBJ_DIR) endif ifeq ($(FC_TMP),pgf90)