Index: trunk/BNC/src/bnchelp.html
===================================================================
--- trunk/BNC/src/bnchelp.html	(revision 11205)
+++ trunk/BNC/src/bnchelp.html	(revision 11212)
@@ -5387,4 +5387,26 @@
       The latest code biases of each stream are used,</li>
     <li>the phase bias signals provided,</li>
+    <li>the phase bias indicators: the SSR format, for IGS-SSR and old RTCM-SSR the dispersive bias consistency
+      indicator and the Melbourne-Wübbena (MW) consistency indicator (new RTCM-SSR has none), per signal the integer
+      and the wide-lane integer indicator (with percentages if they change), and the satellites with changes of the
+      discontinuity counter (PPP-AR users have to reset their ambiguities),</li>
+    <li>the Melbourne-Wübbena check of the phase biases: the indicators only declare the integer property; it is
+      checked with the biases themselves. Every 300 seconds, the MW combination of the phase and code biases of the
+      reference signals is formed per satellite in wide-lane cycles (phase bias of another signal of the frequency if
+      the reference signal has none, e.g. L1C instead of L1W), and differenced with that of each stream of another
+      AC. If the wide-lane biases of both streams are consistent (integer wide-lane ambiguities can be fixed with
+      either), the fractional parts of these differences are the same for all satellites of a system: a common
+      offset, e.g. from different code datums. The RMS of the fractional parts about this offset is reported per
+      other stream (at least 4 satellites; GLONASS not checked, FDMA): below 0.10 cycles consistent, above 0.15
+      cycles not consistent (0.29 cycles for random fractional parts), with the satellites above 0.15 cycles. This
+      checks what a combination of the phase biases (PPP-AR) of several ACs requires, e.g.
+      <pre>
+  G phase bias format and indicators: IGS-SSR, dispersive bias consistency indicator 0, MW consistency indicator 1
+  G phase bias integer / wide-lane integer indicators: 1C integer 1 / wide-lane 2; 2W integer 1 / wide-lane 2; 5I integer 1 / wide-lane 2
+  G MW check: phase biases L1C L2W with the code biases C1W C2W of the reference signals, wide-lane cycles (0.862 m)
+  G MW biases vs. SSRA00CHC1 (1 epochs, 30 satellites): fractional parts about the common offset -0.12 cycles: RMS 0.265 cycles, NOT consistent
+  G MW biases vs. SSRA00NRC0 (1 epochs, 30 satellites): fractional parts about the common offset -0.12 cycles: RMS 0.139 cycles, not clearly consistent
+  G MW biases vs. SSRA00NRC0: satellites with RMS &gt; 0.15 cycles: G01(0.21) G04(0.26) G11(0.24) G21(0.15) G23(0.29) G28(0.30) G29(0.17)
+</pre></li>
     <li>the availability of the satellite yaw angle with the phase biases: 'not provided', or the number of
       satellites and the percentage of phase bias records with yaw angle, listing satellites without or only partly
@@ -8339,5 +8361,6 @@
   10 seconds). The solution is regularized by minimal constraints: per epoch the combined clocks sum up to zero, the
   satellite specific offsets of all ACs providing a satellite sum up to zero, and the satellite specific offsets of
-  each AC sum up to zero. The last condition makes the AC specific offset the mean clock difference of the AC; without
+  each AC sum up to zero (offsets of ACs differing persistently from the other ACs are left out, see 'Robust clock
+  datum' below). The last condition makes the AC specific offset the mean clock difference of the AC; without
   it, the combined clock of a satellite not provided by all ACs would depend on the history of the filter (e.g. after a
   restart). In case of a change of the 'SSR Provider ID',
@@ -8527,5 +8550,7 @@
     AC is used for the clock datum again, which is reported in both logfiles. A single passing check is not
     sufficient, because the offsets are reset with the exclusion and not yet converged; a borderline AC would
-    otherwise change the clock datum every few minutes. A smaller weight factor of the AC would not
+    otherwise change the clock datum every few minutes. Since each change of the datum shifts the combined clocks of
+    the system, the number of passing checks required is doubled each time the same AC is excluded again (2, 4, 8 and
+    at most 16 hours). A smaller weight factor of the AC would not
     help instead: the weights act on the epoch-wise clock variations, while the satellite-specific constant part is
     fixed by the zero-sum conditions, independent of the weights.
@@ -8537,14 +8562,39 @@
   </p>
   <p>
-    <b>Persistent outliers:</b>
+    <b>Robust clock datum and persistent outliers:</b>
     A clock correction whose residual exceeds 'Maximal Residuum' is rejected as outlier. If an AC's clock for a single
-    satellite differs persistently from those of the other ACs, its satellite offset cannot absorb the difference, since
-    the offsets of all ACs of a satellite sum up to zero, and the correction is rejected again in every epoch. This
-    protects the combined clock, but it is worth to be reported to the AC. Therefore, once per hour and system, BNC
-    reports all AC satellites rejected in at least half of their epochs of the last hour (minimum 10 epochs), in the
-    combination logfile and in the BNC logfile, e.g.
+    satellite differs persistently from those of the other ACs, its satellite offset cannot absorb the difference as
+    long as it is part of the zero-sum condition of the satellite: depending on the history of the filter, the
+    difference either shifts the combined clock (e.g. accepted at the start of the filter) or the correction is
+    rejected again in every epoch. Therefore, for each satellite, BNC compares the satellite specific clock difference
+    of each AC referred to the reference signals (AC clock minus AC specific offset minus combined clock, rejected
+    corrections included) with the median of the ACs. A satellite offset rejected as outlier for 60 seconds is taken
+    out of the zero-sum conditions (of the satellite and of the AC) and re-initialized: it then absorbs the constant
+    difference, and the AC only contributes to the variation of the combined clock. This applies to any number of ACs,
+    as long as another offset of the satellite stays in the conditions; a rejected offset in the conditions would
+    otherwise shift the combined clock. For satellites provided by at least three such ACs, an offset deviating by more
+    than 'Maximal Residuum' (at most 0.5 m) for 60 seconds leaves the conditions as well: the offsets with the largest
+    deviations leave first, and a majority of the ACs of the satellite (at least two) stays in the conditions, e.g. if
+    the ACs form two groups with a clock difference. An offset rejoins the zero-sum conditions after its deviation has
+    stayed below half of this threshold for 10 minutes without being rejected. The zero-sum condition of a satellite
+    refers to the values of its offsets only if all offsets in the datum of the satellite (provided within the last
+    hour) are present in the epoch. During a data gap of such an AC, or if its correction is rejected, the sum of the
+    present offsets is kept instead, so that the gap does not shift the combined clock; offsets out of the datum
+    never define it, even if no offset of the datum is present. Both changes are reported in the combination logfile and in the BNC
+    logfile, e.g.
+  </p>
+  <pre>
+bncComb: SHA G26 out of the clock datum: deviation -3.33 m from the median of 6 ACs, rejected as outlier for 60 s
+bncComb: CAS01 G13 back in the clock datum: deviation 0.08 m from the median of 3 ACs (below 0.10 m for 600 s)
+</pre>
+  <p>
+    Corrections can still be rejected persistently, e.g. for satellites provided by fewer than three ACs or for noisy
+    clocks. This protects the combined clock, but it is worth to be reported to the AC. Therefore, once per hour and
+    system, BNC reports all AC satellites rejected in at least half of their epochs of the last hour (minimum 10
+    epochs) and the satellite offsets out of the clock datum, in the combination logfile and in the BNC logfile, e.g.
   </p>
   <pre>
 bncComb: SHA G26 rejected as outlier in 99% of 720 epochs in the last hour (median residual 1.08 m)
+bncComb: G satellite offsets out of the clock datum: SHA G26 (-3.33 m, since 2026-10-02 11:42:15)
 </pre>
   <p>
Index: trunk/BNC/src/combination/bnccomb.cpp
===================================================================
--- trunk/BNC/src/combination/bnccomb.cpp	(revision 11205)
+++ trunk/BNC/src/combination/bnccomb.cpp	(revision 11212)
@@ -1262,5 +1262,6 @@
   // Update and outlier detection loop
   // ---------------------------------
-  SymmetricMatrix QQ_sav = _QQ[sys];
+  SymmetricMatrix     QQ_sav = _QQ[sys];
+  QVector<t_datumObs> datumObs; // all corrections of the epoch, incl. outliers
   while (_running) {
 
@@ -1273,4 +1274,35 @@
     }
 
+    if (datumObs.isEmpty()) {
+      bool referredAC = false;
+      for (int ii = 0; ii < corrs(sys).size(); ii++) {
+        const cmbCorr* corr = corrs(sys)[ii];
+        t_datumObs dObs;
+        dObs.ac       = corr->_acName;
+        dObs.prn      = corr->_prn;
+        dObs.value    = ll(ii+1) + DotProduct(AA.Row(ii+1), x0);
+        dObs.iAC      = 0;
+        dObs.iSat     = 0;
+        dObs.referred = !_biasInconsistent.contains(corr->_acName + sys) && corr->_refBiasesOK;
+        dObs.rejected = false;
+        referredAC    = referredAC || dObs.referred;
+        for (int iPar = 1; iPar <= nPar; iPar++) {
+          const cmbParam* pp = _params[sys][iPar-1];
+          if      (pp->type == cmbParam::offACgnss && pp->AC == corr->_acName) {
+            dObs.iAC = iPar;
+          }
+          else if (pp->type == cmbParam::clkSat && pp->prn == corr->_prn) {
+            dObs.iSat = iPar;
+          }
+        }
+        datumObs.push_back(dObs);
+      }
+      if (!referredAC) { // as in createAmat: then all clocks define the datum
+        for (t_datumObs& dObs : datumObs) {
+          dObs.referred = true;
+        }
+      }
+    }
+
     dx.ReSize(nPar); dx = 0.0;
     kalman(AA, ll, PP, _QQ[sys], dx);
@@ -1278,6 +1310,7 @@
     ColumnVector vv = ll - AA * dx;
 
+    // outliers among the observations only (not the conditions)
     int     maxResIndex;
-    double  maxRes = vv.maximum_absolute_value1(maxResIndex);
+    double  maxRes = vv.Rows(1, corrs(sys).size()).maximum_absolute_value1(maxResIndex);
     out.setRealNumberNotation(QTextStream::FixedNotation);
     out.setRealNumberPrecision(3);
@@ -1300,4 +1333,10 @@
       _outlierStat[sys][corrs(sys)[maxResIndex-1]->_acName + ' ' +
                         corrs(sys)[maxResIndex-1]->_prn.mid(0,3)].residuals.push_back(maxRes);
+      for (t_datumObs& dObs : datumObs) {
+        if (dObs.ac  == corrs(sys)[maxResIndex-1]->_acName &&
+            dObs.prn == corrs(sys)[maxResIndex-1]->_prn) {
+          dObs.rejected = true;
+        }
+      }
       _QQ[sys] = QQ_sav;
       delete corrs(sys)[maxResIndex-1];
@@ -1317,4 +1356,5 @@
         out.setFieldWidth(0);
       }
+      updateDatum(epoTime, sys, out, datumObs, x0 + dx);
       break;
     }
@@ -1401,6 +1441,9 @@
     // exclusion the offsets are reset and not yet converged, so a single
     // passing check does not prove consistency; a borderline AC would
-    // otherwise change the clock datum every few minutes.
-    const int REINCLUDE_CHECKS = 12;
+    // otherwise change the clock datum every few minutes. Each change of the
+    // datum shifts the combined clocks of the system, so the number of
+    // passing checks required is doubled with each further exclusion of the
+    // AC (up to 16 hours).
+    const int REINCLUDE_CHECKS = 12 << std::min(4, std::max(0, _biasExclusions.value(key) - 1));
     if (spread < MIN_SPREAD || slope < MIN_SLOPE || corrCoeff < MIN_CORR) {
       if (_biasInconsistent.contains(key) && ++_biasConsistentChecks[key] < REINCLUDE_CHECKS) {
@@ -1433,4 +1476,5 @@
     if (!_biasInconsistent.contains(key)) {
       _biasInconsistent.insert(key);
+      ++_biasExclusions[key];
       msg += ", AC excluded from the clock datum";
       _biasCheckWarned.remove(key);
@@ -1515,11 +1559,166 @@
 }
 
+// Robust clock datum
+////////////////////////////////////////////////////////////////////////////
+// A persistent clock difference of one AC for a satellite cannot be absorbed
+// by its satellite offset as long as the offset is in the zero-sum condition
+// of the satellite: either it shifts the combined clock (accepted, e.g. at
+// the start of the filter) or the correction is rejected in every epoch
+// (outlier lock-in), depending on the history of the filter. Therefore, per
+// satellite, the satellite-specific clock difference of each AC referred to
+// the reference signals
+//   u = clock - AC offset - combined clock
+// (rejected corrections included) is compared with the median of the ACs.
+// An offset rejected as outlier for DATUM_OUT_SEC leaves the zero-sum
+// conditions (satellite and AC) and is re-initialized: it then absorbs the
+// constant difference, and the AC contributes to the variation of the
+// combined clock only. This applies to any number of ACs, as long as another
+// offset of the satellite stays in the datum (otherwise a rejected offset in
+// the datum would shift the combined clock). For satellites with at least
+// DATUM_MIN_AC ACs, an offset deviating by more than DATUM_OUT_DEV for
+// DATUM_OUT_SEC leaves as well, as long as a majority of the ACs stays in.
+// An offset rejoins the datum after a deviation below DATUM_IN_DEV (at most
+// half of the maximum residual) without rejection for DATUM_IN_SEC. ACs not
+// referred to the reference signals are excluded from the datum anyway and
+// not judged.
+////////////////////////////////////////////////////////////////////////////
+void bncComb::updateDatum(bncTime epoTime, char sys, QTextStream& out,
+                          const QVector<t_datumObs>& datumObs, const ColumnVector& xx) {
+
+  const int    DATUM_MIN_AC  = 3;
+  const double DATUM_OUT_DEV = std::min(0.5, _MAX_RES); // [m]
+  const double DATUM_OUT_SEC = 60.0;
+  const double DATUM_IN_DEV  = 0.5 * DATUM_OUT_DEV;       // [m]
+  const double DATUM_IN_SEC  = 600.0;
+  const double DATUM_FORGET  = 3600.0; // state of offsets not provided for this time is dropped
+
+  QMap<QString, t_datumState>& states = _datumState[sys];
+
+  // parameters observed by accepted corrections
+  QSet<int> observed;
+  for (const t_datumObs& dObs : datumObs) {
+    if (!dObs.rejected) {
+      observed << dObs.iAC << dObs.iSat;
+    }
+  }
+
+  // satellite-specific clock differences per satellite
+  QMap<QString, QVector<const t_datumObs*> > satObs;
+  QMap<QString, double> uu; // key "AC PRN"
+  for (const t_datumObs& dObs : datumObs) {
+    QString key = dObs.ac + ' ' + dObs.prn;
+    states[key].lastSeen = epoTime;
+    states[key].referred = dObs.referred;
+    if (dObs.referred && dObs.iAC && dObs.iSat &&
+        observed.contains(dObs.iAC) && observed.contains(dObs.iSat)) {
+      uu[key] = dObs.value - xx(dObs.iAC) - xx(dObs.iSat);
+      satObs[dObs.prn].push_back(&dObs);
+    }
+  }
+
+  QMapIterator<QString, QVector<const t_datumObs*> > itSat(satObs);
+  while (itSat.hasNext()) {
+    itSat.next();
+    const QVector<const t_datumObs*>& obs = itSat.value();
+    const bool robust = (obs.size() >= DATUM_MIN_AC); // median meaningful
+    QVector<double> uSat;
+    for (const t_datumObs* dObs : obs) {
+      uSat.push_back(uu[dObs->ac + ' ' + dObs->prn]);
+    }
+    std::sort(uSat.begin(), uSat.end());
+    int    nn     = uSat.size();
+    double median = (nn % 2) ? uSat[nn/2] : 0.5 * (uSat[nn/2-1] + uSat[nn/2]);
+
+    // a majority of the ACs stays in the datum (e.g. two groups of ACs with
+    // a clock difference: the median is not meaningful); the offsets with the
+    // largest deviations leave first
+    const int minIn  = std::max(2, (nn + 1) / 2);
+    int       numIn  = 0;
+    QVector<const t_datumObs*> order = obs;
+    for (const t_datumObs* dObs : obs) {
+      QString key = dObs->ac + ' ' + dObs->prn;
+      states[key].dev = uu[key] - median;
+      if (!states[key].out) {
+        ++numIn;
+      }
+    }
+    std::stable_sort(order.begin(), order.end(),
+                     [&states](const t_datumObs* aa, const t_datumObs* bb) {
+                       return fabs(states[aa->ac + ' ' + aa->prn].dev) >
+                              fabs(states[bb->ac + ' ' + bb->prn].dev);
+                     });
+
+    for (const t_datumObs* dObs : order) {
+      QString       key   = dObs->ac + ' ' + dObs->prn;
+      t_datumState& state = states[key];
+      bool change = state.out ? (fabs(state.dev) < DATUM_IN_DEV && !dObs->rejected)
+                              : (dObs->rejected || (robust && fabs(state.dev) > DATUM_OUT_DEV));
+      if (!change) {
+        state.since.reset();
+        continue;
+      }
+      if (!state.since.valid()) {
+        state.since = epoTime;
+      }
+      double duration = epoTime - state.since;
+      if (duration < (state.out ? DATUM_IN_SEC : DATUM_OUT_SEC)) {
+        continue;
+      }
+      // a rejected offset leaves as long as another one stays in, a deviating
+      // (accepted) one only as long as a majority stays in
+      if (!state.out && numIn - 1 < (dObs->rejected ? 1 : minIn)) {
+        continue;
+      }
+      QString msg;
+      if (!state.out) {
+        --numIn;
+        state.out      = true;
+        state.outSince = epoTime;
+        msg = QString("%1 %2 out of the clock datum: deviation %3 m from the median of %4 ACs%5")
+              .arg(dObs->ac).arg(dObs->prn.mid(0,3))
+              .arg(state.dev, 0, 'f', 2).arg(nn)
+              .arg(dObs->rejected ? QString(", rejected as outlier for %1 s").arg(duration, 0, 'f', 0) : QString());
+        // re-initialize the offset: it absorbs the difference from now on
+        for (int iPar = 1; iPar <= _params[sys].size(); iPar++) {
+          cmbParam* pp = _params[sys][iPar-1];
+          if (pp->type == cmbParam::offACSat && pp->AC == dObs->ac && pp->prn == dObs->prn) {
+            _QQ[sys].Row(iPar)    = 0.0;
+            _QQ[sys].Column(iPar) = 0.0;
+            _QQ[sys](iPar,iPar)   = pp->sig0 * pp->sig0;
+          }
+        }
+      }
+      else {
+        ++numIn;
+        state.out = false;
+        msg = QString("%1 %2 back in the clock datum: deviation %3 m from the median of %4 ACs "
+                      "(below %5 m for %6 s)")
+              .arg(dObs->ac).arg(dObs->prn.mid(0,3))
+              .arg(state.dev, 0, 'f', 2).arg(nn)
+              .arg(DATUM_IN_DEV, 0, 'f', 2).arg(duration, 0, 'f', 0);
+      }
+      state.since.reset();
+      out << epoTime.datestr().c_str() << " " << epoTime.timestr().c_str() << " " << msg << "\n";
+      emit newLogRecord(t_logRecord::message(t_logRecord::info, "bncComb: " + msg.toLatin1()), true);
+    }
+  }
+
+  // drop the state of offsets no longer provided
+  QMutableMapIterator<QString, t_datumState> itState(states);
+  while (itState.hasNext()) {
+    itState.next();
+    if (epoTime - itState.value().lastSeen > DATUM_FORGET) {
+      itState.remove();
+    }
+  }
+}
+
 // Report AC satellites rejected as outliers in most epochs
 ////////////////////////////////////////////////////////////////////////////
-// A persistent clock difference of one AC for a satellite cannot be absorbed
-// by its satellite offset, as the offsets of all ACs of the satellite sum up
-// to zero: the correction is rejected again in every epoch. Once per hour
-// and system, AC satellites rejected in at least half of their epochs are
-// reported.
+// Corrections of an AC for a satellite can still be rejected persistently,
+// e.g. for satellites with fewer than DATUM_MIN_AC ACs (see updateDatum) or
+// for noisy clocks. Once per hour and system, AC satellites rejected in at
+// least half of their epochs are reported, as well as the offsets out of
+// the clock datum.
 ////////////////////////////////////////////////////////////////////////////
 void bncComb::checkPersistentOutliers(bncTime epoTime, char sys, QTextStream& out) {
@@ -1552,4 +1751,21 @@
     out << epoTime.datestr().c_str() << " " << epoTime.timestr().c_str() << " " << msg << "\n";
     emit newLogRecord(t_logRecord::message(t_logRecord::warning, "bncComb: " + msg.toLatin1()), true);
+  }
+  QStringList outList;
+  QMapIterator<QString, t_datumState> itState(_datumState[sys]);
+  while (itState.hasNext()) {
+    itState.next();
+    const t_datumState& state = itState.value();
+    if (state.out) {
+      QStringList hlp = itState.key().split(' ');
+      outList << QString("%1 %2 (%3 m, since %4 %5)")
+                 .arg(hlp[0]).arg(hlp[1].mid(0,3)).arg(state.dev, 0, 'f', 2)
+                 .arg(state.outSince.datestr().c_str()).arg(state.outSince.timestr(0).c_str());
+    }
+  }
+  if (!outList.isEmpty()) {
+    QString msg = QString("%1 satellite offsets out of the clock datum: ").arg(sys) + outList.join(", ");
+    out << epoTime.datestr().c_str() << " " << epoTime.timestr().c_str() << " " << msg << "\n";
+    emit newLogRecord(t_logRecord::message(t_logRecord::info, "bncComb: " + msg.toLatin1()), true);
   }
   _outlierStat[sys].clear();
@@ -1870,4 +2086,23 @@
   }
 
+  // Offsets out of the robust clock datum (see updateDatum) and the nominal
+  // datum per satellite: offsets in the datum, provided within the last hour
+  QSet<QString>                outOfDatum;   // "AC PRN" (full PRN)
+  QMap<QString, QSet<QString> > nominalDatum; // PRN -> "AC PRN"
+  if (_method == filter) {
+    QMapIterator<QString, t_datumState> itState(_datumState[sys]);
+    while (itState.hasNext()) {
+      itState.next();
+      const t_datumState& state = itState.value();
+      if (state.out) {
+        outOfDatum.insert(itState.key());
+      }
+      else if (state.referred &&
+               !_biasInconsistent.contains(itState.key().section(' ', 0, 0) + sys)) {
+        nominalDatum[itState.key().section(' ', 1, 1)].insert(itState.key());
+      }
+    }
+  }
+
   // ACs of this epoch, each with a zero-sum condition of its satellite offsets
   QStringList epoACs;
@@ -1951,4 +2186,6 @@
    // }
     int iCond = 1;
+    QSet<int>     incrementRows; // conditions on the increments (continuity)
+    QSet<int>     offIncrement;  // offsets in satellite conditions on the increments
     QSet<int>     offExcluded; // offsets excluded from the zero-sum condition of their satellite
     QSet<int>     offInDatum;  // offsets in the zero-sum condition of their satellite
@@ -1960,5 +2197,6 @@
       ++iCond;
       PP(nObs+iCond) = Ph;
-      QList<int> offAll, offConsistent;
+      QList<int>    offAll, offConsistent, offRobust;
+      QSet<QString> robustKeys;
       for (int iPar = 1; iPar <= _params[sys].size(); iPar++) {
         cmbParam* pp = _params[sys][iPar-1];
@@ -1970,11 +2208,46 @@
           if (!excludedOff.contains(pp->AC + ' ' + pp->prn)) {
             offConsistent << iPar;
+            if (!outOfDatum.contains(pp->AC + ' ' + pp->prn)) {
+              offRobust << iPar;
+              robustKeys.insert(pp->AC + ' ' + pp->prn);
+            }
           }
         }
       }
-      // satellite observed by inconsistent ACs only: all its offsets are used
-      const QList<int>& offUsed = offConsistent.isEmpty() ? offAll : offConsistent;
+      // The condition refers to the values of the offsets (see below) only if
+      // all offsets of the nominal datum of the satellite are present. If one
+      // of them is missing in this epoch (data gap of the AC, correction
+      // rejected as outlier in this iteration), the sum of the present ones
+      // is kept (condition on the increments): otherwise the gap would shift
+      // the combined clock by the offsets of the remaining ACs.
+      const QSet<QString>& nominal = nominalDatum[prn];
+      bool complete = true;
+      for (const QString& key : nominal) {
+        if (!robustKeys.contains(key)) {
+          complete = false;
+          break;
+        }
+      }
+      if (!complete) {
+        incrementRows.insert(iCond);
+        for (int iPar : offRobust) {
+          offIncrement << iPar;
+        }
+      }
+      // satellite observed by inconsistent ACs only: all its offsets are used;
+      // all consistent offsets out of the robust datum: these are used. If
+      // the nominal datum of the satellite is missing completely, the offsets
+      // out of the datum only keep their sum (increments, see above) and are
+      // not used in the conditions of their ACs: they must not define the
+      // clock datum (their differences to the datum ACs are the reason for
+      // their exclusion).
+      const bool keepOnly = offRobust.isEmpty() && !nominal.isEmpty();
+      const QList<int>& offUsed = !offRobust.isEmpty()     ? offRobust     :
+                                  !offConsistent.isEmpty() ? offConsistent : offAll;
       for (int iPar : offAll) {
-        if (offUsed.contains(iPar)) {
+        if (keepOnly && offUsed.contains(iPar)) {
+          AA(nObs+iCond, iPar) = 1.0;
+        }
+        else if (offUsed.contains(iPar)) {
           AA(nObs+iCond, iPar) = 1.0;
           offInDatum << iPar;
@@ -2002,5 +2275,21 @@
         if (_params[sys][iPar-1]->AC == acName) {
           AA(nObs+iCond, iPar) = 1.0;
-        }
+          // an offset kept by its satellite condition (increments) cannot
+          // follow a condition of the AC on the values: both on the increments
+          if (offIncrement.contains(iPar)) {
+            incrementRows.insert(iCond);
+          }
+        }
+      }
+    }
+    // The conditions refer to the parameter values, not to their increments:
+    // with ll = 0, a sum would keep its value of the previous epoch, which
+    // differs from zero after a change of the offsets in the condition (an
+    // offset out of or back in the datum, a satellite no longer provided by
+    // an AC for more than an hour), leaving the datum to the history of the
+    // filter. Exception: incomplete nominal datum of a satellite (see above).
+    for (int iCon = 1; iCon <= nCon; iCon++) {
+      if (!incrementRows.contains(iCon)) {
+        ll(nObs+iCon) = -DotProduct(AA.Row(nObs+iCon), x0);
       }
     }
Index: trunk/BNC/src/combination/bnccomb.h
===================================================================
--- trunk/BNC/src/combination/bnccomb.h	(revision 11205)
+++ trunk/BNC/src/combination/bnccomb.h	(revision 11212)
@@ -264,4 +264,5 @@
   QSet<QString>                              _biasInconsistent; // AC+system excluded from the clock datum
   QMap<QString, int>                         _biasConsistentChecks; // flagged AC+system: passing checks in a row
+  QMap<QString, int>                         _biasExclusions; // AC+system: number of exclusions (hysteresis)
   QMap<char, bncTime>                        _lastFilterEpoch;      // per system: last epoch of the filter prediction
   void checkBiasConsistency(bncTime epoTime, char sys, QTextStream& out);
@@ -278,5 +279,28 @@
   QMap<char, QMap<QString, t_outlierStat> > _outlierStat;      // per system, key "AC PRN"
   QMap<char, bncTime>                       _outlierStatStart; // start of the statistics interval
+  // Robust clock datum: membership of the AC satellite offsets in the
+  // zero-sum conditions, decided by the deviation from the median of the ACs
+  struct t_datumObs {
+    QString ac;
+    QString prn;       // full PRN (with navigation type flag)
+    double  value;     // AC clock referred to the reference signals, corrected [m]
+    int     iAC;       // index of the AC offset parameter (0: none)
+    int     iSat;      // index of the combined clock parameter (0: none)
+    bool    referred;  // AC clock referred to the reference signals
+    bool    rejected;  // rejected as outlier in this epoch
+  };
+  struct t_datumState {
+    t_datumState() : out(false), referred(true), dev(0.0) {}
+    bool    out;      // excluded from the zero-sum conditions
+    bool    referred; // latest correction referred to the reference signals
+    bncTime since;    // start of the condition for a change (out <-> in)
+    bncTime outSince; // excluded since
+    bncTime lastSeen; // last epoch with a correction of the AC for the satellite
+    double  dev;      // latest deviation from the median of the ACs [m]
+  };
+  QMap<char, QMap<QString, t_datumState> >  _datumState; // per system, key "AC PRN" (full PRN)
   void resetSatOffsets(char sys);
+  void updateDatum(bncTime epoTime, char sys, QTextStream& out,
+                   const QVector<t_datumObs>& datumObs, const ColumnVector& xx);
   bool allACsDelivered(const bncTime& epoTime) const;
   bncTime                                    _resTime;
Index: trunk/BNC/src/ssrQc.cpp
===================================================================
--- trunk/BNC/src/ssrQc.cpp	(revision 11205)
+++ trunk/BNC/src/ssrQc.cpp	(revision 11212)
@@ -77,4 +77,9 @@
   const double VTEC_GRID_LAT  = 10.0;   // [deg] grid of the VTEC evaluation, latitudes -80 ... 80
   const double VTEC_GRID_LON  = 15.0;   // [deg]
+  const double MW_SAMPL       = 300.0;  // [s] sampling of the Melbourne-Wuebbena check
+  const double MW_MAX_AGE     = 900.0;  // [s] phase biases older than this are not used
+  const int    MW_MIN_SAT     = 4;      // satellites needed for the common offset
+  const double MW_OK          = 0.10;   // [cycles] RMS of the fractional parts: consistent below,
+  const double MW_BAD         = 0.15;   //          not consistent above (uniform: 0.29)
 
   double tKey(const bncTime& tt) {
@@ -253,5 +258,6 @@
            << "Checks: epochs and update intervals, gaps (interval > 2 x max(declared, median)), latency,"
            << " completeness w.r.t. healthy broadcast ephemerides," << endl
-           << "IOD matching, code and phase bias signals, yaw angle, code biases of the reference signals, clock jumps > "
+           << "IOD matching, code and phase bias signals, phase bias indicators, Melbourne-Wuebbena consistency"
+           << " with the other ACs, yaw angle, code biases of the reference signals, clock jumps > "
            << MAX_CLK_JUMP << " m, largest orbit corrections, VTEC models (system V)" << endl
            << "Reference signals of the clocks: " << t_ssrRefSig::currentString().toStdString() << endl;
@@ -311,4 +317,15 @@
     compareEpoch(_nextCmpEpoch);
     _nextCmpEpoch = _nextCmpEpoch + CMP_SAMPL;
+  }
+  // Melbourne-Wuebbena check of the phase biases
+  if (!_pbLast.isEmpty()) {
+    if (!_nextMwCmp.valid()) {
+      double sec = ceil(time.gpssec() / MW_SAMPL) * MW_SAMPL;
+      _nextMwCmp = bncTime(time.gpsw(), sec);
+    }
+    while (time - _nextMwCmp >= CMP_DELAY) {
+      compareMw(_nextMwCmp);
+      _nextMwCmp = _nextMwCmp + MW_SAMPL;
+    }
   }
   // VTEC comparison
@@ -545,16 +562,45 @@
   QMutexLocker locker(&_mutex);
   for (const t_satPhaseBias& bias : phaseBiases) {
+    QString staID = QString::fromStdString(bias._staID);
+    QString prn   = QString::fromStdString(bias._prn.toString());
+    // latest biases for the Melbourne-Wuebbena check (also as other AC)
+    if (!_excluded.contains(staID) || staID == _reference) {
+      t_pbLast& pl = _pbLast[staID][prn];
+      pl.time = bias._time;
+      pl.values.clear();
+      for (const t_frqPhaseBias& frqBias : bias._bias) {
+        pl.values[QString::fromStdString(frqBias._rnxType2ch)] = frqBias._value;
+      }
+    }
     if (!selected(bias._staID)) continue;
     checkInterval(bias._time);
-    newEpoch(bias._staID, bias._prn.system(), PBIAS, bias._time, bias._updateInt,
-             QString::fromStdString(bias._prn.toString()));
-    QString staSys = QString("%1 %2").arg(bias._staID.c_str()).arg(bias._prn.system());
+    newEpoch(bias._staID, bias._prn.system(), PBIAS, bias._time, bias._updateInt, prn);
+    QString staSys = QString("%1 %2").arg(staID).arg(bias._prn.system());
+    t_satStat& stat = _satStat[staID + ' ' + prn];
+    t_pbIndStat& ind = _pbIndStat[staSys];
+    ind.numRec++;
+    ind.format[(bias._ssrFormat == ssrRtcmNew) ? "new RTCM-SSR" :
+               (bias._ssrFormat == ssrRtcmOld) ? "old RTCM-SSR" : "IGS-SSR"]++;
+    if (bias._ssrFormat != ssrRtcmNew) {  // new RTCM-SSR: no consistency indicators
+      ind.dispInd[bias._dispBiasConsistInd]++;
+      ind.mwInd[bias._MelbWuebConsistInd]++;
+    }
+    bool jumped = false;  // counted once per record, not per signal
     for (const t_frqPhaseBias& frqBias : bias._bias) {
-      _phaseSignals[staSys].insert(QString::fromStdString(frqBias._rnxType2ch));
+      QString sig = QString::fromStdString(frqBias._rnxType2ch);
+      _phaseSignals[staSys].insert(sig);
+      ind.intInd[sig][frqBias._fixIndicator]++;
+      ind.wlInd[sig][frqBias._fixWideLaneIndicator]++;
+      QString jumpKey = staID + ' ' + prn + ' ' + sig;
+      if (_pbJumpLast.contains(jumpKey) && _pbJumpLast[jumpKey] != frqBias._jumpCounter) {
+        jumped = true;
+      }
+      _pbJumpLast[jumpKey] = frqBias._jumpCounter;
+    }
+    if (jumped) {
+      stat.pbJumps++;
     }
     // Yaw angle: new RTCM-SSR has an indicator, old RTCM-SSR and IGS-SSR always
     // carry the field, providers without attitude information send zeros
-    t_satStat& stat = _satStat[QString::fromStdString(bias._staID) + ' ' +
-                               QString::fromStdString(bias._prn.toString())];
     stat.numPB++;
     bool yawProvided = (bias._ssrFormat == ssrRtcmNew) ? (bias._satYawInfoInd != 0)
@@ -570,4 +616,111 @@
       yl.yaw  = bias._yaw;
       yl.rate = bias._yawRate;
+    }
+  }
+}
+
+// Melbourne-Wuebbena combination of the phase and code biases of the
+// reference signals of a stream and satellite in wide-lane cycles:
+//   (f1 b_L1 - f2 b_L2) / (f1 - f2) - (f1 b_C1 + f2 b_C2) / (f1 + f2)
+// The phase bias of a frequency is that of the reference signal or, if not
+// provided, of another signal of the frequency; the code biases are those
+// of the reference signals (as used for the clocks and a combination; with
+// the code bias of the phase signal instead, e.g. C1C for CNES' L1C, CNES and
+// NRCan agreed less on 2026-10-02)
+////////////////////////////////////////////////////////////////////////////
+bool t_ssrQc::mwBias(const QString& staID, const QString& prn, char sys, const bncTime& tt, double& mwCyc) {
+  QString sig1, sig2;
+  t_frequency::type frq1, frq2;
+  if (sys == 'R' || !refSignals(sys, sig1, sig2, frq1, frq2)) {
+    return false;  // GLONASS FDMA: no integer wide-lane ambiguities between satellites
+  }
+  if (!_pbLast.value(staID).contains(prn) || !_cbLast.value(staID).contains(prn)) {
+    return false;
+  }
+  const t_pbLast& pl = _pbLast[staID][prn];
+  if (fabs(tt - pl.time) > MW_MAX_AGE) {
+    return false;
+  }
+  const QMap<QString, double>& cb = _cbLast[staID][prn];
+  auto biases = [&pl, &cb](const QString& sig, double& phase, double& code) {
+    QString used;
+    if (pl.values.contains(sig)) {
+      used = sig;
+    }
+    else {
+      QMapIterator<QString, double> it(pl.values);
+      while (it.hasNext()) {
+        it.next();
+        if (it.key()[0] == sig[0]) {
+          used = it.key();
+          break;
+        }
+      }
+    }
+    if (used.isEmpty()) {
+      return false;
+    }
+    if (!cb.contains(sig)) {
+      return false;
+    }
+    phase = pl.values[used];
+    code  = cb[sig];
+    return true;
+  };
+  double pb1, pb2, cb1, cb2;
+  if (!biases(sig1, pb1, cb1) || !biases(sig2, pb2, cb2)) {
+    return false;
+  }
+  double f1 = t_CST::freq(frq1, 0);
+  double f2 = t_CST::freq(frq2, 0);
+  double mw = (f1 * pb1 - f2 * pb2) / (f1 - f2) - (f1 * cb1 + f2 * cb2) / (f1 + f2);
+  mwCyc = mw / (t_CST::c / (f1 - f2));
+  return true;
+}
+
+// Melbourne-Wuebbena check of one epoch: per pair of streams of different
+// ACs and system, the fractional parts of the MW differences of the
+// satellites about their common (circular mean) offset
+////////////////////////////////////////////////////////////////////////////
+void t_ssrQc::compareMw(const bncTime& tt) {
+  QStringList streams = _pbLast.keys();
+  for (const QString& staA : streams) {
+    if (!selected(staA.toStdString())) continue;
+    for (const QString& staB : streams) {
+      if (staB == staA || !votes(staB) || acOf(staB) == acOf(staA)) continue;
+      QMap<char, QMap<QString, double> > diff;  // system, PRN: MW difference [cycles]
+      for (const QString& prn : _pbLast[staA].keys()) {
+        char   sys = prn[0].toLatin1();
+        double mwA, mwB;
+        if (mwBias(staA, prn, sys, tt, mwA) && mwBias(staB, prn, sys, tt, mwB)) {
+          diff[sys][prn] = mwA - mwB;
+        }
+      }
+      QMapIterator<char, QMap<QString, double> > itSys(diff);
+      while (itSys.hasNext()) {
+        itSys.next();
+        const QMap<QString, double>& dd = itSys.value();
+        if (dd.size() < MW_MIN_SAT) continue;
+        double sSin = 0.0, sCos = 0.0;
+        for (double val : dd) {
+          sSin += sin(2.0 * M_PI * val);
+          sCos += cos(2.0 * M_PI * val);
+        }
+        double offset = atan2(sSin, sCos) / (2.0 * M_PI);
+        t_mwStat& ms = _mwStat[staA][staB][itSys.key()];
+        ms.numEpo++;
+        ms.offset = offset;
+        QMapIterator<QString, double> itD(dd);
+        while (itD.hasNext()) {
+          itD.next();
+          double res = itD.value() - offset;
+          res -= floor(res + 0.5);   // fractional part in [-0.5, 0.5)
+          ms.numRes++;
+          ms.sRes2 += res * res;
+          QPair<unsigned, double>& sr = ms.satRes[itD.key()];
+          sr.first++;
+          sr.second += res * res;
+        }
+      }
     }
   }
@@ -1537,5 +1690,5 @@
       double maxEarly = 0.0;
       QMap<QString, unsigned> missOrb, missClk, missCB, missPB, iodUnknown, unhealthy, noEph,
-                              jumps, missRef, noYaw, yawPartly;
+                              jumps, missRef, noYaw, yawPartly, pbJumps;
       unsigned numPB = 0, numYaw = 0, yawSats = 0;
       double maxRadial = 0.0, maxAlongCross = 0.0;
@@ -1576,4 +1729,5 @@
         if (stat.noEph)        noEph[prn]      = stat.noEph;
         if (stat.clkJumps)     jumps[prn]      = stat.clkJumps;
+        if (stat.pbJumps)      pbJumps[prn]    = stat.pbJumps;
         if (stat.maxRadial > maxRadial) {
           maxRadial    = stat.maxRadial;
@@ -1670,4 +1824,94 @@
         lines << "phase bias signals: " + sigs.join(" ");
       }
+      if (_pbIndStat.contains(staSys)) {
+        const t_pbIndStat& ind = _pbIndStat[staSys];
+        // value list "1" or "0 (12 %), 1 (88 %)"
+        auto values = [](const QMap<int, unsigned>& counts) {
+          unsigned total = 0;
+          for (unsigned nn : counts) total += nn;
+          QStringList parts;
+          QMapIterator<int, unsigned> it(counts);
+          while (it.hasNext()) {
+            it.next();
+            parts << ((counts.size() == 1) ? QString::number(it.key())
+                                           : QString("%1 (%2 %)").arg(it.key())
+                                             .arg(100.0 * it.value() / total, 0, 'f', 0));
+          }
+          return parts.join(", ");
+        };
+        QStringList formats = ind.format.keys();
+        QString line = "phase bias format and indicators: " + formats.join("/");
+        if (!ind.mwInd.isEmpty()) {
+          line += QString(", dispersive bias consistency indicator %1, MW consistency indicator %2")
+                  .arg(values(ind.dispInd)).arg(values(ind.mwInd));
+        }
+        else {
+          line += " (no consistency indicators)";
+        }
+        lines << line;
+        QStringList sigParts;
+        QMapIterator<QString, QMap<int, unsigned> > itSig(ind.intInd);
+        while (itSig.hasNext()) {
+          itSig.next();
+          sigParts << QString("%1 integer %2 / wide-lane %3").arg(itSig.key())
+                      .arg(values(itSig.value())).arg(values(ind.wlInd.value(itSig.key())));
+        }
+        if (!sigParts.isEmpty()) {
+          lines << "phase bias integer / wide-lane integer indicators: " + sigParts.join("; ");
+        }
+        addSats("phase bias discontinuity counter changes", pbJumps);
+      }
+      bool mwAny = false;
+      for (const QMap<char, t_mwStat>& mm : _mwStat.value(staID)) {
+        mwAny = mwAny || mm.contains(sys);
+      }
+      QString mwSig1, mwSig2;
+      t_frequency::type mwFrq1, mwFrq2;
+      if (mwAny && refSignals(sys, mwSig1, mwSig2, mwFrq1, mwFrq2)) {
+        // phase signals used (see mwBias)
+        QStringList used;
+        QStringList pSigs = _phaseSignals.value(staSys).values();
+        pSigs.sort();
+        for (const QString& sig : {mwSig1, mwSig2}) {
+          QString uu = pSigs.contains(sig) ? sig : QString();
+          for (const QString& ps : pSigs) {
+            if (uu.isEmpty() && ps[0] == sig[0]) uu = ps;
+          }
+          used << "L" + uu;
+        }
+        lines << QString("MW check: phase biases %1 with the code biases C%2 C%3 of the reference signals, "
+                         "wide-lane cycles (%4 m)")
+                 .arg(used.join(" ")).arg(mwSig1).arg(mwSig2)
+                 .arg(t_CST::c / (t_CST::freq(mwFrq1, 0) - t_CST::freq(mwFrq2, 0)), 0, 'f', 3);
+      }
+      if (_mwStat.contains(staID)) {
+        QMapIterator<QString, QMap<char, t_mwStat> > itOther(_mwStat[staID]);
+        while (itOther.hasNext()) {
+          itOther.next();
+          if (!itOther.value().contains(sys)) continue;
+          const t_mwStat& ms = itOther.value()[sys];
+          if (ms.numRes == 0) continue;
+          double rms = sqrt(ms.sRes2 / ms.numRes);
+          QString verdict = (rms < MW_OK)  ? "consistent (integer wide-lane biases)" :
+                            (rms > MW_BAD) ? "NOT consistent" : "not clearly consistent";
+          lines << QString("MW biases vs. %1 (%2 epochs, %3 satellites): fractional parts about the "
+                           "common offset %4 cycles: RMS %5 cycles, %6")
+                   .arg(itOther.key()).arg(ms.numEpo).arg(ms.satRes.size())
+                   .arg(ms.offset, 0, 'f', 2).arg(rms, 0, 'f', 3).arg(verdict);
+          QStringList dev;
+          QMapIterator<QString, QPair<unsigned, double> > itS(ms.satRes);
+          while (itS.hasNext()) {
+            itS.next();
+            double rmsSat = sqrt(itS.value().second / itS.value().first);
+            if (rmsSat > MW_BAD) {
+              dev << QString("%1(%2)").arg(itS.key()).arg(rmsSat, 0, 'f', 2);
+            }
+          }
+          if (!dev.isEmpty() && rms < MW_BAD) {
+            lines << QString("MW biases vs. %1: satellites with RMS > %2 cycles: %3")
+                     .arg(itOther.key()).arg(MW_BAD, 0, 'f', 2).arg(dev.join(" "));
+          }
+        }
+      }
       if (numPB) {
         if (numYaw == 0) {
@@ -1768,4 +2012,6 @@
   _cmpEpochs.clear();
   _attEvents.clear();
+  _pbIndStat.clear();
+  _mwStat.clear();
   for (QMap<QString, t_vtecStat>::iterator it = _vtecStat.begin(); it != _vtecStat.end(); ++it) {
     t_vtecStat fresh;
Index: trunk/BNC/src/ssrQc.h
===================================================================
--- trunk/BNC/src/ssrQc.h	(revision 11205)
+++ trunk/BNC/src/ssrQc.h	(revision 11212)
@@ -78,4 +78,5 @@
     unsigned      numPB  = 0;    // phase bias records
     unsigned      numYaw = 0;    // phase bias records with yaw angle
+    unsigned      pbJumps = 0;   // changes of the phase bias discontinuity counter
   };
 
@@ -155,4 +156,42 @@
   QMap<QString, QSet<QString> > _phaseSignals; // key "STA SYS": signals with phase biases
 
+  // Phase bias indicators per stream and system: SSR format, consistency
+  // indicators, integer and wide-lane integer indicators per signal
+  class t_pbIndStat {
+   public:
+    unsigned                              numRec = 0;
+    QMap<QString, unsigned>               format;   // format name: records
+    QMap<int, unsigned>                   dispInd;  // dispersive bias consistency indicator: records
+    QMap<int, unsigned>                   mwInd;    // Melbourne-Wuebbena consistency indicator: records
+    QMap<QString, QMap<int, unsigned> >   intInd;   // signal, integer indicator: records
+    QMap<QString, QMap<int, unsigned> >   wlInd;    // signal, wide-lane integer indicator: records
+  };
+  QMap<QString, t_pbIndStat> _pbIndStat;    // key "STA SYS"
+  QMap<QString, int>         _pbJumpLast;   // key "STA PRN SIG": latest discontinuity counter
+
+  // Melbourne-Wuebbena check: every MW_SAMPL seconds the MW combination of the
+  // phase and code biases of the reference signals (wide-lane cycles) of each
+  // stream is differenced with that of the other ACs per satellite; for
+  // consistent (integer) wide-lane biases the fractional parts of these
+  // differences agree for all satellites of a system (one common offset)
+  class t_pbLast {           // latest phase biases of a stream and satellite
+   public:
+    bncTime                 time;
+    QMap<QString, double>   values;   // signal: bias [m]
+  };
+  class t_mwStat {           // per stream, other stream and system
+   public:
+    unsigned numEpo  = 0;
+    unsigned numRes  = 0;
+    double   sRes2   = 0.0;           // [cycles^2]
+    double   offset  = 0.0;           // latest common offset [cycles]
+    QMap<QString, QPair<unsigned, double> > satRes; // PRN: residuals, sum of squares
+  };
+  void   compareMw(const bncTime& tt);
+  bool   mwBias(const QString& staID, const QString& prn, char sys, const bncTime& tt, double& mwCyc);
+  QMap<QString, QMap<QString, t_pbLast> >                 _pbLast;  // stream, PRN
+  QMap<QString, QMap<QString, QMap<char, t_mwStat> > >    _mwStat;  // stream, other stream, system
+  bncTime                                                 _nextMwCmp;
+
   // Code bias check: DCBs of each stream compared with the other ACs (or
   // the reference stream) and optionally with a Bias SINEX file
