Index: /issm/trunk-jpl/src/c/analyses/StressbalanceSIAAnalysis.cpp
===================================================================
--- /issm/trunk-jpl/src/c/analyses/StressbalanceSIAAnalysis.cpp	(revision 19234)
+++ /issm/trunk-jpl/src/c/analyses/StressbalanceSIAAnalysis.cpp	(revision 19235)
@@ -402,5 +402,12 @@
 	Input* slopey_input    = element->GetInput(SurfaceSlopeYEnum);        _assert_(slopey_input);
 	Input* thickness_input = element->GetInput(ThicknessEnum);            _assert_(thickness_input);
-	Input* drag_input      = element->GetInput(FrictionCoefficientEnum);  _assert_(drag_input);
+	Input* drag_input      = NULL;
+	Friction* friction     = NULL;
+	if(frictionlaw!=5){
+		drag_input = element->GetInput(FrictionCoefficientEnum);  _assert_(drag_input);
+	}
+	else{
+		friction=new Friction(element,3);
+	}
 
 	/*Get Vertical segment indices*/
@@ -443,6 +450,4 @@
 		/*Deal with basal velocities*/
 		if(element->IsOnBase()){
-			drag_input->GetInputValue(&drag,gauss);
-
 			switch(frictionlaw){
 				case 1:
@@ -453,4 +458,5 @@
 				case 2:
 					/*Ritz et al. 1996*/
+					drag_input->GetInputValue(&drag,gauss);
 					ub=drag*(rho_ice*gravity*thickness)*(rho_ice*gravity*thickness)*slope[0]/sqrt(slope2);
 					vb=drag*(rho_ice*gravity*thickness)*(rho_ice*gravity*thickness)*slope[1]/sqrt(slope2);
@@ -458,4 +464,5 @@
 				case 3:
 					/*Rutt et al. 2009*/
+					drag_input->GetInputValue(&drag,gauss);
 					ub=-drag*rho_ice*gravity*thickness*slope[0];
 					vb=-drag*rho_ice*gravity*thickness*slope[1];
@@ -463,4 +470,5 @@
 				case 4:
 					/*Henning Akesson*/
+					drag_input->GetInputValue(&drag,gauss);
 					drag = -4e-15 * surface + 8.6e-12;
 					ub=-drag*rho_ice*gravity*thickness*slope[0];
@@ -468,5 +476,4 @@
 					break;
 				case 5: /*Weertman temp for Kevin*/{
-					Friction* friction=new Friction(element,3);
 					friction->GetAlpha2WeertmanTemp(&drag,gauss);
 					ub = -1./drag * rho_ice*gravity*thickness*slope[0];
@@ -487,4 +494,5 @@
 	xDelete<int>(pairindices);
 	xDelete<IssmDouble>(xyz_list);
+	delete friction;
 	return pe;
 
