Index: ../trunk-jpl/test/Archives/Archive327.nc
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: ../trunk-jpl/test/Archives/Archive120.nc
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: ../trunk-jpl/test/Archives/Archive432.nc
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: ../trunk-jpl/test/Archives/Archive325.nc
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: ../trunk-jpl/test/Archives/Archive805.nc
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: ../trunk-jpl/test/Archives/Archive121.nc
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: ../trunk-jpl/test/Archives/Archive326.nc
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: ../trunk-jpl/test/Archives/Archive803.nc
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: ../trunk-jpl/test/Archives/Archive122.nc
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: ../trunk-jpl/test/Archives/Archive431.nc
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: ../trunk-jpl/src/c/analyses/EnthalpyAnalysis.cpp
===================================================================
--- ../trunk-jpl/src/c/analyses/EnthalpyAnalysis.cpp	(revision 18483)
+++ ../trunk-jpl/src/c/analyses/EnthalpyAnalysis.cpp	(revision 18484)
@@ -314,9 +314,9 @@
 			element->ElementSizes(&hx,&hy,&hz);
 			vel=sqrt(vx*vx + vy*vy + vz*vz)+1.e-14;
 			h=sqrt( pow(hx*vx/vel,2) + pow(hy*vy/vel,2) + pow(hz*vz/vel,2));
-			K[0][0]=h/(2.*vel)*vx*vx;  K[0][1]=h/(2.*vel)*vx*vy; K[0][2]=h/(2.*vel)*vx*vz;
-			K[1][0]=h/(2.*vel)*vy*vx;  K[1][1]=h/(2.*vel)*vy*vy; K[1][2]=h/(2.*vel)*vy*vz;
-			K[2][0]=h/(2.*vel)*vz*vx;  K[2][1]=h/(2.*vel)*vz*vy; K[2][2]=h/(2.*vel)*vz*vz;
+			K[0][0]=h/(2.*vel)*fabs(vx*vx);  K[0][1]=h/(2.*vel)*fabs(vx*vy); K[0][2]=h/(2.*vel)*fabs(vx*vz);
+			K[1][0]=h/(2.*vel)*fabs(vy*vx);  K[1][1]=h/(2.*vel)*fabs(vy*vy); K[1][2]=h/(2.*vel)*fabs(vy*vz);
+			K[2][0]=h/(2.*vel)*fabs(vz*vx);  K[2][1]=h/(2.*vel)*fabs(vz*vy); K[2][2]=h/(2.*vel)*fabs(vz*vz);
 			for(int i=0;i<3;i++) for(int j=0;j<3;j++) K[i][j] = D_scalar*K[i][j];
 
 			GetBAdvecprime(Bprime,element,xyz_list,gauss); 
@@ -1027,7 +1027,10 @@
 		}
 		else{
 			basalmeltingrate[vertexdown]=meltingrate_enthalpy[is];
-			watercolumn[vertexdown]+=meltingrate_enthalpy[is];
+			if(watercolumn[vertexdown]+meltingrate_enthalpy[is]<0.)
+				watercolumn[vertexdown]=0.;
+			else
+				watercolumn[vertexdown]+=meltingrate_enthalpy[is];
 		}	
 		basalmeltingrate[vertexdown]*=rho_water/rho_ice; // convert meltingrate from water to ice equivalent
 		_assert_(watercolumn[vertexdown]>=0.);
