Index: ../trunk-jpl/src/c/analyses/HydrologyDCEfficientAnalysis.cpp
===================================================================
--- ../trunk-jpl/src/c/analyses/HydrologyDCEfficientAnalysis.cpp	(revision 18640)
+++ ../trunk-jpl/src/c/analyses/HydrologyDCEfficientAnalysis.cpp	(revision 18641)
@@ -351,19 +351,11 @@
 	Input* active_element_input=basalelement->GetInput(HydrologydcMaskEplactiveEltEnum); _assert_(active_element_input);
 	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);
 
@@ -438,9 +430,9 @@
 	default:
 		_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;
 }/*}}}*/
 
@@ -484,9 +476,9 @@
 	default:
 		_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: ../trunk-jpl/src/c/analyses/HydrologyDCInefficientAnalysis.h
===================================================================
--- ../trunk-jpl/src/c/analyses/HydrologyDCInefficientAnalysis.h	(revision 18640)
+++ ../trunk-jpl/src/c/analyses/HydrologyDCInefficientAnalysis.h	(revision 18641)
@@ -37,8 +37,8 @@
 		IssmDouble EplSpecificStoring(Element* element);
 		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);
 };
 #endif
Index: ../trunk-jpl/src/c/analyses/HydrologyDCInefficientAnalysis.cpp
===================================================================
--- ../trunk-jpl/src/c/analyses/HydrologyDCInefficientAnalysis.cpp	(revision 18640)
+++ ../trunk-jpl/src/c/analyses/HydrologyDCInefficientAnalysis.cpp	(revision 18641)
@@ -196,10 +196,11 @@
 	basalelement ->GetVerticesCoordinates(&xyz_list);
 	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);
 	/*Transfer related Inputs*/
@@ -237,7 +238,7 @@
 			if(isefficientlayer){
 				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;
 					TripleMultiply(basis,numnodes,1,0,
@@ -299,10 +300,11 @@
 	basalelement->FindParam(&dt,TimesteppingTimeStepEnum);
 	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);}
 
 	IssmDouble sediment_storing    = SedimentStoring(basalelement);
@@ -337,7 +339,7 @@
 				/*Dealing with the sediment part of the transfer term*/
 				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{
 					transfer=0.0;
@@ -567,10 +569,10 @@
 }
 /*}}}*/
 
-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;
 
@@ -585,17 +587,20 @@
 	case 1:
 		_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{
 				transfer=(leakage);
 			}
@@ -607,16 +612,16 @@
 	default:
 		_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;
 
@@ -631,15 +636,15 @@
 	case 1:
 		_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;
 			}
 			else{
@@ -653,9 +658,9 @@
 	default:
 		_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;
 }/*}}}*/
 
