Index: src/Parser/TremoloParser.cpp
===================================================================
--- src/Parser/TremoloParser.cpp	(revision 3aa204ebf392a1f230b813212c4c42ca080da2db)
+++ src/Parser/TremoloParser.cpp	(revision efc80ef549eeaa87e6de7ecddb9bbcf6b0387276)
@@ -143,18 +143,47 @@
   molecule *newmol = World::getInstance().createMolecule();
   newmol->ActiveFlag = true;
+  usedFields_t usedFields_temp;
+  size_t timestep = 0;
+  atom *addedatom = NULL;
+  std::vector<atom *> addedatoms;
+  std::vector<atom *>::iterator atomiter = addedatoms.begin();
   while (file->good()) {
     std::getline(*file, line, '\n');
     // we only parse in the first ATOMDATA line
-    if (usedFields_load.empty()) {
-      location = line.find("ATOMDATA", 0);
-      if (location != string::npos) {
-       parseAtomDataKeysLine(line, location + 8, usedFields_load);
+    location = line.find("ATOMDATA", 0);
+    if (location != string::npos) {
+      parseAtomDataKeysLine(line, location + 8, usedFields_temp);
+      if (usedFields_load.empty()) {
+        // first ATOMDATA: use this line
+        usedFields_load.insert(usedFields_load.end(), usedFields_temp.begin(), usedFields_temp.end());
+        usedFields_temp.clear();
+        LOG(3, "DEBUG: Local usedFields is: " << usedFields_load);
+      } else {
+        // following ATOMDATA: check against present
+        LOG(3, "DEBUG: Parsed check usedFields is: " << usedFields_temp);
+        if (usedFields_load != usedFields_temp) {
+          ELOG(1, "File contains multiple time steps with differing ATOMDATA line, parsing only first time step.");
+          break;
+        } else {
+          // update time step
+          ++timestep;
+          atomiter = addedatoms.begin();
+        }
+      }
+    } else {
+      if (line.length() > 0 && line.at(0) != '#') {
+        if (timestep != 0) {
+          ASSERT( atomiter != addedatoms.end(),
+              "FormatParser< tremolo >::load() - timesteps contains more atoms than first one.");
+          addedatom = *atomiter++;
+        }
+        readAtomDataLine(line, newmol, timestep, addedatom);
+        if (timestep == 0)
+          addedatoms.push_back(addedatom);
       }
     }
-    if (line.length() > 0 && line.at(0) != '#') {
-      readAtomDataLine(line, newmol);
-    }
-  }
-  LOG(3, "DEBUG: Local usedFields is: " << usedFields_load);
+  }
+  ASSERT( addedatoms.size() == newmol->size(),
+      "FormatParser< tremolo >::load() - number of atoms in mol and addedatoms differ.");
 
   // refresh atom::nr and atom::name
@@ -692,10 +721,25 @@
  * \param line to parse as an atom
  * \param *newmol molecule to add atom to
- */
-void FormatParser< tremolo >::readAtomDataLine(const std::string &line, molecule *newmol) {
+ * \param _timestep time step to parse to
+ * \param _addedatom ref to added atom
+ */
+void FormatParser< tremolo >::readAtomDataLine(
+    const std::string &line,
+    molecule *newmol,
+    const size_t _timestep,
+    atom *&_addedatoms)
+{
   std::stringstream lineStream;
-  atom* newAtom = World::getInstance().createAtom();
-  const atomId_t atomid = newAtom->getId();
-  additionalAtomData[atomid] = TremoloAtomInfoContainer(); // fill with default values
+  atom* newAtom = NULL;
+  atomId_t atomid = -1;
+  if (_timestep == 0) {
+    newAtom = World::getInstance().createAtom();
+    _addedatoms = newAtom;
+    atomid = newAtom->getId();
+    additionalAtomData[atomid] = TremoloAtomInfoContainer(); // fill with default values
+  } else {
+    newAtom = _addedatoms;
+    atomid = newAtom->getId();
+  }
   TremoloAtomInfoContainer *atomInfo = &additionalAtomData[atomid];
   TremoloKey::atomDataKey currentField;
@@ -727,6 +771,6 @@
         for (int i=0;i<NDIM;i++) {
           ASSERT(tok_iter != tokens.end(), "FormatParser< tremolo >::readAtomDataLine() - no value for x["+toString(i)+"]!");
-          LOG(4, "INFO: Parsing key " << keyName << " with next token " << word);
-          newAtom->set(i, toDouble(word));
+          LOG(4, "INFO: Parsing key " << keyName << " with next token " << word << " on step " << _timestep);
+          newAtom->setAtStep(i, _timestep, toDouble(word));
           tok_iter++;
         }
@@ -736,9 +780,9 @@
         for (int i=0;i<NDIM;i++) {
           ASSERT(tok_iter != tokens.end(), "FormatParser< tremolo >::readAtomDataLine() - no value for u["+toString(i)+"]!");
-          LOG(4, "INFO: Parsing key " << keyName << " with next token " << word);
+          LOG(4, "INFO: Parsing key " << keyName << " with next token " << word << " on step " << _timestep);
           tempVector[i] = toDouble(word);
           tok_iter++;
         }
-        newAtom->setAtomicVelocity(tempVector);
+        newAtom->setAtomicVelocityAtStep(_timestep, tempVector);
         break;
       case TremoloKey::F :
@@ -746,14 +790,14 @@
         for (int i=0;i<NDIM;i++) {
           ASSERT(tok_iter != tokens.end(), "FormatParser< tremolo >::readAtomDataLine() - no value for F["+toString(i)+"]!");
-          LOG(4, "INFO: Parsing key " << keyName << " with next token " << word);
+          LOG(4, "INFO: Parsing key " << keyName << " with next token " << word << " on step " << _timestep);
           tempVector[i] = toDouble(word);
           tok_iter++;
         }
-        newAtom->setAtomicForce(tempVector);
+        newAtom->setAtomicForceAtStep(_timestep, tempVector);
         break;
       case TremoloKey::type :
       {
         ASSERT(tok_iter != tokens.end(), "FormatParser< tremolo >::readAtomDataLine() - no value for "+keyName+"!");
-        LOG(4, "INFO: Parsing key " << keyName << " with next token " << word);
+        LOG(4, "INFO: Parsing key " << keyName << " with next token " << word << " on step " << _timestep);
         std::string elementname;
         const element * elem = NULL;
@@ -787,29 +831,47 @@
       case TremoloKey::Id :
         ASSERT(tok_iter != tokens.end(), "FormatParser< tremolo >::readAtomDataLine() - no value for "+keyName+"!");
-        LOG(4, "INFO: Parsing key " << keyName << " with next token " << word);
-        associateLocaltoGlobalId(toInt(word), atomid);
+        LOG(4, "INFO: Parsing key " << keyName << " with next token " << word << " on step " << _timestep);
+        if (_timestep == 0) {
+          associateLocaltoGlobalId(toInt(word), atomid);
+        } else {
+          // check association is the same
+          ASSERT( (atomId_t)getGlobalId(toInt(word)) == atomid,
+              "FormatParser< tremolo >::readAtomDataLine() - differing global id "+toString(atomid)
+              +" on timestep "+toString(_timestep));
+          ASSERT( getLocalId(atomid) == toInt(word),
+              "FormatParser< tremolo >::readAtomDataLine() - differing local id "+toString(toInt(word))
+              +" on timestep "+toString(_timestep));
+        }
         tok_iter++;
         break;
       case TremoloKey::neighbors :
         for (int i=0;i<atoi(it->substr(it->find("=") + 1, 1).c_str());i++) {
-          ASSERT(tok_iter != tokens.end(), "FormatParser< tremolo >::readAtomDataLine() - no value for "+keyName+"!");
-          LOG(4, "INFO: Parsing key " << keyName << " with next token " << word);
+          ASSERT(tok_iter != tokens.end(),
+              "FormatParser< tremolo >::readAtomDataLine() - no value for "+keyName+"!");
+          if (_timestep == 0)
+            LOG(4, "INFO: Parsing key " << keyName << " with next token " << word << " on step " << _timestep);
           lineStream << word << "\t";
           tok_iter++;
         }
-        readNeighbors(&lineStream,
-            atoi(it->substr(it->find("=") + 1, 1).c_str()), atomid);
+        if (_timestep == 0) {
+          readNeighbors(&lineStream,
+              atoi(it->substr(it->find("=") + 1, 1).c_str()), atomid);
+        }
         break;
       case TremoloKey::charge :
         ASSERT(tok_iter != tokens.end(), "FormatParser< tremolo >::readAtomDataLine() - no value for "+keyName+"!");
-        LOG(4, "INFO: Parsing key " << keyName << " with next token " << word);
-        atomInfo->set(currentField, word);
-        newAtom->setCharge(boost::lexical_cast<double>(word));
+        if (_timestep == 0) {
+          LOG(4, "INFO: Parsing key " << keyName << " with next token " << word << " on step " << _timestep);
+          atomInfo->set(currentField, word);
+          newAtom->setCharge(boost::lexical_cast<double>(word));
+        }
         tok_iter++;
         break;
       default :
         ASSERT(tok_iter != tokens.end(), "FormatParser< tremolo >::readAtomDataLine() - no value for "+keyName+"!");
-        LOG(4, "INFO: Parsing key " << keyName << " with next token " << word);
-        atomInfo->set(currentField, word);
+        if (_timestep == 0) {
+          LOG(4, "INFO: Parsing key " << keyName << " with next token " << word << " on step " << _timestep);
+          atomInfo->set(currentField, word);
+        }
         tok_iter++;
         break;
