Index: /issm/trunk-jpl/src/c/classes/Misfit.cpp
===================================================================
--- /issm/trunk-jpl/src/c/classes/Misfit.cpp	(revision 22427)
+++ /issm/trunk-jpl/src/c/classes/Misfit.cpp	(revision 22427)
@@ -0,0 +1,253 @@
+/*!\file Misfit.cpp
+ * \brief: Misfit object
+ */
+
+/*Headers:*/
+/*{{{*/
+#ifdef HAVE_CONFIG_H
+   #include <config.h>
+#else
+#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+#endif
+
+#include "./classes.h"
+#include "./ExternalResults/ExternalResult.h"
+#include "./ExternalResults/Results.h"
+#include "../datastructures/datastructures.h"
+#include "./Elements/Element.h"
+#include "./Elements/Elements.h"
+#include "./FemModel.h"
+#include "../modules/SurfaceAreax/SurfaceAreax.h"
+#include "../classes/Params/Parameters.h"
+#include "../classes/Inputs/Input.h"
+#include "../classes/gauss/Gauss.h"
+/*}}}*/
+		
+/*Misfit constructors, destructors :*/
+Misfit::Misfit(){/*{{{*/
+
+	this->definitionenum = -1;
+	this->name = NULL;
+	this->model_enum = UNDEF;
+	this->observation_enum = UNDEF;
+	this->weights_enum = UNDEF;
+	this->timeinterpolation=NULL;
+	this->local=1;
+	this->misfit=0;
+	this->lock=0;
+
+}
+/*}}}*/
+Misfit::Misfit(char* in_name, int in_definitionenum, int in_model_enum, int in_observation_enum, char* in_timeinterpolation, int in_local, int in_weights_enum){/*{{{*/
+
+	this->definitionenum=in_definitionenum;
+	
+	this->name		= xNew<char>(strlen(in_name)+1);
+	xMemCpy<char>(this->name,in_name,strlen(in_name)+1);
+
+	this->timeinterpolation = xNew<char>(strlen(in_timeinterpolation)+1);
+	xMemCpy<char>(this->timeinterpolation,in_timeinterpolation,strlen(in_timeinterpolation)+1);
+				
+	this->model_enum=in_model_enum;
+	this->observation_enum=in_observation_enum;
+	this->weights_enum=in_weights_enum;
+	this->local=in_local;
+	
+	this->misfit=0;
+	this->lock=0;
+}
+/*}}}*/
+Misfit::~Misfit(){/*{{{*/
+	if(this->name)xDelete(this->name);
+	if(this->timeinterpolation)xDelete(this->timeinterpolation);
+	this->misfit=0;
+	this->lock=0;
+}
+/*}}}*/
+/*Object virtual function resolutoin: */
+Object* Misfit::copy() {/*{{{*/
+	Misfit* mf = new Misfit(this->name,this->definitionenum, this->model_enum,this->observation_enum,this->timeinterpolation,this->local,this->weights_enum);
+	mf->misfit=this->misfit;
+	mf->lock=this->lock;
+	return (Object*) mf;
+}
+/*}}}*/
+void Misfit::DeepEcho(void){/*{{{*/
+	this->Echo();
+}
+/*}}}*/
+void Misfit::Echo(void){/*{{{*/
+	_printf_(" Misfit: " << name << " " << this->definitionenum << "\n");
+	_printf_("    model_enum: " << model_enum << " " << EnumToStringx(model_enum) << "\n");
+	_printf_("    observation_enum: " << observation_enum << " " << EnumToStringx(observation_enum) << "\n");
+	_printf_("    weights_enum: " << weights_enum << " " << EnumToStringx(weights_enum) << "\n");
+	_printf_("    timeinterpolation: " << timeinterpolation << "\n");
+	_printf_("    local: " << local << "\n");
+}
+/*}}}*/
+int Misfit::Id(void){/*{{{*/
+	return -1;
+}
+/*}}}*/
+void Misfit::Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){/*{{{*/
+	_error_("not implemented yet!"); 
+} 
+/*}}}*/
+int Misfit::ObjectEnum(void){/*{{{*/
+	return MisfitEnum;
+}
+/*}}}*/
+/*Definition virtual function resolutoin: */
+int Misfit::DefinitionEnum(){/*{{{*/
+	return this->definitionenum;
+}
+/*}}}*/
+char* Misfit::Name(){/*{{{*/
+	char* name2=xNew<char>(strlen(this->name)+1);
+	xMemCpy(name2,this->name,strlen(this->name)+1);
+
+	return name2;
+}
+/*}}}*/
+IssmDouble Misfit::Response(FemModel* femmodel){/*{{{*/
+		 
+	 /*diverse: */
+	 IssmDouble time,starttime,finaltime;
+	 IssmDouble dt;
+	 
+	 /*recover time parameters: */
+	 femmodel->parameters->FindParam(&starttime,TimesteppingStartTimeEnum);
+	 femmodel->parameters->FindParam(&finaltime,TimesteppingFinalTimeEnum);
+	 femmodel->parameters->FindParam(&time,TimeEnum);
+	 femmodel->parameters->FindParam(&dt,TimesteppingTimeStepEnum);
+
+	 if (this->local==1){ /*area integration using elements: {{{*/
+
+		 int i;
+		 IssmDouble misfit_t=0.;
+		 IssmDouble all_misfit_t=0.;
+		 IssmDouble area_t=0.;
+		 IssmDouble all_area_t;
+
+	
+		 /*If we are locked, return time average: */
+		 if(this->lock)return misfit/(time-starttime);
+
+		 for(i=0;i<femmodel->elements->Size();i++){
+			 Element* element=(Element*)femmodel->elements->GetObjectByOffset(i);
+			 misfit_t+=element->Misfit(model_enum,observation_enum,weights_enum);
+			 area_t+=element->MisfitArea(weights_enum);
+		 }
+
+		 ISSM_MPI_Allreduce ( (void*)&misfit_t,(void*)&all_misfit_t,1,ISSM_MPI_DOUBLE,ISSM_MPI_SUM,IssmComm::GetComm());
+		 ISSM_MPI_Allreduce ( (void*)&area_t,(void*)&all_area_t,1,ISSM_MPI_DOUBLE,ISSM_MPI_SUM,IssmComm::GetComm());
+		 area_t=all_area_t;
+		 misfit_t=all_misfit_t;
+		 
+		 /*Divide by surface area if not nill!: */
+		 if (area_t!=0) misfit_t=misfit_t/area_t;
+
+		 /*Add this time's contribution to curent misfit: */
+		 misfit+=dt*misfit_t;
+
+		 /*Do we lock? i.e. are we at final_time? :*/
+		 if(time==finaltime)this->lock=1;
+
+		 /*What we return is the value of misfit / time if transient*/
+		 if(time!=0.) return misfit/(time-starttime); 
+		 return misfit;
+	 } /*}}}*/
+	 else if (this->local==2){ /*vertex by vertex computation: {{{*/
+
+		 IssmDouble* model = NULL;
+		 IssmDouble* observation= NULL;
+		 IssmDouble* weights= NULL;
+		 int msize,osize,wsize;
+		 
+		 /*Are we transient?:*/
+		 if (time==0){
+			 IssmDouble misfit_t=0.;
+			 
+			 /*get global vectors: */
+			 GetVectorFromInputsx(&model,&msize,femmodel,model_enum);
+			 GetVectorFromInputsx(&observation,&osize,femmodel,observation_enum);_assert_(msize==osize);
+			 GetVectorFromInputsx(&weights,&wsize,femmodel,weights_enum); _assert_(wsize==msize);
+
+			 int count=0;
+			 for (int i=0;i<msize;i++){
+				 misfit_t += pow(model[i]-observation[i],2)*weights[i];
+				 if (weights[i]!=0)count++;
+			 }
+			 misfit=sqrt(misfit_t/count);
+
+			 /*Free ressources:*/
+			 xDelete<IssmDouble>(model);
+			 xDelete<IssmDouble>(observation);
+			 xDelete<IssmDouble>(weights);
+
+			 /*return value: */
+			 return misfit;
+		 }
+		 else{
+			 
+			 IssmDouble misfit_t=0.;
+			 IssmDouble all_misfit_t=0.;
+
+			 /*If we are locked, return time average: */
+			 if(this->lock)return misfit/(time-starttime);
+
+			 /*get global vectors: */
+			 GetVectorFromInputsx(&model,&msize,femmodel,model_enum);
+			 GetVectorFromInputsx(&observation,&osize,femmodel,observation_enum);_assert_(msize==osize);
+			 GetVectorFromInputsx(&weights,&wsize,femmodel,weights_enum); _assert_(wsize==msize);
+			 
+			 int count=0;
+			 for (int i=0;i<msize;i++){
+				 misfit_t += pow(model[i]-observation[i],2)*weights[i];
+				 if (weights[i]!=0)count++;
+			 }
+			 misfit=sqrt(misfit_t/count);
+
+			 /*Add this time's contribution to curent misfit: */
+			 misfit=sqrt(misfit_t)/count;
+			 misfit+=dt*misfit_t;
+
+			 /*Do we lock? i.e. are we at final_time? :*/
+			 if(time==finaltime)this->lock=1;
+			 
+			 /*Free ressources:*/
+			 xDelete<IssmDouble>(model);
+			 xDelete<IssmDouble>(observation);
+			 xDelete<IssmDouble>(weights);
+
+			 /*What we return is the value of misfit / time: */
+			 return misfit/(time-starttime);
+		 }
+
+	 } /*}}}*/
+	 else{ /*global computation: {{{ */
+		 
+		 IssmDouble model, observation;
+		 
+		 /*If we are locked, return time average: */
+		 if(this->lock)return misfit/(time-starttime);
+
+		 /*First, the global  model response: */
+		 model=OutputDefinitionsResponsex(femmodel,this->model_enum);
+		 /*Now, the observation is buried inside the elements, go fish it in the first element (cludgy, needs fixing): */
+		 Element* element=(Element*)femmodel->elements->GetObjectByOffset(0); _assert_(element);
+		 Input* input = element->GetInput(observation_enum); _assert_(input);
+		 input->GetInputAverage(&observation);
+		 
+		 /*Add this time's contribution to curent misfit: */
+		 misfit+=dt*(model-observation);
+		 
+		 /*Do we lock? i.e. are we at final_time? :*/
+		 if(time==finaltime)this->lock=1;
+		 
+		 /*What we return is the value of misfit / time: */
+		 return misfit/(time-starttime);
+	 } /*}}}*/
+
+ }
+	/*}}}*/
Index: /issm/trunk-jpl/src/c/classes/Misfit.h
===================================================================
--- /issm/trunk-jpl/src/c/classes/Misfit.h	(revision 22426)
+++ /issm/trunk-jpl/src/c/classes/Misfit.h	(revision 22427)
@@ -7,5 +7,4 @@
 
 /*Headers:*/
-/*{{{*/
 #include "./Definition.h"
 #include "../datastructures/datastructures.h"
@@ -17,7 +16,7 @@
 #include "../classes/Inputs/Input.h"
 #include "../classes/gauss/Gauss.h"
-/*}}}*/
+
 IssmDouble OutputDefinitionsResponsex(FemModel* femmodel,int output_enum);
-void	GetVectorFromInputsx( IssmDouble** pvector, int* pvector_size, FemModel* femmodel,int name);
+void  GetVectorFromInputsx( IssmDouble** pvector, int* pvector_size, FemModel* femmodel,int name);
 
 class Misfit: public Object, public Definition{
@@ -37,232 +36,20 @@
 		
 		/*Misfit constructors, destructors :*/
-		Misfit(){/*{{{*/
-
-			this->definitionenum = -1;
-			this->name = NULL;
-			this->model_enum = UNDEF;
-			this->observation_enum = UNDEF;
-			this->weights_enum = UNDEF;
-			this->timeinterpolation=NULL;
-			this->local=1;
-			this->misfit=0;
-			this->lock=0;
-
-		}
-		/*}}}*/
-		Misfit(char* in_name, int in_definitionenum, int in_model_enum, int in_observation_enum, char* in_timeinterpolation, int in_local, int in_weights_enum){/*{{{*/
-
-			this->definitionenum=in_definitionenum;
-			
-			this->name		= xNew<char>(strlen(in_name)+1);
-			xMemCpy<char>(this->name,in_name,strlen(in_name)+1);
-
-			this->timeinterpolation = xNew<char>(strlen(in_timeinterpolation)+1);
-			xMemCpy<char>(this->timeinterpolation,in_timeinterpolation,strlen(in_timeinterpolation)+1);
-						
-			this->model_enum=in_model_enum;
-			this->observation_enum=in_observation_enum;
-			this->weights_enum=in_weights_enum;
-			this->local=in_local;
-			
-			this->misfit=0;
-			this->lock=0;
-		}
-		/*}}}*/
-		~Misfit(){/*{{{*/
-			if(this->name)xDelete(this->name);
-			if(this->timeinterpolation)xDelete(this->timeinterpolation);
-			this->misfit=0;
-			this->lock=0;
-		}
-		/*}}}*/
+		Misfit();
+		Misfit(char* in_name, int in_definitionenum, int in_model_enum, int in_observation_enum, char* in_timeinterpolation, int in_local, int in_weights_enum);
+		~Misfit();
+		
 		/*Object virtual function resolutoin: */
-		Object* copy() {/*{{{*/
-			Misfit* mf = new Misfit(this->name,this->definitionenum, this->model_enum,this->observation_enum,this->timeinterpolation,this->local,this->weights_enum);
-			mf->misfit=this->misfit;
-			mf->lock=this->lock;
-			return (Object*) mf;
-		}
-		/*}}}*/
-		void DeepEcho(void){/*{{{*/
-			this->Echo();
-		}
-		/*}}}*/
-		void Echo(void){/*{{{*/
-			_printf_(" Misfit: " << name << " " << this->definitionenum << "\n");
-			_printf_("    model_enum: " << model_enum << " " << EnumToStringx(model_enum) << "\n");
-			_printf_("    observation_enum: " << observation_enum << " " << EnumToStringx(observation_enum) << "\n");
-			_printf_("    weights_enum: " << weights_enum << " " << EnumToStringx(weights_enum) << "\n");
-			_printf_("    timeinterpolation: " << timeinterpolation << "\n");
-			_printf_("    local: " << local << "\n");
-		}
-		/*}}}*/
-		int Id(void){/*{{{*/
-			return -1;
-		}
-		/*}}}*/
-		void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){/*{{{*/
-			_error_("not implemented yet!"); 
-		} 
-		/*}}}*/
-		int ObjectEnum(void){/*{{{*/
-			return MisfitEnum;
-		}
-		/*}}}*/
+		Object* copy();
+		void DeepEcho(void);
+		void Echo(void);
+		int Id(void);
+		void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction);
+		int ObjectEnum(void);
+		
 		/*Definition virtual function resolutoin: */
-		int DefinitionEnum(){/*{{{*/
-			return this->definitionenum;
-		}
-		/*}}}*/
-		char* Name(){/*{{{*/
-			char* name2=xNew<char>(strlen(this->name)+1);
-			xMemCpy(name2,this->name,strlen(this->name)+1);
-
-			return name2;
-		}
-		/*}}}*/
-		 IssmDouble Response(FemModel* femmodel){/*{{{*/
-				 
-			 /*diverse: */
-			 IssmDouble time,starttime,finaltime;
-			 IssmDouble dt;
-			 
-			 /*recover time parameters: */
-			 femmodel->parameters->FindParam(&starttime,TimesteppingStartTimeEnum);
-			 femmodel->parameters->FindParam(&finaltime,TimesteppingFinalTimeEnum);
-			 femmodel->parameters->FindParam(&time,TimeEnum);
-			 femmodel->parameters->FindParam(&dt,TimesteppingTimeStepEnum);
-
-			 if (this->local==1){ /*area integration using elements: {{{*/
-
-				 int i;
-				 IssmDouble misfit_t=0.;
-				 IssmDouble all_misfit_t=0.;
-				 IssmDouble area_t=0.;
-				 IssmDouble all_area_t;
-
-			
-				 /*If we are locked, return time average: */
-				 if(this->lock)return misfit/(time-starttime);
-
-				 for(i=0;i<femmodel->elements->Size();i++){
-					 Element* element=(Element*)femmodel->elements->GetObjectByOffset(i);
-					 misfit_t+=element->Misfit(model_enum,observation_enum,weights_enum);
-					 area_t+=element->MisfitArea(weights_enum);
-				 }
-
-				 ISSM_MPI_Allreduce ( (void*)&misfit_t,(void*)&all_misfit_t,1,ISSM_MPI_DOUBLE,ISSM_MPI_SUM,IssmComm::GetComm());
-				 ISSM_MPI_Allreduce ( (void*)&area_t,(void*)&all_area_t,1,ISSM_MPI_DOUBLE,ISSM_MPI_SUM,IssmComm::GetComm());
-				 area_t=all_area_t;
-				 misfit_t=all_misfit_t;
-				 
-				 /*Divide by surface area if not nill!: */
-				 if (area_t!=0) misfit_t=misfit_t/area_t;
-
-				 /*Add this time's contribution to curent misfit: */
-				 misfit+=dt*misfit_t;
-
-				 /*Do we lock? i.e. are we at final_time? :*/
-				 if(time==finaltime)this->lock=1;
-
-				 /*What we return is the value of misfit / time if transient*/
-				 if(time!=0.) return misfit/(time-starttime); 
-				 return misfit;
-			 } /*}}}*/
-			 else if (this->local==2){ /*vertex by vertex computation: {{{*/
-
-				 IssmDouble* model = NULL;
-				 IssmDouble* observation= NULL;
-				 IssmDouble* weights= NULL;
-				 int msize,osize,wsize;
-				 
-				 /*Are we transient?:*/
-				 if (time==0){
-					 IssmDouble misfit_t=0.;
-					 
-					 /*get global vectors: */
-					 GetVectorFromInputsx(&model,&msize,femmodel,model_enum);
-					 GetVectorFromInputsx(&observation,&osize,femmodel,observation_enum);_assert_(msize==osize);
-					 GetVectorFromInputsx(&weights,&wsize,femmodel,weights_enum); _assert_(wsize==msize);
-
-					 int count=0;
-					 for (int i=0;i<msize;i++){
-						 misfit_t += pow(model[i]-observation[i],2)*weights[i];
-						 if (weights[i]!=0)count++;
-					 }
-					 misfit=sqrt(misfit_t/count);
-
-					 /*Free ressources:*/
-					 xDelete<IssmDouble>(model);
-					 xDelete<IssmDouble>(observation);
-					 xDelete<IssmDouble>(weights);
-
-					 /*return value: */
-					 return misfit;
-				 }
-				 else{
-					 
-					 IssmDouble misfit_t=0.;
-					 IssmDouble all_misfit_t=0.;
-
-					 /*If we are locked, return time average: */
-					 if(this->lock)return misfit/(time-starttime);
-
-					 /*get global vectors: */
-					 GetVectorFromInputsx(&model,&msize,femmodel,model_enum);
-					 GetVectorFromInputsx(&observation,&osize,femmodel,observation_enum);_assert_(msize==osize);
-					 GetVectorFromInputsx(&weights,&wsize,femmodel,weights_enum); _assert_(wsize==msize);
-					 
-					 int count=0;
-					 for (int i=0;i<msize;i++){
-						 misfit_t += pow(model[i]-observation[i],2)*weights[i];
-						 if (weights[i]!=0)count++;
-					 }
-					 misfit=sqrt(misfit_t/count);
-
-					 /*Add this time's contribution to curent misfit: */
-					 misfit=sqrt(misfit_t)/count;
-					 misfit+=dt*misfit_t;
-
-					 /*Do we lock? i.e. are we at final_time? :*/
-					 if(time==finaltime)this->lock=1;
-					 
-					 /*Free ressources:*/
-					 xDelete<IssmDouble>(model);
-					 xDelete<IssmDouble>(observation);
-					 xDelete<IssmDouble>(weights);
-
-					 /*What we return is the value of misfit / time: */
-					 return misfit/(time-starttime);
-				 }
-
-			 } /*}}}*/
-			 else{ /*global computation: {{{ */
-				 
-				 IssmDouble model, observation;
-				 
-				 /*If we are locked, return time average: */
-				 if(this->lock)return misfit/(time-starttime);
-
-				 /*First, the global  model response: */
-				 model=OutputDefinitionsResponsex(femmodel,this->model_enum);
-				 /*Now, the observation is buried inside the elements, go fish it in the first element (cludgy, needs fixing): */
-				 Element* element=(Element*)femmodel->elements->GetObjectByOffset(0); _assert_(element);
-				 Input* input = element->GetInput(observation_enum); _assert_(input);
-				 input->GetInputAverage(&observation);
-				 
-				 /*Add this time's contribution to curent misfit: */
-				 misfit+=dt*(model-observation);
-				 
-				 /*Do we lock? i.e. are we at final_time? :*/
-				 if(time==finaltime)this->lock=1;
-				 
-				 /*What we return is the value of misfit / time: */
-				 return misfit/(time-starttime);
-			 } /*}}}*/
-
-		 }
-			/*}}}*/
+		int DefinitionEnum();
+		char* Name();
+		IssmDouble Response(FemModel* femmodel);
 };
-
 #endif  /* _MISFIT_H_ */
Index: /issm/trunk-jpl/src/c/classes/Nodalvalue.cpp
===================================================================
--- /issm/trunk-jpl/src/c/classes/Nodalvalue.cpp	(revision 22427)
+++ /issm/trunk-jpl/src/c/classes/Nodalvalue.cpp	(revision 22427)
@@ -0,0 +1,103 @@
+/*!\file Nodalvalue.h
+ * \brief: header file for Nodalvalue object
+ */
+#ifdef HAVE_CONFIG_H
+   #include <config.h>
+#else
+#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+#endif
+
+/*Headers:*/
+/*{{{*/
+#include "./Elements/Element.h"
+#include "./Elements/Elements.h"
+#include "./FemModel.h"
+#include "../modules/SurfaceAreax/SurfaceAreax.h"
+#include "../classes/Params/Parameters.h"
+#include "../classes/Inputs/Input.h"
+#include "../classes/gauss/Gauss.h"
+#include "./classes.h"
+/*}}}*/
+
+		/*Nodalvalue constructors, destructors :*/
+Nodalvalue::Nodalvalue(){/*{{{*/
+
+	this->definitionenum = -1;
+	this->name = NULL;
+	this->model_enum = UNDEF;
+	this->node = -1;
+
+}
+/*}}}*/
+Nodalvalue::Nodalvalue(char* in_name, int in_definitionenum, int in_model_enum, int in_node){/*{{{*/
+
+	this->definitionenum=in_definitionenum;
+	this->name   = xNew<char>(strlen(in_name)+1);
+	xMemCpy<char>(this->name,in_name,strlen(in_name)+1);
+
+	this->model_enum=in_model_enum;
+	this->node=in_node;
+}
+/*}}}*/
+Nodalvalue::~Nodalvalue(){/*{{{*/
+	if(this->name)xDelete(this->name);
+}
+/*}}}*/
+/*Object virtual function resolutoin: */
+Object* Nodalvalue::copy() {/*{{{*/
+	Nodalvalue* mf = new Nodalvalue(this->name,this->definitionenum, this->model_enum,this->node);
+	return (Object*) mf;
+}
+/*}}}*/
+void Nodalvalue::DeepEcho(void){/*{{{*/
+	this->Echo();
+}
+/*}}}*/
+void Nodalvalue::Echo(void){/*{{{*/
+	_printf_(" Nodalvalue: " << name << " " << this->definitionenum << "\n");
+	_printf_("    model_enum: " << model_enum << " " << EnumToStringx(model_enum) << "\n");
+	_printf_("    node: " << node << "\n");
+}
+/*}}}*/
+int Nodalvalue::Id(void){/*{{{*/
+	return -1;
+}
+/*}}}*/
+void Nodalvalue::Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){/*{{{*/
+	_error_("not implemented yet!"); 
+} 
+/*}}}*/
+int Nodalvalue::ObjectEnum(void){/*{{{*/
+	return NodalvalueEnum;
+}
+/*}}}*/
+/*Definition virtual function resolutoin: */
+int Nodalvalue::DefinitionEnum(){/*{{{*/
+
+	return this->definitionenum;
+}
+/*}}}*/
+char* Nodalvalue::Name(){/*{{{*/
+
+	char* name2=xNew<char>(strlen(this->name)+1);
+	xMemCpy(name2,this->name,strlen(this->name)+1);
+
+	return name2;
+}
+/*}}}*/
+IssmDouble Nodalvalue::Response(FemModel* femmodel){/*{{{*/
+	
+	 /*output:*/
+	 IssmDouble value;
+
+	 /*set index, which will be used by the NodalValue module: */
+	 femmodel->parameters->SetParam(node,IndexEnum);
+
+	 /*call Nodalvalue:*/
+	 NodalValuex(&value, model_enum, femmodel->elements, femmodel->nodes, femmodel->vertices, femmodel->loads, 
+			 femmodel->materials, femmodel->parameters);
+
+	 /*done:*/
+	 return value;
+ }
+ /*}}}*/
Index: /issm/trunk-jpl/src/c/classes/Nodalvalue.h
===================================================================
--- /issm/trunk-jpl/src/c/classes/Nodalvalue.h	(revision 22426)
+++ /issm/trunk-jpl/src/c/classes/Nodalvalue.h	(revision 22427)
@@ -32,85 +32,20 @@
 		
 		/*Nodalvalue constructors, destructors :*/
-		Nodalvalue(){/*{{{*/
+Nodalvalue();
+Nodalvalue(char* in_name, int in_definitionenum, int in_model_enum, int in_node);
+~Nodalvalue();
 
-			this->definitionenum = -1;
-			this->name = NULL;
-			this->model_enum = UNDEF;
-			this->node = -1;
+/*Object virtual function resolutoin: */
+Object* copy();
+void DeepEcho(void);
+void Echo(void);
+int Id(void);
+void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction);
+int ObjectEnum(void);
 
-		}
-		/*}}}*/
-		Nodalvalue(char* in_name, int in_definitionenum, int in_model_enum, int in_node){/*{{{*/
-
-			this->definitionenum=in_definitionenum;
-			this->name   = xNew<char>(strlen(in_name)+1);
-			xMemCpy<char>(this->name,in_name,strlen(in_name)+1);
-
-			this->model_enum=in_model_enum;
-			this->node=in_node;
-		}
-		/*}}}*/
-		~Nodalvalue(){/*{{{*/
-			if(this->name)xDelete(this->name);
-		}
-		/*}}}*/
-		/*Object virtual function resolutoin: */
-		Object* copy() {/*{{{*/
-			Nodalvalue* mf = new Nodalvalue(this->name,this->definitionenum, this->model_enum,this->node);
-			return (Object*) mf;
-		}
-		/*}}}*/
-		void DeepEcho(void){/*{{{*/
-			this->Echo();
-		}
-		/*}}}*/
-		void Echo(void){/*{{{*/
-			_printf_(" Nodalvalue: " << name << " " << this->definitionenum << "\n");
-			_printf_("    model_enum: " << model_enum << " " << EnumToStringx(model_enum) << "\n");
-			_printf_("    node: " << node << "\n");
-		}
-		/*}}}*/
-		int Id(void){/*{{{*/
-			return -1;
-		}
-		/*}}}*/
-		void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){/*{{{*/
-			_error_("not implemented yet!"); 
-		} 
-		/*}}}*/
-		int ObjectEnum(void){/*{{{*/
-			return NodalvalueEnum;
-		}
-		/*}}}*/
-		/*Definition virtual function resolutoin: */
-		int DefinitionEnum(){/*{{{*/
-
-			return this->definitionenum;
-		}
-		/*}}}*/
-		char* Name(){/*{{{*/
-
-			char* name2=xNew<char>(strlen(this->name)+1);
-			xMemCpy(name2,this->name,strlen(this->name)+1);
-
-			return name2;
-		}
-		/*}}}*/
-		 IssmDouble Response(FemModel* femmodel){/*{{{*/
-			
-			 /*output:*/
-			 IssmDouble value;
-
-			 /*set index, which will be used by the NodalValue module: */
-			 femmodel->parameters->SetParam(node,IndexEnum);
-
-			 /*call Nodalvalue:*/
-			 NodalValuex(&value, model_enum, femmodel->elements, femmodel->nodes, femmodel->vertices, femmodel->loads, 
-					 femmodel->materials, femmodel->parameters);
-
-			 /*done:*/
-			 return value;
-		 }
-		 /*}}}*/
+/*Definition virtual function resolutoin: */
+int DefinitionEnum();
+char* Name();
+IssmDouble Response(FemModel* femmodel);
 };
 
Index: /issm/trunk-jpl/src/c/classes/Regionaloutput.cpp
===================================================================
--- /issm/trunk-jpl/src/c/classes/Regionaloutput.cpp	(revision 22427)
+++ /issm/trunk-jpl/src/c/classes/Regionaloutput.cpp	(revision 22427)
@@ -0,0 +1,157 @@
+/*!\file Regionaloutput.cpp
+ * \brief: implementation for the Regionaloutput object
+ */
+
+/*Include files: {{{*/
+#ifdef HAVE_CONFIG_H
+   #include <config.h>
+#else
+#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+#endif
+
+/*Headers:*/
+#include "./classes.h"
+#include "./Definition.h"
+#include "./Elements/Element.h"
+#include "./Elements/Elements.h"
+#include "./FemModel.h"
+#include "../classes/Params/Parameters.h"
+
+/*}}}*/
+
+Regionaloutput::Regionaloutput(char* in_name, int in_definitionenum, char* in_outputname, IssmDouble* maskin, int Min){ /*{{{*/
+
+	this->definitionenum=in_definitionenum;
+	this->outputname = xNew<char>(strlen(in_outputname)+1);
+	xMemCpy<char>(this->outputname,in_outputname,strlen(in_outputname)+1);
+	this->name = xNew<char>(strlen(in_name)+1);
+	xMemCpy<char>(this->name,in_name,strlen(in_name)+1);
+
+	this->mask   = xNew<IssmDouble>(Min);
+	xMemCpy<IssmDouble>(this->mask, maskin, Min);
+
+	this->M=Min;
+
+}
+/*}}}*/
+Regionaloutput::~Regionaloutput(){/*{{{*/
+	if(this->name)xDelete(this->name); 
+	if(this->outputname)xDelete(this->outputname);
+	if(this->mask)xDelete(this->mask);
+}
+/*}}}*/
+
+/*Object virtual function resolutoin: */
+Object* Regionaloutput::copy() {/*{{{*/
+	Regionaloutput* mf = new Regionaloutput(this->name,this->definitionenum,this->outputname,this->mask,this->M);
+	return (Object*) mf;
+}
+/*}}}*/
+void Regionaloutput::DeepEcho(void){/*{{{*/
+	this->Echo();
+}
+/*}}}*/
+void Regionaloutput::Echo(void){/*{{{*/
+	_printf_(" Regionaloutput: " << this->name << " " << this->definitionenum << "\n");
+	_printf_("    outputname enum: " << this->outputname << "Enum\n");
+	_printf_("    mask: " << this->mask << "\n");
+	_printf_("    M: " << this->M << "\n");
+}
+/*}}}*/
+int Regionaloutput::Id(void){/*{{{*/
+	return -1;
+}
+/*}}}*/
+void Regionaloutput::Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){/*{{{*/
+	_error_("not implemented yet!"); 
+} 
+/*}}}*/
+int Regionaloutput::ObjectEnum(void){/*{{{*/
+	return RegionaloutputEnum;
+}
+/*}}}*/
+
+/*Definition virtual function resolutoin: */
+int Regionaloutput::DefinitionEnum(){/*{{{*/
+
+	return this->definitionenum;
+}
+/*}}}*/
+char* Regionaloutput::Name(){/*{{{*/
+
+	char* name2=xNew<char>(strlen(this->name)+1);
+	xMemCpy(name2,this->name,strlen(this->name)+1);
+
+	return name2;
+}
+/*}}}*/
+IssmDouble Regionaloutput::Response(FemModel* femmodel){/*{{{*/
+
+	int i;
+	IssmDouble val_t=0.;
+	IssmDouble all_val_t=0.;
+	int outputenum = StringToEnumx(this->outputname);
+
+	for(i=0;i<femmodel->elements->Size();i++){
+		Element* element=(Element*)femmodel->elements->GetObjectByOffset(i);
+		switch(outputenum){
+			case GroundedAreaEnum:
+				val_t+=element->GroundedArea(this->mask,false);
+				break;
+			case GroundedAreaScaledEnum:
+				val_t+=element->GroundedArea(this->mask,true);
+				break;
+			case FloatingAreaEnum:
+				val_t+=element->FloatingArea(this->mask,false);
+				break;
+			case FloatingAreaScaledEnum:
+				val_t+=element->FloatingArea(this->mask,true);
+				break;
+			case IceMassEnum:
+				val_t+=element->IceMass(this->mask,false);
+				break;
+			case IceMassScaledEnum:
+				val_t+=element->IceMass(this->mask,true);
+				break;
+			case IceVolumeEnum:
+				val_t+=element->IceVolume(this->mask,false);
+				break;
+			case IceVolumeScaledEnum:
+				val_t+=element->IceVolume(this->mask,true);
+				break;
+			case IceVolumeAboveFloatationEnum:
+				val_t+=element->IceVolumeAboveFloatation(this->mask,false);
+				break;
+			case IceVolumeAboveFloatationScaledEnum:
+				val_t+=element->IceVolumeAboveFloatation(this->mask,true);
+				break;
+			case TotalFloatingBmbEnum:
+				val_t+=element->TotalFloatingBmb(this->mask,false);
+				break;
+			case TotalFloatingBmbScaledEnum:
+				val_t+=element->TotalFloatingBmb(this->mask,true);
+				break;
+			case TotalGroundedBmbEnum:
+				val_t+=element->TotalGroundedBmb(this->mask,false);
+				break;
+			case TotalGroundedBmbScaledEnum:
+				val_t+=element->TotalGroundedBmb(this->mask,true);
+				break;
+			case TotalSmbEnum:
+				val_t+=element->TotalSmb(this->mask,false);
+				break;
+			case TotalSmbScaledEnum:
+				val_t+=element->TotalSmb(this->mask,true);
+				break;
+			default:
+				_error_("Regional output type " << this->outputname << " not supported yet!");
+		}
+	}
+
+	ISSM_MPI_Allreduce ( (void*)&val_t,(void*)&all_val_t,1,ISSM_MPI_DOUBLE,ISSM_MPI_SUM,IssmComm::GetComm());
+	val_t=all_val_t;
+
+	return val_t;
+}
+/*}}}*/
+
Index: /issm/trunk-jpl/src/c/classes/Regionaloutput.h
===================================================================
--- /issm/trunk-jpl/src/c/classes/Regionaloutput.h	(revision 22426)
+++ /issm/trunk-jpl/src/c/classes/Regionaloutput.h	(revision 22427)
@@ -19,157 +19,29 @@
 class Regionaloutput: public Object, public Definition{
 
-	public: 
+public: 
 
-		int         definitionenum;
-		char*       outputname;
-		char*       name;
-		IssmDouble* mask;
-		int         M;
-		
-		/*Regionalicevolume: constructors, destructors :*/
-		Regionaloutput(){/*{{{*/
+	int         definitionenum;
+	char*       outputname;
+	char*       name;
+	IssmDouble* mask;
+	int         M;
+	
+/*Regionalicevolume: constructors, destructors :*/
+Regionaloutput();
+Regionaloutput(char* in_name, int in_definitionenum, char* in_outputname, IssmDouble* maskin, int Min);
+~Regionaloutput();
 
-			this->definitionenum = -1;
-			this->outputname = NULL;
-			this->name = NULL;
-			this->mask=NULL;
-			this->M=0;
+/*Object virtual function resolutoin: */
+Object* copy();
+void DeepEcho(void);
+void Echo(void);
+int Id(void);
+void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction);
+int ObjectEnum(void);
 
-		}
-		/*}}}*/
-		Regionaloutput(char* in_name, int in_definitionenum, char* in_outputname, IssmDouble* maskin, int Min){ /*{{{*/
-
-			this->definitionenum=in_definitionenum;
-			this->outputname = xNew<char>(strlen(in_outputname)+1);
-			xMemCpy<char>(this->outputname,in_outputname,strlen(in_outputname)+1);
-			this->name = xNew<char>(strlen(in_name)+1);
-			xMemCpy<char>(this->name,in_name,strlen(in_name)+1);
-
-			this->mask   = xNew<IssmDouble>(Min);
-			xMemCpy<IssmDouble>(this->mask, maskin, Min);
-
-			this->M=Min;
-
-		}
-		/*}}}*/
-		~Regionaloutput(){/*{{{*/
-			if(this->name)xDelete(this->name); 
-			if(this->outputname)xDelete(this->outputname);
-			if(this->mask)xDelete(this->mask);
-		}
-		/*}}}*/
-		/*Object virtual function resolutoin: */
-		Object* copy() {/*{{{*/
-			Regionaloutput* mf = new Regionaloutput(this->name,this->definitionenum,this->outputname,this->mask,this->M);
-			return (Object*) mf;
-		}
-		/*}}}*/
-		void DeepEcho(void){/*{{{*/
-			this->Echo();
-		}
-		/*}}}*/
-		void Echo(void){/*{{{*/
-			_printf_(" Regionaloutput: " << this->name << " " << this->definitionenum << "\n");
-			_printf_("    outputname enum: " << this->outputname << "Enum\n");
-			_printf_("    mask: " << this->mask << "\n");
-			_printf_("    M: " << this->M << "\n");
-		}
-		/*}}}*/
-		int Id(void){/*{{{*/
-			return -1;
-		}
-		/*}}}*/
-		void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){/*{{{*/
-			_error_("not implemented yet!"); 
-		} 
-		/*}}}*/
-		int ObjectEnum(void){/*{{{*/
-			return RegionaloutputEnum;
-		}
-		/*}}}*/
-		/*Definition virtual function resolutoin: */
-		int DefinitionEnum(){/*{{{*/
-
-			return this->definitionenum;
-		}
-		/*}}}*/
-		char* Name(){/*{{{*/
-
-			char* name2=xNew<char>(strlen(this->name)+1);
-			xMemCpy(name2,this->name,strlen(this->name)+1);
-
-			return name2;
-		}
-		/*}}}*/
-		IssmDouble Response(FemModel* femmodel){/*{{{*/
-
-			int i;
-			IssmDouble val_t=0.;
-			IssmDouble all_val_t=0.;
-			int outputenum = StringToEnumx(this->outputname);
-
-			for(i=0;i<femmodel->elements->Size();i++){
-				Element* element=(Element*)femmodel->elements->GetObjectByOffset(i);
-				switch(outputenum){
-					case GroundedAreaEnum:
-						val_t+=element->GroundedArea(this->mask,false);
-						break;
-					case GroundedAreaScaledEnum:
-						val_t+=element->GroundedArea(this->mask,true);
-						break;
-					case FloatingAreaEnum:
-						val_t+=element->FloatingArea(this->mask,false);
-						break;
-					case FloatingAreaScaledEnum:
-						val_t+=element->FloatingArea(this->mask,true);
-						break;
-					case IceMassEnum:
-						val_t+=element->IceMass(this->mask,false);
-						break;
-					case IceMassScaledEnum:
-						val_t+=element->IceMass(this->mask,true);
-						break;
-					case IceVolumeEnum:
-						val_t+=element->IceVolume(this->mask,false);
-						break;
-					case IceVolumeScaledEnum:
-						val_t+=element->IceVolume(this->mask,true);
-						break;
-					case IceVolumeAboveFloatationEnum:
-						val_t+=element->IceVolumeAboveFloatation(this->mask,false);
-						break;
-					case IceVolumeAboveFloatationScaledEnum:
-						val_t+=element->IceVolumeAboveFloatation(this->mask,true);
-						break;
-					case TotalFloatingBmbEnum:
-						val_t+=element->TotalFloatingBmb(this->mask,false);
-						break;
-					case TotalFloatingBmbScaledEnum:
-						val_t+=element->TotalFloatingBmb(this->mask,true);
-						break;
-					case TotalGroundedBmbEnum:
-						val_t+=element->TotalGroundedBmb(this->mask,false);
-						break;
-					case TotalGroundedBmbScaledEnum:
-						val_t+=element->TotalGroundedBmb(this->mask,true);
-						break;
-					case TotalSmbEnum:
-						val_t+=element->TotalSmb(this->mask,false);
-						break;
-					case TotalSmbScaledEnum:
-						val_t+=element->TotalSmb(this->mask,true);
-						break;
-					default:
-						_error_("Regional output type " << this->outputname << " not supported yet!");
-				}
-			}
-
-			ISSM_MPI_Allreduce ( (void*)&val_t,(void*)&all_val_t,1,ISSM_MPI_DOUBLE,ISSM_MPI_SUM,IssmComm::GetComm());
-			val_t=all_val_t;
-
-			return val_t;
-		}
-		/*}}}*/
+/*Definition virtual function resolutoin: */
+int DefinitionEnum();
+char* Name();
+IssmDouble Response(FemModel* femmodel);
 };
-
 #endif  /* _REGIONALOUTPUT_H_ */
