Index: /trunk/BNC/src/PPP_SSR_I/pppClient.cpp
===================================================================
--- /trunk/BNC/src/PPP_SSR_I/pppClient.cpp	(revision 8541)
+++ /trunk/BNC/src/PPP_SSR_I/pppClient.cpp	(revision 8542)
@@ -408,5 +408,5 @@
     bncTime ToT = satData->tt - prange / t_CST::c - clkSat;
 
-    ColumnVector xc(7);
+    ColumnVector xc(6);
     ColumnVector vv(3);
     if (getSatPos(ToT, satData->prn, xc, vv) != success) {
Index: /trunk/BNC/src/RTCM/rtcm_utils.cpp
===================================================================
--- /trunk/BNC/src/RTCM/rtcm_utils.cpp	(revision 8541)
+++ /trunk/BNC/src/RTCM/rtcm_utils.cpp	(revision 8542)
@@ -35,5 +35,5 @@
   // --------------
   rho = 0.0;
-  ColumnVector xc(7);
+  ColumnVector xc(6);
   ColumnVector vv(3);
   eph->getCrd(bncTime(GPSWeek, GPSWeeks), xc, vv, false);
Index: /trunk/BNC/src/bncephuser.cpp
===================================================================
--- /trunk/BNC/src/bncephuser.cpp	(revision 8541)
+++ /trunk/BNC/src/bncephuser.cpp	(revision 8542)
@@ -188,5 +188,5 @@
   // Simple Check - check satellite radial distance
   // ----------------------------------------------
-  ColumnVector xc(7);
+  ColumnVector xc(6);
   ColumnVector vv(3);
   if (eph->getCrd(eph->TOC(), xc, vv, false) != success) {
Index: /trunk/BNC/src/combination/bnccomb.cpp
===================================================================
--- /trunk/BNC/src/combination/bnccomb.cpp	(revision 8541)
+++ /trunk/BNC/src/combination/bnccomb.cpp	(revision 8542)
@@ -449,9 +449,9 @@
   }
 
-  ColumnVector oldXC(7);
+  ColumnVector oldXC(6);
   ColumnVector oldVV(3);
   corr->_eph->getCrd(corr->_time, oldXC, oldVV, false);
 
-  ColumnVector newXC(7);
+  ColumnVector newXC(6);
   ColumnVector newVV(3);
   lastEph->getCrd(corr->_time, newXC, newVV, false);
@@ -688,5 +688,5 @@
     const t_eph* eph = corr->_eph;
     if (eph) {
-      ColumnVector xc(7);
+      ColumnVector xc(6);
       ColumnVector vv(3);
       eph->getCrd(_resTime, xc, vv, false);
@@ -740,5 +740,5 @@
     clkCorrections.push_back(clkCorr);
 
-    ColumnVector xc(7);
+    ColumnVector xc(6);
     ColumnVector vv(3);
     corr->_eph->setClkCorr(dynamic_cast<const t_clkCorr*>(&clkCorr));
Index: /trunk/BNC/src/ephemeris.cpp
===================================================================
--- /trunk/BNC/src/ephemeris.cpp	(revision 8541)
+++ /trunk/BNC/src/ephemeris.cpp	(revision 8542)
@@ -65,5 +65,5 @@
                                                  << 900 << 1800 << 3600 << 7200
                                                  << 10800;
-  xc.ReSize(7);
+  xc.ReSize(6);
   vv.ReSize(3);
   if (position(tt.gpsw(), tt.gpssec(), xc.data(), vv.data()) != success) {
@@ -320,5 +320,5 @@
   static const double gmGRS      = 398.6005e12;
 
-  memset(xc, 0, 7*sizeof(double));
+  memset(xc, 0, 6*sizeof(double));
   memset(vv, 0, 3*sizeof(double));
 
@@ -368,8 +368,4 @@
   double tc = tt - _TOC;
   xc[3] = _clock_bias + _clock_drift*tc + _clock_driftrate*tc*tc;
-
-  xc[4] = _clock_bias;
-  xc[5] = _clock_drift;
-  xc[6] = _clock_driftrate;
 
   // Velocity
@@ -402,4 +398,7 @@
   xc[3] -= 2.0 * (xc[0]*vv[0] + xc[1]*vv[1] + xc[2]*vv[2]) / t_CST::c / t_CST::c;
 
+  xc[4] = _clock_drift + _clock_driftrate*tc;
+  xc[5] = _clock_driftrate;
+  
   return success;
 }
@@ -618,5 +617,5 @@
   static const double nominalStep = 10.0;
 
-  memset(xc, 0, 7*sizeof(double));
+  memset(xc, 0, 6*sizeof(double));
   memset(vv, 0, 3*sizeof(double));
 
@@ -655,7 +654,6 @@
   xc[3] = -_tau + _gamma * dtClk;
 
-  xc[4] = -_tau;
-  xc[5] = _gamma;
-  xc[6] = 0.0;
+  xc[4] = _gamma;
+  xc[5] = 0.0;
 
   return success;
@@ -923,5 +921,5 @@
   static const double gmWGS = 398.6004418e12;
 
-  memset(xc, 0, 7*sizeof(double));
+  memset(xc, 0, 6*sizeof(double));
   memset(vv, 0, 3*sizeof(double));
 
@@ -971,8 +969,4 @@
   double tc = tt - _TOC;
   xc[3] = _clock_bias + _clock_drift*tc + _clock_driftrate*tc*tc;
-
-  xc[4] = _clock_bias;
-  xc[5] = _clock_drift;
-  xc[6] = _clock_driftrate;
 
   // Velocity
@@ -1007,4 +1001,7 @@
   //xc[3] -= 2.0 * (xc[0]*vv[0] + xc[1]*vv[1] + xc[2]*vv[2]) / t_CST::c / t_CST::c;
 
+  xc[4] = _clock_drift + _clock_driftrate*tc;
+  xc[5] = _clock_driftrate;
+  
   return success;
 }
@@ -1319,7 +1316,6 @@
   xc[3] = _agf0 + _agf1 * dt;
 
-  xc[4] = _agf0;
-  xc[5] = _agf1;
-  xc[6] = 0.0;
+  xc[4] = _agf1;
+  xc[5] = 0.0;
 
   return success;
@@ -1673,8 +1669,4 @@
   xc[3] = _clock_bias + _clock_drift*tc + _clock_driftrate*tc*tc;
 
-  xc[4] = _clock_bias;
-  xc[5] = _clock_drift;
-  xc[6] = _clock_driftrate;
-
   // dotC  = _clock_drift + _clock_driftrate*tc
   //       - 4.442807633e-10*_e*sqrt(a0)*cos(E) * dEdM * n;
@@ -1687,4 +1679,6 @@
   // xc[3] -= 2.0 * (xc[0]*vv[0] + xc[1]*vv[1] + xc[2]*vv[2]) / t_CST::c / t_CST::c;
 
+  xc[4] = _clock_drift + _clock_driftrate*tc;
+  xc[5] = _clock_driftrate;
   return success;
 }
Index: /trunk/BNC/src/rinex/reqcanalyze.cpp
===================================================================
--- /trunk/BNC/src/rinex/reqcanalyze.cpp	(revision 8541)
+++ /trunk/BNC/src/rinex/reqcanalyze.cpp	(revision 8542)
@@ -288,5 +288,5 @@
     }
     if (eph) {
-      ColumnVector xSat(7);
+      ColumnVector xSat(6);
       ColumnVector vv(3);
       if (eph->getCrd(_currEpo->tt, xSat, vv, false) == success) {
@@ -351,5 +351,5 @@
   }
   if (eph) {
-    ColumnVector xc(7);
+    ColumnVector xc(6);
     ColumnVector vv(3);
     if ( xyzSta.size() == 3 && (xyzSta[0] != 0.0 || xyzSta[1] != 0.0 || xyzSta[2] != 0.0) &&
@@ -1101,5 +1101,5 @@
       for (epoTime = startTime - interval; epoTime < endTime;
            epoTime = epoTime + interval) {
-        ColumnVector xc(7);
+        ColumnVector xc(6);
         ColumnVector vv(3);
         if ( xyzSta.size() == 3 && (xyzSta[0] != 0.0 || xyzSta[1] != 0.0 || xyzSta[2] != 0.0) &&
Index: /trunk/BNC/src/upload/bncrtnetuploadcaster.cpp
===================================================================
--- /trunk/BNC/src/upload/bncrtnetuploadcaster.cpp	(revision 8541)
+++ /trunk/BNC/src/upload/bncrtnetuploadcaster.cpp	(revision 8542)
@@ -507,9 +507,10 @@
         }
         else {
-          in >> numVal;
-          for (int ii = 0; ii < numVal; ii++) {
-            double dummy;
-            in >> dummy;
-          }
+          emit(newMessage("                      RTNET format error: "
+                          +  lines[ii].toLatin1(), false));
+          qDebug() << "bncRtnetUploadCaster: decode " + QByteArray(epoTime.datestr().c_str())
+                      + " " + QByteArray(epoTime.timestr().c_str()) + " "
+                      + _casterID.toLatin1();
+          qDebug() << "                      RTNET format error: " + lines[ii].toLatin1();
         }
       }
@@ -549,6 +550,9 @@
       if (sd) {
         QString outLine;
-        processSatellite(eph, epoTime.gpsw(), epoTime.gpssec(), prnStr, rtnAPC, rtnUra,
-            rtnClk, rtnVel, rtnCoM, rtnClkSig, sd, outLine);
+        t_irc irc = processSatellite(eph, epoTime.gpsw(), epoTime.gpssec(), prnStr, rtnAPC,
+                                     rtnUra, rtnClk, rtnVel, rtnCoM, rtnClkSig, sd, outLine);
+        if (irc != success) {
+          continue;
+        }
       }
 
@@ -2264,5 +2268,5 @@
 //
 ////////////////////////////////////////////////////////////////////////////
-void bncRtnetUploadCaster::processSatellite(const t_eph* eph, int GPSweek,
+t_irc bncRtnetUploadCaster::processSatellite(const t_eph* eph, int GPSweek,
     double GPSweeks, const QString& prn, const ColumnVector& rtnAPC,
     double rtnUra, const ColumnVector& rtnClk, const ColumnVector& rtnVel,
@@ -2272,11 +2276,19 @@
   // Broadcast Position and Velocity
   // -------------------------------
-  ColumnVector xB(7);
+  ColumnVector xB(6);
   ColumnVector vB(3);
-  eph->getCrd(bncTime(GPSweek, GPSweeks), xB, vB, false);
+  t_irc irc = eph->getCrd(bncTime(GPSweek, GPSweeks), xB, vB, false);
+
+  if (irc != success) {
+    return irc;
+  }
 
   // Precise Position
   // ----------------
   ColumnVector xP = _CoM ? rtnCoM : rtnAPC;
+
+  if (xP.size() == 0) {
+    return failure;
+  }
 
   double dc = 0.0;
@@ -2301,13 +2313,6 @@
   // ----------------
   double dClkA0 = rtnClk(1) - (xB(4) - dc) * t_CST::c;
-  double dClkA1 = 0.0;
-  double dClkA2 = 0.0;
-  if (rtnClk(2)) {
-    dClkA0 = rtnClk(1) - (xB(5) - dc) * t_CST::c;
-    dClkA1 = rtnClk(2) -  xB(6) * t_CST::c;
-  }
-  if (rtnClk(3)) {
-    dClkA2 = rtnClk(3) - xB(7) * t_CST::c;
-  }
+  double dClkA1 = rtnClk(2) -  xB(5) * t_CST::c;
+  double dClkA2 = rtnClk(3) -  xB(6) * t_CST::c;
 
   if (sd) {
@@ -2363,4 +2368,5 @@
     _sp3->write(GPSweek, GPSweeks, prn, rtnCoM, clkRnx, rtnVel, clkRnxRate);
   }
+  return success;
 }
 
Index: /trunk/BNC/src/upload/bncrtnetuploadcaster.h
===================================================================
--- /trunk/BNC/src/upload/bncrtnetuploadcaster.h	(revision 8541)
+++ /trunk/BNC/src/upload/bncrtnetuploadcaster.h	(revision 8542)
@@ -30,5 +30,5 @@
   virtual ~bncRtnetUploadCaster();
  private:
-  void processSatellite(const t_eph* eph, int GPSweek,
+  t_irc processSatellite(const t_eph* eph, int GPSweek,
                         double GPSweeks, const QString& prn,
                         const ColumnVector& rtnAPC,
