Index: /issm/trunk/src/c/EnumDefinitions/EnumDefinitions.h
===================================================================
--- /issm/trunk/src/c/EnumDefinitions/EnumDefinitions.h	(revision 9879)
+++ /issm/trunk/src/c/EnumDefinitions/EnumDefinitions.h	(revision 9880)
@@ -475,5 +475,4 @@
 	DragCoefficientAbsGradientEnum,
 	TransientInputEnum,
-	/*Temporary*/
 	OutputfilenameEnum,
 	WaterfractionEnum,
@@ -485,4 +484,5 @@
 	HydrologyWaterVyEnum,
 	SpcDynamicEnum,
+	IceVolumeEnum,
 	MaximumNumberOfEnums
 };
Index: /issm/trunk/src/c/Makefile.am
===================================================================
--- /issm/trunk/src/c/Makefile.am	(revision 9879)
+++ /issm/trunk/src/c/Makefile.am	(revision 9880)
@@ -544,4 +544,6 @@
 					./modules/SurfaceAreax/SurfaceAreax.h\
 					./modules/SurfaceAreax/SurfaceAreax.cpp\
+					./modules/IceVolumex/IceVolumex.h\
+					./modules/IceVolumex/IceVolumex.cpp\
 					./modules/SurfaceAbsVelMisfitx/SurfaceAbsVelMisfitx.h\
 					./modules/SurfaceAbsVelMisfitx/SurfaceAbsVelMisfitx.cpp\
@@ -1241,4 +1243,6 @@
 					  ./modules/MinVzx/MinVzx.h\
 					  ./modules/MinVzx/MinVzx.cpp\
+					  ./modules/IceVolumex/IceVolumex.h\
+					  ./modules/IceVolumex/IceVolumex.cpp\
 					  ./modules/RheologyBbarx/RheologyBbarx.cpp\
 					  ./modules/RheologyBbarx/RheologyBbarx.h\
Index: /issm/trunk/src/c/modules/EnumToStringx/EnumToStringx.cpp
===================================================================
--- /issm/trunk/src/c/modules/EnumToStringx/EnumToStringx.cpp	(revision 9879)
+++ /issm/trunk/src/c/modules/EnumToStringx/EnumToStringx.cpp	(revision 9880)
@@ -428,4 +428,5 @@
 		case HydrologyWaterVyEnum : return "HydrologyWaterVy";
 		case SpcDynamicEnum : return "SpcDynamic";
+		case IceVolumeEnum : return "IceVolume";
 		default : return "unknown";
 
Index: /issm/trunk/src/c/modules/IceVolumex/IceVolumex.cpp
===================================================================
--- /issm/trunk/src/c/modules/IceVolumex/IceVolumex.cpp	(revision 9880)
+++ /issm/trunk/src/c/modules/IceVolumex/IceVolumex.cpp	(revision 9880)
@@ -0,0 +1,26 @@
+/*!\file IceVolumex
+ * \brief: compute total ice volume
+ */
+
+#include "./IceVolumex.h"
+
+#include "../../shared/shared.h"
+#include "../../include/include.h"
+#include "../../toolkits/toolkits.h"
+#include "../../EnumDefinitions/EnumDefinitions.h"
+
+void IceVolumex(double* pV, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials,Parameters* parameters,bool process_units){
+
+	double local_ice_volume = 0;
+	double total_ice_volume;
+
+	for(int i=0;i<elements->Size();i++){
+		Element* element=(Element*)elements->GetObjectByOffset(i);
+		local_ice_volume+=element->IceVolume();
+	}
+	MPI_Reduce(&local_ice_volume,&total_ice_volume,1,MPI_DOUBLE,MPI_SUM,0,MPI_COMM_WORLD );
+	MPI_Bcast(&total_ice_volume,1,MPI_DOUBLE,0,MPI_COMM_WORLD);
+
+	/*Assign output pointers: */
+	*pV=total_ice_volume;
+}
Index: /issm/trunk/src/c/modules/IceVolumex/IceVolumex.h
===================================================================
--- /issm/trunk/src/c/modules/IceVolumex/IceVolumex.h	(revision 9880)
+++ /issm/trunk/src/c/modules/IceVolumex/IceVolumex.h	(revision 9880)
@@ -0,0 +1,14 @@
+/*!\file:  IceVolumex.h
+ * \brief header file for inverse methods misfit computation
+ */ 
+
+#ifndef _ICEVOLUMEX_H
+#define _ICEVOLUMEX_H
+
+#include "../../Container/Container.h"
+#include "../../objects/objects.h"
+
+/* local prototypes: */
+void IceVolumex(double* pV, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,bool process_units);
+
+#endif
Index: /issm/trunk/src/c/modules/RequestedOutputsx/RequestedOutputsx.cpp
===================================================================
--- /issm/trunk/src/c/modules/RequestedOutputsx/RequestedOutputsx.cpp	(revision 9879)
+++ /issm/trunk/src/c/modules/RequestedOutputsx/RequestedOutputsx.cpp	(revision 9880)
@@ -9,18 +9,29 @@
 #include "../../EnumDefinitions/EnumDefinitions.h"
 
-void RequestedOutputsx(Elements* elements,Nodes* nodes,Vertices* vertices,Loads* loads,Materials* materials,Parameters* parameters, int* requested_outputs, int numoutputs, int step, double time){
+void RequestedOutputsx(Results* results,Elements* elements,Nodes* nodes,Vertices* vertices,Loads* loads,Materials* materials,Parameters* parameters, int* requested_outputs, int numoutputs, int step, double time){
 
-	int  i,o;
+	int  i,j;
 	int  output_enum;
+	double output_value;
 	Element* element=NULL;
 
 	/*retrieve parameters: */
 	if(numoutputs){
-		for(o=0;o<numoutputs;o++){
-			output_enum=requested_outputs[o];
-			/*create this output in the element inputs, and then transfer to results: */
-			for(i=0;i<elements->Size();i++){
-				element=(Element*)elements->GetObjectByOffset(i);
-				element->RequestedOutput(output_enum,step,time);
+		for(i=0;i<numoutputs;i++){
+			output_enum=requested_outputs[i];
+
+			switch(output_enum){
+
+				case IceVolumeEnum:
+					Responsex(&output_value,elements,nodes,vertices,loads,materials,parameters,"IceVolume",false,0);
+					results->AddObject(new DoubleExternalResult(results->Size()+1,IceVolumeEnum,output_value,step,time));
+					break;
+				default:
+					/*create this output in the element inputs, and then transfer to results:*/
+					for(j=0;j<elements->Size();j++){
+						element=(Element*)elements->GetObjectByOffset(j);
+						element->RequestedOutput(output_enum,step,time);
+					}
+					break;
 			}
 		}
Index: /issm/trunk/src/c/modules/RequestedOutputsx/RequestedOutputsx.h
===================================================================
--- /issm/trunk/src/c/modules/RequestedOutputsx/RequestedOutputsx.h	(revision 9879)
+++ /issm/trunk/src/c/modules/RequestedOutputsx/RequestedOutputsx.h	(revision 9880)
@@ -9,5 +9,5 @@
 
 /* local prototypes: */
-void RequestedOutputsx(Elements* elements,Nodes* nodes,Vertices* vertices,Loads* loads,Materials* materials,Parameters* parameters, int* requested_outputs, int numoutputs, int step=1, double time=0);
+void RequestedOutputsx(Results* results,Elements* elements,Nodes* nodes,Vertices* vertices,Loads* loads,Materials* materials,Parameters* parameters, int* requested_outputs, int numoutputs, int step=1, double time=0);
 
 #endif  /* _INPUTTORESULTX_H */
Index: /issm/trunk/src/c/modules/Responsex/Responsex.cpp
===================================================================
--- /issm/trunk/src/c/modules/Responsex/Responsex.cpp	(revision 9879)
+++ /issm/trunk/src/c/modules/Responsex/Responsex.cpp	(revision 9880)
@@ -21,4 +21,5 @@
 
 		#ifdef _HAVE_RESPONSES_
+		case IceVolumeEnum:              IceVolumex(               responses, elements,nodes, vertices, loads, materials, parameters,process_units); break;
 		case MinVelEnum:                 MinVelx(                  responses, elements,nodes, vertices, loads, materials, parameters,process_units); break;
 		case MaxVelEnum:                 MaxVelx(                  responses, elements,nodes, vertices, loads, materials, parameters,process_units); break;
Index: /issm/trunk/src/c/modules/StringToEnumx/StringToEnumx.cpp
===================================================================
--- /issm/trunk/src/c/modules/StringToEnumx/StringToEnumx.cpp	(revision 9879)
+++ /issm/trunk/src/c/modules/StringToEnumx/StringToEnumx.cpp	(revision 9880)
@@ -426,4 +426,5 @@
 	else if (strcmp(name,"HydrologyWaterVy")==0) return HydrologyWaterVyEnum;
 	else if (strcmp(name,"SpcDynamic")==0) return SpcDynamicEnum;
+	else if (strcmp(name,"IceVolume")==0) return IceVolumeEnum;
 	else _error_("Enum %s not found",name);
 
Index: /issm/trunk/src/c/modules/modules.h
===================================================================
--- /issm/trunk/src/c/modules/modules.h	(revision 9879)
+++ /issm/trunk/src/c/modules/modules.h	(revision 9880)
@@ -33,4 +33,5 @@
 #include "./GroundingLineMigrationx/GroundingLineMigrationx.h"
 #include "./HoleFillerx/HoleFillerx.h"
+#include "./IceVolumex/IceVolumex.h"
 #include "./InputControlUpdatex/InputControlUpdatex.h"
 #include "./InputConvergencex/InputConvergencex.h"
Index: /issm/trunk/src/c/objects/Elements/Element.h
===================================================================
--- /issm/trunk/src/c/objects/Elements/Element.h	(revision 9879)
+++ /issm/trunk/src/c/objects/Elements/Element.h	(revision 9880)
@@ -88,4 +88,5 @@
 		virtual double MassFlux(double* segment,bool process_units)=0;
 		virtual double RheologyBbarx(void)=0;
+		virtual double IceVolume(void)=0;
 		virtual int    NodalValue(double* pvalue, int index, int natureofdataenum,bool process_units)=0;
 		#endif
Index: /issm/trunk/src/c/objects/Elements/Penta.cpp
===================================================================
--- /issm/trunk/src/c/objects/Elements/Penta.cpp	(revision 9879)
+++ /issm/trunk/src/c/objects/Elements/Penta.cpp	(revision 9880)
@@ -2667,4 +2667,27 @@
 
 #ifdef _HAVE_RESPONSES_
+/*FUNCTION Penta::IceVolume {{{1*/
+double Penta::IceVolume(void){
+
+	/*The volume of a troncated prism is base * 1/3 sum(length of edges)*/
+	double base,height;
+	double xyz_list[NUMVERTICES][3];
+
+	if(IsOnWater())return 0;
+
+	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
+
+	/*First calculate the area of the base (cross section triangle)
+	 * http://en.wikipedia.org/wiki/Pentangle
+	 * base = 1/2 abs((xA-xC)(yB-yA)-(xA-xB)(yC-yA))*/
+	base = 1./2.*fabs((xyz_list[0][0]-xyz_list[2][0])*(xyz_list[1][1]-xyz_list[0][1]) - (xyz_list[0][0]-xyz_list[1][0])*(xyz_list[2][1]-xyz_list[0][1]));
+
+	/*Now get the average height*/
+	height = 1./3.*((xyz_list[3][2]-xyz_list[0][2])+(xyz_list[4][2]-xyz_list[1][2])+(xyz_list[5][2]-xyz_list[2][2]));
+
+	/*Return: */
+	return base*height;
+}
+/*}}}*/
 /*FUNCTION Penta::RheologyBbarx{{{1*/
 double Penta::RheologyBbarx(void){
Index: /issm/trunk/src/c/objects/Elements/Penta.h
===================================================================
--- /issm/trunk/src/c/objects/Elements/Penta.h	(revision 9879)
+++ /issm/trunk/src/c/objects/Elements/Penta.h	(revision 9880)
@@ -123,4 +123,5 @@
 
 		 #ifdef _HAVE_RESPONSES_
+		double IceVolume(void);
 		void   MinVel(double* pminvel, bool process_units);
 		void   MinVx(double* pminvx, bool process_units);
Index: /issm/trunk/src/c/objects/Elements/Tria.cpp
===================================================================
--- /issm/trunk/src/c/objects/Elements/Tria.cpp	(revision 9879)
+++ /issm/trunk/src/c/objects/Elements/Tria.cpp	(revision 9880)
@@ -2663,4 +2663,30 @@
 
 #ifdef _HAVE_RESPONSES_
+/*FUNCTION Tria::IceVolume {{{1*/
+double Tria::IceVolume(void){
+
+	/*The volume of a troncated prism is base * 1/3 sum(length of edges)*/
+	double base,surface,bed;
+	double xyz_list[NUMVERTICES][3];
+
+	if(IsOnWater())return 0;
+
+	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
+
+	/*First calculate the area of the base (cross section triangle)
+	 * http://en.wikipedia.org/wiki/Triangle
+	 * base = 1/2 abs((xA-xC)(yB-yA)-(xA-xB)(yC-yA))*/
+	base = 1./2. * fabs((xyz_list[0][0]-xyz_list[2][0])*(xyz_list[1][1]-xyz_list[0][1]) - (xyz_list[0][0]-xyz_list[1][0])*(xyz_list[2][1]-xyz_list[0][1]));
+
+	/*Now get the average height*/
+	Input* surface_input = inputs->GetInput(SurfaceEnum); _assert_(surface_input);
+	Input* bed_input     = inputs->GetInput(BedEnum);     _assert_(bed_input);
+	surface_input->GetParameterAverage(&surface);
+	bed_input->GetParameterAverage(&bed);
+
+	/*Return: */
+	return base*(surface-bed);
+}
+/*}}}*/
 /*FUNCTION Tria::MassFlux {{{1*/
 double Tria::MassFlux( double* segment,bool process_units){
Index: /issm/trunk/src/c/objects/Elements/Tria.h
===================================================================
--- /issm/trunk/src/c/objects/Elements/Tria.h	(revision 9879)
+++ /issm/trunk/src/c/objects/Elements/Tria.h	(revision 9880)
@@ -124,4 +124,5 @@
 
 		#ifdef _HAVE_RESPONSES_
+		double IceVolume(void);
 		void   MinVel(double* pminvel, bool process_units);
 		void   MinVx(double* pminvx, bool process_units);
Index: /issm/trunk/src/c/solutions/diagnostic_core.cpp
===================================================================
--- /issm/trunk/src/c/solutions/diagnostic_core.cpp	(revision 9879)
+++ /issm/trunk/src/c/solutions/diagnostic_core.cpp	(revision 9880)
@@ -92,5 +92,5 @@
 		InputToResultx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,PressureEnum);
 		if(dim==3) InputToResultx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,VzEnum);
-		RequestedOutputsx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,requested_outputs,numoutputs);
+		RequestedOutputsx(femmodel->results,femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,requested_outputs,numoutputs);
 	}
 
Index: /issm/trunk/src/c/solutions/steadystate_core.cpp
===================================================================
--- /issm/trunk/src/c/solutions/steadystate_core.cpp	(revision 9879)
+++ /issm/trunk/src/c/solutions/steadystate_core.cpp	(revision 9880)
@@ -84,5 +84,5 @@
 		InputToResultx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,TemperatureEnum);
 		InputToResultx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,BasalforcingsMeltingRateEnum);
-		RequestedOutputsx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,requested_outputs,numoutputs);
+		RequestedOutputsx(femmodel->results,femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,requested_outputs,numoutputs);
 	}
 
Index: /issm/trunk/src/c/solutions/transient_core.cpp
===================================================================
--- /issm/trunk/src/c/solutions/transient_core.cpp	(revision 9879)
+++ /issm/trunk/src/c/solutions/transient_core.cpp	(revision 9880)
@@ -122,5 +122,5 @@
 			InputToResultx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,SurfaceforcingsMassBalanceEnum,step,time);
 			InputToResultx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,MaskElementonfloatingiceEnum,step,time);
-			RequestedOutputsx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,requested_outputs,numoutputs);
+			RequestedOutputsx(femmodel->results,femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,requested_outputs,numoutputs,step,time);
 
 			/*unload results*/
