Index: issm/trunk/src/c/modules/ModelProcessorx/Balancedthickness/UpdateElementsBalancedthickness.cpp
===================================================================
--- issm/trunk/src/c/modules/ModelProcessorx/Balancedthickness/UpdateElementsBalancedthickness.cpp	(revision 4000)
+++ issm/trunk/src/c/modules/ModelProcessorx/Balancedthickness/UpdateElementsBalancedthickness.cpp	(revision 4000)
@@ -0,0 +1,64 @@
+/*
+ * UpdateElementsBalancedthickness:
+ */
+
+#include "../../../DataSet/DataSet.h"
+#include "../../../toolkits/toolkits.h"
+#include "../../../io/io.h"
+#include "../../../EnumDefinitions/EnumDefinitions.h"
+#include "../../../objects/objects.h"
+#include "../../../shared/shared.h"
+#include "../../MeshPartitionx/MeshPartitionx.h"
+#include "../../../include/include.h"
+#include "../ModelProcessorx.h"
+
+void	UpdateElementsBalancedthickness(DataSet* elements, IoModel* iomodel,ConstDataHandle iomodel_handle,int analysis_counter){
+
+	/*Intermediary*/
+	int i;
+	Element* element=NULL;
+
+	/*Fetch data needed: */
+	IoModelFetchData(&iomodel->elements,NULL,NULL,iomodel_handle,"elements");
+	IoModelFetchData(&iomodel->thickness,NULL,NULL,iomodel_handle,"thickness");
+	IoModelFetchData(&iomodel->surface,NULL,NULL,iomodel_handle,"surface");
+	IoModelFetchData(&iomodel->bed,NULL,NULL,iomodel_handle,"bed");
+	IoModelFetchData(&iomodel->elementoniceshelf,NULL,NULL,iomodel_handle,"elementoniceshelf");
+	IoModelFetchData(&iomodel->elementonwater,NULL,NULL,iomodel_handle,"elementonwater");
+	IoModelFetchData(&iomodel->vx,NULL,NULL,iomodel_handle,"vx");
+	IoModelFetchData(&iomodel->vy,NULL,NULL,iomodel_handle,"vy");
+	IoModelFetchData(&iomodel->melting_rate,NULL,NULL,iomodel_handle,"melting_rate");
+	IoModelFetchData(&iomodel->accumulation_rate,NULL,NULL,iomodel_handle,"accumulation_rate");
+	IoModelFetchData(&iomodel->dhdt,NULL,NULL,iomodel_handle,"dhdt");
+
+	if (iomodel->dim==3){
+		IoModelFetchData(&iomodel->elementonbed,NULL,NULL,iomodel_handle,"elementonbed");
+		IoModelFetchData(&iomodel->elementonsurface,NULL,NULL,iomodel_handle,"elementonsurface");
+		IoModelFetchData(&iomodel->upperelements,NULL,NULL,iomodel_handle,"upperelements");
+		IoModelFetchData(&iomodel->lowerelements,NULL,NULL,iomodel_handle,"lowerelements");
+	}
+
+	/*Update elements: */
+	for (i=0;i<elements->Size();i++){
+
+		element=(Element*)elements->GetObjectByOffset(i);
+		element->Update(iomodel,analysis_counter);
+
+	}
+
+	/*Free data: */
+	xfree((void**)&iomodel->elements);
+	xfree((void**)&iomodel->thickness);
+	xfree((void**)&iomodel->surface);
+	xfree((void**)&iomodel->bed);
+	xfree((void**)&iomodel->elementoniceshelf);
+	xfree((void**)&iomodel->elementonbed);
+	xfree((void**)&iomodel->elementonsurface);
+	xfree((void**)&iomodel->elementonwater);
+	xfree((void**)&iomodel->vx);
+	xfree((void**)&iomodel->vy);
+	xfree((void**)&iomodel->melting_rate);
+	xfree((void**)&iomodel->accumulation_rate);
+	xfree((void**)&iomodel->upperelements);
+	xfree((void**)&iomodel->lowerelements);
+}
Index: issm/trunk/src/c/modules/ModelProcessorx/Balancedthickness2/UpdateElementsBalancedthickness2.cpp
===================================================================
--- issm/trunk/src/c/modules/ModelProcessorx/Balancedthickness2/UpdateElementsBalancedthickness2.cpp	(revision 4000)
+++ issm/trunk/src/c/modules/ModelProcessorx/Balancedthickness2/UpdateElementsBalancedthickness2.cpp	(revision 4000)
@@ -0,0 +1,58 @@
+/*
+ * UpdateElementsBalancedthickness2:
+ */
+
+#include "../../../DataSet/DataSet.h"
+#include "../../../toolkits/toolkits.h"
+#include "../../../io/io.h"
+#include "../../../EnumDefinitions/EnumDefinitions.h"
+#include "../../../objects/objects.h"
+#include "../../../shared/shared.h"
+#include "../../MeshPartitionx/MeshPartitionx.h"
+#include "../../../include/include.h"
+#include "../ModelProcessorx.h"
+
+void	UpdateElementsBalancedthickness2(DataSet* elements, IoModel* iomodel,ConstDataHandle iomodel_handle,int analysis_counter){
+
+	/*Intermediary*/
+	int i;
+	Element* element=NULL;
+
+	/*Fetch data needed: */
+	IoModelFetchData(&iomodel->elements,NULL,NULL,iomodel_handle,"elements");
+	IoModelFetchData(&iomodel->thickness,NULL,NULL,iomodel_handle,"thickness");
+	IoModelFetchData(&iomodel->surface,NULL,NULL,iomodel_handle,"surface");
+	IoModelFetchData(&iomodel->bed,NULL,NULL,iomodel_handle,"bed");
+	IoModelFetchData(&iomodel->elementoniceshelf,NULL,NULL,iomodel_handle,"elementoniceshelf");
+	IoModelFetchData(&iomodel->elementonwater,NULL,NULL,iomodel_handle,"elementonwater");
+	IoModelFetchData(&iomodel->vx,NULL,NULL,iomodel_handle,"vx");
+	IoModelFetchData(&iomodel->vy,NULL,NULL,iomodel_handle,"vy");
+	IoModelFetchData(&iomodel->melting_rate,NULL,NULL,iomodel_handle,"melting_rate");
+	IoModelFetchData(&iomodel->accumulation_rate,NULL,NULL,iomodel_handle,"accumulation_rate");
+	IoModelFetchData(&iomodel->dhdt,NULL,NULL,iomodel_handle,"dhdt");
+
+	if (iomodel->dim==3){
+		ISSMERROR("not implemented yet");
+	}
+
+	/*Update elements: */
+	for (i=0;i<elements->Size();i++){
+
+		element=(Element*)elements->GetObjectByOffset(i);
+		element->Update(iomodel,analysis_counter);
+
+	}
+
+	/*Free data: */
+	xfree((void**)&iomodel->elements);
+	xfree((void**)&iomodel->thickness);
+	xfree((void**)&iomodel->surface);
+	xfree((void**)&iomodel->bed);
+	xfree((void**)&iomodel->elementoniceshelf);
+	xfree((void**)&iomodel->elementonwater);
+	xfree((void**)&iomodel->vx);
+	xfree((void**)&iomodel->vy);
+	xfree((void**)&iomodel->melting_rate);
+	xfree((void**)&iomodel->accumulation_rate);
+	xfree((void**)&iomodel->dhdt);
+}
Index: issm/trunk/src/c/modules/ModelProcessorx/Balancedvelocities/UpdateElementsBalancedvelocities.cpp
===================================================================
--- issm/trunk/src/c/modules/ModelProcessorx/Balancedvelocities/UpdateElementsBalancedvelocities.cpp	(revision 4000)
+++ issm/trunk/src/c/modules/ModelProcessorx/Balancedvelocities/UpdateElementsBalancedvelocities.cpp	(revision 4000)
@@ -0,0 +1,64 @@
+/*
+ * UpdateElementsBalancedvelocities:
+ */
+
+#include "../../../DataSet/DataSet.h"
+#include "../../../toolkits/toolkits.h"
+#include "../../../io/io.h"
+#include "../../../EnumDefinitions/EnumDefinitions.h"
+#include "../../../objects/objects.h"
+#include "../../../shared/shared.h"
+#include "../../MeshPartitionx/MeshPartitionx.h"
+#include "../../../include/include.h"
+#include "../ModelProcessorx.h"
+
+void	UpdateElementsBalancedvelocities(DataSet* elements, IoModel* iomodel,ConstDataHandle iomodel_handle,int analysis_counter){
+
+	/*Intermediary*/
+	int i;
+	Element* element=NULL;
+
+	/*Fetch data needed: */
+	IoModelFetchData(&iomodel->elements,NULL,NULL,iomodel_handle,"elements");
+	IoModelFetchData(&iomodel->thickness,NULL,NULL,iomodel_handle,"thickness");
+	IoModelFetchData(&iomodel->surface,NULL,NULL,iomodel_handle,"surface");
+	IoModelFetchData(&iomodel->bed,NULL,NULL,iomodel_handle,"bed");
+	IoModelFetchData(&iomodel->elementoniceshelf,NULL,NULL,iomodel_handle,"elementoniceshelf");
+	IoModelFetchData(&iomodel->elementonwater,NULL,NULL,iomodel_handle,"elementonwater");
+	IoModelFetchData(&iomodel->vx,NULL,NULL,iomodel_handle,"vx");
+	IoModelFetchData(&iomodel->vy,NULL,NULL,iomodel_handle,"vy");
+	IoModelFetchData(&iomodel->melting_rate,NULL,NULL,iomodel_handle,"melting_rate");
+	IoModelFetchData(&iomodel->accumulation_rate,NULL,NULL,iomodel_handle,"accumulation_rate");
+
+	if (iomodel->dim==3){
+		IoModelFetchData(&iomodel->elementonbed,NULL,NULL,iomodel_handle,"elementonbed");
+		IoModelFetchData(&iomodel->elementonsurface,NULL,NULL,iomodel_handle,"elementonsurface");
+		IoModelFetchData(&iomodel->upperelements,NULL,NULL,iomodel_handle,"upperelements");
+		IoModelFetchData(&iomodel->lowerelements,NULL,NULL,iomodel_handle,"lowerelements");
+	}
+
+	/*Update elements: */
+	for (i=0;i<elements->Size();i++){
+
+		element=(Element*)elements->GetObjectByOffset(i);
+		element->Update(iomodel,analysis_counter);
+
+	}
+
+	/*Free data: */
+	xfree((void**)&iomodel->elements);
+	xfree((void**)&iomodel->thickness);
+	xfree((void**)&iomodel->surface);
+	xfree((void**)&iomodel->bed);
+	xfree((void**)&iomodel->elementoniceshelf);
+	xfree((void**)&iomodel->elementonwater);
+	xfree((void**)&iomodel->elementonbed);
+	xfree((void**)&iomodel->elementonsurface);
+	xfree((void**)&iomodel->vx);
+	xfree((void**)&iomodel->vy);
+	xfree((void**)&iomodel->vz);
+	xfree((void**)&iomodel->melting_rate);
+	xfree((void**)&iomodel->accumulation_rate);
+	xfree((void**)&iomodel->upperelements);
+	xfree((void**)&iomodel->lowerelements);
+}
Index: issm/trunk/src/c/modules/ModelProcessorx/DiagnosticHutter/UpdateElementsDiagnosticHutter.cpp
===================================================================
--- issm/trunk/src/c/modules/ModelProcessorx/DiagnosticHutter/UpdateElementsDiagnosticHutter.cpp	(revision 4000)
+++ issm/trunk/src/c/modules/ModelProcessorx/DiagnosticHutter/UpdateElementsDiagnosticHutter.cpp	(revision 4000)
@@ -0,0 +1,69 @@
+/*
+ * UpdateElementsDiagnosticHutter:
+ */
+
+#include "../../../DataSet/DataSet.h"
+#include "../../../toolkits/toolkits.h"
+#include "../../../io/io.h"
+#include "../../../EnumDefinitions/EnumDefinitions.h"
+#include "../../../objects/objects.h"
+#include "../../../shared/shared.h"
+#include "../../MeshPartitionx/MeshPartitionx.h"
+#include "../../../include/include.h"
+#include "../ModelProcessorx.h"
+
+void	UpdateElementsDiagnosticHutter(DataSet* elements, IoModel* iomodel,ConstDataHandle iomodel_handle,int analysis_counter){
+
+	/*Intermediary*/
+	int i;
+	Element* element=NULL;
+
+	/*Now, is the flag hutter on? otherwise, do nothing: */
+	if (!iomodel->ishutter)goto cleanup_and_return;
+
+	/*Fetch data needed: */
+	IoModelFetchData(&iomodel->gridonhutter,NULL,NULL,iomodel_handle,"gridonhutter");
+	IoModelFetchData(&iomodel->thickness,NULL,NULL,iomodel_handle,"thickness");
+	IoModelFetchData(&iomodel->surface,NULL,NULL,iomodel_handle,"surface");
+	IoModelFetchData(&iomodel->bed,NULL,NULL,iomodel_handle,"bed");
+	IoModelFetchData(&iomodel->gridonsurface,NULL,NULL,iomodel_handle,"gridonsurface");
+	IoModelFetchData(&iomodel->gridonbed,NULL,NULL,iomodel_handle,"gridonbed");
+	IoModelFetchData(&iomodel->uppergrids,NULL,NULL,iomodel_handle,"uppergrids");
+	IoModelFetchData(&iomodel->drag_coefficient,NULL,NULL,iomodel_handle,"drag_coefficient");
+	IoModelFetchData(&iomodel->rheology_B,NULL,NULL,iomodel_handle,"rheology_B");
+	IoModelFetchData(&iomodel->rheology_n,NULL,NULL,iomodel_handle,"rheology_n");
+	IoModelFetchData(&iomodel->elements_type,NULL,NULL,iomodel_handle,"elements_type");
+	IoModelFetchData(&iomodel->elementonbed,NULL,NULL,iomodel_handle,"elementonbed");
+	IoModelFetchData(&iomodel->elementonsurface,NULL,NULL,iomodel_handle,"elementonsurface");
+	IoModelFetchData(&iomodel->elementonwater,NULL,NULL,iomodel_handle,"elementonwater");
+	IoModelFetchData(&iomodel->elements,NULL,NULL,iomodel_handle,"elements");
+	IoModelFetchData(&iomodel->upperelements,NULL,NULL,iomodel_handle,"upperelements");
+	IoModelFetchData(&iomodel->lowerelements,NULL,NULL,iomodel_handle,"lowerelements");
+
+	/*Update elements: */
+	for (i=0;i<elements->Size();i++){
+
+		element=(Element*)elements->GetObjectByOffset(i);
+		element->Update(iomodel,analysis_counter);
+
+	}
+
+	/*Free data: */
+	xfree((void**)&iomodel->gridonhutter);
+	xfree((void**)&iomodel->thickness);
+	xfree((void**)&iomodel->surface);
+	xfree((void**)&iomodel->bed);
+	xfree((void**)&iomodel->gridonsurface);
+	xfree((void**)&iomodel->gridonbed);
+	xfree((void**)&iomodel->uppergrids);
+	xfree((void**)&iomodel->drag_coefficient);
+	xfree((void**)&iomodel->rheology_B);
+	xfree((void**)&iomodel->rheology_n);
+	xfree((void**)&iomodel->elements_type);
+	xfree((void**)&iomodel->elementonbed);
+	xfree((void**)&iomodel->elementonsurface);
+	xfree((void**)&iomodel->elementonwater);
+	xfree((void**)&iomodel->elements);
+	xfree((void**)&iomodel->upperelements);
+	xfree((void**)&iomodel->lowerelements);
+}
Index: issm/trunk/src/c/modules/ModelProcessorx/DiagnosticStokes/UpdateElementsDiagnosticStokes.cpp
===================================================================
--- issm/trunk/src/c/modules/ModelProcessorx/DiagnosticStokes/UpdateElementsDiagnosticStokes.cpp	(revision 4000)
+++ issm/trunk/src/c/modules/ModelProcessorx/DiagnosticStokes/UpdateElementsDiagnosticStokes.cpp	(revision 4000)
@@ -0,0 +1,88 @@
+/*
+ * UpdateElementsDiagnosticHoriz:
+ */
+
+#include "../../../DataSet/DataSet.h"
+#include "../../../toolkits/toolkits.h"
+#include "../../../io/io.h"
+#include "../../../EnumDefinitions/EnumDefinitions.h"
+#include "../../../objects/objects.h"
+#include "../../../shared/shared.h"
+#include "../../MeshPartitionx/MeshPartitionx.h"
+#include "../../../include/include.h"
+#include "../ModelProcessorx.h"
+
+void	UpdateElementsDiagnosticHoriz(DataSet* elements, IoModel* iomodel,ConstDataHandle iomodel_handle,int analysis_counter){
+
+	/*Intermediary*/
+	int i;
+	Element* element=NULL;
+
+	/*Now, is the flag stokes on? otherwise, do nothing: */
+	if (!iomodel->isstokes)goto cleanup_and_return;
+	if (iomodel->dim==2)goto cleanup_and_return;
+
+	/*Fetch data needed: */
+	IoModelFetchData(&iomodel->elements,NULL,NULL,iomodel_handle,"elements");
+	IoModelFetchData(&iomodel->thickness,NULL,NULL,iomodel_handle,"thickness");
+	IoModelFetchData(&iomodel->surface,NULL,NULL,iomodel_handle,"surface");
+	IoModelFetchData(&iomodel->bed,NULL,NULL,iomodel_handle,"bed");
+	IoModelFetchData(&iomodel->drag_coefficient,NULL,NULL,iomodel_handle,"drag_coefficient");
+	IoModelFetchData(&iomodel->drag_p,NULL,NULL,iomodel_handle,"drag_p");
+	IoModelFetchData(&iomodel->drag_q,NULL,NULL,iomodel_handle,"drag_q");
+	IoModelFetchData(&iomodel->elementoniceshelf,NULL,NULL,iomodel_handle,"elementoniceshelf");
+	IoModelFetchData(&iomodel->elementonbed,NULL,NULL,iomodel_handle,"elementonbed");
+	IoModelFetchData(&iomodel->elementonsurface,NULL,NULL,iomodel_handle,"elementonsurface");
+	IoModelFetchData(&iomodel->elementonwater,NULL,NULL,iomodel_handle,"elementonwater");
+	IoModelFetchData(&iomodel->elements_type,NULL,NULL,iomodel_handle,"elements_type");
+	IoModelFetchData(&iomodel->rheology_B,NULL,NULL,iomodel_handle,"rheology_B");
+	IoModelFetchData(&iomodel->rheology_n,NULL,NULL,iomodel_handle,"rheology_n");
+	IoModelFetchData(&iomodel->accumulation_rate,NULL,NULL,iomodel_handle,"accumulation_rate");
+	IoModelFetchData(&iomodel->melting_rate,NULL,NULL,iomodel_handle,"melting_rate");
+	IoModelFetchData(&iomodel->vx,NULL,NULL,iomodel_handle,"vx");
+	IoModelFetchData(&iomodel->vy,NULL,NULL,iomodel_handle,"vy");
+	IoModelFetchData(&iomodel->vz,NULL,NULL,iomodel_handle,"vz");
+	IoModelFetchData(&iomodel->upperelements,NULL,NULL,iomodel_handle,"upperelements");
+	IoModelFetchData(&iomodel->lowerelements,NULL,NULL,iomodel_handle,"lowerelements");
+	if (iomodel->control_analysis){
+		IoModelFetchData(&iomodel->vx_obs,NULL,NULL,iomodel_handle,"vx_obs");
+		IoModelFetchData(&iomodel->vy_obs,NULL,NULL,iomodel_handle,"vy_obs");
+		IoModelFetchData(&iomodel->weights,NULL,NULL,iomodel_handle,"weights");
+	}
+
+	/*Update elements: */
+	for (i=0;i<elements->Size();i++){
+
+		element=(Element*)elements->GetObjectByOffset(i);
+		element->Update(iomodel,analysis_counter);
+
+	}
+
+	/*Free data: */
+	xfree((void**)&iomodel->elements);
+	xfree((void**)&iomodel->thickness);
+	xfree((void**)&iomodel->surface);
+	xfree((void**)&iomodel->bed);
+	xfree((void**)&iomodel->drag_coefficient);
+	xfree((void**)&iomodel->drag_p);
+	xfree((void**)&iomodel->drag_q);
+	xfree((void**)&iomodel->elementoniceshelf);
+	xfree((void**)&iomodel->elementonbed);
+	xfree((void**)&iomodel->elementonsurface);
+	xfree((void**)&iomodel->elementonwater);
+	xfree((void**)&iomodel->elements_type);
+	xfree((void**)&iomodel->rheology_B);
+	xfree((void**)&iomodel->rheology_n);
+	xfree((void**)&iomodel->accumulation_rate);
+	xfree((void**)&iomodel->melting_rate);
+	xfree((void**)&iomodel->vx);
+	xfree((void**)&iomodel->vy);
+	xfree((void**)&iomodel->vz);
+	xfree((void**)&iomodel->upperelements);
+	xfree((void**)&iomodel->lowerelements);
+	if (iomodel->control_analysis){
+		xfree((void**)&iomodel->vx_obs);
+		xfree((void**)&iomodel->vy_obs);
+		xfree((void**)&iomodel->weights);
+	}
+}
Index: issm/trunk/src/c/modules/ModelProcessorx/DiagnosticVert/UpdateElementsDiagnosticVert.cpp
===================================================================
--- issm/trunk/src/c/modules/ModelProcessorx/DiagnosticVert/UpdateElementsDiagnosticVert.cpp	(revision 4000)
+++ issm/trunk/src/c/modules/ModelProcessorx/DiagnosticVert/UpdateElementsDiagnosticVert.cpp	(revision 4000)
@@ -0,0 +1,61 @@
+/*
+ * UpdateElementsDiagnosticVert:
+ */
+
+#include "../../../DataSet/DataSet.h"
+#include "../../../toolkits/toolkits.h"
+#include "../../../io/io.h"
+#include "../../../EnumDefinitions/EnumDefinitions.h"
+#include "../../../objects/objects.h"
+#include "../../../shared/shared.h"
+#include "../../MeshPartitionx/MeshPartitionx.h"
+#include "../../../include/include.h"
+#include "../ModelProcessorx.h"
+
+void	UpdateElementsDiagnosticVert(DataSet* elements, IoModel* iomodel,ConstDataHandle iomodel_handle,int analysis_counter){
+
+	/*Intermediary*/
+	int i;
+	Element* element=NULL;
+
+	/*Now, is the model 3d? otherwise, do nothing: */
+	if (iomodel->dim==2)goto cleanup_and_return;
+
+	/*Fetch data needed: */
+	IoModelFetchData(&iomodel->elements,NULL,NULL,iomodel_handle,"elements");
+	IoModelFetchData(&iomodel->thickness,NULL,NULL,iomodel_handle,"thickness");
+	IoModelFetchData(&iomodel->surface,NULL,NULL,iomodel_handle,"surface");
+	IoModelFetchData(&iomodel->bed,NULL,NULL,iomodel_handle,"bed");
+	IoModelFetchData(&iomodel->elementoniceshelf,NULL,NULL,iomodel_handle,"elementoniceshelf");
+	IoModelFetchData(&iomodel->elementonbed,NULL,NULL,iomodel_handle,"elementonbed");
+	IoModelFetchData(&iomodel->elementonsurface,NULL,NULL,iomodel_handle,"elementonsurface");
+	IoModelFetchData(&iomodel->elementonwater,NULL,NULL,iomodel_handle,"elementonwater");
+	IoModelFetchData(&iomodel->rheology_B,NULL,NULL,iomodel_handle,"rheology_B");
+	IoModelFetchData(&iomodel->rheology_n,NULL,NULL,iomodel_handle,"rheology_n");
+	IoModelFetchData(&iomodel->vx,NULL,NULL,iomodel_handle,"vx");
+	IoModelFetchData(&iomodel->vy,NULL,NULL,iomodel_handle,"vy");
+	IoModelFetchData(&iomodel->upperelements,NULL,NULL,iomodel_handle,"upperelements");
+	IoModelFetchData(&iomodel->lowerelements,NULL,NULL,iomodel_handle,"lowerelements");
+
+	/*Update elements: */
+	for (i=0;i<elements->Size();i++){
+
+		element=(Element*)elements->GetObjectByOffset(i);
+		element->Update(iomodel,analysis_counter);
+
+	}
+
+	/*Free data: */
+	xfree((void**)&iomodel->elements);
+	xfree((void**)&iomodel->thickness);
+	xfree((void**)&iomodel->surface);
+	xfree((void**)&iomodel->bed);
+	xfree((void**)&iomodel->elementoniceshelf);
+	xfree((void**)&iomodel->elementonbed);
+	xfree((void**)&iomodel->elementonsurface);
+	xfree((void**)&iomodel->elementonwater);
+	xfree((void**)&iomodel->vx);
+	xfree((void**)&iomodel->vy);
+	xfree((void**)&iomodel->upperelements);
+	xfree((void**)&iomodel->lowerelements);
+}
Index: issm/trunk/src/c/modules/ModelProcessorx/Melting/UpdateElementsMelting.cpp
===================================================================
--- issm/trunk/src/c/modules/ModelProcessorx/Melting/UpdateElementsMelting.cpp	(revision 4000)
+++ issm/trunk/src/c/modules/ModelProcessorx/Melting/UpdateElementsMelting.cpp	(revision 4000)
@@ -0,0 +1,73 @@
+/*
+ * UpdateElementsMelting:
+ */
+
+#include "../../../DataSet/DataSet.h"
+#include "../../../toolkits/toolkits.h"
+#include "../../../io/io.h"
+#include "../../../EnumDefinitions/EnumDefinitions.h"
+#include "../../../objects/objects.h"
+#include "../../../shared/shared.h"
+#include "../../MeshPartitionx/MeshPartitionx.h"
+#include "../../../include/include.h"
+#include "../ModelProcessorx.h"
+
+void	UpdateElementsMelting(DataSet* elements, IoModel* iomodel,ConstDataHandle iomodel_handle,int analysis_counter){
+
+	/*Intermediary*/
+	int i;
+	Element* element=NULL;
+
+	/*Now, is the model 3d? otherwise, do nothing: */
+	if (iomodel->dim==2)goto cleanup_and_return;
+
+	/*Fetch data needed: */
+	IoModelFetchData(&iomodel->elements,NULL,NULL,iomodel_handle,"elements");
+	IoModelFetchData(&iomodel->thickness,NULL,NULL,iomodel_handle,"thickness");
+	IoModelFetchData(&iomodel->surface,NULL,NULL,iomodel_handle,"surface");
+	IoModelFetchData(&iomodel->bed,NULL,NULL,iomodel_handle,"bed");
+	IoModelFetchData(&iomodel->drag_coefficient,NULL,NULL,iomodel_handle,"drag_coefficient");
+	IoModelFetchData(&iomodel->drag_p,NULL,NULL,iomodel_handle,"drag_p");
+	IoModelFetchData(&iomodel->drag_q,NULL,NULL,iomodel_handle,"drag_q");
+	IoModelFetchData(&iomodel->elementoniceshelf,NULL,NULL,iomodel_handle,"elementoniceshelf");
+	IoModelFetchData(&iomodel->elementonbed,NULL,NULL,iomodel_handle,"elementonbed");
+	IoModelFetchData(&iomodel->elementonsurface,NULL,NULL,iomodel_handle,"elementonsurface");
+	IoModelFetchData(&iomodel->elementonwater,NULL,NULL,iomodel_handle,"elementonwater");
+	IoModelFetchData(&iomodel->elements_type,NULL,NULL,iomodel_handle,"elements_type");
+	IoModelFetchData(&iomodel->rheology_B,NULL,NULL,iomodel_handle,"rheology_B");
+	IoModelFetchData(&iomodel->rheology_n,NULL,NULL,iomodel_handle,"rheology_n");
+	IoModelFetchData(&iomodel->accumulation_rate,NULL,NULL,iomodel_handle,"accumulation_rate");
+	IoModelFetchData(&iomodel->melting_ratex,NULL,NULL,iomodel_handle,"melting_rate");
+	IoModelFetchData(&iomodel->pressure,NULL,NULL,iomodel_handle,"pressure");
+	IoModelFetchData(&iomodel->upperelements,NULL,NULL,iomodel_handle,"upperelements");
+	IoModelFetchData(&iomodel->lowerelements,NULL,NULL,iomodel_handle,"lowerelements");
+
+	/*Update elements: */
+	for (i=0;i<elements->Size();i++){
+
+		element=(Element*)elements->GetObjectByOffset(i);
+		element->Update(iomodel,analysis_counter);
+
+	}
+
+	/*Free data: */
+	xfree((void**)&iomodel->elements);
+	xfree((void**)&iomodel->thickness);
+	xfree((void**)&iomodel->surface);
+	xfree((void**)&iomodel->bed);
+	xfree((void**)&iomodel->drag_coefficient);
+	xfree((void**)&iomodel->drag_p);
+	xfree((void**)&iomodel->drag_q);
+	xfree((void**)&iomodel->elementoniceshelf);
+	xfree((void**)&iomodel->elementonbed);
+	xfree((void**)&iomodel->elementonsurface);
+	xfree((void**)&iomodel->elementonwater);
+	xfree((void**)&iomodel->elements_type);
+	xfree((void**)&iomodel->rheology_B);
+	xfree((void**)&iomodel->rheology_n);
+	xfree((void**)&iomodel->accumulation_rate);
+	xfree((void**)&iomodel->melting_rate);
+	xfree((void**)&iomodel->pressure);
+	xfree((void**)&iomodel->upperelements);
+	xfree((void**)&iomodel->lowerelements);
+}
Index: issm/trunk/src/c/modules/ModelProcessorx/Prognostic/UpdateElementsPrognostic.cpp
===================================================================
--- issm/trunk/src/c/modules/ModelProcessorx/Prognostic/UpdateElementsPrognostic.cpp	(revision 4000)
+++ issm/trunk/src/c/modules/ModelProcessorx/Prognostic/UpdateElementsPrognostic.cpp	(revision 4000)
@@ -0,0 +1,67 @@
+/*
+ * UpdateElementsPrognostic:
+ */
+
+#include "../../../DataSet/DataSet.h"
+#include "../../../toolkits/toolkits.h"
+#include "../../../io/io.h"
+#include "../../../EnumDefinitions/EnumDefinitions.h"
+#include "../../../objects/objects.h"
+#include "../../../shared/shared.h"
+#include "../../MeshPartitionx/MeshPartitionx.h"
+#include "../../../include/include.h"
+#include "../ModelProcessorx.h"
+
+void	UpdateElementsPrognostic(DataSet* elements, IoModel* iomodel,ConstDataHandle iomodel_handle,int analysis_counter){
+
+	/*Intermediary*/
+	int i;
+	Element* element=NULL;
+
+	/*Fetch data needed: */
+	IoModelFetchData(&iomodel->elements,NULL,NULL,iomodel_handle,"elements");
+	IoModelFetchData(&iomodel->thickness,NULL,NULL,iomodel_handle,"thickness");
+	IoModelFetchData(&iomodel->surface,NULL,NULL,iomodel_handle,"surface");
+	IoModelFetchData(&iomodel->bed,NULL,NULL,iomodel_handle,"bed");
+	IoModelFetchData(&iomodel->elementoniceshelf,NULL,NULL,iomodel_handle,"elementoniceshelf");
+	IoModelFetchData(&iomodel->elementonwater,NULL,NULL,iomodel_handle,"elementonwater");
+	IoModelFetchData(&iomodel->accumulation_rate,NULL,NULL,iomodel_handle,"accumulation_rate");
+	IoModelFetchData(&iomodel->melting_rate,NULL,NULL,iomodel_handle,"melting_rate");
+	IoModelFetchData(&iomodel->vx,NULL,NULL,iomodel_handle,"vx");
+	IoModelFetchData(&iomodel->vy,NULL,NULL,iomodel_handle,"vy");
+
+	if (iomodel->dim==3){
+		IoModelFetchData(&iomodel->elementonbed,NULL,NULL,iomodel_handle,"elementonbed");
+		IoModelFetchData(&iomodel->elementonsurface,NULL,NULL,iomodel_handle,"elementonsurface");
+		IoModelFetchData(&iomodel->pressure,NULL,NULL,iomodel_handle,"pressure");
+		IoModelFetchData(&iomodel->temperature,NULL,NULL,iomodel_handle,"temperature");
+		IoModelFetchData(&iomodel->upperelements,NULL,NULL,iomodel_handle,"upperelements");
+		IoModelFetchData(&iomodel->lowerelements,NULL,NULL,iomodel_handle,"lowerelements");
+	}
+
+	/*Update elements: */
+	for (i=0;i<elements->Size();i++){
+
+		element=(Element*)elements->GetObjectByOffset(i);
+		element->Update(iomodel,analysis_counter);
+
+	}
+
+	/*Free data: */
+	xfree((void**)&iomodel->elements);
+	xfree((void**)&iomodel->thickness);
+	xfree((void**)&iomodel->surface);
+	xfree((void**)&iomodel->bed);
+	xfree((void**)&iomodel->elementoniceshelf);
+	xfree((void**)&iomodel->elementonbed);
+	xfree((void**)&iomodel->elementonsurface);
+	xfree((void**)&iomodel->elementonwater);
+	xfree((void**)&iomodel->accumulation_rate);
+	xfree((void**)&iomodel->melting_rate);
+	xfree((void**)&iomodel->vx);
+	xfree((void**)&iomodel->vy);
+	xfree((void**)&iomodel->pressure);
+	xfree((void**)&iomodel->temperature);
+	xfree((void**)&iomodel->upperelements);
+	xfree((void**)&iomodel->lowerelements);
+}
Index: issm/trunk/src/c/modules/ModelProcessorx/Prognostic2/UpdateElementsPrognostic2.cpp
===================================================================
--- issm/trunk/src/c/modules/ModelProcessorx/Prognostic2/UpdateElementsPrognostic2.cpp	(revision 4000)
+++ issm/trunk/src/c/modules/ModelProcessorx/Prognostic2/UpdateElementsPrognostic2.cpp	(revision 4000)
@@ -0,0 +1,56 @@
+/*
+ * UpdateElementsPrognostic2:
+ */
+
+#include "../../../DataSet/DataSet.h"
+#include "../../../toolkits/toolkits.h"
+#include "../../../io/io.h"
+#include "../../../EnumDefinitions/EnumDefinitions.h"
+#include "../../../objects/objects.h"
+#include "../../../shared/shared.h"
+#include "../../MeshPartitionx/MeshPartitionx.h"
+#include "../../../include/include.h"
+#include "../ModelProcessorx.h"
+
+void	UpdateElementsPrognostic2(DataSet* elements, IoModel* iomodel,ConstDataHandle iomodel_handle,int analysis_counter){
+
+	/*Intermediary*/
+	int i;
+	Element* element=NULL;
+
+	/*Fetch data needed: */
+	IoModelFetchData(&iomodel->elements,NULL,NULL,iomodel_handle,"elements");
+	IoModelFetchData(&iomodel->thickness,NULL,NULL,iomodel_handle,"thickness");
+	IoModelFetchData(&iomodel->surface,NULL,NULL,iomodel_handle,"surface");
+	IoModelFetchData(&iomodel->bed,NULL,NULL,iomodel_handle,"bed");
+	IoModelFetchData(&iomodel->elementoniceshelf,NULL,NULL,iomodel_handle,"elementoniceshelf");
+	IoModelFetchData(&iomodel->elementonwater,NULL,NULL,iomodel_handle,"elementonwater");
+	IoModelFetchData(&iomodel->accumulation_rate,NULL,NULL,iomodel_handle,"accumulaton_rate");
+	IoModelFetchData(&iomodel->melting_rate,NULL,NULL,iomodel_handle,"melting_rate");
+	IoModelFetchData(&iomodel->vx,NULL,NULL,iomodel_handle,"vx");
+	IoModelFetchData(&iomodel->vy,NULL,NULL,iomodel_handle,"vy");
+
+	if (iomodel->dim==3){
+		ISSMERROR("not implemented yet");
+	}
+
+	/*Update elements: */
+	for (i=0;i<elements->Size();i++){
+
+		element=(Element*)elements->GetObjectByOffset(i);
+		element->Update(iomodel,analysis_counter);
+
+	}
+
+	/*Free data: */
+	xfree((void**)&iomodel->elements);
+	xfree((void**)&iomodel->thickness);
+	xfree((void**)&iomodel->surface);
+	xfree((void**)&iomodel->bed);
+	xfree((void**)&iomodel->elementoniceshelf);
+	xfree((void**)&iomodel->elementonwater);
+	xfree((void**)&iomodel->accumulation_rate);
+	xfree((void**)&iomodel->melting_rate);
+	xfree((void**)&iomodel->vx);
+	xfree((void**)&iomodel->vy);
+}
Index: issm/trunk/src/c/modules/ModelProcessorx/SlopeCompute/UpdateElementsSlopeCompute.cpp
===================================================================
--- issm/trunk/src/c/modules/ModelProcessorx/SlopeCompute/UpdateElementsSlopeCompute.cpp	(revision 4000)
+++ issm/trunk/src/c/modules/ModelProcessorx/SlopeCompute/UpdateElementsSlopeCompute.cpp	(revision 4000)
@@ -0,0 +1,49 @@
+/*
+ * UpdateElementsSlopeCompute:
+ */
+
+#include "../../../DataSet/DataSet.h"
+#include "../../../toolkits/toolkits.h"
+#include "../../../io/io.h"
+#include "../../../EnumDefinitions/EnumDefinitions.h"
+#include "../../../objects/objects.h"
+#include "../../../shared/shared.h"
+#include "../../MeshPartitionx/MeshPartitionx.h"
+#include "../../../include/include.h"
+#include "../ModelProcessorx.h"
+
+void	UpdateElementsSlopeCompute(DataSet* elements, IoModel* iomodel,ConstDataHandle iomodel_handle,int analysis_counter){
+
+	/*Intermediary*/
+	int i;
+	Element* element=NULL;
+
+	/*Fetch data needed: */
+	IoModelFetchData(&iomodel->elements,NULL,NULL,iomodel_handle,"elements");
+	IoModelFetchData(&iomodel->surface,NULL,NULL,iomodel_handle,"surface");
+	IoModelFetchData(&iomodel->bed,NULL,NULL,iomodel_handle,"bed");
+	IoModelFetchData(&iomodel->elementonwater,NULL,NULL,iomodel_handle,"elementonwater");
+
+	if (iomodel->dim==3){
+		IoModelFetchData(&iomodel->elementonbed,NULL,NULL,iomodel_handle,"elementonbed");
+		IoModelFetchData(&iomodel->upperelements,NULL,NULL,iomodel_handle,"upperelements");
+		IoModelFetchData(&iomodel->lowerelements,NULL,NULL,iomodel_handle,"lowerelements");
+	}
+
+	/*Update elements: */
+	for (i=0;i<elements->Size();i++){
+
+		element=(Element*)elements->GetObjectByOffset(i);
+		element->Update(iomodel,analysis_counter);
+
+	}
+
+	/*Free data: */
+	xfree((void**)&iomodel->elements);
+	xfree((void**)&iomodel->surface);
+	xfree((void**)&iomodel->bed);
+	xfree((void**)&iomodel->elementonwater);
+	xfree((void**)&iomodel->elementonbed);
+	xfree((void**)&iomodel->upperelements);
+	xfree((void**)&iomodel->lowerelements);
+}
Index: issm/trunk/src/c/modules/ModelProcessorx/Thermal/UpdateElementsThermal.cpp
===================================================================
--- issm/trunk/src/c/modules/ModelProcessorx/Thermal/UpdateElementsThermal.cpp	(revision 4000)
+++ issm/trunk/src/c/modules/ModelProcessorx/Thermal/UpdateElementsThermal.cpp	(revision 4000)
@@ -0,0 +1,75 @@
+/*
+ * UpdateElementsThermal:
+ */
+
+#include "../../../DataSet/DataSet.h"
+#include "../../../toolkits/toolkits.h"
+#include "../../../io/io.h"
+#include "../../../EnumDefinitions/EnumDefinitions.h"
+#include "../../../objects/objects.h"
+#include "../../../shared/shared.h"
+#include "../../MeshPartitionx/MeshPartitionx.h"
+#include "../../../include/include.h"
+#include "../ModelProcessorx.h"
+
+void	UpdateElementsThermal(DataSet* elements, IoModel* iomodel,ConstDataHandle iomodel_handle,int analysis_counter){
+
+	/*Intermediary*/
+	int i;
+	Element* element=NULL;
+
+	/*Now, is the model 3d? otherwise, do nothing: */
+	if (iomodel->dim==2)goto cleanup_and_return;
+
+	/*Fetch data needed: */
+	IoModelFetchData(&iomodel->elements,NULL,NULL,iomodel_handle,"elements");
+	IoModelFetchData(&iomodel->thickness,NULL,NULL,iomodel_handle,"thickness");
+	IoModelFetchData(&iomodel->surface,NULL,NULL,iomodel_handle,"surface");
+	IoModelFetchData(&iomodel->bed,NULL,NULL,iomodel_handle,"bed");
+	IoModelFetchData(&iomodel->drag_coefficient,NULL,NULL,iomodel_handle,"drag_coefficient");
+	IoModelFetchData(&iomodel->drag_p,NULL,NULL,iomodel_handle,"drag_p");
+	IoModelFetchData(&iomodel->drag_q,NULL,NULL,iomodel_handle,"drag_q");
+	IoModelFetchData(&iomodel->elementoniceshelf,NULL,NULL,iomodel_handle,"elementoniceshelf");
+	IoModelFetchData(&iomodel->elementonbed,NULL,NULL,iomodel_handle,"elementonbed");
+	IoModelFetchData(&iomodel->elementonsurface,NULL,NULL,iomodel_handle,"elementonsurface");
+	IoModelFetchData(&iomodel->elementonwater,NULL,NULL,iomodel_handle,"elementonwater");
+	IoModelFetchData(&iomodel->elements_type,NULL,NULL,iomodel_handle,"elements_type");
+	IoModelFetchData(&iomodel->rheology_B,NULL,NULL,iomodel_handle,"rheology_B");
+	IoModelFetchData(&iomodel->rheology_n,NULL,NULL,iomodel_handle,"rheology_n");
+	IoModelFetchData(&iomodel->pressure,NULL,NULL,iomodel_handle,"pressure");
+	IoModelFetchData(&iomodel->temperature,NULL,NULL,iomodel_handle,"temperature");
+	IoModelFetchData(&iomodel->vx,NULL,NULL,iomodel_handle,"vx");
+	IoModelFetchData(&iomodel->vy,NULL,NULL,iomodel_handle,"vy");
+	IoModelFetchData(&iomodel->upperelements,NULL,NULL,iomodel_handle,"upperelements");
+	IoModelFetchData(&iomodel->lowerelements,NULL,NULL,iomodel_handle,"lowerelements");
+
+	/*Update elements: */
+	for (i=0;i<elements->Size();i++){
+
+		element=(Element*)elements->GetObjectByOffset(i);
+		element->Update(iomodel,analysis_counter);
+
+	}
+
+	/*Free data: */
+	xfree((void**)&iomodel->elements);
+	xfree((void**)&iomodel->thickness);
+	xfree((void**)&iomodel->surface);
+	xfree((void**)&iomodel->bed);
+	xfree((void**)&iomodel->drag_coefficient);
+	xfree((void**)&iomodel->drag_p);
+	xfree((void**)&iomodel->drag_q);
+	xfree((void**)&iomodel->elementoniceshelf);
+	xfree((void**)&iomodel->elementonbed);
+	xfree((void**)&iomodel->elementonsurface);
+	xfree((void**)&iomodel->elementonwater);
+	xfree((void**)&iomodel->elementons_type);
+	xfree((void**)&iomodel->rheology_B);
+	xfree((void**)&iomodel->rheology_n);
+	xfree((void**)&iomodel->pressure);
+	xfree((void**)&iomodel->temperature);
+	xfree((void**)&iomodel->vx);
+	xfree((void**)&iomodel->vy);
+	xfree((void**)&iomodel->upperelements);
+	xfree((void**)&iomodel->lowerelements);
+}
