Index: /issm/trunk-jpl/src/c/analyses/AdjointHorizAnalysis.cpp
===================================================================
--- /issm/trunk-jpl/src/c/analyses/AdjointHorizAnalysis.cpp	(revision 25853)
+++ /issm/trunk-jpl/src/c/analyses/AdjointHorizAnalysis.cpp	(revision 25854)
@@ -1661,5 +1661,4 @@
 	/*Intermediaries*/
 	int      domaintype,dim;
-	int frictionlaw;
 	Element* basalelement;
 
@@ -1702,5 +1701,5 @@
 
 	/* get the friction law: if 2-Weertman, 11-Schoof, use a special name for the coefficient*/
-	element->FindParam(&frictionlaw, FrictionLawEnum);
+	int frictionlaw; element->FindParam(&frictionlaw, FrictionLawEnum);
 	Input* dragcoefficient_input;
 	switch(frictionlaw) {
@@ -1790,5 +1789,18 @@
 		adjointz_input  = element->GetInput(AdjointzEnum);             _assert_(adjointz_input);
 	}
-	Input* dragcoeff_input = element->GetInput(FrictionCoefficientEnum);  _assert_(dragcoeff_input);
+	/* get the friction law: 1- Budd, 11-Schoof*/
+	int frictionlaw; element->FindParam(&frictionlaw, FrictionLawEnum);
+	Input* dragcoeff_input = NULL;
+	switch(frictionlaw) {
+		case 1:
+			dragcoeff_input = element->GetInput(FrictionCoefficientEnum); _assert_(dragcoeff_input);
+			break;
+		case 2:
+		case 11:
+			dragcoeff_input = element->GetInput(FrictionCEnum); _assert_(dragcoeff_input);
+			break;
+		default:
+			_error_("Friction law "<< frictionlaw <<" not supported in the inversion.");
+	}
 
 	/* Start  looping on the number of gaussian points: */
@@ -1882,9 +1894,23 @@
 	Input* adjointx_input  = element->GetInput(AdjointxEnum);             _assert_(adjointx_input);
 	Input* adjointy_input  = NULL;
-	Input* dragcoeff_input = element->GetInput(FrictionCoefficientEnum);  _assert_(dragcoeff_input);
 	if(domaintype!=Domain2DverticalEnum){
 		vy_input        = element->GetInput(VyEnum);                   _assert_(vy_input);
 		adjointy_input  = element->GetInput(AdjointyEnum);             _assert_(adjointy_input);
 	}
+	/* get the friction law: 1- Budd, 11-Schoof*/
+	int frictionlaw; element->FindParam(&frictionlaw, FrictionLawEnum);
+	Input* dragcoeff_input = NULL;
+	switch(frictionlaw) {
+		case 1:
+			dragcoeff_input = element->GetInput(FrictionCoefficientEnum); _assert_(dragcoeff_input);
+			break;
+		case 2:
+		case 11:
+			dragcoeff_input = element->GetInput(FrictionCEnum); _assert_(dragcoeff_input);
+			break;
+		default:
+			_error_("Friction law "<< frictionlaw <<" not supported in the inversion.");
+	}
+
 	/* Start  looping on the number of gaussian points: */
 	Gauss* gauss=element->NewGaussBase(4);
@@ -1958,5 +1984,4 @@
 	/*Fetch number of vertices for this finite element*/
 	int numvertices = basalelement->GetNumberOfVertices();
-	int frictionlaw;
 
 	/*Initialize some vectors*/
@@ -1977,6 +2002,6 @@
 
 	/* get the friction law: 1- Budd, 11-Schoof*/
-	element->FindParam(&frictionlaw, FrictionLawEnum);
-	Input* dragcoeff_input;
+	int frictionlaw;element->FindParam(&frictionlaw, FrictionLawEnum);
+	Input* dragcoeff_input = NULL;
 	switch(frictionlaw) {
 		case 1:
