diff --git a/spack_repo/packages/icon-nwp/package.py b/spack_repo/packages/icon-nwp/package.py
index bb8acee52570fe94b33d4e8d3ea69eda679628ca..65c1b2df37624fcd2968678b3d0cfb0ab6b4e72d 100644
--- a/spack_repo/packages/icon-nwp/package.py
+++ b/spack_repo/packages/icon-nwp/package.py
@@ -38,6 +38,7 @@ class IconNwp(Package):
 
     variant("plexrt", default=False, description="add 3D radiation support with TenStream")
     variant("petsc", default=False, description="add PETSc support")
+    variant("debug", default=False, description="add debug flags when compiling icon")
 
     # Dependencies
     depends_on("mpi")
@@ -202,7 +203,6 @@ class IconNwp(Package):
             f"ICON_BUNDLED_CFLAGS=-O3 -mtune={mtune}",
             f"CPPFLAGS={' '.join(CPPFLAGS)}",
             "FCFLAGS=-std=legacy -fmodule-private -fimplicit-none -fmax-identifier-length=63 -Wall -Wcharacter-truncation -Wconversion -Wunderflow -Wunused-parameter -Wno-surprising -fall-intrinsics -g -mpc64 -w",
-            "ICON_FCFLAGS=-fbacktrace -fbounds-check -fstack-protector-all -finit-real=nan -finit-integer=-2147483648 -finit-character=127 -w -O2",
             f"ICON_OCEAN_FCFLAGS=-O3 -mtune={mtune}",
             f"LDFLAGS={' '.join(libs)}",
             f"LIBS={' '.join(libs)}",
@@ -210,6 +210,13 @@ class IconNwp(Package):
             f"--enable-grib2",
         ]
 
+        ICON_FCFLAGS="-std=f2008 -fallow-argument-mismatch -fmodule-private -fimplicit-none -Wall"
+        if "+debug" in self.spec:
+            options.append(f"ICON_FCFLAGS={ICON_FCFLAGS} -fbacktrace -fbounds-check -fstack-protector-all -finit-real=nan -finit-integer=-2147483648 -finit-character=127 -w -O2")
+        else:
+            options.append(f"ICON_FCFLAGS={ICON_FCFLAGS} -O3")
+
+
         # For some reason there's a problem with OpenMPI with gcc@11.3.0 which makes the configuration fail.
         if self.spec.compiler.name == "gcc" and self.spec.compiler.version == Version("11.3.0"):
             options.append("--enable-mpi-checks=no")