Index: /issm/trunk-jpl/src/c/analyses/transient_core.cpp
===================================================================
--- /issm/trunk-jpl/src/c/analyses/transient_core.cpp	(revision 15897)
+++ /issm/trunk-jpl/src/c/analyses/transient_core.cpp	(revision 15898)
@@ -140,4 +140,9 @@
 			_error_("ISSM was not compiled with grounding line migration capabilities. Exiting");
 			#endif
+			if(save_results){
+				InputToResultx(femmodel,SurfaceEnum);
+				InputToResultx(femmodel,BedEnum);
+				InputToResultx(femmodel,MaskElementonfloatingiceEnum);
+			}
 		}
 		if(isgia){
@@ -155,5 +160,4 @@
 			if(VerboseSolution()) _printf0_("   saving transient results\n");
 			InputToResultx(femmodel,SurfaceforcingsMassBalanceEnum);
-			InputToResultx(femmodel,MaskElementonfloatingiceEnum);
 			femmodel->RequestedOutputsx(requested_outputs,numoutputs);
 			if(isdelta18o){
Index: /issm/trunk-jpl/src/c/classes/Elements/Penta.cpp
===================================================================
--- /issm/trunk-jpl/src/c/classes/Elements/Penta.cpp	(revision 15897)
+++ /issm/trunk-jpl/src/c/classes/Elements/Penta.cpp	(revision 15898)
@@ -2107,8 +2107,8 @@
 	/*If we don't find it, no big deal, just don't do the transfer. Otherwise, build a new Result 
 	 * object out of the input, with the additional step and time information: */
-	this->results->AddObject((Object*)input->SpawnResult(step,time));
+	this->results->AddResult(input->SpawnResult(step,time));
 	#ifdef _HAVE_CONTROL_
 	if(input->ObjectEnum()==ControlInputEnum){
-		if(((ControlInput*)input)->gradient!=NULL) this->results->AddObject((Object*)((ControlInput*)input)->SpawnGradient(step,time));
+		if(((ControlInput*)input)->gradient!=NULL) this->results->AddResult(((ControlInput*)input)->SpawnGradient(step,time));
 	}
 	#endif
Index: /issm/trunk-jpl/src/c/classes/Elements/Tria.cpp
===================================================================
--- /issm/trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 15897)
+++ /issm/trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 15898)
@@ -1429,9 +1429,9 @@
 	/*If we don't find it, no big deal, just don't do the transfer. Otherwise, build a new Result 
 	 * object out of the input, with the additional step and time information: */
-	this->results->AddObject((Object*)input->SpawnResult(step,time));
+	this->results->AddResult(input->SpawnResult(step,time));
 
 	#ifdef _HAVE_CONTROL_
 	if(input->ObjectEnum()==ControlInputEnum){
-		if(((ControlInput*)input)->gradient!=NULL) this->results->AddObject((Object*)((ControlInput*)input)->SpawnGradient(step,time));
+		if(((ControlInput*)input)->gradient!=NULL) this->results->AddResult(((ControlInput*)input)->SpawnGradient(step,time));
 	}
 	#endif
Index: /issm/trunk-jpl/src/c/classes/ExternalResults/Results.cpp
===================================================================
--- /issm/trunk-jpl/src/c/classes/ExternalResults/Results.cpp	(revision 15897)
+++ /issm/trunk-jpl/src/c/classes/ExternalResults/Results.cpp	(revision 15898)
@@ -54,2 +54,30 @@
 }
 /*}}}*/
+/*FUNCTION Results::Write{{{*/
+int Results::AddResult(ElementResult* in_result){
+
+	/*First, go through dataset of inputs and check whether any input 
+	 * with the same name is already in. If so, erase the corresponding 
+	 * object before adding this new one: */
+	vector<Object*>::iterator object;
+	ElementResult* result=NULL;
+
+	/*In debugging mode, check that the input is not a NULL pointer*/
+	_assert_(in_result);
+
+	for(object=objects.begin() ; object<objects.end(); object++){
+
+		result=dynamic_cast<ElementResult*>(*object);
+
+		if(result->InstanceEnum()==in_result->InstanceEnum()){
+			if(result->GetStep()==in_result->GetStep()){
+				this->DeleteObject(result);
+				break;
+			}
+		}
+	}
+	this->AddObject(in_result);
+
+	return 1;
+}
+/*}}}*/
Index: /issm/trunk-jpl/src/c/classes/ExternalResults/Results.h
===================================================================
--- /issm/trunk-jpl/src/c/classes/ExternalResults/Results.h	(revision 15897)
+++ /issm/trunk-jpl/src/c/classes/ExternalResults/Results.h	(revision 15898)
@@ -6,4 +6,5 @@
 /*forward declarations */
 class Parameters;
+class ElementResult;
 
 /*!\brief Declaration of Results class.
@@ -19,5 +20,6 @@
 		~Results();
 
-		/*numerics*/
+		/*Mehthos*/
+		int AddResult(ElementResult* result);
 		void Write(Parameters* parameters);
 };
