Index: /issm/trunk-jpl/src/c/analyses/HydrologyDCInefficientAnalysis.cpp
===================================================================
--- /issm/trunk-jpl/src/c/analyses/HydrologyDCInefficientAnalysis.cpp	(revision 21914)
+++ /issm/trunk-jpl/src/c/analyses/HydrologyDCInefficientAnalysis.cpp	(revision 21915)
@@ -59,5 +59,4 @@
 
 	bool   isefficientlayer;
-	bool   element_active;
 	int    hydrology_model;
 	
Index: /issm/trunk-jpl/src/c/analyses/MeltingAnalysis.cpp
===================================================================
--- /issm/trunk-jpl/src/c/analyses/MeltingAnalysis.cpp	(revision 21914)
+++ /issm/trunk-jpl/src/c/analyses/MeltingAnalysis.cpp	(revision 21915)
@@ -38,6 +38,4 @@
 }/*}}}*/
 void MeltingAnalysis::UpdateElements(Elements* elements,IoModel* iomodel,int analysis_counter,int analysis_type){/*{{{*/
-
-	int frictionlaw;
 
 	/*Now, is the model 3d? otherwise, do nothing: */
Index: /issm/trunk-jpl/src/c/bamg/BamgVertex.cpp
===================================================================
--- /issm/trunk-jpl/src/c/bamg/BamgVertex.cpp	(revision 21914)
+++ /issm/trunk-jpl/src/c/bamg/BamgVertex.cpp	(revision 21915)
@@ -194,5 +194,4 @@
 				tria->det =  bamg::det( (*tria)[0],(*tria)[1]  ,(*tria)[2]);
 				if (loop) {
-					BamgVertex *v0,*v1,*v2,*v3;
 					if (tria->det<0) ok =1;			       
 					else if ( (double)tria->det < detold/2 ) ok=1;
Index: /issm/trunk-jpl/src/c/bamg/Mesh.cpp
===================================================================
--- /issm/trunk-jpl/src/c/bamg/Mesh.cpp	(revision 21914)
+++ /issm/trunk-jpl/src/c/bamg/Mesh.cpp	(revision 21915)
@@ -133,5 +133,6 @@
 				nbt++;           
 			  }
-		  if (nbt==0 && nbv==0) {
+		  if (nbt==0 && nbv==0){
+			  delete [] refv;
 			  _error_("All triangles have been removed");
 		  }
Index: /issm/trunk-jpl/src/c/classes/ExternalResults/GenericExternalResult.h
===================================================================
--- /issm/trunk-jpl/src/c/classes/ExternalResults/GenericExternalResult.h	(revision 21914)
+++ /issm/trunk-jpl/src/c/classes/ExternalResults/GenericExternalResult.h	(revision 21915)
@@ -321,5 +321,5 @@
 template <> inline void GenericExternalResult<char*>::Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){/*{{{*/
 
-	int size;
+	int size = 0;
 
 	if(marshall_direction==MARSHALLING_FORWARD || marshall_direction == MARSHALLING_SIZE)size=strlen(value)+1;
Index: /issm/trunk-jpl/src/c/classes/FemModel.cpp
===================================================================
--- /issm/trunk-jpl/src/c/classes/FemModel.cpp	(revision 21914)
+++ /issm/trunk-jpl/src/c/classes/FemModel.cpp	(revision 21915)
@@ -152,5 +152,5 @@
 	#ifndef _HAVE_JAVASCRIPT_
 	if(this->parameters->Exist(OutputFileNameEnum)) this->parameters->FindParam(&outbinfilename,OutputFileNameEnum);
-	if(this-parameters->Exist(LockFileNameEnum)) this->parameters->FindParam(&lockfilename,LockFileNameEnum);
+	if(this->parameters->Exist(LockFileNameEnum)) this->parameters->FindParam(&lockfilename,LockFileNameEnum);
 	#endif
 
@@ -178,8 +178,5 @@
 	/*Now delete: */
 	if(profiler)delete profiler;
-	
-	
-}
-/*}}}*/
+}/*}}}*/
 
 /*Object management*/
Index: /issm/trunk-jpl/src/c/classes/Loads/Pengrid.h
===================================================================
--- /issm/trunk-jpl/src/c/classes/Loads/Pengrid.h	(revision 21914)
+++ /issm/trunk-jpl/src/c/classes/Loads/Pengrid.h	(revision 21915)
@@ -46,5 +46,5 @@
 		/*Pengrid constructors, destructors {{{*/
 		Pengrid();
-		Pengrid(int index, int id, IoModel* iomodel,int analysis_type);
+		Pengrid(int id, int index, IoModel* iomodel,int analysis_type);
 		~Pengrid();
 		/*}}}*/
Index: /issm/trunk-jpl/src/c/classes/Params/StringParam.cpp
===================================================================
--- /issm/trunk-jpl/src/c/classes/Params/StringParam.cpp	(revision 21914)
+++ /issm/trunk-jpl/src/c/classes/Params/StringParam.cpp	(revision 21915)
@@ -52,5 +52,5 @@
 void StringParam::Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ /*{{{*/
 
-	int size;
+	int size = 0;
 
 	if(marshall_direction==MARSHALLING_FORWARD || marshall_direction == MARSHALLING_SIZE)size=strlen(value)+1;
Index: /issm/trunk-jpl/src/c/classes/kriging/Observations.cpp
===================================================================
--- /issm/trunk-jpl/src/c/classes/kriging/Observations.cpp	(revision 21914)
+++ /issm/trunk-jpl/src/c/classes/kriging/Observations.cpp	(revision 21915)
@@ -256,4 +256,7 @@
 	/*If radius is not provided or is 0, return all observations*/
 	if(radius==0) radius=this->quadtree->root->length;
+
+	/*For CPPcheck*/
+	hmin = 2*radius;
 
 	/*First, find closest point in Quadtree (fast but might not be the true closest obs)*/
Index: /issm/trunk-jpl/src/c/modules/ExpToLevelSetx/ExpToLevelSetx.cpp
===================================================================
--- /issm/trunk-jpl/src/c/modules/ExpToLevelSetx/ExpToLevelSetx.cpp	(revision 21914)
+++ /issm/trunk-jpl/src/c/modules/ExpToLevelSetx/ExpToLevelSetx.cpp	(revision 21915)
@@ -12,10 +12,6 @@
 int ExpToLevelSetx(double** pdistance,double* x, double* y, int nods, Contours* contours){
 
-	/*Contour:*/
-	double value;
-
 	/*output: */
-	double*  distance;
-	distance = xNew<double>(nods);
+	double* distance = xNew<double>(nods);
 	for(int i=0;i<nods;i++) distance[i]=1e50;
 
Index: /issm/trunk-jpl/src/c/modules/MeshProfileIntersectionx/MeshProfileIntersectionx.cpp
===================================================================
--- /issm/trunk-jpl/src/c/modules/MeshProfileIntersectionx/MeshProfileIntersectionx.cpp	(revision 21914)
+++ /issm/trunk-jpl/src/c/modules/MeshProfileIntersectionx/MeshProfileIntersectionx.cpp	(revision 21915)
@@ -149,5 +149,6 @@
 
 	double xel[2],yel[2];
-	double coord1,coord2;
+	double coord1 = 0.;
+	double coord2 = 0.;
 	double xfinal[2],yfinal[2];
 
Index: /issm/trunk-jpl/src/c/modules/SurfaceMassBalancex/Gembx.cpp
===================================================================
--- /issm/trunk-jpl/src/c/modules/SurfaceMassBalancex/Gembx.cpp	(revision 21914)
+++ /issm/trunk-jpl/src/c/modules/SurfaceMassBalancex/Gembx.cpp	(revision 21915)
@@ -33,5 +33,4 @@
 
 	/*output: */
-	int m;
 	IssmDouble* dz=NULL;
 
Index: /issm/trunk-jpl/src/c/shared/Sorting/binary_search.cpp
===================================================================
--- /issm/trunk-jpl/src/c/shared/Sorting/binary_search.cpp	(revision 21914)
+++ /issm/trunk-jpl/src/c/shared/Sorting/binary_search.cpp	(revision 21915)
@@ -15,6 +15,6 @@
 
 	/*output: */
-	int offset;  //offset, if found
-	int found=0; //found=0 if target is not found, 1 otherwise.
+	int offset=0;  //offset, if found
+	int found=0;   //found=0 if target is not found, 1 otherwise.
 
 	/*intermediary: */
