Index: /issm/branches/trunk-jpl-damage/src/c/modules/ModelProcessorx/CreateElementsVerticesAndMaterials.cpp
===================================================================
--- /issm/branches/trunk-jpl-damage/src/c/modules/ModelProcessorx/CreateElementsVerticesAndMaterials.cpp	(revision 12273)
+++ /issm/branches/trunk-jpl-damage/src/c/modules/ModelProcessorx/CreateElementsVerticesAndMaterials.cpp	(revision 12274)
@@ -71,5 +71,5 @@
 				InversionMaxParametersEnum,InversionThreshParametersEnum);
 
-	/*Add new constrant material property tgo materials, at the end: */
+	/*Add new constant material property to materials, at the end: */
 	materials->AddObject(new Matpar(numberofelements+1,iomodel));//put it at the end of the materials
 	
@@ -82,5 +82,5 @@
 	for (i=0;i<numberofvertices;i++){
 
-		/*vertices and nodes (same number, as we are running continuous galerkin formulation: */
+		/*vertices and nodes (same number, as we are running continuous galerkin formulation): */
 		if(iomodel->my_vertices[i]){
 			
Index: /issm/branches/trunk-jpl-damage/src/c/objects/Elements/Penta.cpp
===================================================================
--- /issm/branches/trunk-jpl-damage/src/c/objects/Elements/Penta.cpp	(revision 12273)
+++ /issm/branches/trunk-jpl-damage/src/c/objects/Elements/Penta.cpp	(revision 12274)
@@ -4475,7 +4475,7 @@
 	Input* input=NULL;
 
-	if(enum_type==MaterialsRheologyBbarEnum){
+	if(enum_type==MaterialsRheologyBbarEnum || enum_type==MaterialsRheologyZbarEnum){
 		if(!IsOnBed()) return;
-		input=(Input*)matice->inputs->GetInput(MaterialsRheologyBEnum);
+		input=(Input*)matice->inputs->GetInput(enum_type);
 	}
 	else{
@@ -4494,6 +4494,6 @@
 	Input* input=NULL;
 
-	if(enum_type==MaterialsRheologyBbarEnum){
-		input=(Input*)matice->inputs->GetInput(MaterialsRheologyBEnum);
+	if(enum_type==MaterialsRheologyBbarEnum || enum_type==MaterialsRheologyZbarEnum){
+		input=(Input*)matice->inputs->GetInput(enum_type);
 	}
 	else{
@@ -4513,6 +4513,6 @@
 	Input* input=NULL;
 
-	if(enum_type==MaterialsRheologyBbarEnum){
-		input=(Input*)matice->inputs->GetInput(MaterialsRheologyBEnum);
+	if(enum_type==MaterialsRheologyBbarEnum || enum_type==MaterialsRheologyZbarEnum){
+		input=(Input*)matice->inputs->GetInput(enum_type);
 	}
 	else{
@@ -5069,4 +5069,7 @@
 	this->InputDepthAverageAtBase(MaterialsRheologyBEnum,MaterialsRheologyBbarEnum,MaterialsEnum);
 
+	/*Depth Average Z*/
+	this->InputDepthAverageAtBase(MaterialsRheologyZEnum,MaterialsRheologyZbarEnum,MaterialsEnum);
+
 	/*Collapse element to the base*/
 	Tria* tria=(Tria*)SpawnTria(0,1,2); //nodes 0, 1 and 2 make the new tria (lower face).
@@ -5086,4 +5089,7 @@
 	/*Depth Average B*/
 	this->InputDepthAverageAtBase(MaterialsRheologyBEnum,MaterialsRheologyBbarEnum,MaterialsEnum);
+
+	/*Depth Average Z*/
+	this->InputDepthAverageAtBase(MaterialsRheologyZEnum,MaterialsRheologyZbarEnum,MaterialsEnum);
 
 	/*Collapse element to the base*/
@@ -5104,4 +5110,7 @@
 	this->InputDepthAverageAtBase(MaterialsRheologyBEnum,MaterialsRheologyBbarEnum,MaterialsEnum);
 
+	/*Depth Average Z*/
+	this->InputDepthAverageAtBase(MaterialsRheologyZEnum,MaterialsRheologyZbarEnum,MaterialsEnum);
+
 	/*Collapse element to the base*/
 	Tria* tria=(Tria*)SpawnTria(0,1,2);
@@ -5126,7 +5135,7 @@
 	for(int i=0;i<num_controls;i++){
 
-		if(control_type[i]==MaterialsRheologyBbarEnum){
+		if(control_type[i]==MaterialsRheologyBbarEnum || control_type[i]==MaterialsRheologyZbarEnum){
 			if (!IsOnBed()) goto cleanup_and_return;
-			input=(Input*)matice->inputs->GetInput(MaterialsRheologyBEnum); _assert_(input);
+			input=(Input*)matice->inputs->GetInput(control_type[i]); _assert_(input);
 		}
 		else{
@@ -5140,6 +5149,6 @@
 		if (save_parameter) ((ControlInput*)input)->SaveValue();
 
-		if(control_type[i]==MaterialsRheologyBbarEnum){
-			this->InputExtrude(MaterialsRheologyBEnum,MaterialsEnum);
+		if(control_type[i]==MaterialsRheologyBbarEnum || control_type[i]==MaterialsRheologyZbarEnum){
+			this->InputExtrude(control_type[i],MaterialsEnum);
 		}
 	}
Index: /issm/branches/trunk-jpl-damage/src/c/objects/Elements/Tria.cpp
===================================================================
--- /issm/branches/trunk-jpl-damage/src/c/objects/Elements/Tria.cpp	(revision 12273)
+++ /issm/branches/trunk-jpl-damage/src/c/objects/Elements/Tria.cpp	(revision 12274)
@@ -3789,5 +3789,5 @@
 	this->GetConnectivityList(&connectivity[0]);
 
-	/*Build frictoin element, needed later: */
+	/*Build friction element, needed later: */
 	friction=new Friction("2d",inputs,matpar,analysis_type);
 
