Index: /trunk/BNS/bnseph.cpp
===================================================================
--- /trunk/BNS/bnseph.cpp	(revision 1897)
+++ /trunk/BNS/bnseph.cpp	(revision 1898)
@@ -697,13 +697,18 @@
 ////////////////////////////////////////////////////////////////////////////
 int t_ephGlo::IOD() const {
-  ////  return int(fmod(_GPSweeks,86400.0)) / 600;
-
-  //// unsigned int tb  = int(fmod(_GPSweeks,86400.0)) * 1000; // msec of day
-  unsigned int tb  = int(fmod(_GPSweeks,86400.0)); //sec of day
-
-  // 5 LSBs of iod are equal to 5 LSBs of tb, remaining bits are zero
-  // ----------------------------------------------------------------
-  const int shift = sizeof(tb) * 8 - 5;
-  unsigned int iod = tb << shift;
-  return (iod >> shift);
-}
+
+  bool old = true;
+
+  if (old) { // 5 LSBs of iod are equal to 5 LSBs of tb
+    unsigned int tb  = int(fmod(_GPSweeks,86400.0)); //sec of day
+    const int shift = sizeof(tb) * 8 - 5;
+    unsigned int iod = tb << shift;
+    return (iod >> shift);
+  }
+  else     {  // 7 LSBs of iod are equal to 7 LSBs of tk
+    unsigned tk = int(_tki);
+    const int shift = sizeof(tk) * 8 - 7;
+    unsigned int iod = tk << shift;
+    return (iod >> shift);
+  }
+}
