Index: issm/trunk-jpl/src/c/analyses/HydrologyDCEfficientAnalysis.cpp
===================================================================
--- issm/trunk-jpl/src/c/analyses/HydrologyDCEfficientAnalysis.cpp	(revision 18640)
+++ issm/trunk-jpl/src/c/analyses/HydrologyDCEfficientAnalysis.cpp	(revision 18641)
@@ -352,17 +352,9 @@
 	active_element_input->GetInputValue(&active_element);
 
-	/* if(!active_element){ */
-	/* 	/\*Keeping thickness to initial value if EPL is not active*\/ */
-	/* 	for(i=0;i<numnodes;i++){ */
-	/* 		eplHeads[i]=sedhead[i]; */
-	/* 	} */
-	/* } */
-	/* else{ */
-		/*Use the dof list to index into the solution vector: */
+	/*Use the dof list to index into the solution vector: */
 	for(i=0;i<numnodes;i++){
 		eplHeads[i]=solution[doflist[i]];
 		if(xIsNan<IssmDouble>(eplHeads[i])) _error_("NaN found in solution vector");
 	}
-		//	}
 	/*Add input to the element: */
 	element->AddBasalInput(EplHeadEnum,eplHeads,P1Enum);
@@ -439,7 +431,7 @@
 		_error_("no case higher than 1 for the Transfer method");
 	}
-	if(element->Id()==42){
-		printf("Transferefficient Kmat %e, %e, %e, %i \n",transfer,sediment_head,epl_head,element->Id());
-	}
+	/* if(element->Id()==42){ */
+	/* 	printf("Transferefficient Kmat %e, %e, %e, %e \n",transfer,sediment_head,epl_head,sed_residual); */
+	/* } */
 	return transfer;
 }/*}}}*/
@@ -485,7 +477,7 @@
 		_error_("no case higher than 1 for the Transfer method");
 	}
-	if(element->Id()==42){
-		printf("Transferefficient Pvec %e, %e, %e\n",transfer,sediment_head,epl_head);
-	}
+	/* if(element->Id()==42){ */
+	/* 	printf("Transferefficient Pvec %e, %e, %e, %e\n",transfer,sediment_head,epl_head,sed_residual); */
+	/* } */
 	return transfer;
 }/*}}}*/
Index: issm/trunk-jpl/src/c/analyses/HydrologyDCInefficientAnalysis.cpp
===================================================================
--- issm/trunk-jpl/src/c/analyses/HydrologyDCInefficientAnalysis.cpp	(revision 18640)
+++ issm/trunk-jpl/src/c/analyses/HydrologyDCInefficientAnalysis.cpp	(revision 18641)
@@ -197,8 +197,9 @@
 	basalelement ->FindParam(&dt,TimesteppingTimeStepEnum);
 	basalelement ->FindParam(&isefficientlayer,HydrologydcIsefficientlayerEnum);
-	Input* SedTrans_input    = basalelement->GetInput(HydrologydcSedimentTransmitivityEnum); _assert_(SedTrans_input);
-	Input* sed_head_input    = basalelement->GetInput(SedimentHeadEnum);
-	Input* epl_head_input    = basalelement->GetInput(EplHeadEnum);
-	Input* residual_input  = basalelement->GetInput(SedimentHeadResidualEnum);
+	Input* SedTrans_input = basalelement->GetInput(HydrologydcSedimentTransmitivityEnum); _assert_(SedTrans_input);
+	Input* sed_head_input = basalelement->GetInput(SedimentHeadEnum);
+	Input* epl_head_input = basalelement->GetInput(EplHeadEnum);
+	Input* base_input     = basalelement->GetInput(BaseEnum);
+	Input* thick_input    = basalelement->GetInput(ThicknessEnum);
 
 	IssmDouble sediment_storing = SedimentStoring(basalelement);
@@ -238,5 +239,5 @@
 				active_element_input->GetInputValue(&active_element);
 				if(active_element){
-					transfer=GetHydrologyKMatrixTransfer(basalelement,gauss,sed_head_input,epl_head_input,residual_input);
+					transfer=GetHydrologyKMatrixTransfer(basalelement,gauss,sed_head_input,epl_head_input,thick_input,base_input);
 					basalelement->NodalFunctions(&basis[0],gauss);
 					D_scalar=transfer*gauss->weight*Jdet*dt;
@@ -300,8 +301,9 @@
 	basalelement->FindParam(&isefficientlayer,HydrologydcIsefficientlayerEnum);
 
-	Input* sed_head_input    = basalelement->GetInput(SedimentHeadEnum);
-	Input* epl_head_input    = basalelement->GetInput(EplHeadEnum);
-	Input* water_input       = basalelement->GetInput(BasalforcingsGroundediceMeltingRateEnum); _assert_(water_input);
-	Input* residual_input    = basalelement->GetInput(SedimentHeadResidualEnum);
+	Input* sed_head_input = basalelement->GetInput(SedimentHeadEnum);
+	Input* epl_head_input = basalelement->GetInput(EplHeadEnum);
+	Input* water_input    = basalelement->GetInput(BasalforcingsGroundediceMeltingRateEnum); _assert_(water_input);
+	Input* base_input     = basalelement->GetInput(BaseEnum);
+	Input* thick_input    = basalelement->GetInput(ThicknessEnum);
 	if(dt!= 0.){old_wh_input = basalelement->GetInput(SedimentHeadOldEnum);                     _assert_(old_wh_input);}
 
@@ -338,5 +340,5 @@
 				active_element_input->GetInputValue(&active_element);
 				if(active_element){
-					transfer=GetHydrologyPVectorTransfer(basalelement,gauss,sed_head_input,epl_head_input,residual_input);
+					transfer=GetHydrologyPVectorTransfer(basalelement,gauss,sed_head_input,epl_head_input,thick_input,base_input);
 				}
 				else{
@@ -568,8 +570,8 @@
 /*}}}*/
 
-IssmDouble HydrologyDCInefficientAnalysis::GetHydrologyKMatrixTransfer(Element* element, Gauss* gauss, Input* sed_head_input, Input* epl_head_input, Input* residual_input){/*{{{*/
+IssmDouble HydrologyDCInefficientAnalysis::GetHydrologyKMatrixTransfer(Element* element, Gauss* gauss, Input* sed_head_input, Input* epl_head_input, Input* thick_input, Input* base_input){/*{{{*/
 
 	int transfermethod;
-	IssmDouble sed_residual;
+	IssmDouble hmax;
 	IssmDouble epl_head,sediment_head;
 	IssmDouble leakage,transfer;
@@ -586,14 +588,17 @@
 		_assert_(sed_head_input);
 		_assert_(epl_head_input);
-		_assert_(residual_input);
 		
 		sed_head_input->GetInputValue(&sediment_head,gauss);
 		epl_head_input->GetInputValue(&epl_head,gauss);
-		residual_input->GetInputValue(&sed_residual,gauss);
 		element->FindParam(&leakage,HydrologydcLeakageFactorEnum);
+
+		hmax=GetHydrologyDCInefficientHmax(element, gauss, thick_input, base_input);
 		
 		if(epl_head>sediment_head){  
-			if(sediment_head>=400.0){
+			if(sediment_head>=hmax){
 				transfer=0.0;
+			}
+			else if{
+				transfer=(leakage);
 			}
 			else{
@@ -608,14 +613,14 @@
 		_error_("no case higher than 1 for the Transfer method");
 	}
-	if(element->Id()==42){
-		printf("TransferInfficient Kmat %e, %e, %e, %i\n",transfer,sediment_head,epl_head,element->Id());
-	}
+	/* if(element->Id()==42){ */
+	/* 	printf("TransferInfficient Kmat %e, %e, %e\n",transfer,sediment_head,epl_head); */
+	/* } */
 	return transfer;
 }/*}}}*/
 
-IssmDouble HydrologyDCInefficientAnalysis::GetHydrologyPVectorTransfer(Element* element, Gauss* gauss, Input* sed_head_input, Input* epl_head_input, Input* residual_input){/*{{{*/
+IssmDouble HydrologyDCInefficientAnalysis::GetHydrologyPVectorTransfer(Element* element, Gauss* gauss, Input* sed_head_input, Input* epl_head_input, Input* thick_input, Input* base_input){/*{{{*/
 
 	int transfermethod;
-	IssmDouble sed_residual;
+	IssmDouble hmax;
 	IssmDouble epl_head,sediment_head;
 	IssmDouble leakage,transfer;
@@ -632,13 +637,13 @@
 		_assert_(sed_head_input);
 		_assert_(epl_head_input);
-		_assert_(residual_input);
 		
 		sed_head_input->GetInputValue(&sediment_head,gauss);
 		epl_head_input->GetInputValue(&epl_head,gauss);
-		residual_input->GetInputValue(&sed_residual,gauss);
 		element->FindParam(&leakage,HydrologydcLeakageFactorEnum);
 
- 		if(epl_head>sediment_head){  
-			if(sediment_head>=400.0){
+		hmax=GetHydrologyDCInefficientHmax(element, gauss, thick_input, base_input);
+		
+		if(epl_head>sediment_head){  
+			if(sediment_head>=hmax){
 				transfer=0.0;
 			}
@@ -654,7 +659,7 @@
 		_error_("no case higher than 1 for the Transfer method");
 	}
-	if(element->Id()==42){
-		printf("TransferInfficient Pvec %e, %e, %e, %i\n",transfer,sediment_head,epl_head,element->Id());
-	}
+	/* if(element->Id()==42){ */
+	/* 	printf("TransferInfficient Pvec %e, %e, %e\n",transfer,sediment_head,epl_head); */
+	/* } */
 	return transfer;
 }/*}}}*/
Index: issm/trunk-jpl/src/c/analyses/HydrologyDCInefficientAnalysis.h
===================================================================
--- issm/trunk-jpl/src/c/analyses/HydrologyDCInefficientAnalysis.h	(revision 18640)
+++ issm/trunk-jpl/src/c/analyses/HydrologyDCInefficientAnalysis.h	(revision 18641)
@@ -38,6 +38,6 @@
 		IssmDouble GetHydrologyDCInefficientHmax(Element* element, Gauss* gauss, Input* thickness_input, Input* base_input);
 		void GetHydrologyDCInefficientHmax(IssmDouble* ph_max,Element* element, Node* innode);
-		IssmDouble GetHydrologyKMatrixTransfer(Element* element, Gauss* gauss, Input* sed_head_input, Input* epl_head_input, Input* residual_input);
-		IssmDouble GetHydrologyPVectorTransfer(Element* element, Gauss* gauss, Input* sed_head_input, Input* epl_head_input, Input* residual_input);
+		IssmDouble GetHydrologyKMatrixTransfer(Element* element, Gauss* gauss, Input* sed_head_input, Input* epl_head_input, Input* thick_input, Input* base_input);
+		IssmDouble GetHydrologyPVectorTransfer(Element* element, Gauss* gauss, Input* sed_head_input, Input* epl_head_input, Input* thick_input, Input* base_input);
 		void ElementizeEplMask(FemModel* femmodel);
 };
