Index: /issm/trunk-jpl/src/c/datastructures/DataSet.cpp
===================================================================
--- /issm/trunk-jpl/src/c/datastructures/DataSet.cpp	(revision 25527)
+++ /issm/trunk-jpl/src/c/datastructures/DataSet.cpp	(revision 25528)
@@ -94,13 +94,15 @@
 
 	vector<Object*>::iterator obj;
-	int obj_size=0;
 	int obj_enum=0;
 	int i;
 
-	if(marshallhandle->OperationNumber()==MARSHALLING_WRITE || marshallhandle->OperationNumber()==MARSHALLING_SIZE){
+	int obj_size=0;
+	if(marshallhandle->OperationNumber()!=MARSHALLING_LOAD){
 		obj_size=objects.size();
 	}
 	else{
-		clear();
+		/*FIXME: if the assert below does not go off, then remove else{}*/
+		_assert_(this->Size()==0);
+		//clear();
 	}
 
@@ -114,5 +116,5 @@
 
 	/*Now branch according to direction of marshalling: */
-	if(marshallhandle->OperationNumber()==MARSHALLING_WRITE || marshallhandle->OperationNumber()==MARSHALLING_SIZE){
+	if(marshallhandle->OperationNumber()!=MARSHALLING_LOAD){
 		if(!(this->sorted && numsorted>0 && this->id_offsets)){
 			this->sorted_ids=NULL;
@@ -152,90 +154,75 @@
 			 *stored in the buffer: */
 			if(obj_enum==NodeEnum){
-				Node* node=NULL;
-				node=new Node();
+				Node* node=new Node();
 				node->Marshall(marshallhandle);
 				this->AddObject(node);
 			}
 			else if(obj_enum==VertexEnum){
-				Vertex* vertex=NULL;
-				vertex=new Vertex();
+				Vertex* vertex=new Vertex();
 				vertex->Marshall(marshallhandle);
 				this->AddObject(vertex);
 			}
 			else if(obj_enum==MaticeEnum){
-				Matice* matice=NULL;
-				matice=new Matice();
+				Matice* matice=new Matice();
 				matice->Marshall(marshallhandle);
 				this->AddObject(matice);
 			}
 			else if(obj_enum==MatestarEnum){
-				Matestar* matestar=NULL;
-				matestar=new Matestar();
+				Matestar* matestar=new Matestar();
 				matestar->Marshall(marshallhandle);
 				this->AddObject(matestar);
 			}
 			else if(obj_enum==SpcStaticEnum){
-				SpcStatic* spcstatic=NULL;
-				spcstatic=new SpcStatic();
+				SpcStatic* spcstatic=new SpcStatic();
 				spcstatic->Marshall(marshallhandle);
 				this->AddObject(spcstatic);
 			}
 			else if(obj_enum==SpcDynamicEnum){
-				SpcDynamic* spcdynamic=NULL;
-				spcdynamic=new SpcDynamic();
+				SpcDynamic* spcdynamic=new SpcDynamic();
 				spcdynamic->Marshall(marshallhandle);
 				this->AddObject(spcdynamic);
 			}
 			else if(obj_enum==SpcTransientEnum){
-				SpcTransient* spctransient=NULL;
-				spctransient=new SpcTransient();
+				SpcTransient* spctransient=new SpcTransient();
 				spctransient->Marshall(marshallhandle);
 				this->AddObject(spctransient);
 			}
 			else if(obj_enum==TriaEnum){
-				Tria* tria=NULL;
-				tria=new Tria();
+				Tria* tria=new Tria();
 				tria->Marshall(marshallhandle);
 				this->AddObject(tria);
 			}
 			else if(obj_enum==PentaEnum){
-				Penta* penta=NULL;
-				penta=new Penta();
+				Penta* penta=new Penta();
 				penta->Marshall(marshallhandle);
 				this->AddObject(penta);
 			}
 			else if(obj_enum==TetraEnum){
-				Tetra* tetra=NULL;
-				tetra=new Tetra();
+				Tetra* tetra=new Tetra();
 				tetra->Marshall(marshallhandle);
 				this->AddObject(tetra);
 			}
 			else if(obj_enum==SegEnum){
-				Seg* seg=NULL;
-				seg=new Seg();
+				Seg* seg=new Seg();
 				seg->Marshall(marshallhandle);
 				this->AddObject(seg);
 			}
 			else if(obj_enum==RiftfrontEnum){
-				Riftfront* rift=NULL;
-				rift=new Riftfront();
+				Riftfront* rift=new Riftfront();
 				rift->Marshall(marshallhandle);
 				this->AddObject(rift);
 			}
 			else if(obj_enum==NumericalfluxEnum){
-				Numericalflux* numflux=NULL;
-				numflux=new Numericalflux();
+				Numericalflux* numflux=new Numericalflux();
 				numflux->Marshall(marshallhandle);
 				this->AddObject(numflux);
 			}
 			else if(obj_enum==PengridEnum){
-				Pengrid* pengrid=NULL;
-				pengrid=new Pengrid();
+				Pengrid* pengrid=new Pengrid();
 				pengrid->Marshall(marshallhandle);
 				this->AddObject(pengrid);
 			}
 			else if(obj_enum==PenpairEnum){
-				Penpair* penpair=NULL;
-				penpair=new Penpair();
+				Penpair* penpair=new Penpair();
 				penpair->Marshall(marshallhandle);
 				this->AddObject(penpair);
@@ -245,4 +232,12 @@
 				result->Marshall(marshallhandle);
 				this->AddObject(result);
+			}
+			else if(obj_enum==DependentObjectEnum){
+				DependentObject* dep=new DependentObject();
+				dep->Marshall(marshallhandle);
+				this->AddObject(dep);
+			}
+			else if(obj_enum==GenericExternalResultEnum){
+				_printf_("   WARNING: Could not load GenericExternalResult, need overload\n");
 			}
 			else _error_("could not recognize enum type: " << obj_enum << ": " << EnumToStringx(obj_enum) ); 
