Index: trunk/BNC/src/PPP/pppClient.cpp
===================================================================
--- trunk/BNC/src/PPP/pppClient.cpp	(revision 9387)
+++ trunk/BNC/src/PPP/pppClient.cpp	(revision 9395)
@@ -634,5 +634,6 @@
           return finish(failure);
         }
-        if (_obsPool->refSatChanged()) {
+        if (_obsPool->refSatChanged() &&
+            _opt->_obsModelType  != t_pppOptions::UncombPPP) {
             epochReProcessing = true;
             continue;
@@ -665,5 +666,6 @@
       // Epoch re-processing required?
       // -----------------------------
-      if (_obsPool->refSatChangeRequired()) {//SLIP
+      if (_obsPool->refSatChangeRequired() && //SLIP
+          _opt->_obsModelType  != t_pppOptions::UncombPPP) {
         epochReProcessing = true;
         _obsPool->deleteLastEpoch();
@@ -777,5 +779,5 @@
 //////////////////////////////////////////////////////////////////////////////
 void t_pppClient::setRefSatellites(std::vector<t_pppSatObs*>& obsVector) {
-
+  t_irc  refSatReDefinition = success;
   // reference satellite definition per system
   for (unsigned iSys = 0; iSys < _opt->systems().size(); iSys++) {
@@ -789,4 +791,5 @@
       }
       // reference satellite is unchanged
+      // ================================
       if      (!_obsPool->refSatChangeRequired(sys) && refSat->prn() == satObs->prn()) {
         refSatDefined = true;
@@ -797,14 +800,18 @@
       }
       // reference satellite has changed
-      else if ( _obsPool->refSatChangeRequired(sys) &&
-                refSat->prn() != satObs->prn() &&
-                !_historicalRefSats[sys].contains(satObs->prn())) {
+      // ===============================
+      else if ( _obsPool->refSatChangeRequired(sys) && refSat->prn() != satObs->prn()) {
         if (satObs->prn().system() == sys) {
-          refSatDefined = true;
-          obsVector[ii]->setAsReference();
-          refSat->setPrn(satObs->prn());
+          if (!_historicalRefSats[sys].contains(satObs->prn())) {
+            refSatDefined = true;
+            obsVector[ii]->setAsReference();
+            refSat->setPrn(satObs->prn());
 #ifdef BNC_DEBUG_PPP
           LOG << "=> set refsatprn: "  <<  satObs->prn().toString() << endl;
 #endif
+          }
+          else if ( _historicalRefSats[sys].contains(satObs->prn())) {
+            refSatReDefinition = failure;
+          }
         }
       }
@@ -816,5 +823,12 @@
       }
     }
+
+    if ((!refSatDefined) && (refSatReDefinition == failure)) {
+      refSat->setPrn(t_prn(sys, 99));
+      continue;
+    }
+
     // reference satellite has to be initialized
+    // =========================================
     if (!refSatDefined) {
       for (unsigned ii = 0; ii < obsVector.size(); ii++) {
@@ -823,6 +837,5 @@
           continue;
         }
-        if (satObs->prn().system() == sys &&
-            !_historicalRefSats[sys].contains(satObs->prn())) {
+        if (satObs->prn().system() == sys) {
           obsVector[ii]->setAsReference();
           refSat->setPrn(satObs->prn());
@@ -838,5 +851,6 @@
       }
     }
-    if (!refSatDefined) {
+
+    if (!refSatDefined) { // no observations for that system
       refSat->setPrn(t_prn());
     }
@@ -858,5 +872,8 @@
     char  sys = it.key();
     t_prn prn = it.value()->prn();
-    if (prn.number() == 0) {
+    if      (prn.number() ==  0) { // no obs for that system available
+      continue;
+    }
+    else if (prn.number() == 99) { // refSat re-definition not possible
       return failure;
     }
@@ -885,6 +902,5 @@
       _historicalRefSats[sys].append(prn);
     }
-  }
-}
+  }}
 
 //
Index: trunk/BNC/src/PPP/pppFilter.cpp
===================================================================
--- trunk/BNC/src/PPP/pppFilter.cpp	(revision 9387)
+++ trunk/BNC/src/PPP/pppFilter.cpp	(revision 9395)
@@ -138,4 +138,5 @@
         }
       }
+      if (!obsVector.size()) {continue;}
       if (processSystem(OPT->LCs(sys), obsVector, _refPrn,
                         epoch->pseudoObsIono(), preProcessing) != success) {
@@ -174,4 +175,5 @@
       }
     }
+    if (!num) {continue;}
     LOG << epoTimeStr << " SATNUM " << system << ' ' << right << setw(2) << num << endl;
     if (processSystem(OPT->LCs(system), obsVector, _refPrn,
@@ -266,4 +268,26 @@
           if (tLC == t_lc::GIM) {continue;}
           if (tLC == t_lc::Tz0) {continue;}
+          ++iObs;
+          usedObs.push_back(obs);
+          usedTypes.push_back(tLC);
+          for (unsigned iPar = 0; iPar < params.size(); iPar++) {
+            const t_pppParam* par = params[iPar];
+            AA[iObs][iPar] = par->partial(_epoTime, obs, tLC, refPrn);
+          }
+          ll[iObs] = obs->obsValue(tLC) - obs->cmpValue(tLC) - DotProduct(_x0, AA.Row(iObs+1));
+          PP[iObs] = 1.0 / (obs->sigma(tLC) * obs->sigma(tLC));
+        }
+      }
+    }
+
+    // pseudo Obs Tropo
+    // ================
+    if (OPT->_pseudoObsTropo) {
+      for (unsigned ii = 0; ii < obsVector.size(); ii++) {
+        t_pppSatObs* obs = obsVector[ii];
+        if (!obs->isReference()) {continue;}
+        for (unsigned jj = 0; jj < usedLCs; jj++) {
+          const t_lc::type tLC = LCs[jj];
+          if (tLC != t_lc::Tz0) {continue;}
           ++iObs;
           usedObs.push_back(obs);
@@ -309,25 +333,4 @@
       }
     }
-    // pseudo Obs Tropo
-    // ================
-    if (OPT->_pseudoObsTropo) {
-      for (unsigned ii = 0; ii < obsVector.size(); ii++) {
-        t_pppSatObs* obs = obsVector[ii];
-        if (!obs->isReference()) {continue;}
-        for (unsigned jj = 0; jj < usedLCs; jj++) {
-          const t_lc::type tLC = LCs[jj];
-          if (tLC != t_lc::Tz0) {continue;}
-          ++iObs;
-          usedObs.push_back(obs);
-          usedTypes.push_back(tLC);
-          for (unsigned iPar = 0; iPar < params.size(); iPar++) {
-            const t_pppParam* par = params[iPar];
-            AA[iObs][iPar] = par->partial(_epoTime, obs, tLC, refPrn);
-          }
-          ll[iObs] = obs->obsValue(tLC) - obs->cmpValue(tLC) - DotProduct(_x0, AA.Row(iObs+1));
-          PP[iObs] = 1.0 / (obs->sigma(tLC) * obs->sigma(tLC));
-        }
-      }
-    }
 
     // Check number of observations, truncate matrices
@@ -561,5 +564,5 @@
 }
 
-// Add innfinite noise to iono
+// Add infinite noise to iono
 ////////////////////////////////////////////////////////////////////////////
 t_irc t_pppFilter::addNoiseToIono(char sys) {
@@ -745,4 +748,21 @@
       }
     }
+    // pseudo Obs Tropo
+    // ================
+    if (OPT->_pseudoObsTropo) {
+      for (unsigned ii = 0; ii < obsVector.size(); ii++) {
+        t_pppSatObs* obs = obsVector[ii];
+        if (!obs->isReference()) {continue;}
+        for (unsigned jj = 0; jj < usedLCs; jj++) {
+          const t_lc::type tLC = LCs[jj];
+          if (tLC != t_lc::Tz0) {continue;}
+          ++iObs;
+          for (unsigned iPar = 0; iPar < params.size(); iPar++) {
+            const t_pppParam* par = params[iPar];
+            AA[iObs][iPar] = par->partial(_epoTime, obs, tLC, refPrn);
+          }
+        }
+      }
+    }
     _datumTrafo->updateIndices(iObs+1);
     _datumTrafo->prepareAA(AA.SubMatrix(1, iObs+1 , 1, _parlist->nPar()), 2);
@@ -791,5 +811,5 @@
 ////////////////////////////////////////////////////////////////////////////
 void t_pppFilter::initDatumTransformation(const std::vector<t_pppSatObs*>& allObs) {
-  unsigned realObs = 0;
+  unsigned trafoObs = 0;
   for (unsigned iSys = 0; iSys < OPT->systems().size(); iSys++) {
     char system = OPT->systems()[iSys];
@@ -809,7 +829,12 @@
       realUsedLCs -= 1;
     }
-    realObs += satNum * realUsedLCs;
-  }
-  _datumTrafo->setObsNum(realObs);
+    trafoObs += satNum * realUsedLCs;
+
+    if (OPT->_pseudoObsTropo) {
+      trafoObs += 1;
+    }
+
+  }
+  _datumTrafo->setObsNum(trafoObs);
   _datumTrafo->setParNum(_parlist->nPar());
   _datumTrafo->initAA();
