Index: ../trunk-jpl/src/c/analyses/HydrologyDCEfficientAnalysis.cpp
===================================================================
--- ../trunk-jpl/src/c/analyses/HydrologyDCEfficientAnalysis.cpp	(revision 19002)
+++ ../trunk-jpl/src/c/analyses/HydrologyDCEfficientAnalysis.cpp	(revision 19003)
@@ -590,10 +590,10 @@
 			for(int i=0;i<numnodes;i++){
 				
 				/*Compute first the effective pressure in the EPL*/
-				EPL_N=gravity*((rho_ice*ice_thickness[i])-(rho_water*(eplhead[i]-bed[i])));
+				EPL_N=gravity*((rho_ice*ice_thickness[i])-(rho_water*min(0.0,(eplhead[i]-bed[i]))));
 				if(EPL_N<0.0)EPL_N=0.0;
 				/*Get then the square of the gradient of EPL heads*/
-				EPLgrad2 = (epl_slopeX[i]+epl_slopeY[i])*(epl_slopeX[i]+epl_slopeY[i]);
+				EPLgrad2 = (epl_slopeX[i]*epl_slopeX[i])+(epl_slopeY[i]*epl_slopeY[i]);
 				
 				/*And proceed to the real thing*/
 				thickness[i] = old_thickness[i]*(1+((rho_water*gravity*dt)/(rho_ice*latentheat))*epl_conductivity*EPLgrad2-2.0*(A*dt/(pow(n,n)))*(pow(EPL_N,n)));
@@ -711,7 +711,6 @@
 				if(eplzigzag_counter[basalelement->nodes[i]->Lid()]<eplflip_lock |eplflip_lock==0){
 					vec_mask->SetValue(basalelement->nodes[i]->Sid(),0.,INS_VAL);
 					epl_thickness[i]=init_thick;
-					//If no more active nodes in the element probably colapse it two
 				}
 				else{
 					vec_mask->SetValue(basalelement->nodes[i]->Sid(),1.,INS_VAL);
Index: ../trunk-jpl/src/c/analyses/HydrologyDCInefficientAnalysis.cpp
===================================================================
--- ../trunk-jpl/src/c/analyses/HydrologyDCInefficientAnalysis.cpp	(revision 19002)
+++ ../trunk-jpl/src/c/analyses/HydrologyDCInefficientAnalysis.cpp	(revision 19003)
@@ -465,7 +465,8 @@
 			else{
 				residual[i] = 0.;
 			}
-			pressure[i]=(rho_ice*g*thickness[i])-(rho_freshwater*g*(min(h_max,values[i])-base[i]));
+			//adding base in min to take into account heads under bed wich don't change N
+			pressure[i]=(rho_ice*g*thickness[i])-(rho_freshwater*g*(min(h_max,values[i],base[i])-base[i]));
 		}
 		xDelete<IssmDouble>(thickness);
 		xDelete<IssmDouble>(base);
