Index: /issm/trunk-jpl/src/c/shared/io/Marshalling/Marshalling.h
===================================================================
--- /issm/trunk-jpl/src/c/shared/io/Marshalling/Marshalling.h	(revision 25509)
+++ /issm/trunk-jpl/src/c/shared/io/Marshalling/Marshalling.h	(revision 25510)
@@ -19,4 +19,5 @@
 	AD_COUNTDOUBLES,
 	AD_REGISTERINPUT,
+	AD_REGISTEROUTPUT,
 	AD_SETADJOINT,
 #endif
@@ -143,8 +144,12 @@
 		int   double_count;
 		int*  identifiers;
-		auto* tape_codi;
-
-	public:
-		RegisterInputFunctor(auto* tape_in,int* identifiers_in) : MarshallHandle(AD_REGISTERINPUT),double_count(0),identifiers(identifiers_in),tape_codi(tape_in)){}
+		IssmDouble::TapeType* tape_codi;
+
+	public:
+		RegisterInputFunctor(int* identifiers_in) : MarshallHandle(AD_REGISTERINPUT){
+			this->double_count = 0;
+			this->identifiers  = identifiers_in;
+			this->tape_codi    = &(IssmDouble::getGlobalTape());
+		}
 		int DoubleCount(void){return this->double_count;};
 		void Echo(void){
@@ -173,4 +178,39 @@
 		}
 }; /*}}}*/
+class RegisterOutputFunctor:  public MarshallHandle{ /*{{{*/
+
+	private:
+		int   double_count;
+		IssmDouble::TapeType* tape_codi;
+
+	public:
+		RegisterOutputFunctor(void) : MarshallHandle(AD_REGISTERINPUT){
+			this->double_count = 0;
+			this->tape_codi    = &(IssmDouble::getGlobalTape());
+		}
+		int DoubleCount(void){return this->double_count;};
+		void Echo(void){
+			printf("RegisterOutputFunctor Echo:\n");
+			printf("   double_count: %i\n",double_count);
+		}
+		template<typename T> void call(T & value){
+			/*General case: do nothing*/
+		}
+		template<typename T> void call(T* & value,int size){
+			/*General case: do nothing*/
+		}
+		void call(IssmDouble value){
+			this->tape_codi->registerOutput(value);
+			this->double_count++;
+		}
+		void call(IssmDouble* value,int size){
+			if(value){
+				for(int i=0;i<size;i++){
+					this->tape_codi->registerOutput(value[i]);
+					this->double_count++;
+				}
+			}
+		}
+}; /*}}}*/
 #endif
 
@@ -183,4 +223,5 @@
 		case AD_COUNTDOUBLES:  {CountDoublesFunctor*    temp = xDynamicCast<CountDoublesFunctor*>(this);    temp->call(value); break;}
 		case AD_REGISTERINPUT: {RegisterInputFunctor*   temp = xDynamicCast<RegisterInputFunctor*>(this);   temp->call(value); break;}
+		case AD_REGISTEROUTPUT:{RegisterOutputFunctor*  temp = xDynamicCast<RegisterOutputFunctor*>(this);  temp->call(value); break;}
 		//case AD_SETADJOINT:    {SetAdjointFunction*     temp = xDynamicCast<SetAdjointFunction*>(this);     temp->call(value); break;}
 #endif
@@ -196,4 +237,5 @@
 		case AD_COUNTDOUBLES:  {CountDoublesFunctor*    temp = xDynamicCast<CountDoublesFunctor*>(this);    temp->call(value,size); break;}
 		case AD_REGISTERINPUT: {RegisterInputFunctor*   temp = xDynamicCast<RegisterInputFunctor*>(this);   temp->call(value,size); break;}
+		case AD_REGISTEROUTPUT:{RegisterOutputFunctor*  temp = xDynamicCast<RegisterOutputFunctor*>(this);  temp->call(value,size); break;}
 		//case AD_SETADJOINT:    {SetAdjointFunction*     temp = xDynamicCast<SetAdjointFunction*>(this);     temp->call(value,size); break;}
 #endif
