Index: issm/trunk/src/c/objects/Elements/Penta.cpp
===================================================================
--- issm/trunk/src/c/objects/Elements/Penta.cpp	(revision 5746)
+++ issm/trunk/src/c/objects/Elements/Penta.cpp	(revision 5747)
@@ -556,8 +556,8 @@
 
 	/*Retrieve all inputs we will be needing: */
-	Input* pressure_input=inputs->GetInput(PressureEnum);
-	Input* vx_input=inputs->GetInput(VxEnum);
-	Input* vy_input=inputs->GetInput(VyEnum);
-	Input* vz_input=inputs->GetInput(VzEnum);
+	Input* pressure_input=inputs->GetInput(PressureEnum); ISSMASSERT(pressure_input);
+	Input* vx_input=inputs->GetInput(VxEnum);             ISSMASSERT(vx_input);
+	Input* vy_input=inputs->GetInput(VyEnum);             ISSMASSERT(vy_input);
+	Input* vz_input=inputs->GetInput(VzEnum);             ISSMASSERT(vz_input);
 
 	/* Start  looping on the number of gaussian points: */
@@ -2085,10 +2085,4 @@
 	Penta* pentabase=NULL;
 
-	/*inputs: */
-	Input* vx_input=NULL;
-	Input* vy_input=NULL;
-	Input* vxold_input=NULL;
-	Input* vyold_input=NULL;
-
 	/*retrieve some parameters: */
 	this->parameters->FindParam(&viscosity_overshoot,ViscosityOvershootEnum);
@@ -2107,8 +2101,8 @@
 
 	/*Retrieve all inputs we will be needing: */
-	vx_input=inputs->GetInput(VxEnum);
-	vy_input=inputs->GetInput(VyEnum);
-	vxold_input=inputs->GetInput(VxOldEnum);
-	vyold_input=inputs->GetInput(VyOldEnum);
+	Input* vx_input=inputs->GetInput(VxEnum);       ISSMASSERT(vx_input);
+	Input* vy_input=inputs->GetInput(VyEnum);       ISSMASSERT(vy_input);
+	Input* vxold_input=inputs->GetInput(VxOldEnum); ISSMASSERT(vxold_input);
+	Input* vyold_input=inputs->GetInput(VyOldEnum); ISSMASSERT(vyold_input);
 
 	/* Start  looping on the number of gaussian points: */
@@ -2301,11 +2295,5 @@
 	Tria*  tria=NULL;
 	Penta* pentabase=NULL;
-
-	/*inputs: */
 	int  approximation;
-	Input* vx_input=NULL;
-	Input* vy_input=NULL;
-	Input* vxold_input=NULL;
-	Input* vyold_input=NULL;
 
 	inputs->GetParameterValue(&approximation,ApproximationEnum);
@@ -2359,8 +2347,8 @@
 
 		/*Retrieve all inputs we will be needing: */
-		vx_input=inputs->GetInput(VxEnum);
-		vy_input=inputs->GetInput(VyEnum);
-		vxold_input=inputs->GetInput(VxOldEnum);
-		vyold_input=inputs->GetInput(VyOldEnum);
+		Input* vx_input=inputs->GetInput(VxEnum);       ISSMASSERT(vx_input);
+		Input* vy_input=inputs->GetInput(VyEnum);       ISSMASSERT(vy_input);
+		Input* vxold_input=inputs->GetInput(VxOldEnum); ISSMASSERT(vxold_input);
+		Input* vyold_input=inputs->GetInput(VyOldEnum); ISSMASSERT(vyold_input);
 
 		/* Start  looping on the number of gaussian points: */
@@ -2479,10 +2467,4 @@
 	Tria*  tria=NULL;
 
-	/*inputs: */
-	Input* vx_input=NULL;
-	Input* vy_input=NULL;
-	Input* vxold_input=NULL;
-	Input* vyold_input=NULL;
-
 	/*retrieve some parameters: */
 	this->parameters->FindParam(&viscosity_overshoot,ViscosityOvershootEnum);
@@ -2498,8 +2480,8 @@
 
 	/*Retrieve all inputs we will be needing: */
-	vx_input=inputs->GetInput(VxEnum);
-	vy_input=inputs->GetInput(VyEnum);
-	vxold_input=inputs->GetInput(VxOldEnum);
-	vyold_input=inputs->GetInput(VyOldEnum);
+	Input* vx_input=inputs->GetInput(VxEnum);       ISSMASSERT(vx_input);
+	Input* vy_input=inputs->GetInput(VyEnum);       ISSMASSERT(vy_input);
+	Input* vxold_input=inputs->GetInput(VxOldEnum); ISSMASSERT(vxold_input);
+	Input* vyold_input=inputs->GetInput(VyOldEnum); ISSMASSERT(vyold_input);
 
 	/* Start  looping on the number of gaussian points: */
@@ -2618,7 +2600,7 @@
 
 	/*Retrieve all inputs we will be needing: */
-	Input* vx_input=inputs->GetInput(VxEnum);
-	Input* vy_input=inputs->GetInput(VyEnum);
-	Input* vz_input=inputs->GetInput(VzEnum);
+	Input* vx_input=inputs->GetInput(VxEnum); ISSMASSERT(vx_input);
+	Input* vy_input=inputs->GetInput(VyEnum); ISSMASSERT(vy_input);
+	Input* vz_input=inputs->GetInput(VzEnum); ISSMASSERT(vz_input);
 
 	/* Start  looping on the number of gaussian points: */
@@ -2934,9 +2916,4 @@
 	Tria*  tria=NULL;
 
-	/*inputs: */
-	Input* vx_input=NULL;
-	Input* vy_input=NULL;
-	Input* vz_input=NULL;
-
 	/*If on water, skip: */
 	if(IsOnWater())return;
@@ -2958,7 +2935,7 @@
 	this->parameters->FindParam(&epsvel,EpsVelEnum);
 
-	vx_input=inputs->GetInput(VxEnum);
-	vy_input=inputs->GetInput(VyEnum);
-	vz_input=inputs->GetInput(VzEnum);
+	Input* vx_input=inputs->GetInput(VxEnum); ISSMASSERT(vx_input);
+	Input* vy_input=inputs->GetInput(VyEnum); ISSMASSERT(vy_input);
+	Input* vz_input=inputs->GetInput(VzEnum); ISSMASSERT(vz_input);
 
 	/* Start  looping on the number of gaussian points: */
@@ -3211,8 +3188,8 @@
 
 	//recover extra inputs
-	Input* thickness_input=inputs->GetInput(ThicknessEnum);
-	Input* surface_input=inputs->GetInput(SurfaceEnum);
-	Input* slopex_input=inputs->GetInput(SurfaceSlopeXEnum);
-	Input* slopey_input=inputs->GetInput(SurfaceSlopeYEnum);
+	Input* thickness_input=inputs->GetInput(ThicknessEnum);  ISSMASSERT(thickness_input);
+	Input* surface_input=inputs->GetInput(SurfaceEnum);      ISSMASSERT(surface_input);
+	Input* slopex_input=inputs->GetInput(SurfaceSlopeXEnum); ISSMASSERT(slopex_input);
+	Input* slopey_input=inputs->GetInput(SurfaceSlopeYEnum); ISSMASSERT(slopey_input);
 
 	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
@@ -3334,8 +3311,4 @@
 	double  pe_g_gaussian[numdof];
 
-	/*inputs: */
-	Input* surface_input=NULL;
-	Input* thickness_input=NULL;
-
 	/*If on water, skip load: */
 	if(IsOnWater())return;
@@ -3348,6 +3321,6 @@
 
 	/*Retrieve all inputs we will be needing: */
-	thickness_input=inputs->GetInput(ThicknessEnum);
-	surface_input=inputs->GetInput(SurfaceEnum);
+	Input* thickness_input=inputs->GetInput(ThicknessEnum); ISSMASSERT(thickness_input);
+	Input* surface_input=inputs->GetInput(SurfaceEnum);     ISSMASSERT(surface_input);
 
 	/* Start  looping on the number of gaussian points: */
@@ -3440,8 +3413,4 @@
 	/*inputs: */
 	int  approximation;
-	Input* vx_input=NULL;
-	Input* vy_input=NULL;
-	Input* vz_input=NULL;
-	Input* bed_input=NULL;
 
 	/*retrieve inputs :*/
@@ -3464,8 +3433,8 @@
 
 	/*Retrieve all inputs we will be needing: */
-	vx_input=inputs->GetInput(VxEnum);
-	vy_input=inputs->GetInput(VyEnum);
-	vz_input=inputs->GetInput(VzEnum);
-	bed_input=inputs->GetInput(BedEnum);
+	Input* vx_input=inputs->GetInput(VxEnum);   ISSMASSERT(vx_input);
+	Input* vy_input=inputs->GetInput(VyEnum);   ISSMASSERT(vy_input);
+	Input* vz_input=inputs->GetInput(VzEnum);   ISSMASSERT(vz_input);
+	Input* bed_input=inputs->GetInput(BedEnum); ISSMASSERT(bed_input);
 
 	/* Start  looping on the number of gaussian points: */
@@ -3610,8 +3579,4 @@
 	double dv[3];
 	double dudx,dvdy;
-
-	/*inputs: */
-	Input* vx_input=NULL;
-	Input* vy_input=NULL;
 
 	/*If on water, skip: */
@@ -3632,6 +3597,6 @@
 
 	/*Retrieve all inputs we will be needing: */
-	vx_input=inputs->GetInput(VxEnum);
-	vy_input=inputs->GetInput(VyEnum);
+	Input* vx_input=inputs->GetInput(VxEnum); ISSMASSERT(vx_input);
+	Input* vy_input=inputs->GetInput(VyEnum); ISSMASSERT(vy_input);
 
 	/* Start  looping on the number of gaussian points: */
@@ -3770,13 +3735,5 @@
 	/*Collapsed formulation: */
 	Tria*  tria=NULL;
-
-	/*parameters: */
 	double dt;
-
-	/*inputs: */
-	Input* vx_input=NULL;
-	Input* vy_input=NULL;
-	Input* vz_input=NULL;
-	Input* temperature_input=NULL;
 
 	/*retrieve some parameters: */
@@ -3799,8 +3756,11 @@
 
 	/*Retrieve all inputs we will be needing: */
-	vx_input=inputs->GetInput(VxEnum);
-	vy_input=inputs->GetInput(VyEnum);
-	vz_input=inputs->GetInput(VzEnum);
-	if (dt) temperature_input=inputs->GetInput(TemperatureEnum);
+	Input* vx_input=inputs->GetInput(VxEnum); ISSMASSERT(vx_input);
+	Input* vy_input=inputs->GetInput(VyEnum); ISSMASSERT(vy_input);
+	Input* vz_input=inputs->GetInput(VzEnum); ISSMASSERT(vz_input);
+	Input* temperature_input=NULL;
+	if (dt){
+		temperature_input=inputs->GetInput(TemperatureEnum); ISSMASSERT(inputs);
+	}
 
 	/* Start  looping on the number of gaussian points: */
@@ -4503,5 +4463,4 @@
 	double       xyz_list[NUMVERTICES][3];
 
-	Input  *vz_input        = NULL;
 	double *vz_ptr          = NULL;
 	Penta  *penta          = NULL;
@@ -4537,5 +4496,5 @@
 
 		/*Now Compute vel*/
-		vz_input=inputs->GetInput(VzEnum);
+		Input* vz_input=inputs->GetInput(VzEnum);
 		if (vz_input){
 			if (vz_input->Enum()!=PentaVertexInputEnum) ISSMERROR("Cannot compute Vel as Vz is of type %s",EnumToString(vz_input->Enum()));
@@ -4595,5 +4554,4 @@
 	double       xyz_list[NUMVERTICES][3];
 
-	Input  *vz_input       = NULL;
 	double *vz_ptr         = NULL;
 	Penta  *penta          = NULL;
@@ -4627,5 +4585,5 @@
 
 	/*Get Vz*/
-	vz_input=inputs->GetInput(VzEnum);
+	Input* vz_input=inputs->GetInput(VzEnum);
 	if (vz_input){
 		if (vz_input->Enum()!=PentaVertexInputEnum){
@@ -4686,6 +4644,4 @@
 	double       rho_ice,g;
 	double       xyz_list[NUMVERTICES][3];
-	
-	Input  *vz_input        = NULL;
 	double *vz_ptr          = NULL;
 
@@ -4708,5 +4664,5 @@
 
 	/*Get Vz*/
-	vz_input=inputs->GetInput(VzEnum);
+	Input* vz_input=inputs->GetInput(VzEnum);
 	if (vz_input){
 		if (vz_input->Enum()!=PentaVertexInputEnum){
@@ -4765,6 +4721,4 @@
 	double       rho_ice,g;
 	double       xyz_list[NUMVERTICES][3];
-	
-	Input*       vz_input=NULL;
 	double*      vz_ptr=NULL;
 
@@ -4787,5 +4741,5 @@
 
 	/*Get Vz*/
-	vz_input=inputs->GetInput(VzEnum);
+	Input* vz_input=inputs->GetInput(VzEnum);
 	if (vz_input){
 		if (vz_input->Enum()!=PentaVertexInputEnum){
@@ -4845,7 +4799,5 @@
 	double       xyz_list[NUMVERTICES][3];
 
-	Input*       vx_input=NULL;
 	double*      vx_ptr=NULL;
-	Input*       vy_input=NULL;
 	double*      vy_ptr=NULL;
 
@@ -4867,5 +4819,5 @@
 
 	/*Get Vx and Vy*/
-	vx_input=inputs->GetInput(VxEnum);
+	Input* vx_input=inputs->GetInput(VxEnum);
 	if (vx_input){
 		if (vx_input->Enum()!=PentaVertexInputEnum) ISSMERROR("Cannot compute Vel as Vx is of type %s",EnumToString(vx_input->Enum()));
@@ -4875,5 +4827,5 @@
 	else for(i=0;i<NUMVERTICES;i++) vx[i]=0.0;
 
-	vy_input=inputs->GetInput(VyEnum);
+	Input* vy_input=inputs->GetInput(VyEnum);
 	if (vy_input){
 		if (vy_input->Enum()!=PentaVertexInputEnum) ISSMERROR("Cannot compute Vel as Vy is of type %s",EnumToString(vy_input->Enum()));
Index: issm/trunk/src/c/objects/Elements/Tria.cpp
===================================================================
--- issm/trunk/src/c/objects/Elements/Tria.cpp	(revision 5746)
+++ issm/trunk/src/c/objects/Elements/Tria.cpp	(revision 5747)
@@ -647,7 +647,7 @@
 	this->parameters->FindParam(&control_type,ControlTypeEnum);
 	this->parameters->FindParam(&cm_noisedmp,CmNoiseDmpEnum);
-	Input* drag_input=inputs->GetInput(DragCoefficientEnum);
-	Input* dhdt_input=inputs->GetInput(DhDtEnum);
-	Input* Bbar_input=matice->inputs->GetInput(RheologyBbarEnum);
+	Input* drag_input=inputs->GetInput(DragCoefficientEnum);      ISSMASSERT(drag_input);
+	Input* dhdt_input=inputs->GetInput(DhDtEnum);                 ISSMASSERT(dhdt_input);
+	Input* Bbar_input=matice->inputs->GetInput(RheologyBbarEnum); ISSMASSERT(Bbar_input);
 
 	/*If on water, return 0: */
@@ -1005,14 +1005,6 @@
 	double epsilon[3]; /* epsilon=[exx,eyy,exy];*/
 
-	/*inputs: */
-	Input* vx_input=NULL;
-	Input* vy_input=NULL;
-	Input* adjointx_input=NULL;
-	Input* adjointy_input=NULL;
-	Input* dragcoefficient_input=NULL;
-
 	/*parameters: */
 	double  cm_noisedmp;
-
 	int analysis_type;
 
@@ -1035,9 +1027,9 @@
 
 	/*Retrieve all inputs we will be needing: */
-	adjointx_input=inputs->GetInput(AdjointxEnum);
-	adjointy_input=inputs->GetInput(AdjointyEnum);
-	vx_input=inputs->GetInput(VxEnum);
-	vy_input=inputs->GetInput(VyEnum);
-	dragcoefficient_input=inputs->GetInput(DragCoefficientEnum);
+	Input* adjointx_input=inputs->GetInput(AdjointxEnum);               ISSMASSERT(adjointx_input);
+	Input* adjointy_input=inputs->GetInput(AdjointyEnum);               ISSMASSERT(adjointy_input);
+	Input* vx_input=inputs->GetInput(VxEnum);                           ISSMASSERT(vx_input);
+	Input* vy_input=inputs->GetInput(VyEnum);                           ISSMASSERT(vy_input);
+	Input* dragcoefficient_input=inputs->GetInput(DragCoefficientEnum); ISSMASSERT(dragcoefficient_input);
 
 	/* Start  looping on the number of gaussian points: */
@@ -1544,5 +1536,5 @@
 	Input* thickness_input   =inputs->GetInput(ThicknessEnum);   ISSMASSERT(thickness_input);
 	Input* thicknessobs_input=inputs->GetInput(ThicknessObsEnum);ISSMASSERT(thicknessobs_input);
-	Input* weights_input     =inputs->GetInput(WeightsEnum);ISSMASSERT(weights_input);
+	Input* weights_input     =inputs->GetInput(WeightsEnum);     ISSMASSERT(weights_input);
 
 	/* Start  looping on the number of gaussian points: */
@@ -2455,10 +2447,10 @@
 	/*Retrieve all inputs we will be needed*/
 	if(dim==2){
-		vxaverage_input=inputs->GetInput(VxEnum);
-		vyaverage_input=inputs->GetInput(VyEnum);
+		vxaverage_input=inputs->GetInput(VxEnum); ISSMASSERT(vxaverage_input);
+		vyaverage_input=inputs->GetInput(VyEnum); ISSMASSERT(vyaverage_input);
 	}
 	else{
-		vxaverage_input=inputs->GetInput(VxAverageEnum);
-		vyaverage_input=inputs->GetInput(VyAverageEnum);
+		vxaverage_input=inputs->GetInput(VxAverageEnum); ISSMASSERT(vxaverage_input);
+		vyaverage_input=inputs->GetInput(VyAverageEnum); ISSMASSERT(vyaverage_input);
 	}
 
@@ -2583,8 +2575,4 @@
 	int     dim;
 
-	/*inputs: */
-	Input* vx_input=NULL;
-	Input* vy_input=NULL;
-
 	/* Get node coordinates and dof list: */
 	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
@@ -2593,8 +2581,6 @@
 
 	/*Retrieve all inputs we will be needed*/
-	if(dim==2){
-		vx_input=inputs->GetInput(VxEnum);
-		vy_input=inputs->GetInput(VyEnum);
-	}
+	Input* vx_input=inputs->GetInput(VxEnum); ISSMASSERT(vx_input);
+	Input* vy_input=inputs->GetInput(VyEnum); ISSMASSERT(vy_input);
 
 	/* Start  looping on the number of gaussian points: */
@@ -2685,5 +2671,4 @@
 	Input* vxaverage_input=NULL;
 	Input* vyaverage_input=NULL;
-	Input* surface_input=NULL;
 	bool artdiff;
 
@@ -2697,12 +2682,12 @@
 
 	/*Retrieve all inputs we will be needed*/
-	surface_input=inputs->GetInput(SurfaceEnum);
+	Input* surface_input=inputs->GetInput(SurfaceEnum); ISSMASSERT(surface_input);
 	if(dim==2){
-		vxaverage_input=inputs->GetInput(VxEnum);
-		vyaverage_input=inputs->GetInput(VyEnum);
+		vxaverage_input=inputs->GetInput(VxEnum); ISSMASSERT(vxaverage_input);
+		vyaverage_input=inputs->GetInput(VyEnum); ISSMASSERT(vyaverage_input);
 	}
 	else{
-		vxaverage_input=inputs->GetInput(VxAverageEnum);
-		vyaverage_input=inputs->GetInput(VyAverageEnum);
+		vxaverage_input=inputs->GetInput(VxAverageEnum); ISSMASSERT(vxaverage_input);
+		vyaverage_input=inputs->GetInput(VyAverageEnum); ISSMASSERT(vyaverage_input);
 	}
 
@@ -2849,11 +2834,4 @@
 	double  thickness;
 
-	/*inputs: */
-	Input* thickness_input=NULL;
-	Input* vx_input=NULL;
-	Input* vy_input=NULL;
-	Input* vxold_input=NULL;
-	Input* vyold_input=NULL;
-
 	/*retrieve some parameters: */
 	this->parameters->FindParam(&viscosity_overshoot,ViscosityOvershootEnum);
@@ -2867,9 +2845,9 @@
 
 	/*Retrieve all inputs we will be needing: */
-	thickness_input=inputs->GetInput(ThicknessEnum);
-	vx_input=inputs->GetInput(VxEnum);
-	vy_input=inputs->GetInput(VyEnum);
-	vxold_input=inputs->GetInput(VxOldEnum);
-	vyold_input=inputs->GetInput(VyOldEnum);
+	Input* thickness_input=inputs->GetInput(ThicknessEnum); ISSMASSERT(thickness_input);
+	Input* vx_input=inputs->GetInput(VxEnum);               ISSMASSERT(vx_input);
+	Input* vy_input=inputs->GetInput(VyEnum);               ISSMASSERT(vy_input);
+	Input* vxold_input=inputs->GetInput(VxOldEnum);         ISSMASSERT(vxold_input);
+	Input* vyold_input=inputs->GetInput(VyOldEnum);         ISSMASSERT(vyold_input);
 
 	/* Start  looping on the number of gaussian points: */
@@ -2973,8 +2951,4 @@
 	/*inputs: */
 	int  drag_type;
-	Input* surface_input=NULL;
-	Input* vx_input=NULL;
-	Input* vy_input=NULL;
-	Input* vz_input=NULL;
 
 	/*retrive parameters: */
@@ -2983,8 +2957,8 @@
 	/*retrieve inputs :*/
 	inputs->GetParameterValue(&drag_type,DragTypeEnum);
-	surface_input=inputs->GetInput(SurfaceEnum);
-	vx_input=inputs->GetInput(VxEnum);
-	vy_input=inputs->GetInput(VyEnum);
-	vz_input=inputs->GetInput(VzEnum);
+	Input* surface_input=inputs->GetInput(SurfaceEnum); ISSMASSERT(surface_input);
+	Input* vx_input=inputs->GetInput(VxEnum);           ISSMASSERT(vx_input);
+	Input* vy_input=inputs->GetInput(VyEnum);           ISSMASSERT(vy_input);
+	Input* vz_input=inputs->GetInput(VzEnum);           ISSMASSERT(vz_input);
 	
 	/* Get node coordinates and dof list: */
@@ -3094,8 +3068,4 @@
 	/*inputs: */
 	int  drag_type;
-	Input* surface_input=NULL;
-	Input* vx_input=NULL;
-	Input* vy_input=NULL;
-	Input* vz_input=NULL;
 
 	/*retrive parameters: */
@@ -3104,8 +3074,8 @@
 	/*retrieve inputs :*/
 	inputs->GetParameterValue(&drag_type,DragTypeEnum);
-	surface_input=inputs->GetInput(SurfaceEnum);
-	vx_input=inputs->GetInput(VxEnum);
-	vy_input=inputs->GetInput(VyEnum);
-	vz_input=inputs->GetInput(VzEnum);
+	Input* surface_input=inputs->GetInput(SurfaceEnum); ISSMASSERT(surface_input);
+	Input* vx_input=inputs->GetInput(VxEnum);           ISSMASSERT(vx_input);
+	Input* vy_input=inputs->GetInput(VyEnum);           ISSMASSERT(vy_input);
+	Input* vz_input=inputs->GetInput(VzEnum);           ISSMASSERT(vz_input);
 	
 	/* Get node coordinates and dof list: */
@@ -3212,8 +3182,4 @@
 	/*inputs: */
 	int  drag_type;
-	Input* surface_input=NULL;
-	Input* vx_input=NULL;
-	Input* vy_input=NULL;
-	Input* vz_input=NULL;
 
 	/*retrive parameters: */
@@ -3222,8 +3188,8 @@
 	/*retrieve inputs :*/
 	inputs->GetParameterValue(&drag_type,DragTypeEnum);
-	surface_input=inputs->GetInput(SurfaceEnum);
-	vx_input=inputs->GetInput(VxEnum);
-	vy_input=inputs->GetInput(VyEnum);
-	vz_input=inputs->GetInput(VzEnum);
+	Input* surface_input=inputs->GetInput(SurfaceEnum); ISSMASSERT(surface_input);
+	Input* vx_input=inputs->GetInput(VxEnum);           ISSMASSERT(vx_input);
+	Input* vy_input=inputs->GetInput(VyEnum);           ISSMASSERT(vy_input);
+	Input* vz_input=inputs->GetInput(VzEnum);           ISSMASSERT(vz_input);
 	
 	/* Get node coordinates and dof list: */
@@ -3544,10 +3510,10 @@
 	/*Retrieve all inputs we will be needing: */
 	if(dim==2){
-		vxaverage_input=inputs->GetInput(VxEnum); 
-		vyaverage_input=inputs->GetInput(VyEnum);
+		vxaverage_input=inputs->GetInput(VxEnum); ISSMASSERT(vxaverage_input);
+		vyaverage_input=inputs->GetInput(VyEnum); ISSMASSERT(vyaverage_input);
 	}
 	else{
-		vxaverage_input=inputs->GetInput(VxAverageEnum);
-		vyaverage_input=inputs->GetInput(VyAverageEnum);
+		vxaverage_input=inputs->GetInput(VxAverageEnum); ISSMASSERT(vxaverage_input);
+		vyaverage_input=inputs->GetInput(VyAverageEnum); ISSMASSERT(vyaverage_input);
 	}
 
@@ -3703,10 +3669,10 @@
 	/*Retrieve all inputs we will be needed*/
 	if(dim==2){
-		vxaverage_input=inputs->GetInput(VxEnum);
-		vyaverage_input=inputs->GetInput(VyEnum);
+		vxaverage_input=inputs->GetInput(VxEnum); ISSMASSERT(vxaverage_input);
+		vyaverage_input=inputs->GetInput(VyEnum); ISSMASSERT(vyaverage_input);
 	}
 	else{
-		vxaverage_input=inputs->GetInput(VxAverageEnum);
-		vyaverage_input=inputs->GetInput(VyAverageEnum);
+		vxaverage_input=inputs->GetInput(VxAverageEnum); ISSMASSERT(vxaverage_input);
+		vyaverage_input=inputs->GetInput(VyAverageEnum); ISSMASSERT(vyaverage_input);
 	}
 
@@ -3920,9 +3886,4 @@
 	double  dhdt_g;
 
-	/*inputs: */
-	Input* accumulation_input=NULL;
-	Input* melting_input=NULL;
-	Input* dhdt_input=NULL;
-
 	/* Get node coordinates and dof list: */
 	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
@@ -3930,7 +3891,7 @@
 
 	/*retrieve inputs :*/
-	accumulation_input=inputs->GetInput(AccumulationRateEnum); ISSMASSERT(accumulation_input);
-	melting_input=inputs->GetInput(MeltingRateEnum);           ISSMASSERT(melting_input);
-	dhdt_input=inputs->GetInput(DhDtEnum);                     ISSMASSERT(dhdt_input);
+	Input* accumulation_input=inputs->GetInput(AccumulationRateEnum); ISSMASSERT(accumulation_input);
+	Input* melting_input=inputs->GetInput(MeltingRateEnum);           ISSMASSERT(melting_input);
+	Input* dhdt_input=inputs->GetInput(DhDtEnum);                     ISSMASSERT(dhdt_input);
 	
 	/* Start  looping on the number of gaussian points: */
@@ -3990,9 +3951,4 @@
 	double  dhdt_g;
 
-	/*inputs: */
-	Input* accumulation_input=NULL;
-	Input* melting_input=NULL;
-	Input* dhdt_input=NULL;
-
 	/* Get node coordinates and dof list: */
 	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
@@ -4000,7 +3956,7 @@
 
 	/*Retrieve all inputs we will be needing: */
-	accumulation_input=inputs->GetInput(AccumulationRateEnum);
-	melting_input=inputs->GetInput(MeltingRateEnum);
-	dhdt_input=inputs->GetInput(DhDtEnum);
+	Input* accumulation_input=inputs->GetInput(AccumulationRateEnum); ISSMASSERT(accumulation_input);
+	Input* melting_input=inputs->GetInput(MeltingRateEnum);           ISSMASSERT(melting_input);
+	Input* dhdt_input=inputs->GetInput(DhDtEnum);                     ISSMASSERT(dhdt_input);
 
 	/* Start  looping on the number of gaussian points: */
@@ -4059,8 +4015,4 @@
 	double  melting_g;
 
-	/*inputs: */
-	Input* accumulation_input=NULL;
-	Input* melting_input=NULL;
-
 	/* Get node coordinates and dof list: */
 	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
@@ -4068,6 +4020,6 @@
 
 	/*Retrieve all inputs we will be needing: */
-	accumulation_input=inputs->GetInput(AccumulationRateEnum);
-	melting_input=inputs->GetInput(MeltingRateEnum);
+	Input* accumulation_input=inputs->GetInput(AccumulationRateEnum); ISSMASSERT(accumulation_input);
+	Input* melting_input=inputs->GetInput(MeltingRateEnum);           ISSMASSERT(melting_input);
 
 	/* Start  looping on the number of gaussian points: */
@@ -4133,10 +4085,4 @@
 	double  dbdx,dbdy;
 
-	/*inputs: */
-	Input* melting_input=NULL;
-	Input* vx_input=NULL;
-	Input* vy_input=NULL;
-	Input* bed_input=NULL;
-
 	/* Get node coordinates and dof list: */
 	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
@@ -4144,8 +4090,8 @@
 
 	/*Retrieve all inputs we will be needing: */
-	melting_input=inputs->GetInput(MeltingRateEnum);
-	vx_input=inputs->GetInput(VxEnum);
-	vy_input=inputs->GetInput(VyEnum);
-	bed_input=inputs->GetInput(BedEnum);
+	Input* melting_input=inputs->GetInput(MeltingRateEnum); ISSMASSERT(melting_input);
+	Input* vx_input=inputs->GetInput(VxEnum);               ISSMASSERT(vx_input);
+	Input* vy_input=inputs->GetInput(VyEnum);               ISSMASSERT(vy_input);
+	Input* bed_input=inputs->GetInput(BedEnum);             ISSMASSERT(bed_input);
 
 	/*For icesheets: */
@@ -4308,9 +4254,4 @@
 	double l1l2l3[3];
 
-	/*inputs: */
-	Input* thickness_input=NULL;
-	Input* thicknessobs_input=NULL;
-	Input* weights_input=NULL;
-
 	/* Get node coordinates and dof list: */
 	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
@@ -4318,7 +4259,7 @@
 
 	/*Retrieve all inputs we will be needing: */
-	thickness_input   =inputs->GetInput(ThicknessEnum);   ISSMASSERT(thickness_input);
-	thicknessobs_input=inputs->GetInput(ThicknessObsEnum);ISSMASSERT(thicknessobs_input);
-	weights_input     =inputs->GetInput(WeightsEnum);ISSMASSERT(weights_input);
+	Input* thickness_input   =inputs->GetInput(ThicknessEnum);   ISSMASSERT(thickness_input);
+	Input* thicknessobs_input=inputs->GetInput(ThicknessObsEnum);ISSMASSERT(thicknessobs_input);
+	Input* weights_input     =inputs->GetInput(WeightsEnum);     ISSMASSERT(weights_input);
 
 	/* Start  looping on the number of gaussian points: */
@@ -4808,9 +4749,4 @@
 	double    slope2;
 	int       connectivity;
-
-	/*flags: */
-	Input* slopex_input=NULL;
-	Input* slopey_input=NULL;
-	Input* thickness_input=NULL;
 	GaussTria* gauss=NULL;
 
@@ -4827,7 +4763,7 @@
 
 	/* Get slopes and thickness */
-	slopex_input=inputs->GetInput(SurfaceSlopeXEnum);
-	slopey_input=inputs->GetInput(SurfaceSlopeYEnum);
-	thickness_input=inputs->GetInput(ThicknessEnum);
+	Input* slopex_input=inputs->GetInput(SurfaceSlopeXEnum); ISSMASSERT(slopex_input);
+	Input* slopey_input=inputs->GetInput(SurfaceSlopeYEnum); ISSMASSERT(slopey_input);
+	Input* thickness_input=inputs->GetInput(ThicknessEnum);  ISSMASSERT(thickness_input);
 
 	/*Spawn 3 sing elements: */
@@ -4888,10 +4824,5 @@
 	double  melting_g;
 	double  thickness_g;
-
-	/*inputs: */
 	double  dt;
-	Input* accumulation_input=NULL;
-	Input* melting_input=NULL;
-	Input* thickness_input=NULL;
 
 	/*retrieve some parameters: */
@@ -4903,7 +4834,7 @@
 
 	/*Retrieve all inputs we will be needing: */
-	accumulation_input=inputs->GetInput(AccumulationRateEnum);
-	melting_input=inputs->GetInput(MeltingRateEnum);
-	thickness_input=inputs->GetInput(ThicknessEnum);
+	Input* accumulation_input=inputs->GetInput(AccumulationRateEnum); ISSMASSERT(accumulation_input);
+	Input* melting_input=inputs->GetInput(MeltingRateEnum);           ISSMASSERT(melting_input);
+	Input* thickness_input=inputs->GetInput(ThicknessEnum);           ISSMASSERT(thickness_input);
 
 	/* Start  looping on the number of gaussian points: */
@@ -4964,7 +4895,4 @@
 	double  thickness_g;
 	double  dt;
-	Input*  accumulation_input=NULL;
-	Input*  melting_input=NULL;
-	Input*  thickness_input=NULL;
 
 	/*retrieve some parameters: */
@@ -4976,7 +4904,7 @@
 
 	/*Retrieve all inputs we will be needing: */
-	accumulation_input=inputs->GetInput(AccumulationRateEnum);
-	melting_input=inputs->GetInput(MeltingRateEnum);
-	thickness_input=inputs->GetInput(ThicknessEnum);
+	Input* accumulation_input=inputs->GetInput(AccumulationRateEnum); ISSMASSERT(accumulation_input);
+	Input* melting_input=inputs->GetInput(MeltingRateEnum);           ISSMASSERT(melting_input);
+	Input* thickness_input=inputs->GetInput(ThicknessEnum);           ISSMASSERT(thickness_input);
 
 	/* Start  looping on the number of gaussian points: */
@@ -5048,8 +4976,8 @@
 	/*Retrieve all inputs we will be needing: */
 	if ( (analysis_type==SurfaceSlopeXAnalysisEnum) || (analysis_type==SurfaceSlopeYAnalysisEnum)){
-		slope_input=inputs->GetInput(SurfaceEnum);
+		slope_input=inputs->GetInput(SurfaceEnum); ISSMASSERT(slope_input);
 	}
 	if ( (analysis_type==BedSlopeXAnalysisEnum) || (analysis_type==BedSlopeYAnalysisEnum)){
-		slope_input=inputs->GetInput(BedEnum);
+		slope_input=inputs->GetInput(BedEnum);     ISSMASSERT(slope_input);
 	}
 		
@@ -5118,10 +5046,6 @@
 	double  P_terms[numdof]={0.0};
 	double  l1l2l3[NUMVERTICES];
-
 	double  t_pmp;
 	double  scalar_ocean;
-
-	/*inputs: */
-	Input* pressure_input=NULL;
 
 	/* Get node coordinates and dof list: */
@@ -5144,5 +5068,5 @@
 
 	/*Retrieve all inputs we will be needing: */
-	pressure_input=inputs->GetInput(PressureEnum);
+	Input* pressure_input=inputs->GetInput(PressureEnum); ISSMASSERT(pressure_input);
 
 	/* Start looping on the number of gauss 2d (nodes on the bedrock) */
@@ -5218,10 +5142,4 @@
 	parameters->FindParam(&analysis_type,AnalysisTypeEnum);
 
-	/*inputs: */
-	Input* vx_input=NULL;
-	Input* vy_input=NULL;
-	Input* vz_input=NULL;
-	Input* geothermalflux_input=NULL;
-	
 	/* Get node coordinates and dof list: */
 	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
@@ -5241,8 +5159,8 @@
 
 	/*Retrieve all inputs we will be needing: */
-	vx_input=inputs->GetInput(VxEnum);
-	vy_input=inputs->GetInput(VyEnum);
-	vz_input=inputs->GetInput(VzEnum);
-	geothermalflux_input=inputs->GetInput(GeothermalFluxEnum);
+	Input* vx_input=inputs->GetInput(VxEnum);                         ISSMASSERT(vx_input);
+	Input* vy_input=inputs->GetInput(VyEnum);                         ISSMASSERT(vy_input);
+	Input* vz_input=inputs->GetInput(VzEnum);                         ISSMASSERT(vz_input);
+	Input* geothermalflux_input=inputs->GetInput(GeothermalFluxEnum); ISSMASSERT(geothermalflux_input);
 
 	/* Ice/ocean heat exchange flux on ice shelf base */
