Index: trunk/BNC/src/PPP/pppClient.cpp
===================================================================
--- trunk/BNC/src/PPP/pppClient.cpp	(revision 8956)
+++ trunk/BNC/src/PPP/pppClient.cpp	(revision 8961)
@@ -220,9 +220,25 @@
         satObs->setPseudoObsIono(t_frequency::G1, stecRef);
       }
-      satObs->printObsMinusComputed();
       it++;
     }
   }
-
+  if (_opt->_pseudoObsTropo) {
+    vector<t_pppSatObs*>::iterator it = obsVector.begin();
+    while (it != obsVector.end()) {
+      t_pppSatObs* satObs = *it;
+      if (satObs->isReference()) {
+        satObs->setPseudoObsTropo();
+      }
+      it++;
+    }
+  }
+/*
+  vector<t_pppSatObs*>::iterator it = obsVector.begin();
+      while (it != obsVector.end()) {
+        t_pppSatObs* satObs = *it;
+        satObs->printObsMinusComputed();
+        it++;
+      }
+*/
   return pseudoObsIono;
 }
Index: trunk/BNC/src/PPP/pppFilter.cpp
===================================================================
--- trunk/BNC/src/PPP/pppFilter.cpp	(revision 8956)
+++ trunk/BNC/src/PPP/pppFilter.cpp	(revision 8961)
@@ -117,16 +117,26 @@
   // Init Datum Trafo
   // ----------------------------------------
-  if ((OPT->_obsModelType == OPT->DCMcodeBias ||
-       OPT->_obsModelType == OPT->DCMphaseBias) &&
-      (_numEpoProcessing == 1)) {
+  if ((OPT->_obsModelType == OPT->DCMcodeBias   ||
+       OPT->_obsModelType == OPT->DCMphaseBias) && (_numEpoProcessing == 1)) {
     _numAllUsedLCs = 0;
     for (unsigned iSys = 0; iSys < OPT->systems().size(); iSys++) {
       char system = OPT->systems()[iSys];
       _numAllUsedLCs += OPT->LCs(system).size();
-      if (OPT->_pseudoObsIono && !epoch->pseudoObsIono()) {
+      if (OPT->_pseudoObsIono && epoch->pseudoObsIono() == false) {
         _numAllUsedLCs -= 1;  // GIM not used
       }
     }
-    int maxObs = allObs.size() * _numAllUsedLCs;
+    int modify = 0;
+    if (OPT->_pseudoObsTropo) {
+      modify  = -1;
+    }
+    // max Obs
+    int maxObs = allObs.size() * (_numAllUsedLCs + modify);
+    if (OPT->_pseudoObsIono && epoch->pseudoObsIono() == true) { // stecDiff w.r.t refSat
+      maxObs -= 1;
+    }
+    if (OPT->_pseudoObsTropo) {
+      maxObs += 1;  // once per station
+    }
     _datumTrafo->initAA(maxObs, _parlist->nPar());
   }
@@ -144,4 +154,5 @@
         _refPrn = (_obsPool->getRefSatMapElement(system))->prn();
         if (_obsPool->hasHistoricalRefSat(_refPrn)) {
+          LOG << epoTimeStr << " Warning: prevent to process erroneous refSat again!";
           return failure;
         }
@@ -219,17 +230,24 @@
   }
 
-  unsigned usedLCs = LCs.size(); //qDebug() << "usedLCs: " << usedLCs;
+  unsigned usedLCs = LCs.size();
   if (OPT->_pseudoObsIono && !pseudoObsIonoAvailable) {
     usedLCs -= 1;  // GIM not used
   }
+
   ColumnVector               xSav       = _xFlt;
   SymmetricMatrix            QSav       = _QFlt;
   string                     epoTimeStr = string(_epoTime);
   const vector<t_pppParam*>& params     = _parlist->params();
-  unsigned                   maxObs     = obsVector.size() * usedLCs;
-  //unsigned                   maxObs     = 2 * usedLCs;
-
+  int modify = 0;
+  if (OPT->_pseudoObsTropo) {
+    modify  = -1;
+  }
+  // max Obs
+  unsigned maxObs = obsVector.size() * (usedLCs + modify);
   if (OPT->_pseudoObsIono && pseudoObsIonoAvailable) { // stecDiff w.r.t refSat
     maxObs -= 1;
+  }
+  if (OPT->_pseudoObsTropo) {
+    maxObs +=1;   // tropo pseudo obs once per station
   }
 
@@ -257,5 +275,6 @@
         for (unsigned jj = 0; jj < usedLCs; jj++) {
           const t_lc::type tLC = LCs[jj];
-          if (tLC == t_lc::GIM &&  obs->isReference()) {continue;}
+          if (tLC == t_lc::GIM && obs->isReference()) {continue;}
+          if (tLC == t_lc::Tz0 && ii+1 != obsVector.size()) {continue;}
           ++iObs;
           usedObs.push_back(obs);
@@ -417,5 +436,4 @@
           _slips[obs->prn()]._obsSlipCounter = obs->slipCounter();
         }
-
         if (_slips[obs->prn()]._biasJumpCounter != -1 &&
             _slips[obs->prn()]._biasJumpCounter != obs->biasJumpCounter()) {
@@ -468,5 +486,5 @@
 t_irc t_pppFilter::resetAmb(t_prn prn, const vector<t_pppSatObs*>& obsVector,
                             SymmetricMatrix* QSav, ColumnVector* xSav) {
-
+                            
   t_irc irc = failure;
   vector<t_pppParam*>& params = _parlist->params();
@@ -587,5 +605,4 @@
 ////////////////////////////////////////////////////////////////////////////
 void t_pppFilter::datumTransformation(const ColumnVector& xFltOld, const SymmetricMatrix& QFltOld) {
-
   Matrix D21 = _datumTrafo->computeTrafoMatrix();
   _QFlt << D21 * QFltOld * D21.t();
Index: trunk/BNC/src/PPP/pppParlist.cpp
===================================================================
--- trunk/BNC/src/PPP/pppParlist.cpp	(revision 8956)
+++ trunk/BNC/src/PPP/pppParlist.cpp	(revision 8961)
@@ -141,20 +141,20 @@
   switch (_type) {
   case crdX:
-    if (tLC == t_lc::GIM) {return 0.0;}
+    if (tLC == t_lc::GIM || tLC == t_lc::Tz0) {return 0.0;}
     return (sta->xyzApr()[0] - obs->xc()[0]) / rhoV.NormFrobenius();
   case crdY:
-    if (tLC == t_lc::GIM) {return 0.0;}
+    if (tLC == t_lc::GIM || tLC == t_lc::Tz0) {return 0.0;}
     return (sta->xyzApr()[1] - obs->xc()[1]) / rhoV.NormFrobenius();
   case crdZ:
-    if (tLC == t_lc::GIM) {return 0.0;}
+    if (tLC == t_lc::GIM || tLC == t_lc::Tz0) {return 0.0;}
     return (sta->xyzApr()[2] - obs->xc()[2]) / rhoV.NormFrobenius();
   case clkR:
-    if (tLC == t_lc::GIM) {return 0.0;}
+    if (tLC == t_lc::GIM || tLC == t_lc::Tz0) {return 0.0;}
     return 1.0;
   case offGG:
-    if (tLC == t_lc::GIM) {return 0.0;}
+    if (tLC == t_lc::GIM || tLC == t_lc::Tz0) {return 0.0;}
     return (obs->prn().system() == 'R') ? 1.0 : 0.0;
   case amb:
-    if      (tLC == t_lc::GIM) {return 0.0;}
+    if      (tLC == t_lc::GIM || tLC == t_lc::Tz0) {return 0.0;}
     else if ((OPT->_obsModelType == OPT->IF)     ||
              (OPT->_obsModelType == OPT->PPPRTK) ||
@@ -181,8 +181,14 @@
     break;
   case trp:
-    if (tLC == t_lc::GIM) {return 0.0;}
-    return  1.0 / sin(obs->eleSat());
+    if      (tLC == t_lc::GIM) {
+      return 0.0;
+    }
+    else if (tLC == t_lc::Tz0) {
+      return 1.0;
+    }
+    else {
+      return 1.0 / sin(obs->eleSat());
+    }
   case ion:
-
     if (obs->prn() == _prn) {
       if      (tLC == t_lc::c1) {
@@ -203,10 +209,10 @@
     }
     if (tLC == t_lc::GIM && _prn == refPrn) {
-      return  1.0;
+      return 1.0;
     }
     break;
   case cBias1:
     if  (tLC == t_lc::c1) {
-      return  1.0;
+      return 1.0;
     }
     else {
@@ -216,5 +222,5 @@
   case cBias2:
      if (tLC == t_lc::c2) {
-      return  1.0;
+      return 1.0;
     }
     else {
@@ -224,5 +230,5 @@
   case pBias1:
     if  (tLC == t_lc::l1) {
-      return  1.0;
+      return 1.0;
     }
     else {
@@ -232,5 +238,5 @@
   case pBias2:
     if  (tLC == t_lc::l2) {
-      return  1.0;
+      return 1.0;
     }
     else {
Index: trunk/BNC/src/PPP/pppSatObs.cpp
===================================================================
--- trunk/BNC/src/PPP/pppSatObs.cpp	(revision 8956)
+++ trunk/BNC/src/PPP/pppSatObs.cpp	(revision 8961)
@@ -92,5 +92,5 @@
   for (unsigned ii = 0; ii < OPT->LCs(_prn.system()).size(); ii++) {
     t_lc::type tLC = OPT->LCs(_prn.system())[ii];
-    if (tLC == t_lc::GIM) {continue;}
+    if (tLC == t_lc::GIM || tLC == t_lc::Tz0) {continue;}
     if (!isValid(tLC)) {
       _valid = false;
@@ -190,4 +190,5 @@
     return;
   case t_lc::GIM:
+  case t_lc::Tz0:
   case t_lc::dummy:
   case t_lc::maxLc:
@@ -218,6 +219,10 @@
     }
     else {
-      return _stecRefSat - _stecSat;
-    }
+      return _stecRefSat;
+    }
+  }
+
+  if (tLC == t_lc::Tz0) {
+    return _model._tropo0;
   }
 
@@ -292,4 +297,8 @@
   if (tLC == t_lc::GIM) {
     retVal = OPT->_sigmaGIMdiff * OPT->_sigmaGIMdiff;
+  }
+
+  if (tLC == t_lc::Tz0) {
+    retVal = OPT->_sigmaTz0 * OPT->_sigmaTz0;
   }
 
@@ -407,5 +416,6 @@
   // Tropospheric Delay
   // ------------------
-  _model._tropo = t_tropo::delay_saast(rRec, _model._eleSat);
+  _model._tropo  = t_tropo::delay_saast(rRec, _model._eleSat);
+  _model._tropo0 = t_tropo::delay_saast(rRec, M_PI/2.0);
 
   // Code Biases
@@ -570,5 +580,8 @@
   }
   else if (tLC == t_lc::GIM) {
-    cmpValue = 0.0;
+    cmpValue =  _stecSat;
+  }
+  else if (tLC == t_lc::Tz0) {
+    cmpValue = _model._tropo0;
   }
   else {
@@ -633,2 +646,9 @@
   _stecRefSat = stecRefSat;
 }
+
+
+//
+////////////////////////////////////////////////////////////////////////////
+void  t_pppSatObs::setPseudoObsTropo() {qDebug() << "setPseudoObsTropo";
+  _tropo0 = _model._tropo0;
+}
Index: trunk/BNC/src/PPP/pppSatObs.h
===================================================================
--- trunk/BNC/src/PPP/pppSatObs.h	(revision 8956)
+++ trunk/BNC/src/PPP/pppSatObs.h	(revision 8961)
@@ -46,4 +46,5 @@
   double              getRes(t_lc::type tLC) const;
   void                setPseudoObsIono(t_frequency::type freq, double stecRefSat);
+  void                setPseudoObsTropo();
   double              getIonoCodeDelay(t_frequency::type freq) {return _model._ionoCodeDelay[freq];}
 
@@ -94,4 +95,5 @@
       _antEcc    = 0.0;
       _tropo     = 0.0;
+      _tropo0    = 0.0;
       _tideEarth = 0.0;
       _tideOcean = 0.0;
@@ -114,4 +116,5 @@
     double _antEcc;
     double _tropo;
+    double _tropo0;
     double _tideEarth;
     double _tideOcean;
@@ -142,4 +145,5 @@
   double                       _stecRefSat;
   double                       _stecSat;
+  double                       _tropo0;
 };
 
