Index: /issm/trunk-jpl/src/c/classes/Loads/Friction.cpp
===================================================================
--- /issm/trunk-jpl/src/c/classes/Loads/Friction.cpp	(revision 26600)
+++ /issm/trunk-jpl/src/c/classes/Loads/Friction.cpp	(revision 26601)
@@ -197,7 +197,13 @@
 	IssmDouble vmag = VelMag(gauss);
 
-	/*Check to prevent dividing by zero if vmag==0*/
-	if(vmag==0. && (s-1.)<=0.) alpha_complement=0.;
-	else alpha_complement=pow(Neff,r)*pow(vmag,(s-1));
+	if(s==1.){
+		/*This is to make AD happy and avoid 0^0*/
+		alpha_complement=pow(Neff,r);
+	}
+	else{
+		/*Check to prevent dividing by zero if vmag==0*/
+		if(vmag==0. && (s-1.)<0.) alpha_complement=0.;
+		else alpha_complement=pow(Neff,r)*pow(vmag,(s-1.));
+	}
 
 	/*Assign output pointers:*/
@@ -344,10 +350,12 @@
 	IssmDouble vmag = VelMag(gauss);
 
-	/*Check to prevent dividing by zero if vmag==0*/
-	if(vmag==0. && (s-1.)<=0.){
-		alpha2=0.;
+	if(s==1.){
+		/*This is to make AD happy and avoid 0^0*/
+		alpha2=drag_coefficient*drag_coefficient*pow(Neff,r);
 	}
 	else{
-		alpha2=drag_coefficient*drag_coefficient*pow(Neff,r)*pow(vmag,(s-1.));
+		/*Check to prevent dividing by zero if vmag==0*/
+		if(vmag==0. && (s-1.)<0.) alpha2=0.;
+		else alpha2=drag_coefficient*drag_coefficient*pow(Neff,r)*pow(vmag,(s-1.));
 	}
 
@@ -541,6 +549,12 @@
 
 	/*Check to prevent dividing by zero if vmag==0*/
-	if(vmag==0. && (s-1.)<=0.) alpha2=0.;
-	else alpha2=drag_coefficient*drag_coefficient*pow(Neff,r)*pow(vmag,(s-1.));
+	if(s==1.){
+		/*This is to make AD happy and avoid 0^0*/
+		alpha2=drag_coefficient*drag_coefficient*pow(Neff,r);
+	}
+	else{
+		if(vmag==0. && (s-1.)<0.) alpha2=0.;
+		else alpha2=drag_coefficient*drag_coefficient*pow(Neff,r)*pow(vmag,(s-1.));
+	}
 
 	/*Assign output pointers:*/
@@ -586,7 +600,13 @@
 	IssmDouble vmag = VelMag(gauss);
 
-	/*Check to prevent dividing by zero if vmag==0*/
-	if(vmag==0. && (s-1.)<=0.) alpha2=0.;
-	else alpha2=drag_coefficient*drag_coefficient*pow(Neff,r)*pow(vmag,(s-1.));
+	if(s==1.){
+		/*This is to make AD happy and avoid 0^0*/
+		alpha2=drag_coefficient*drag_coefficient*pow(Neff,r);
+	}
+	else{
+		/*Check to prevent dividing by zero if vmag==0*/
+		if(vmag==0. && (s-1.)<0.) alpha2=0.;
+		else alpha2=drag_coefficient*drag_coefficient*pow(Neff,r)*pow(vmag,(s-1.));
+	}
 
 	/*Assign output pointers:*/
