diff --git a/src/cluster/cluster.cpp b/src/cluster/cluster.cpp
index a6f99a8dd76cc6b0cbbf8f77a557f1d9001e72cf..68892d7a5db66d97d94fd0a01f6958cd6e19ade7 100644
--- a/src/cluster/cluster.cpp
+++ b/src/cluster/cluster.cpp
@@ -757,9 +757,15 @@ int cluster_jxi488_cycle(
 	+ ").\n";
       logger->log(message, LOG_WARN);
     } else if (recommended_li < cid->c1->li) {
-      message = "INFO: lowering internal order from " + to_string(cid->c1->li) + " to "
-	+ to_string(recommended_li) + " for scale iteration " + to_string(jxi488) + ".\n";
-      logger->log(message, LOG_INFO);
+      if (gconf->dyn_order_flag > 0) {
+	message = "INFO: lowering internal order from " + to_string(cid->c1->li) + " to "
+	  + to_string(recommended_li) + " for scale iteration " + to_string(jxi488) + ".\n";
+	logger->log(message, LOG_INFO);
+      } else {
+	message = "WARNING: internal order " + to_string(cid->c1->li) + " too high for scale iteration "
+	  + to_string(jxi488) + ".\n";
+	logger->log(message, LOG_WARN);
+      }
     }
     if (recommended_le > cid->c1->le) {
       message = "WARNING: external order " + to_string(cid->c1->le) + " for scale iteration "
@@ -767,17 +773,25 @@ int cluster_jxi488_cycle(
 	+ ").\n";
       logger->log(message, LOG_WARN);
     } else if (recommended_le < cid->c1->le) {
-      message = "INFO: lowering external order from " + to_string(cid->c1->le) + " to "
-	+ to_string(recommended_le) + " for scale iteration " + to_string(jxi488) + ".\n";
-      logger->log(message, LOG_INFO);
+      if (gconf->dyn_order_flag > 0) {
+	message = "INFO: lowering external order from " + to_string(cid->c1->le) + " to "
+	  + to_string(recommended_le) + " for scale iteration " + to_string(jxi488) + ".\n";
+	logger->log(message, LOG_INFO);
+      } else {
+	message = "INFO: external order " + to_string(cid->c1->le) + " too high for scale iteration "
+	  + to_string(jxi488) + ".\n";
+	logger->log(message, LOG_WARN);
+      }
     }
     if (recommended_li < max_li || recommended_le < max_le) {
-      int new_li = (recommended_li < max_li) ? recommended_li : max_li;
-      int new_le = (recommended_le < max_le) ? recommended_le : max_le;
-      cid->update_orders(sconf->_rcf, new_li, new_le);
-      is_first_scale = true;
-      jaw = 1;
-      cid->refinemode = 2;
+      if (gconf->dyn_order_flag > 0) {
+	int new_li = (recommended_li < max_li) ? recommended_li : max_li;
+	int new_le = (recommended_le < max_le) ? recommended_le : max_le;
+	cid->update_orders(sconf->_rcf, new_li, new_le);
+	is_first_scale = true;
+	jaw = 1;
+	cid->refinemode = 2;
+      }
     }
   }
   int li = cid->c1->li;
@@ -883,16 +897,18 @@ int cluster_jxi488_cycle(
   double actualaccuracy = cid->accuracygoal;
   invert_matrix(cid->am, ndit, jer, cid->maxrefiters, actualaccuracy, cid->refinemode, output_path, jxi488, mxndm, cid->proc_device);
   // in principle, we should check whether the returned actualaccuracy is indeed lower than the accuracygoal, and do something about it if not
-#ifdef USE_REFINEMENT
-  if (cid->refinemode==2) {
-    message = "INFO: calibration obtained accuracy " + to_string(actualaccuracy) + " (" + to_string(cid->accuracygoal) + " requested) in " + to_string(cid->maxrefiters) + " refinement iterations\n";
-    logger->log(message);
-    if (actualaccuracy > 1e-1) {
-      printf("Accuracy worse than 0.1, stopping");
-      exit(1);
+  if (gconf->refine_flag > 0) {
+    if (cid->refinemode==2) {
+      message = "DEBUG: iterative refinement enabled at run-time.\n";
+      logger->log(message, LOG_DEBG);
+      message = "INFO: calibration obtained accuracy " + to_string(actualaccuracy) + " (" + to_string(cid->accuracygoal) + " requested) in " + to_string(cid->maxrefiters) + " refinement iterations\n";
+      logger->log(message);
+      if (actualaccuracy > 1e-1) {
+	printf("Accuracy worse than 0.1, stopping");
+	exit(1);
+      }
     }
   }
-#endif
   cid->refinemode = 0;
 #ifdef DEBUG_AM
   VirtualAsciiFile *outam2 = new VirtualAsciiFile();
diff --git a/src/inclusion/inclusion.cpp b/src/inclusion/inclusion.cpp
index 6346157b1b9c3293d9536e4fe899aa22713b03f0..1d4433a0b7d49fc7a1d342cc26975927df496e26 100644
--- a/src/inclusion/inclusion.cpp
+++ b/src/inclusion/inclusion.cpp
@@ -743,9 +743,15 @@ int inclusion_jxi488_cycle(int jxi488, ScattererConfiguration *sconf, GeometryCo
 	+ ").\n";
       logger->log(message, LOG_WARN);
     } else if (recommended_li < cid->c1->li) {
-      message = "INFO: lowering internal order from " + to_string(cid->c1->li) + " to "
-	+ to_string(recommended_li) + " for scale iteration " + to_string(jxi488) + ".\n";
-      logger->log(message, LOG_INFO);
+      if (gconf->dyn_order_flag > 0) {
+	message = "INFO: lowering internal order from " + to_string(cid->c1->li) + " to "
+	  + to_string(recommended_li) + " for scale iteration " + to_string(jxi488) + ".\n";
+	logger->log(message, LOG_INFO);
+      } else {
+	message = "WARNING: internal order " + to_string(cid->c1->li) + " too high for scale iteration "
+	  + to_string(jxi488) + ".\n";
+	logger->log(message, LOG_WARN);
+      }
     }
     if (recommended_le > cid->c1->le) {
       message = "WARNING: external order " + to_string(cid->c1->le) + " for scale iteration "
@@ -753,17 +759,25 @@ int inclusion_jxi488_cycle(int jxi488, ScattererConfiguration *sconf, GeometryCo
 	+ ").\n";
       logger->log(message, LOG_WARN);
     } else if (recommended_le < cid->c1->le) {
-      message = "INFO: lowering external order from " + to_string(cid->c1->le) + " to "
-	+ to_string(recommended_le) + " for scale iteration " + to_string(jxi488) + ".\n";
-      logger->log(message, LOG_INFO);
+      if (gconf->dyn_order_flag > 0) {
+	message = "INFO: lowering external order from " + to_string(cid->c1->le) + " to "
+	  + to_string(recommended_le) + " for scale iteration " + to_string(jxi488) + ".\n";
+	logger->log(message, LOG_INFO);
+      } else {
+	message = "WARNING: external order " + to_string(cid->c1->le) + " too high for scale iteration "
+	  + to_string(jxi488) + ".\n";
+	logger->log(message, LOG_WARN);
+      }
     }
     if (recommended_li < max_li || recommended_le < max_le) {
-      int new_li = (recommended_li < max_li) ? recommended_li : max_li;
-      int new_le = (recommended_le < max_le) ? recommended_le : max_le;
-      cid->update_orders(sconf->_rcf, new_li, new_le);
-      is_first_scale = true;
-      jaw = 1;
-      cid->refinemode = 2;
+      if (gconf->dyn_order_flag > 0) {
+	int new_li = (recommended_li < max_li) ? recommended_li : max_li;
+	int new_le = (recommended_le < max_le) ? recommended_le : max_le;
+	cid->update_orders(sconf->_rcf, new_li, new_le);
+	is_first_scale = true;
+	jaw = 1;
+	cid->refinemode = 2;
+      }
     }
   }
   int li = cid->c1->li;
@@ -873,16 +887,18 @@ int inclusion_jxi488_cycle(int jxi488, ScattererConfiguration *sconf, GeometryCo
   double actualaccuracy = cid->accuracygoal;
   invert_matrix(cid->am, cid->c1->ndm, jer, cid->maxrefiters, actualaccuracy, cid->refinemode, output_path, jxi488, mxndm, cid->proc_device);
   // in principle, we should check whether the returned actualaccuracy is indeed lower than the accuracygoal, and do something about it if not
-#ifdef USE_REFINEMENT
-  if (cid->refinemode==2) {
-    message = "INFO: calibration obtained accuracy " + to_string(actualaccuracy) + " (" + to_string(cid->accuracygoal) + " requested) in " + to_string(cid->maxrefiters) + " refinement iterations\n";
-    logger->log(message);
-    if (actualaccuracy > 1e-2) {
-      printf("Accuracy worse than 0.01, stopping");
-      exit(1);
+  if (gconf->refine_flag > 0) {
+    if (cid->refinemode==2) {
+      message = "DEBUG: iterative refinement enabled at run-time.\n";
+      logger->log(message, LOG_DEBG);
+      message = "INFO: calibration obtained accuracy " + to_string(actualaccuracy) + " (" + to_string(cid->accuracygoal) + " requested) in " + to_string(cid->maxrefiters) + " refinement iterations\n";
+      logger->log(message);
+      if (actualaccuracy > 1e-2) {
+	printf("Accuracy worse than 0.01, stopping");
+	exit(1);
+      }
     }
   }
-#endif // USE_REFINEMENT
 #ifdef USE_NVTX
   nvtxRangePop();
 #endif
diff --git a/src/sphere/sphere.cpp b/src/sphere/sphere.cpp
index 1cfddc5c7425c56dfa26efd0ba032341f2fd529c..07dbd7b28f67418764a92b7c411c0c0d9296df60 100644
--- a/src/sphere/sphere.cpp
+++ b/src/sphere/sphere.cpp
@@ -593,14 +593,21 @@ int sphere_jxi488_cycle(
 	+ ").\n";
       logger->log(message, LOG_WARN);
     } else if (recommended_lm < max_lm) {
-      int new_lm = recommended_lm;
-      message = "INFO: lowering internal order from " + to_string(max_lm) + " to "
-	+ to_string(recommended_lm) + " for scale iteration " + to_string(jxi488) + ".\n";
-      logger->log(message, LOG_INFO);
-      sid->update_order(new_lm);
-      is_first_scale = true;
-      // jw = 1;
-      l_max = new_lm;
+      if (gconf->dyn_order_flag > 0) {
+	int new_lm = recommended_lm;
+	message = "INFO: lowering internal order from " + to_string(max_lm) + " to "
+	  + to_string(recommended_lm) + " for scale iteration " + to_string(jxi488) + ".\n";
+	logger->log(message, LOG_INFO);
+	sid->update_order(new_lm);
+	is_first_scale = true;
+	// jw = 1;
+	l_max = new_lm;
+      } else {
+	message = "WARNING: internal order " + to_string(max_lm) + " for scale iteration "
+	  + to_string(jxi488) + " too high (recommended order is " + to_string(recommended_lm)
+	  + ").\n";
+      logger->log(message, LOG_WARN);
+      }
     }
   }
   // End of dynamic order check