Index: /issm/trunk-jpl/src/c/classes/Elements/Element.cpp
===================================================================
--- /issm/trunk-jpl/src/c/classes/Elements/Element.cpp	(revision 19214)
+++ /issm/trunk-jpl/src/c/classes/Elements/Element.cpp	(revision 19215)
@@ -1264,4 +1264,18 @@
 
 }/*}}}*/
+void       Element::Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction,int numanalyses){/*{{{*/
+	
+	_assert_(this);
+	if(marshall_direction==MARSHALLING_BACKWARD) inputs=new Inputs();
+
+	MARSHALLING_ENUM(ElementEnum);
+	
+	MARSHALLING(id);
+	MARSHALLING(sid);
+	MARSHALLING(element_type);
+	MARSHALLING_DYNAMIC(element_type_list,int,numanalyses);
+
+}
+/*}}}*/
 void       Element::MigrateGroundingLine(IssmDouble* phi_ungrounding){/*{{{*/
 
Index: /issm/trunk-jpl/src/c/classes/Elements/Element.h
===================================================================
--- /issm/trunk-jpl/src/c/classes/Elements/Element.h	(revision 19214)
+++ /issm/trunk-jpl/src/c/classes/Elements/Element.h	(revision 19215)
@@ -67,5 +67,4 @@
 		void               DeleteMaterials(void);
 		IssmDouble         Divergence(void);
-		void               Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ _error_("not implemented yet!");};
 		void               dViscositydBFS(IssmDouble* pdmudB,int dim,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input,Input* vz_input);
 		void               dViscositydBHO(IssmDouble* pdmudB,int dim,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input);
@@ -120,4 +119,6 @@
 		void               LinearFloatingiceMeltingRate(); 
 		void               MigrateGroundingLine(IssmDouble* sheet_ungrounding);
+		void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction,int numanalyses);
+
 		ElementMatrix*     NewElementMatrix(int approximation_enum=NoneApproximationEnum);
 		ElementMatrix*     NewElementMatrixCoupling(int number_nodes,int approximation_enum=NoneApproximationEnum);
Index: /issm/trunk-jpl/src/c/classes/Elements/ElementHook.cpp
===================================================================
--- /issm/trunk-jpl/src/c/classes/Elements/ElementHook.cpp	(revision 19214)
+++ /issm/trunk-jpl/src/c/classes/Elements/ElementHook.cpp	(revision 19215)
@@ -74,4 +74,54 @@
 }
 /*}}}*/
+void ElementHook::Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ /*{{{*/
+
+	int i;
+	bool* hnodes_null=NULL; /*intermediary needed*/
+	bool  hneighbors_null=true; /*don't deal with hneighbors, unless explicitely asked to*/
+
+	_assert_(this);
+
+	/*preliminary, before marshall starts: */
+	if(marshall_direction==MARSHALLING_FORWARD || marshall_direction==MARSHALLING_SIZE){
+		if(this->hneighbors)hneighbors_null=false;
+		hnodes_null=xNew<bool>(numanalyses);
+		for(i=0;i<numanalyses;i++){
+			if(this->hnodes[i])hnodes_null[i]=false;
+			else hnodes_null[i]=true;
+		}
+	}
+
+	/*ok, marshall operations: */
+	MARSHALLING_ENUM(ElementHookEnum);
+	MARSHALLING(numanalyses);
+	MARSHALLING(hneighbors_null);
+	MARSHALLING_DYNAMIC(hnodes_null,bool,numanalyses);
+
+	if(marshall_direction==MARSHALLING_BACKWARD){
+		
+		this->hnodes      = new Hook*[numanalyses];
+		this->hvertices   = new Hook();
+		this->hmaterial   = new Hook();
+		this->hmatpar     = new Hook();
+		if(!hneighbors_null)this->hneighbors  = new Hook();
+
+		/*Initialize hnodes: */
+		for(int i=0;i<this->numanalyses;i++){
+			if(!hnodes_null[i])this->hnodes[i]=new Hook();
+			else this->hnodes[i]=NULL;
+		}
+	}
+
+	for (i=0;i<numanalyses;i++) if(this->hnodes[i])this->hnodes[i]->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction);
+	this->hvertices->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction);
+	this->hmatpar->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction);
+	this->hmatpar->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction);
+	if(this->hneighbors)this->hneighbors->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction);
+
+	/*Free ressources: */
+	xDelete<bool>(hnodes_null);
+
+}
+/*}}}*/
 
 void ElementHook::InitHookNeighbors(int* element_ids){/*{{{*/
Index: /issm/trunk-jpl/src/c/classes/Elements/ElementHook.h
===================================================================
--- /issm/trunk-jpl/src/c/classes/Elements/ElementHook.h	(revision 19214)
+++ /issm/trunk-jpl/src/c/classes/Elements/ElementHook.h	(revision 19215)
@@ -23,4 +23,5 @@
 		ElementHook(int in_numanalyses,int material_id,int numvertices,IoModel* iomodel);
 		~ElementHook();
+		void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction);
 
 		void InitHookNeighbors(int* element_ids);               //3d only
Index: /issm/trunk-jpl/src/c/classes/Elements/Penta.h
===================================================================
--- /issm/trunk-jpl/src/c/classes/Elements/Penta.h	(revision 19214)
+++ /issm/trunk-jpl/src/c/classes/Elements/Penta.h	(revision 19215)
@@ -42,4 +42,5 @@
 		Object *copy();
 		int     ObjectEnum();
+		void    Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ _error_("not implemented yet!");};
 		/*}}}*/
 		/*Penta routines:{{{*/
Index: /issm/trunk-jpl/src/c/classes/Elements/Seg.h
===================================================================
--- /issm/trunk-jpl/src/c/classes/Elements/Seg.h	(revision 19214)
+++ /issm/trunk-jpl/src/c/classes/Elements/Seg.h	(revision 19215)
@@ -38,4 +38,5 @@
 		int     ObjectEnum();
 		Object *copy();
+		void    Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ _error_("not implemented yet!");};
 		/*}}}*/
 		/*Element virtual functions definitions: {{{*/
Index: /issm/trunk-jpl/src/c/classes/Elements/Tetra.h
===================================================================
--- /issm/trunk-jpl/src/c/classes/Elements/Tetra.h	(revision 19214)
+++ /issm/trunk-jpl/src/c/classes/Elements/Tetra.h	(revision 19215)
@@ -38,4 +38,5 @@
 		int     ObjectEnum();
 		Object *copy();
+		void    Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ _error_("not implemented yet!");};
 		/*}}}*/
 		/*Element virtual functions definitions: {{{*/
Index: /issm/trunk-jpl/src/c/classes/Elements/Tria.cpp
===================================================================
--- /issm/trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 19214)
+++ /issm/trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 19215)
@@ -115,4 +115,16 @@
 }
 /*}}}*/
+void Tria::Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ /*{{{*/
+	
+	MARSHALLING_ENUM(TriaEnum);
+	
+	/*Call parent classes: */
+	ElementHook::Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction);
+	Element::Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction,this->numanalyses);
+	TriaRef::Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction);
+
+}
+/*}}}*/
+
 
 /*Other*/
Index: /issm/trunk-jpl/src/c/classes/Elements/Tria.h
===================================================================
--- /issm/trunk-jpl/src/c/classes/Elements/Tria.h	(revision 19214)
+++ /issm/trunk-jpl/src/c/classes/Elements/Tria.h	(revision 19215)
@@ -40,4 +40,5 @@
 		int     ObjectEnum();
 		Object *copy();
+		void    Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction);
 		/*}}}*/
 		/*Update virtual functions resolution: {{{*/
Index: /issm/trunk-jpl/src/c/classes/Elements/TriaRef.h
===================================================================
--- /issm/trunk-jpl/src/c/classes/Elements/TriaRef.h	(revision 19214)
+++ /issm/trunk-jpl/src/c/classes/Elements/TriaRef.h	(revision 19215)
@@ -33,4 +33,6 @@
 		int  TensorInterpolation(int fe_stokes);
 		int  VelocityInterpolation(int fe_stokes);
+		void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ _error_("not implemented yet!"); };
+
 };
 #endif
Index: /issm/trunk-jpl/src/c/classes/FemModel.cpp
===================================================================
--- /issm/trunk-jpl/src/c/classes/FemModel.cpp	(revision 19214)
+++ /issm/trunk-jpl/src/c/classes/FemModel.cpp	(revision 19215)
@@ -619,5 +619,5 @@
 
 	/*Create buffer to hold marshalled femmodel: */
-	this->Marshall(NULL,&femmodel_size,MARSHALLING_FORWARD);
+	this->Marshall(NULL,&femmodel_size,MARSHALLING_SIZE);
 	femmodel_buffer=xNew<char>(femmodel_size);
 
@@ -648,5 +648,5 @@
 	MARSHALLING_DYNAMIC(analysis_type_list,int,analysis_counter);
 
-	if(marshall_direction==MARSHALLING_BACKWARDS){
+	if(marshall_direction==MARSHALLING_BACKWARD){
 		profiler=new Profiler;
 		elements=new Elements();
Index: /issm/trunk-jpl/src/c/classes/Hook.cpp
===================================================================
--- /issm/trunk-jpl/src/c/classes/Hook.cpp	(revision 19214)
+++ /issm/trunk-jpl/src/c/classes/Hook.cpp	(revision 19215)
@@ -118,4 +118,13 @@
 
 	return (Object*)output;
+}
+/*}}}*/
+void Hook::Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ /*{{{*/
+
+	MARSHALLING_ENUM(HookEnum);
+	MARSHALLING(num);
+	MARSHALLING_DYNAMIC(ids,int,num);
+	MARSHALLING_DYNAMIC(offsets,int,num);
+
 }
 /*}}}*/
Index: /issm/trunk-jpl/src/c/classes/Hook.h
===================================================================
--- /issm/trunk-jpl/src/c/classes/Hook.h	(revision 19214)
+++ /issm/trunk-jpl/src/c/classes/Hook.h	(revision 19215)
@@ -34,4 +34,5 @@
 		void       DeepEcho(void);
 		Object*    copy(void);
+		void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction);
 		/*}}}*/
 		/*Hook management: {{{*/
Index: /issm/trunk-jpl/src/c/classes/Params/DoubleParam.cpp
===================================================================
--- /issm/trunk-jpl/src/c/classes/Params/DoubleParam.cpp	(revision 19214)
+++ /issm/trunk-jpl/src/c/classes/Params/DoubleParam.cpp	(revision 19215)
@@ -52,4 +52,13 @@
 }
 /*}}}*/
+void DoubleParam::Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ /*{{{*/
+
+	MARSHALLING_ENUM(DoubleParamEnum);
+
+	MARSHALLING(enum_type);
+	MARSHALLING(value);
+
+}
+/*}}}*/
 
 /*DoubleParam virtual functions definitions: */
Index: /issm/trunk-jpl/src/c/classes/Params/DoubleParam.h
===================================================================
--- /issm/trunk-jpl/src/c/classes/Params/DoubleParam.h	(revision 19214)
+++ /issm/trunk-jpl/src/c/classes/Params/DoubleParam.h	(revision 19215)
@@ -37,5 +37,5 @@
 		int   ObjectEnum();
 		Object* copy();
-		void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ _error_("not implemented yet!"); };
+		void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction);
 		/*}}}*/
 		/*Param vritual function definitions: {{{*/
Index: /issm/trunk-jpl/src/c/classes/Params/IntParam.cpp
===================================================================
--- /issm/trunk-jpl/src/c/classes/Params/IntParam.cpp	(revision 19214)
+++ /issm/trunk-jpl/src/c/classes/Params/IntParam.cpp	(revision 19215)
@@ -55,2 +55,12 @@
 }
 /*}}}*/
+void IntParam::Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ /*{{{*/
+
+	MARSHALLING_ENUM(IntParamEnum);
+
+	MARSHALLING(enum_type);
+	MARSHALLING(value);
+
+}
+/*}}}*/
+
Index: /issm/trunk-jpl/src/c/classes/Params/IntParam.h
===================================================================
--- /issm/trunk-jpl/src/c/classes/Params/IntParam.h	(revision 19214)
+++ /issm/trunk-jpl/src/c/classes/Params/IntParam.h	(revision 19215)
@@ -37,5 +37,5 @@
 		int   ObjectEnum();
 		Object* copy();
-		void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ _error_("not implemented yet!"); };
+		void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction);
 		/*}}}*/
 		/*Param vritual function definitions: {{{*/
Index: /issm/trunk-jpl/src/c/classes/Profiler.cpp
===================================================================
--- /issm/trunk-jpl/src/c/classes/Profiler.cpp	(revision 19214)
+++ /issm/trunk-jpl/src/c/classes/Profiler.cpp	(revision 19215)
@@ -67,4 +67,21 @@
 
 	return ProfilerEnum;
+
+}
+/*}}}*/
+void Profiler::Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ /*{{{*/
+
+	MARSHALLING_ENUM(ProfilerEnum);
+
+	if(marshall_direction==MARSHALLING_BACKWARD){
+		this->time=new Parameters();
+		this->flops=new Parameters();
+		this->memory=new Parameters();
+	}
+	
+	time->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction);
+	flops->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction);
+	memory->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction);
+
 
 }
Index: /issm/trunk-jpl/src/c/classes/Profiler.h
===================================================================
--- /issm/trunk-jpl/src/c/classes/Profiler.h	(revision 19214)
+++ /issm/trunk-jpl/src/c/classes/Profiler.h	(revision 19215)
@@ -43,5 +43,5 @@
 		int     ObjectEnum();
 		Object *copy();
-		void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ _error_("not implemented yet!"); };
+		void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction);
 		/*}}}*/
 		/*Profiler routines {{{*/
Index: /issm/trunk-jpl/src/c/datastructures/DataSet.cpp
===================================================================
--- /issm/trunk-jpl/src/c/datastructures/DataSet.cpp	(revision 19214)
+++ /issm/trunk-jpl/src/c/datastructures/DataSet.cpp	(revision 19215)
@@ -93,5 +93,5 @@
 	int i;
 	
-	if(marshall_direction==MARSHALLING_FORWARD){
+	if(marshall_direction==MARSHALLING_FORWARD || marshall_direction==MARSHALLING_SIZE){
 		numsorted=objects.size();
 	}
@@ -106,5 +106,5 @@
 
 	/*Now branch according to direction of marshalling: */
-	if(marshall_direction==MARSHALLING_FORWARD){
+	if(marshall_direction==MARSHALLING_FORWARD || marshall_direction==MARSHALLING_SIZE){
 		/*Go through our objects, and marshall them into the buffer: */
 		for ( obj=this->objects.begin() ; obj < this->objects.end(); obj++ ){
@@ -140,4 +140,16 @@
 					this->AddObject(vertex);}
 					break;
+				case DoubleParamEnum:{
+					DoubleParam* doubleparam=NULL;
+					doubleparam=new DoubleParam();
+					doubleparam->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction);
+					this->AddObject(doubleparam);}
+					break;
+				case IntParamEnum:{
+					IntParam* intparam=NULL;
+					intparam=new IntParam();
+					intparam->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction);
+					this->AddObject(intparam);}
+					break;
 				default:
 					_error_("could not recognize enum type: " << EnumToStringx(enum_type));
Index: /issm/trunk-jpl/src/c/shared/Enum/EnumDefinitions.h
===================================================================
--- /issm/trunk-jpl/src/c/shared/Enum/EnumDefinitions.h	(revision 19214)
+++ /issm/trunk-jpl/src/c/shared/Enum/EnumDefinitions.h	(revision 19215)
@@ -484,4 +484,6 @@
 	DoubleVecParamEnum,
 	ElementEnum,
+	ElementHookEnum,
+	HookEnum,
 	ExternalResultEnum,
 	FileParamEnum,
Index: /issm/trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp
===================================================================
--- /issm/trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp	(revision 19214)
+++ /issm/trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp	(revision 19215)
@@ -479,4 +479,6 @@
 		case DoubleVecParamEnum : return "DoubleVecParam";
 		case ElementEnum : return "Element";
+		case ElementHookEnum : return "ElementHook";
+		case HookEnum : return "Hook";
 		case ExternalResultEnum : return "ExternalResult";
 		case FileParamEnum : return "FileParam";
Index: /issm/trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp
===================================================================
--- /issm/trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp	(revision 19214)
+++ /issm/trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp	(revision 19215)
@@ -488,4 +488,6 @@
 	      else if (strcmp(name,"DoubleVecParam")==0) return DoubleVecParamEnum;
 	      else if (strcmp(name,"Element")==0) return ElementEnum;
+	      else if (strcmp(name,"ElementHook")==0) return ElementHookEnum;
+	      else if (strcmp(name,"Hook")==0) return HookEnum;
 	      else if (strcmp(name,"ExternalResult")==0) return ExternalResultEnum;
 	      else if (strcmp(name,"FileParam")==0) return FileParamEnum;
@@ -504,10 +506,10 @@
 	      else if (strcmp(name,"Matpar")==0) return MatparEnum;
 	      else if (strcmp(name,"Node")==0) return NodeEnum;
-	      else if (strcmp(name,"Numericalflux")==0) return NumericalfluxEnum;
-	      else if (strcmp(name,"NumericalfluxType")==0) return NumericalfluxTypeEnum;
          else stage=5;
    }
    if(stage==5){
-	      if (strcmp(name,"Param")==0) return ParamEnum;
+	      if (strcmp(name,"Numericalflux")==0) return NumericalfluxEnum;
+	      else if (strcmp(name,"NumericalfluxType")==0) return NumericalfluxTypeEnum;
+	      else if (strcmp(name,"Param")==0) return ParamEnum;
 	      else if (strcmp(name,"Pengrid")==0) return PengridEnum;
 	      else if (strcmp(name,"Penpair")==0) return PenpairEnum;
@@ -627,10 +629,10 @@
 	      else if (strcmp(name,"StressTensorxz")==0) return StressTensorxzEnum;
 	      else if (strcmp(name,"StressTensoryy")==0) return StressTensoryyEnum;
-	      else if (strcmp(name,"StressTensoryz")==0) return StressTensoryzEnum;
-	      else if (strcmp(name,"StressTensorzz")==0) return StressTensorzzEnum;
          else stage=6;
    }
    if(stage==6){
-	      if (strcmp(name,"StressMaxPrincipal")==0) return StressMaxPrincipalEnum;
+	      if (strcmp(name,"StressTensoryz")==0) return StressTensoryzEnum;
+	      else if (strcmp(name,"StressTensorzz")==0) return StressTensorzzEnum;
+	      else if (strcmp(name,"StressMaxPrincipal")==0) return StressMaxPrincipalEnum;
 	      else if (strcmp(name,"DeviatoricStress")==0) return DeviatoricStressEnum;
 	      else if (strcmp(name,"DeviatoricStressxx")==0) return DeviatoricStressxxEnum;
@@ -750,10 +752,10 @@
 	      else if (strcmp(name,"Outputdefinition64")==0) return Outputdefinition64Enum;
 	      else if (strcmp(name,"Outputdefinition65")==0) return Outputdefinition65Enum;
-	      else if (strcmp(name,"Outputdefinition66")==0) return Outputdefinition66Enum;
-	      else if (strcmp(name,"Outputdefinition67")==0) return Outputdefinition67Enum;
          else stage=7;
    }
    if(stage==7){
-	      if (strcmp(name,"Outputdefinition68")==0) return Outputdefinition68Enum;
+	      if (strcmp(name,"Outputdefinition66")==0) return Outputdefinition66Enum;
+	      else if (strcmp(name,"Outputdefinition67")==0) return Outputdefinition67Enum;
+	      else if (strcmp(name,"Outputdefinition68")==0) return Outputdefinition68Enum;
 	      else if (strcmp(name,"Outputdefinition69")==0) return Outputdefinition69Enum;
 	      else if (strcmp(name,"Outputdefinition70")==0) return Outputdefinition70Enum;
@@ -873,10 +875,10 @@
 	      else if (strcmp(name,"Scaled")==0) return ScaledEnum;
 	      else if (strcmp(name,"Separate")==0) return SeparateEnum;
-	      else if (strcmp(name,"Sset")==0) return SsetEnum;
-	      else if (strcmp(name,"Verbose")==0) return VerboseEnum;
          else stage=8;
    }
    if(stage==8){
-	      if (strcmp(name,"TriangleInterp")==0) return TriangleInterpEnum;
+	      if (strcmp(name,"Sset")==0) return SsetEnum;
+	      else if (strcmp(name,"Verbose")==0) return VerboseEnum;
+	      else if (strcmp(name,"TriangleInterp")==0) return TriangleInterpEnum;
 	      else if (strcmp(name,"BilinearInterp")==0) return BilinearInterpEnum;
 	      else if (strcmp(name,"NearestInterp")==0) return NearestInterpEnum;
Index: /issm/trunk-jpl/src/c/shared/io/Marshalling/Marshalling.h
===================================================================
--- /issm/trunk-jpl/src/c/shared/io/Marshalling/Marshalling.h	(revision 19214)
+++ /issm/trunk-jpl/src/c/shared/io/Marshalling/Marshalling.h	(revision 19215)
@@ -8,59 +8,73 @@
 enum marshall_directions{
 	MARSHALLING_FORWARD,
-	MARSHALLING_BACKWARDS
+	MARSHALLING_BACKWARD,
+	MARSHALLING_SIZE
 };
 
-#define MARSHALLING_ENUM(EN) \
-	int enum_type=EN; \
+#define MARSHALLING_ENUM(EN)\
+	int enum_type=EN;\
 	if(marshall_direction==MARSHALLING_FORWARD){\
-		if(pmarshalled_data){\
-			memcpy(*pmarshalled_data,&enum_type,sizeof(int));\
-			*pmarshalled_data+=sizeof(int);\
-		}\
+		memcpy(*pmarshalled_data,&enum_type,sizeof(int));\
+		*pmarshalled_data+=sizeof(int);\
 		*pmarshalled_data_size+=sizeof(int);\
-	}
+	}\
+	else if(marshall_direction==MARSHALLING_SIZE){\
+		*pmarshalled_data_size+=sizeof(int);\
+	}\
+	else if(marshall_direction==MARSHALLING_BACKWARD){\
+	}\
+	else _error_("Wrong direction during the Marshall process");\
 
-#define MARSHALLING(FIELD) \
-\
+
+#define MARSHALLING(FIELD)\
+	\
 	if(marshall_direction==MARSHALLING_FORWARD){\
-		if(pmarshalled_data){\
-			memcpy(*pmarshalled_data,&FIELD,sizeof(FIELD));\
-			*pmarshalled_data+=sizeof(FIELD);\
-		}\
+		memcpy(*pmarshalled_data,&FIELD,sizeof(FIELD));\
+		*pmarshalled_data+=sizeof(FIELD);\
 		*pmarshalled_data_size+=sizeof(FIELD);\
 	}\
-	else{\
+	else if(marshall_direction==MARSHALLING_SIZE){\
+		*pmarshalled_data_size+=sizeof(FIELD);\
+	}\
+	else if(marshall_direction==MARSHALLING_BACKWARD){\
 		memcpy(&FIELD,*pmarshalled_data,sizeof(FIELD));\
 		*pmarshalled_data+=sizeof(FIELD);\
-	}
+	}\
+	else _error_("Wrong direction during the Marshall process");
+
 
 #define MARSHALLING_ARRAY(FIELD,TYPE,SIZE) \
-\
+	\
 	if(marshall_direction==MARSHALLING_FORWARD){\
-		if(pmarshalled_data){\
-			memcpy(*pmarshalled_data,FIELD,SIZE*sizeof(TYPE));\
-			*pmarshalled_data+=SIZE*sizeof(TYPE);\
-		}\
+		memcpy(*pmarshalled_data,FIELD,SIZE*sizeof(TYPE));\
+		*pmarshalled_data+=SIZE*sizeof(TYPE);\
 		*pmarshalled_data_size+=SIZE*sizeof(TYPE);\
 	}\
-	else{\
+	else if(marshall_direction==MARSHALLING_SIZE){\
+		*pmarshalled_data_size+=SIZE*sizeof(TYPE);\
+	}\
+	else if(marshall_direction==MARSHALLING_BACKWARD){\
 		memcpy(FIELD,*pmarshalled_data,SIZE*sizeof(TYPE));\
 		*pmarshalled_data+=SIZE*sizeof(TYPE);\
-	}
+	}\
+	else _error_("Wrong direction during the Marshall process");
+
 
 #define MARSHALLING_DYNAMIC(FIELD,TYPE,SIZE) \
-\
+	\
 	if(marshall_direction==MARSHALLING_FORWARD){\
-		if(pmarshalled_data){\
-			memcpy(*pmarshalled_data,FIELD,SIZE*sizeof(TYPE));\
-			*pmarshalled_data+=SIZE*sizeof(TYPE);\
-		}\
+		memcpy(*pmarshalled_data,FIELD,SIZE*sizeof(TYPE));\
+		*pmarshalled_data+=SIZE*sizeof(TYPE);\
 		*pmarshalled_data_size+=SIZE*sizeof(TYPE);\
 	}\
-	else{\
+	else if(marshall_direction==MARSHALLING_SIZE){\
+		*pmarshalled_data_size+=SIZE*sizeof(TYPE);\
+	}\
+	else if(marshall_direction==MARSHALLING_BACKWARD){\
 		FIELD=xNew<TYPE>(SIZE);\
 		memcpy(FIELD,*pmarshalled_data,SIZE*sizeof(TYPE));\
 		*pmarshalled_data+=SIZE*sizeof(TYPE);\
-	}
+	}\
+	else _error_("Wrong direction during the Marshall process");
 
 #endif	
Index: /issm/trunk-jpl/src/m/enum/ElementHookEnum.m
===================================================================
--- /issm/trunk-jpl/src/m/enum/ElementHookEnum.m	(revision 19215)
+++ /issm/trunk-jpl/src/m/enum/ElementHookEnum.m	(revision 19215)
@@ -0,0 +1,11 @@
+function macro=ElementHookEnum()
+%ELEMENTHOOKENUM - Enum of ElementHook
+%
+%   WARNING: DO NOT MODIFY THIS FILE
+%            this file has been automatically generated by src/c/shared/Enum/Synchronize.sh
+%            Please read src/c/shared/Enum/README for more information
+%
+%   Usage:
+%      macro=ElementHookEnum()
+
+macro=StringToEnum('ElementHook');
Index: /issm/trunk-jpl/src/m/enum/EnumDefinitions.py
===================================================================
--- /issm/trunk-jpl/src/m/enum/EnumDefinitions.py	(revision 19214)
+++ /issm/trunk-jpl/src/m/enum/EnumDefinitions.py	(revision 19215)
@@ -471,4 +471,6 @@
 def DoubleVecParamEnum(): return StringToEnum("DoubleVecParam")[0]
 def ElementEnum(): return StringToEnum("Element")[0]
+def ElementHookEnum(): return StringToEnum("ElementHook")[0]
+def HookEnum(): return StringToEnum("Hook")[0]
 def ExternalResultEnum(): return StringToEnum("ExternalResult")[0]
 def FileParamEnum(): return StringToEnum("FileParam")[0]
Index: /issm/trunk-jpl/src/m/enum/HookEnum.m
===================================================================
--- /issm/trunk-jpl/src/m/enum/HookEnum.m	(revision 19215)
+++ /issm/trunk-jpl/src/m/enum/HookEnum.m	(revision 19215)
@@ -0,0 +1,11 @@
+function macro=HookEnum()
+%HOOKENUM - Enum of Hook
+%
+%   WARNING: DO NOT MODIFY THIS FILE
+%            this file has been automatically generated by src/c/shared/Enum/Synchronize.sh
+%            Please read src/c/shared/Enum/README for more information
+%
+%   Usage:
+%      macro=HookEnum()
+
+macro=StringToEnum('Hook');
