Index: /issm/trunk/src/c/objects/Elements/Penta.cpp
===================================================================
--- /issm/trunk/src/c/objects/Elements/Penta.cpp	(revision 8656)
+++ /issm/trunk/src/c/objects/Elements/Penta.cpp	(revision 8657)
@@ -4596,5 +4596,5 @@
 
 		/*Build alpha_complement_list: */
-		if (drag_type==2) friction->GetAlphaComplement(&alpha_complement, gauss,VxEnum,VyEnum);
+		if (drag_type==2) friction->GetAlphaComplement(&alpha_complement, gauss,VxEnum,VyEnum,VzEnum);
 		else alpha_complement=0;
 
@@ -4662,5 +4662,5 @@
 	/*Build frictoin element, needed later: */
 	inputs->GetParameterValue(&drag_type,DragTypeEnum);
-	friction=new Friction("2d",inputs,matpar,analysis_type);
+	friction=new Friction("3d",inputs,matpar,analysis_type);
 
 	/* Start  looping on the number of gaussian points: */
@@ -4671,5 +4671,5 @@
 
 		/*Recover alpha_complement and drag: */
-		if (drag_type==2) friction->GetAlphaComplement(&alpha_complement, gauss,VxEnum,VyEnum);
+		if (drag_type==2) friction->GetAlphaComplement(&alpha_complement, gauss,VxEnum,VyEnum,VzEnum);
 		else alpha_complement=0;
 		drag_input->GetParameterValue(&drag,gauss);
Index: /issm/trunk/src/c/objects/Elements/Tria.cpp
===================================================================
--- /issm/trunk/src/c/objects/Elements/Tria.cpp	(revision 8656)
+++ /issm/trunk/src/c/objects/Elements/Tria.cpp	(revision 8657)
@@ -3084,5 +3084,5 @@
 
 		/*Build alpha_complement_list: */
-		if (drag_type==2) friction->GetAlphaComplement(&alpha_complement, gauss,VxEnum,VyEnum);
+		if (drag_type==2) friction->GetAlphaComplement(&alpha_complement, gauss,VxEnum,VyEnum,VzEnum);
 		else alpha_complement=0;
 	
Index: /issm/trunk/src/c/objects/Loads/Friction.cpp
===================================================================
--- /issm/trunk/src/c/objects/Loads/Friction.cpp	(revision 8656)
+++ /issm/trunk/src/c/objects/Loads/Friction.cpp	(revision 8657)
@@ -71,5 +71,4 @@
 	double  alpha2;
 
-
 	/*Recover parameters: */
 	inputs->GetParameterValue(&drag_p,DragPEnum);
@@ -136,5 +135,4 @@
 	double  alpha2;
 
-
 	/*Recover parameters: */
 	inputs->GetParameterValue(&drag_p,DragPEnum);
@@ -185,6 +183,6 @@
 }
 /*}}}*/
-/*FUNCTION Friction::GetAlphaComplement(double* palpha_complement, GaussTria* gauss,int vxenum,int vyenum) {{{1*/
-void Friction::GetAlphaComplement(double* palpha_complement, GaussTria* gauss,int vxenum,int vyenum){
+/*FUNCTION Friction::GetAlphaComplement(double* palpha_complement, GaussTria* gauss,int vxenum,int vyenum,int vzenum) {{{1*/
+void Friction::GetAlphaComplement(double* palpha_complement, GaussTria* gauss,int vxenum,int vyenum,int vzenum){
 
 	/* FrictionGetAlpha2 computes alpha2= drag^2 * Neff ^r * vel ^s, with Neff=rho_ice*g*thickness+rho_ice*g*bed, r=q/p and s=1/p. 
@@ -194,10 +192,8 @@
 	/*diverse: */
 	int     i;
+	double  r,s;
+	double  vx,vy,vz,vmag;
+	double  drag_p,drag_q;
 	double  Neff;
-	double  r,s;
-	double  vx;
-	double  vy;
-	double  vmag;
-	double  drag_p,drag_q;
 	double  drag_coefficient;
 	double  bed,thickness;
@@ -217,5 +213,4 @@
 	rho_water=matpar->GetRhoWater();
 
-
 	//compute r and q coefficients: */
 	r=drag_q/drag_p;
@@ -232,7 +227,16 @@
 
 	//We need the velocity magnitude to evaluate the basal stress:
-	this->GetParameterValue(&vx, gauss,vxenum);
-	this->GetParameterValue(&vy, gauss,vyenum);
-	vmag=sqrt(pow(vx,2)+pow(vy,2));
+	if(strcmp(element_type,"2d")==0){
+		this->GetParameterValue(&vx, gauss,vxenum);
+		this->GetParameterValue(&vy, gauss,vyenum);
+		vmag=sqrt(pow(vx,2)+pow(vy,2));
+	}
+	else if (strcmp(element_type,"3d")==0){
+		this->GetParameterValue(&vx, gauss,vxenum);
+		this->GetParameterValue(&vy, gauss,vyenum);
+		this->GetParameterValue(&vz, gauss,vzenum);
+		vmag=sqrt(pow(vx,2)+pow(vy,2)+pow(vz,2));
+	}
+	else _error_("element_type %s not supported yet",element_type);
 
 	/*Checks that s-1>0 if v=0*/
@@ -245,6 +249,6 @@
 }
 /*}}}*/
-/*FUNCTION Friction::GetAlphaComplement(double* palpha_complement, GaussPenta* gauss,int vxenum,int vyenum) {{{1*/
-void Friction::GetAlphaComplement(double* palpha_complement, GaussPenta* gauss,int vxenum,int vyenum){
+/*FUNCTION Friction::GetAlphaComplement(double* palpha_complement, GaussPenta* gauss,int vxenum,int vyenum,int vzenum) {{{1*/
+void Friction::GetAlphaComplement(double* palpha_complement, GaussPenta* gauss,int vxenum,int vyenum,int vzenum){
 
 	/* FrictionGetAlpha2 computes alpha2= drag^2 * Neff ^r * vel ^s, with Neff=rho_ice*g*thickness+rho_ice*g*bed, r=q/p and s=1/p. 
@@ -254,10 +258,8 @@
 	/*diverse: */
 	int     i;
+	double  r,s;
+	double  vx,vy,vz,vmag;
+	double  drag_p,drag_q;
 	double  Neff;
-	double  r,s;
-	double  vx;
-	double  vy;
-	double  vmag;
-	double  drag_p,drag_q;
 	double  drag_coefficient;
 	double  bed,thickness;
@@ -277,5 +279,4 @@
 	rho_water=matpar->GetRhoWater();
 
-
 	//compute r and q coefficients: */
 	r=drag_q/drag_p;
@@ -292,7 +293,16 @@
 
 	//We need the velocity magnitude to evaluate the basal stress:
-	this->GetParameterValue(&vx, gauss,vxenum);
-	this->GetParameterValue(&vy, gauss,vyenum);
-	vmag=sqrt(pow(vx,2)+pow(vy,2));
+	if(strcmp(element_type,"2d")==0){
+		this->GetParameterValue(&vx, gauss,vxenum);
+		this->GetParameterValue(&vy, gauss,vyenum);
+		vmag=sqrt(pow(vx,2)+pow(vy,2));
+	}
+	else if (strcmp(element_type,"3d")==0){
+		this->GetParameterValue(&vx, gauss,vxenum);
+		this->GetParameterValue(&vy, gauss,vyenum);
+		this->GetParameterValue(&vz, gauss,vzenum);
+		vmag=sqrt(pow(vx,2)+pow(vy,2)+pow(vz,2));
+	}
+	else _error_("element_type %s not supported yet",element_type);
 
 	/*Checks that s-1>0 if v=0*/
Index: /issm/trunk/src/c/objects/Loads/Friction.h
===================================================================
--- /issm/trunk/src/c/objects/Loads/Friction.h	(revision 8656)
+++ /issm/trunk/src/c/objects/Loads/Friction.h	(revision 8657)
@@ -29,6 +29,6 @@
 		void  GetAlpha2(double* palpha2, GaussTria* gauss,int vxenum,int vyenum,int vzenum);
 		void  GetAlpha2(double* palpha2, GaussPenta* gauss,int vxenum,int vyenum,int vzenum);
-		void  GetAlphaComplement(double* alpha_complement, GaussTria* gauss,int vxenum,int vyenum);
-		void  GetAlphaComplement(double* alpha_complement, GaussPenta* gauss,int vxenum,int vyenum);
+		void  GetAlphaComplement(double* alpha_complement, GaussTria* gauss,int vxenum,int vyenum,int vzenum);
+		void  GetAlphaComplement(double* alpha_complement, GaussPenta* gauss,int vxenum,int vyenum,int vzenum);
 		void  GetParameterValue(double* pvalue,GaussTria* gauss,int enum_type);
 		void  GetParameterValue(double* pvalue,GaussPenta* gauss,int enum_type);
