Index: /issm/trunk/src/m/solutions/dakota/responsefunctions/MassFlux.m
===================================================================
--- /issm/trunk/src/m/solutions/dakota/responsefunctions/MassFlux.m	(revision 355)
+++ /issm/trunk/src/m/solutions/dakota/responsefunctions/MassFlux.m	(revision 355)
@@ -0,0 +1,15 @@
+function [value]=MassFlux(md)
+
+
+%ok, go around the domain outline, pick up the md.segments, build the normals, and 
+%then add normals * thickness * velocity * length segment
+
+length=sqrt( (md.x(md.segments(:,1))-md.x(md.segments(:,2))).^2 + (md.y(md.segments(:,1))-md.y(md.segments(:,2))).^2 );
+normal(:,1)=cos(atan2( (md.x(md.segments(:,1))-md.x(md.segments(:,2))) , (md.y(md.segments(:,2))-md.y(md.segments(:,1))) ) );
+normal(:,2)=sin(atan2( (md.x(md.segments(:,1))-md.x(md.segments(:,2))) , (md.y(md.segments(:,2))-md.y(md.segments(:,1))) ) );
+
+thickness=md.thickness(md.segments(:,1:2))*[1;1]/2;
+vx=md.vx(md.segments(:,1:2))*[1;1]/2;
+vy=md.vy(md.segments(:,1:2))*[1;1]/2;
+
+value=sum(md.rho_ice.*thickness.*length.*(normal(:,1).*vx+normal(:,2).*vy));
Index: /issm/trunk/src/m/solutions/dakota/responsefunctions/QmuResponseValue.m
===================================================================
--- /issm/trunk/src/m/solutions/dakota/responsefunctions/QmuResponseValue.m	(revision 354)
+++ /issm/trunk/src/m/solutions/dakota/responsefunctions/QmuResponseValue.m	(revision 355)
@@ -19,4 +19,6 @@
 	case {'max_vel'}
 		value=MaxVel(md);
+	case {'mass_flux'}
+		value=MassFlux(md);
 	otherwise
 		warning('dresp_write:unrec_dresp','Unrecognized response: %s',descriptor)
