Index: /issm/branches/trunk-larour-SLPS2022/src/c/classes/FemModel.cpp
===================================================================
--- /issm/branches/trunk-larour-SLPS2022/src/c/classes/FemModel.cpp	(revision 27211)
+++ /issm/branches/trunk-larour-SLPS2022/src/c/classes/FemModel.cpp	(revision 27212)
@@ -1761,4 +1761,17 @@
 	*pV=total_ice_volume;
 
+}/*}}}*/
+void FemModel::InputToP0(int inputenum,int outputenum){/*{{{*/
+
+	IssmDouble average;
+
+	/*Collapse input to P0, by doing the average. We need to have the elements 
+	 * to do so, so loop onto elements: */
+	for(Object* & object : this->elements->objects){
+		Element* element = xDynamicCast<Element*>(object);
+		Input*  input = element->GetInput(inputenum);
+		input->GetInputAverage(&average);
+		element->AddInput(outputenum,&average,P0Enum);
+	}
 }/*}}}*/
 void FemModel::MassFluxx(IssmDouble* pmass_flux){/*{{{*/
Index: /issm/branches/trunk-larour-SLPS2022/src/c/classes/FemModel.h
===================================================================
--- /issm/branches/trunk-larour-SLPS2022/src/c/classes/FemModel.h	(revision 27211)
+++ /issm/branches/trunk-larour-SLPS2022/src/c/classes/FemModel.h	(revision 27212)
@@ -116,4 +116,5 @@
 		void IceVolumex(IssmDouble* pV, bool scaled);
 		void IceVolumeAboveFloatationx(IssmDouble* pV, bool scaled);
+		void InputToP0(int inputenum,int outputenum);
 		void InputMakeDiscontinuous(int enum_in);
 		void MassFluxx(IssmDouble* presponse);
