diff --git a/libcdi b/libcdi
index cf8e957e756279c23be849352d55ae0e55ddf164..beac578c7a38640a274287482827b01e8bcf1d2d 160000
--- a/libcdi
+++ b/libcdi
@@ -1 +1 @@
-Subproject commit cf8e957e756279c23be849352d55ae0e55ddf164
+Subproject commit beac578c7a38640a274287482827b01e8bcf1d2d
diff --git a/src/Diff.cc b/src/Diff.cc
index 9b74d3db70934832bb1e02ca09fe9b6ee95c1f00..7b5aec01c3b79202fac263b08bcfd7ddafad6ef0 100644
--- a/src/Diff.cc
+++ b/src/Diff.cc
@@ -307,14 +307,22 @@ compare_fields(Field &field1, Field &field2, int fieldNumber, const CdoVar &var,
   if (dr.absm > params.absLimit || (checkRelativeLimit && dr.relm >= params.relLimit)) params.numDiffFields++;
   if (dr.absm > params.absLimit2 || (checkRelativeLimit && dr.relm >= params.relLimit)) params.numDiffFields2++;
 
-  if (numNANs1)
-    cdo_warning("Found %zu NaNs in infile1 which are not treated as missing values. This can lead to incorrect CDO results in all "
-                "other arithmetic functions!",
-                numNANs1);
-  if (numNANs2)
-    cdo_warning("Found %zu NaNs in infile2 which are not treated as missing values. This can lead to incorrect CDO results in all "
-                "other arithmetic functions!",
-                numNANs2);
+  static auto lwarn1{ true };
+  static auto lwarn2{ true };
+  if (lwarn1 && numNANs1)
+    {
+      lwarn1 = false;
+      cdo_warning("Found %zu NaNs in infile1 which are not treated as missing values. This can lead to incorrect CDO results in "
+                  "all other arithmetic functions!",
+                  numNANs1);
+    }
+  if (lwarn2 && numNANs2)
+    {
+      lwarn2 = false;
+      cdo_warning("Found %zu NaNs in infile2 which are not treated as missing values. This can lead to incorrect CDO results in "
+                  "all other arithmetic functions!",
+                  numNANs2);
+    }
 }
 
 class Diff : public Process