Index: /issm/trunk-jpl/src/c/classes/Elements/Penta.cpp
===================================================================
--- /issm/trunk-jpl/src/c/classes/Elements/Penta.cpp	(revision 16163)
+++ /issm/trunk-jpl/src/c/classes/Elements/Penta.cpp	(revision 16164)
@@ -433,5 +433,4 @@
 
 	/*retrieve parameters: */
-	ElementMatrix* Ke=NULL;
 	int analysis_type;
 	parameters->FindParam(&analysis_type,AnalysisTypeEnum);
@@ -1413,10 +1412,9 @@
 	/*Recover input*/
 	Input* input=inputs->GetInput(enumtype);
-	if (!input) _error_("Input " << EnumToStringx(enumtype) << " not found in element");
-	int    numnodes = this->NumberofNodes();
+	if(!input) _error_("Input " << EnumToStringx(enumtype) << " not found in element");
 
 	/* Start looping on the number of vertices: */
 	GaussPenta* gauss=new GaussPenta();
-	for (int iv=0;iv<this->NumberofNodes();iv++){
+	for(int iv=0;iv<this->NumberofNodes();iv++){
 		gauss->GaussNode(this->element_type,iv);
 		input->GetInputValue(&pvalue[iv],gauss);
@@ -4084,5 +4082,5 @@
 	/*Intermediaries */
 	int        stabilization;
-	int        i,j,found=0;
+	int        i,j;
 	IssmDouble Jdet,u,v,w,um,vm,wm;
 	IssmDouble h,hx,hy,hz,vx,vy,vz,vel;
@@ -4320,5 +4318,5 @@
 	/*Intermediaries */
 	int        stabilization;
-	int        i,j,found=0;
+	int        i,j;
 	IssmDouble Jdet,u,v,w,um,vm,wm,vel;
 	IssmDouble h,hx,hy,hz,vx,vy,vz;
@@ -4540,5 +4538,5 @@
 
 	/*Intermediaries*/
-	int        i,found=0;
+	int        i;
 	int        stabilization;
 	IssmDouble Jdet,phi,dt;
@@ -4550,5 +4548,4 @@
 	IssmDouble u,v,w;
 	IssmDouble scalar_def,scalar_transient;
-	IssmDouble temperature_list[NUMVERTICES];
 	IssmDouble xyz_list[NUMVERTICES][3];
 	IssmDouble L[numdof];
@@ -4809,5 +4806,5 @@
 
 	/*Intermediaries*/
-	int        i,found=0;
+	int        i;
 	int        stabilization;
 	IssmDouble Jdet,phi,dt;
@@ -4818,5 +4815,4 @@
 	IssmDouble u,v,w;
 	IssmDouble scalar_def,scalar_transient;
-	IssmDouble temperature_list[NUMVERTICES];
 	IssmDouble xyz_list[NUMVERTICES][3];
 	IssmDouble L[numdof];
@@ -5086,5 +5082,5 @@
 	IssmDouble  B_average,s_average;
 	int        *doflist = NULL;
-	IssmDouble  pressure[numdof];
+	//IssmDouble  pressure[numdof];
 
 	/*Get dof list: */
@@ -7918,5 +7914,4 @@
 	int         i,j;
 	IssmDouble  Jdet,viscosity;
-	IssmDouble  epsilon[5];       /* epsilon=[exx,eyy,exy,exz,eyz];*/
 	IssmDouble  xyz_list[NUMVERTICES][3];
 	IssmDouble  B[3][numdof2d];
@@ -8658,5 +8653,4 @@
 	IssmDouble  xyz_list[NUMVERTICES][3];
 	IssmDouble  basis[6]; //for the six nodes of the penta
-	Tria*       tria=NULL;
 	Friction*   friction=NULL;
 	GaussPenta  *gauss=NULL;
@@ -8821,5 +8815,4 @@
 	IssmDouble  xyz_list[NUMVERTICES][3];
 	IssmDouble  basis[6]; //for the six nodes of the penta
-	Tria*       tria=NULL;
 	Friction*   friction=NULL;
 	GaussPenta  *gauss=NULL;
@@ -9367,10 +9360,7 @@
 	IssmDouble xyz_list[NUMVERTICES][3];
 	IssmDouble epsilon[6]; /* epsilon=[exx,eyy,ezz,exy,exz,eyz];*/
-	IssmDouble l1l6[6]; //for the six nodes and the bubble 
-	IssmDouble dh1dh6[3][NUMVERTICES];
 	GaussPenta *gauss=NULL;
 
 	/*Stabilization*/
-	bool       stabilization = true;
 	IssmDouble dbasis[3][6];
 	IssmDouble dmu[3];
@@ -9412,5 +9402,4 @@
 
 		GetJacobianDeterminant(&Jdet, &xyz_list[0][0],gauss);
-		GetNodalFunctionsP1(&l1l6[0], gauss);
 		this->GetStrainRate3d(&epsilon[0],&xyz_list[0][0],gauss,vx_input,vy_input,vz_input);
 		material->GetViscosity3dFS(&viscosity,&epsilon[0]);
@@ -9790,7 +9779,4 @@
 /*FUNCTION Penta::CreateJacobianStressbalanceHO{{{*/
 ElementMatrix* Penta::CreateJacobianStressbalanceHO(void){
-
-	/*Constants*/
-	const int    numdof=NDOF2*NUMVERTICES;
 
 	/*Intermediaries */
@@ -10670,9 +10656,4 @@
 	int*       doflists        = NULL;
 	int*       doflistpressure = NULL;
-	Penta      *penta          = NULL;
-
-	/*OK, we have to add results of this element for HO 
-	 * and results from the penta at base for SSA. Now recover results*/
-	penta=GetBasalElement();
 
 	/*Get dof listof this element (HO dofs) and of the penta at base (SSA dofs): */
Index: /issm/trunk-jpl/src/c/classes/Elements/Tria.cpp
===================================================================
--- /issm/trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 16163)
+++ /issm/trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 16164)
@@ -350,5 +350,4 @@
 
 	/*retrive parameters: */
-	ElementVector* pe=NULL;
 	int analysis_type;
 	parameters->FindParam(&analysis_type,AnalysisTypeEnum);
@@ -1225,6 +1224,5 @@
 	/*Recover input*/
 	Input* input=inputs->GetInput(enumtype);
-	if (!input) _error_("Input " << EnumToStringx(enumtype) << " not found in element");
-	int    numnodes = this->NumberofNodes();
+	if(!input) _error_("Input " << EnumToStringx(enumtype) << " not found in element");
 
 	/* Start looping on the number of vertices: */
@@ -2041,10 +2039,8 @@
 
 	/*Intermediaries*/
-	int     i;
-	int     numberofresults = 0;
-	int     *resultsenums   = NULL;
-	int     *resultssizes   = NULL;
-	IssmDouble  *resultstimes   = NULL;
-	int     *resultssteps   = NULL;
+	int        *resultsenums    = NULL;
+	int        *resultssizes    = NULL;
+	IssmDouble *resultstimes    = NULL;
+	int        *resultssteps    = NULL;
 
 	/*Checks*/
@@ -2052,8 +2048,5 @@
 
 	/*Count number of results*/
-	for(i=0;i<this->results->Size();i++){
-		ElementResult* elementresult=(ElementResult*)this->results->GetObjectByOffset(i);
-		numberofresults++;
-	}
+	int numberofresults = this->results->Size();
 
 	if(numberofresults){
@@ -2066,5 +2059,5 @@
 
 		/*populate enums*/
-		for(i=0;i<this->results->Size();i++){
+		for(int i=0;i<this->results->Size();i++){
 			ElementResult* elementresult=(ElementResult*)this->results->GetObjectByOffset(i);
 			resultsenums[i]=elementresult->InstanceEnum();
@@ -2420,5 +2413,4 @@
 	/*Intermediaries*/
 	int        i;
-	int        tria_vertex_ids[3];
 	IssmDouble nodeinputs[3];
 	IssmDouble yts;
@@ -2441,9 +2433,4 @@
 	/*Recover element type*/
 	this->SetElementType(finiteelement_type,analysis_counter);
-
-	/*Recover vertices ids needed to initialize inputs*/
-	for(i=0;i<3;i++){ 
-		tria_vertex_ids[i]=reCast<int>(iomodel->elements[3*index+i]); //ids for vertices are in the elements array from Matlab
-	}
 
 	/*Recover nodes ids needed to initialize the node hook.*/
@@ -3181,5 +3168,4 @@
 	/*Fetch number of nodes and dof for this finite element*/
 	int numnodes = this->NumberofNodes();
-	int numdof   = numnodes*NDOF2;
 
 	/*Initialize Element vector and vectors*/
@@ -3314,5 +3300,4 @@
 	/*Fetch number of nodes and dof for this finite element*/
 	int numnodes = this->NumberofNodes(); _assert_(numnodes==3); 
-	int numdof   = numnodes*NDOF2;
 
 	/*Initialize Element vector*/
@@ -3371,5 +3356,4 @@
 	/*Fetch number of nodes and dof for this finite element*/
 	int numnodes = this->NumberofNodes();
-	int numdof   = numnodes*NDOF2;
 
 	/*Initialize Element matrix, vectors and Gaussian points*/
@@ -4033,5 +4017,4 @@
 	IssmDouble grade_g_gaussian[NUMVERTICES];
 	IssmDouble basis[3];
-	IssmDouble epsilon[3]; /* epsilon=[exx,eyy,exy];*/
 	Friction*  friction=NULL;
 	GaussTria  *gauss=NULL;
@@ -4537,5 +4520,4 @@
 IssmDouble Tria::SurfaceLogVxVyMisfit(int weight_index){
 
-	int        fit=-1;
 	IssmDouble Jelem=0, S=0;
 	IssmDouble epsvel=2.220446049250313e-16;
@@ -7258,5 +7240,4 @@
 	IssmDouble D_scalar,Jdet,thickness;
 	IssmDouble xyz_list[NUMVERTICES][3];
-	IssmDouble D[2][2];
 	IssmDouble l=8.;
 
@@ -7498,6 +7479,4 @@
 	ElementVector* pe    = new ElementVector(nodes,numnodes,this->parameters);
 	IssmDouble*    basis  = xNew<IssmDouble>(numnodes);
-	IssmDouble*    Vx     = xNew<IssmDouble>(numnodes);
-	IssmDouble*    Vy     = xNew<IssmDouble>(numnodes);
 
 	/*Retrieve all inputs and parameters*/
Index: /issm/trunk-jpl/src/c/classes/FemModel.cpp
===================================================================
--- /issm/trunk-jpl/src/c/classes/FemModel.cpp	(revision 16163)
+++ /issm/trunk-jpl/src/c/classes/FemModel.cpp	(revision 16164)
@@ -400,5 +400,4 @@
 void FemModel::UpdateConstraintsx(void){ /*{{{*/
 
-	Element   *element = NULL;
 	IssmDouble time;
 	int        analysis_type;
@@ -1022,7 +1021,6 @@
 
 	/*Intermediary*/
-	int      num_responses;
-	Element *element       = NULL;
-	int     *responses     = NULL;
+	int num_responses;
+	int *responses = NULL;
 
 	/*output: */
Index: /issm/trunk-jpl/src/c/classes/IoModel.cpp
===================================================================
--- /issm/trunk-jpl/src/c/classes/IoModel.cpp	(revision 16163)
+++ /issm/trunk-jpl/src/c/classes/IoModel.cpp	(revision 16164)
@@ -288,12 +288,9 @@
 	va_list ap;
 	int     dataenum;
-	int     i;
-	DoubleMatParam* parameter=NULL;
 
 	/*Go through the entire list of enums and delete the corresponding data from the iomodel-data dataset: */
-
 	va_start(ap,num);
-	for(i = 0; i <num; i++){
-		dataenum=va_arg(ap, int);
+	for(int i=0;i<num;i++){
+		dataenum=va_arg(ap,int);
 		_assert_(dataenum<MaximumNumberOfDefinitionsEnum);
 
@@ -1041,7 +1038,4 @@
 	int     i;
 	bool    defaulting    = false;
-	bool    transient     = false;
-
-	FILE   *fid           = NULL;
 	int     code          = 0;
 	int     vector_layout = 0;
@@ -1061,5 +1055,5 @@
 
 	/*First of, find the record for the enum, and get code  of data type: */
-	fid=this->SetFilePointerToData(&code, &vector_layout,vector_enum);
+	this->SetFilePointerToData(&code, &vector_layout,vector_enum);
 
 	switch(code){
Index: /issm/trunk-jpl/src/c/classes/Loads/Numericalflux.cpp
===================================================================
--- /issm/trunk-jpl/src/c/classes/Loads/Numericalflux.cpp	(revision 16163)
+++ /issm/trunk-jpl/src/c/classes/Loads/Numericalflux.cpp	(revision 16164)
@@ -39,15 +39,10 @@
 	int  pos1,pos2,pos3,pos4;
 	int  num_nodes;
-	int  num_elems;
 
 	/*numericalflux constructor data: */
 	int   numericalflux_elem_ids[2];
-	int   numericalflux_mparid;
 	int   numericalflux_vertex_ids[2];
 	int   numericalflux_node_ids[4];
 	int   numericalflux_type;
-
-	/* Get MatPar id */
-	numericalflux_mparid=iomodel->numberofelements+1; //matlab indexing
 
 	/*Get edge*/
@@ -60,5 +55,5 @@
 	if(e2==-1){
 		/* Boundary edge, only one element */
-		num_elems=1; num_nodes=2;
+		num_nodes=2;
 		numericalflux_type=BoundaryEnum;
 		numericalflux_elem_ids[0]=e1;
@@ -66,5 +61,5 @@
 	else{
 		/* internal edge: connected to 2 elements */
-		num_elems=2; num_nodes=4;
+		 num_nodes=4;
 		numericalflux_type=InternalEnum;
 		numericalflux_elem_ids[0]=e1;
Index: /issm/trunk-jpl/src/c/classes/Loads/Pengrid.cpp
===================================================================
--- /issm/trunk-jpl/src/c/classes/Loads/Pengrid.cpp	(revision 16163)
+++ /issm/trunk-jpl/src/c/classes/Loads/Pengrid.cpp	(revision 16164)
@@ -441,6 +441,4 @@
 
 	//   The penalty is stable if it doesn't change during to successive iterations.   
-
-	int        found=0;
 	const int  numnodes=1;
 	IssmDouble pressure;
@@ -449,5 +447,4 @@
 	int        new_active;
 	int        unstable=0;
-	int        reset_penalties=0;
 	int        penalty_lock;
 
@@ -508,5 +505,4 @@
 ElementMatrix* Pengrid::PenaltyCreateKMatrixMelting(IssmDouble kmax){
 
-	const int numdof=NUMVERTICES*NDOF1;
 	IssmDouble pressure,temperature,t_pmp;
 	IssmDouble penalty_factor;
@@ -538,5 +534,4 @@
 ElementMatrix* Pengrid::PenaltyCreateKMatrixThermal(IssmDouble kmax){
 
-	const int numdof=NUMVERTICES*NDOF1;
 	IssmDouble    penalty_factor;
 
@@ -557,5 +552,4 @@
 ElementVector* Pengrid::PenaltyCreatePVectorMelting(IssmDouble kmax){
 
-	const int numdof=NUMVERTICES*NDOF1;
 	IssmDouble pressure;
 	IssmDouble temperature;
@@ -600,5 +594,4 @@
 ElementVector* Pengrid::PenaltyCreatePVectorThermal(IssmDouble kmax){
 
-	const int numdof=NUMVERTICES*NDOF1;
 	IssmDouble pressure;
 	IssmDouble t_pmp;
@@ -632,6 +625,4 @@
 	const int  numnodes        = 1;
 	int        unstable        = 0;
-	int        reset_penalties = 0;
-	int        found           = 0;	
 	int        new_active;
 	IssmDouble pressure;
@@ -669,5 +660,4 @@
 ElementMatrix* Pengrid::PenaltyCreateKMatrixHydrologyDCInefficient(IssmDouble kmax){
 
-	const int numdof=NUMVERTICES*NDOF1;
 	IssmDouble    penalty_factor;
 
@@ -688,5 +678,4 @@
 ElementVector* Pengrid::PenaltyCreatePVectorHydrologyDCInefficient(IssmDouble kmax){
 
-	const int  numdof=NUMVERTICES*NDOF1;
 	IssmDouble h_max;
 	IssmDouble penalty_factor;
Index: /issm/trunk-jpl/src/c/classes/Loads/Riftfront.cpp
===================================================================
--- /issm/trunk-jpl/src/c/classes/Loads/Riftfront.cpp	(revision 16163)
+++ /issm/trunk-jpl/src/c/classes/Loads/Riftfront.cpp	(revision 16164)
@@ -454,5 +454,4 @@
 
 	const int   numdof = NDOF2*NUMVERTICES;
-	int         dofs[1]             = {0};
 	IssmDouble  thickness;
 	IssmDouble  h[2];
@@ -534,5 +533,4 @@
 ElementVector* Riftfront::PenaltyCreatePVectorStressbalanceHoriz(IssmDouble kmax){
 
-	const int  numdof = NDOF2*NUMVERTICES;
 	int        j;
 	IssmDouble rho_ice;
@@ -636,17 +634,16 @@
 int Riftfront::Constrain(int* punstable){
 
-	const int   numnodes        = 2;
-	IssmDouble      penetration;
+	IssmDouble  penetration;
 	int         activate;
 	int         unstable;
-	IssmDouble      vx1;
-	IssmDouble      vy1;
-	IssmDouble      vx2;
-	IssmDouble      vy2;
-	IssmDouble      fractionincrement;
+	IssmDouble  vx1;
+	IssmDouble  vy1;
+	IssmDouble  vx2;
+	IssmDouble  vy2;
+	IssmDouble  fractionincrement;
 
 	/*Objects: */
-	Tria       *tria1           = NULL;
-	Tria       *tria2           = NULL;
+	Tria  *tria1 = NULL;
+	Tria  *tria2 = NULL;
 
 	/*enum of element? */
@@ -756,14 +753,13 @@
 int   Riftfront::MaxPenetration(IssmDouble* ppenetration){
 
-	const int     numnodes=2;
-	IssmDouble        penetration=0;
-	IssmDouble      vx1;
-	IssmDouble      vy1;
-	IssmDouble      vx2;
-	IssmDouble      vy2;
+	IssmDouble penetration;
+	IssmDouble vx1;
+	IssmDouble vy1;
+	IssmDouble vx2;
+	IssmDouble vy2;
 
 	/*Objects: */
-	Tria       *tria1           = NULL;
-	Tria       *tria2           = NULL;
+	Tria  *tria1 = NULL;
+	Tria  *tria2 = NULL;
 
 	/*enum of element? */
@@ -773,7 +769,4 @@
 	tria1=(Tria*)elements[0];
 	tria2=(Tria*)elements[1];
-
-	//initialize: 
-	penetration=-1;
 
 	/*recover velocity: */
@@ -787,8 +780,8 @@
 
 	/*Now, we return penetration only if we are active!: */
-	if(this->active==0)penetration=-1;
+	if(this->active==0) penetration=-1.;
 
 	/*If we are zigzag locked, same thing: */
-	if(this->counter>this->penalty_lock)penetration=-1;
+	if(this->counter>this->penalty_lock) penetration=-1.;
 
 	/*assign output pointer: */
@@ -838,5 +831,4 @@
 int   Riftfront::PotentialUnstableConstraint(int* punstable){
 
-	const int   numnodes        = 2;
 	IssmDouble  penetration;
 	int         unstable;
@@ -887,15 +879,14 @@
 int   Riftfront::PreConstrain(int* punstable){
 
-	const int   numnodes    = 2;
-	IssmDouble      penetration;
+	IssmDouble  penetration;
 	int         unstable;
-	IssmDouble      vx1;
-	IssmDouble      vy1;
-	IssmDouble      vx2;
-	IssmDouble      vy2;
+	IssmDouble  vx1;
+	IssmDouble  vy1;
+	IssmDouble  vx2;
+	IssmDouble  vy2;
 
 	/*Objects: */
-	Tria       *tria1       = NULL;
-	Tria       *tria2       = NULL;
+	Tria *tria1 = NULL;
+	Tria *tria2 = NULL;
 
 	/*enum of element? */
Index: /issm/trunk-jpl/src/c/classes/Node.cpp
===================================================================
--- /issm/trunk-jpl/src/c/classes/Node.cpp	(revision 16163)
+++ /issm/trunk-jpl/src/c/classes/Node.cpp	(revision 16164)
@@ -26,5 +26,4 @@
 	/*Intermediary*/
 	int k,l;
-	int gsize;
 
 	/*id: */
@@ -41,5 +40,4 @@
 	this->indexingupdate = true;
 	DistributeNumDofs(&this->indexing,analysis_type,in_approximation); //number of dofs per node
-	gsize=this->indexing.gsize;
 
 	if(analysis_type==StressbalanceAnalysisEnum)
@@ -1128,9 +1126,8 @@
 void CoordinateSystemTransform(IssmDouble** ptransform,Node** nodes,int numnodes,int* cs_array){/*{{{*/
 
-	int     i,counter;
-	int     numdofs           = 0;
+	int         i,counter;
+	int         numdofs   = 0;
 	IssmDouble  norm;
-	IssmDouble *transform         = NULL;
-	IssmDouble *values            = NULL;
+	IssmDouble *transform = NULL;
 	IssmDouble  coord_system[3][3];
 
Index: /issm/trunk-jpl/src/c/classes/kriging/Observations.cpp
===================================================================
--- /issm/trunk-jpl/src/c/classes/kriging/Observations.cpp	(revision 16163)
+++ /issm/trunk-jpl/src/c/classes/kriging/Observations.cpp	(revision 16164)
@@ -125,5 +125,5 @@
 	/*Output and Intermediaries*/
 	int          nobs,i,index;
-	IssmPDouble  hmin,h2,hmin2,radius2;
+	IssmPDouble  hmin,h2,hmin2;
 	int         *indices      = NULL;
 	Observation *observation  = NULL;
@@ -139,7 +139,4 @@
 		if(hmin<radius) radius=hmin;
 	}
-
-	/*Compute radius square*/
-	radius2 = radius*radius;
 
 	/*Find all observations that are in radius*/
Index: /issm/trunk-jpl/src/c/classes/kriging/Quadtree.cpp
===================================================================
--- /issm/trunk-jpl/src/c/classes/kriging/Quadtree.cpp	(revision 16163)
+++ /issm/trunk-jpl/src/c/classes/kriging/Quadtree.cpp	(revision 16164)
@@ -257,5 +257,5 @@
 	QuadtreeBox  *box  = NULL;
 	int           xi,yi;
-	int           level,levelbin;
+	int           levelbin;
 	int           index = -1;
 	double        length,length2;
@@ -264,6 +264,5 @@
 	this->IntergerCoordinates(&xi,&yi,x,y);
 
-	/*Initialize levels*/
-	level    = 0;
+	/*Initialize level*/
 	levelbin = (1L<<this->MaxDepth);// = 2^30
 
@@ -273,7 +272,5 @@
 	/*Find the smallest box where this point is located*/
 	while((box=*pbox) && (box->nbitems<0)){ 
-
-		levelbin>>=1; level+=1; 
-
+		levelbin>>=1;
 		pbox = &box->box[IJ(xi,yi,levelbin)];
 	}
Index: /issm/trunk-jpl/src/c/main/kriging.cpp
===================================================================
--- /issm/trunk-jpl/src/c/main/kriging.cpp	(revision 16163)
+++ /issm/trunk-jpl/src/c/main/kriging.cpp	(revision 16164)
@@ -14,5 +14,4 @@
 	FILE *output_fid = NULL;
 	FILE *input_fid  = NULL;
-	bool  waitonlock = false;
 
 	/*File names*/
Index: /issm/trunk-jpl/src/c/modules/AverageOntoPartitionx/AverageOntoPartitionx.cpp
===================================================================
--- /issm/trunk-jpl/src/c/modules/AverageOntoPartitionx/AverageOntoPartitionx.cpp	(revision 16163)
+++ /issm/trunk-jpl/src/c/modules/AverageOntoPartitionx/AverageOntoPartitionx.cpp	(revision 16164)
@@ -19,5 +19,4 @@
 	int     npart;
 	double *qmu_part  = NULL;
-	int     numberofvertices;
 
 	/*output: */
@@ -31,5 +30,4 @@
 
 	/*Some parameters: */
-	numberofvertices=vertices->NumberOfVertices();
 	parameters->FindParam(&npart,QmuNumberofpartitionsEnum);
 
Index: /issm/trunk-jpl/src/c/modules/ComputeBasalStressx/ComputeBasalStressx.cpp
===================================================================
--- /issm/trunk-jpl/src/c/modules/ComputeBasalStressx/ComputeBasalStressx.cpp	(revision 16163)
+++ /issm/trunk-jpl/src/c/modules/ComputeBasalStressx/ComputeBasalStressx.cpp	(revision 16164)
@@ -11,8 +11,6 @@
 
 	/*Intermediary*/
-	int i;
-	int      found=0;
-	IssmDouble   numberofelements;
-	Element* element=NULL;
+	IssmDouble numberofelements;
+	Element*   element=NULL;
 
 	/*output: */
@@ -26,5 +24,5 @@
 
 	/*Compute basal stress for each element: */
-	for (i=0;i<elements->Size();i++){
+	for(int i=0;i<elements->Size();i++){
 		element=dynamic_cast<Element*>(elements->GetObjectByOffset(i));
 		element->ComputeBasalStress(sigma);
Index: /issm/trunk-jpl/src/c/modules/ComputeStrainRatex/ComputeStrainRatex.cpp
===================================================================
--- /issm/trunk-jpl/src/c/modules/ComputeStrainRatex/ComputeStrainRatex.cpp	(revision 16163)
+++ /issm/trunk-jpl/src/c/modules/ComputeStrainRatex/ComputeStrainRatex.cpp	(revision 16164)
@@ -8,9 +8,7 @@
 #include "../../toolkits/toolkits.h"
 
-void	ComputeStrainRatex( Vector<IssmDouble>** peps,Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,Parameters* parameters){
+void	ComputeStrainRatex(Vector<IssmDouble>** peps,Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,Parameters* parameters){
 
 	/*Intermediary*/
-	int i;
-	int      found=0;
 	int      numberofelements;
 	Element* element=NULL;
@@ -26,5 +24,5 @@
 
 	/*Compute basal stress for each element: */
-	for (i=0;i<elements->Size();i++){
+	for(int i=0;i<elements->Size();i++){
 		element=dynamic_cast<Element*>(elements->GetObjectByOffset(i));
 		element->ComputeStrainRate(eps);
Index: /issm/trunk-jpl/src/c/modules/ConfigureObjectsx/ConfigureObjectsx.cpp
===================================================================
--- /issm/trunk-jpl/src/c/modules/ConfigureObjectsx/ConfigureObjectsx.cpp	(revision 16163)
+++ /issm/trunk-jpl/src/c/modules/ConfigureObjectsx/ConfigureObjectsx.cpp	(revision 16164)
@@ -12,11 +12,10 @@
 
 	/*Intermediary*/
-	int i;
-	int noerr=1;
-	int configuration_type;
-	Element  *element  = NULL;
-	Load     *load     = NULL;
-	Node     *node     = NULL;
-	Material *material = NULL;
+	int       i;
+	int       noerr = 1;
+	int       configuration_type;
+	Element  *element            = NULL;
+	Load     *load               = NULL;
+	Material *material           = NULL;
 
 	/*Get analysis type: */
@@ -24,10 +23,10 @@
 
 	if(VerboseMProcessor()) _printf0_("      Configuring elements...\n");
-	for (i=0;i<elements->Size();i++){
+	for(i=0;i<elements->Size();i++){
 		element=dynamic_cast<Element*>(elements->GetObjectByOffset(i));
 		element->Configure(elements,loads,nodes,vertices,materials,parameters);
 	}
 	if(VerboseMProcessor()) _printf0_("      Configuring loads...\n");
-	for (i=0;i<loads->Size();i++){
+	for(i=0;i<loads->Size();i++){
 		load=(Load*)loads->GetObjectByOffset(i);
 		if (load->InAnalysis(configuration_type)){
@@ -36,5 +35,5 @@
 	}
 	if(VerboseMProcessor()) _printf0_("      Configuring materials...\n");
-	for (i=0;i<materials->Size();i++){
+	for(i=0;i<materials->Size();i++){
 		material=(Material*)materials->GetObjectByOffset(i);
 		material->Configure(elements);
Index: /issm/trunk-jpl/src/c/modules/ConstraintsStatex/RiftConstraintsState.cpp
===================================================================
--- /issm/trunk-jpl/src/c/modules/ConstraintsStatex/RiftConstraintsState.cpp	(revision 16163)
+++ /issm/trunk-jpl/src/c/modules/ConstraintsStatex/RiftConstraintsState.cpp	(revision 16164)
@@ -230,16 +230,8 @@
 void RiftSetPreStable(Loads* loads){
 
-	int i;
-
-	Riftfront* riftfront=NULL;
-	int found=0;
-	int mpi_found=0;
-
 	/*go though loads, and set loads to pre stable.:*/
-	for (i=0;i<loads->Size();i++){
-
+	for(int i=0;i<loads->Size();i++){
 		if(RiftfrontEnum==loads->GetEnum(i)){
-
-			riftfront=(Riftfront*)loads->GetObjectByOffset(i);
+			Riftfront* riftfront=(Riftfront*)loads->GetObjectByOffset(i);
 			riftfront->SetPreStable();
 		}
Index: /issm/trunk-jpl/src/c/modules/ContourToMeshx/ContourToMeshxt.cpp
===================================================================
--- /issm/trunk-jpl/src/c/modules/ContourToMeshx/ContourToMeshxt.cpp	(revision 16163)
+++ /issm/trunk-jpl/src/c/modules/ContourToMeshx/ContourToMeshxt.cpp	(revision 16164)
@@ -13,39 +13,22 @@
 void* ContourToMeshxt(void* vpthread_handle){
 
-	int noerr=1;
-
 	/*gate variables :*/
-	ContourToMeshxThreadStruct* gate=NULL;
-	pthread_handle* handle=NULL;
-	int     my_thread;
-	int     num_threads;
-	int     i0;
-	int     i1;
-
-	int i;
-
-	/*Contour:*/
-	Contours* contours=NULL;
-
-	/*parameters: */
-	int nods;
-	int edgevalue;
-	double* x=NULL;
-	double* y=NULL;
-	double* in_nod=NULL;
+	ContourToMeshxThreadStruct *gate        = NULL;
+	pthread_handle             *handle      = NULL;
+	int  i,i1,i0;
 
 	/*recover handle and gate: */
-	handle=(pthread_handle*)vpthread_handle;
-	gate=(ContourToMeshxThreadStruct*)handle->gate;
-	my_thread=handle->id;
-	num_threads=handle->num;
+	handle          = (pthread_handle*)vpthread_handle;
+	gate            = (ContourToMeshxThreadStruct*)handle->gate;
+	int my_thread   = handle->id;
+	int num_threads = handle->num;
 
 	/*recover parameters :*/
-	contours=gate->contours;
-	nods=gate->nods;
-	edgevalue=gate->edgevalue;
-	in_nod=gate->in_nod;
-	x=gate->x;
-	y=gate->y;
+	Contours* contours  = gate->contours;
+	int       nods      = gate->nods;
+	int       edgevalue = gate->edgevalue;
+	double   *in_nod    = gate->in_nod;
+	double   *x         = gate->x;
+	double   *y         = gate->y;
 
 	/*distribute indices across threads :*/
Index: /issm/trunk-jpl/src/c/modules/ContourToNodesx/ContourToNodesx.cpp
===================================================================
--- /issm/trunk-jpl/src/c/modules/ContourToNodesx/ContourToNodesx.cpp	(revision 16163)
+++ /issm/trunk-jpl/src/c/modules/ContourToNodesx/ContourToNodesx.cpp	(revision 16164)
@@ -34,9 +34,4 @@
 int ContourToNodesx(IssmPDouble** pflags,double* x, double* y, int nods, Contours* contours, int edgevalue){
 
-	/*Contour:*/
-	Contour<IssmPDouble>* contouri=NULL;
-	double*  xc=NULL;
-	double*  yc=NULL;
-
 	/*output: */
 	IssmPDouble* flags=NULL;
Index: /issm/trunk-jpl/src/c/modules/CreateJacobianMatrixx/CreateJacobianMatrixx.cpp
===================================================================
--- /issm/trunk-jpl/src/c/modules/CreateJacobianMatrixx/CreateJacobianMatrixx.cpp	(revision 16163)
+++ /issm/trunk-jpl/src/c/modules/CreateJacobianMatrixx/CreateJacobianMatrixx.cpp	(revision 16164)
@@ -11,6 +11,5 @@
 
 	int      i,connectivity;
-	int      numberofdofspernode;
-	int      fsize,configuration_type;
+	int      configuration_type;
 	Element *element = NULL;
 	Load    *load    = NULL;
@@ -23,6 +22,4 @@
 	femmodel->parameters->FindParam(&configuration_type,ConfigurationTypeEnum);
 	femmodel->parameters->FindParam(&connectivity,MeshAverageVertexConnectivityEnum);
-	fsize=femmodel->nodes->NumberOfDofs(configuration_type,FsetEnum);
-	numberofdofspernode=femmodel->nodes->MaxNumDofs(configuration_type,GsetEnum);
 
 	/*Initialize Jacobian Matrix*/
Index: /issm/trunk-jpl/src/c/modules/GiaDeflectionCorex/GiaDeflectionCorex.cpp
===================================================================
--- /issm/trunk-jpl/src/c/modules/GiaDeflectionCorex/GiaDeflectionCorex.cpp	(revision 16163)
+++ /issm/trunk-jpl/src/c/modules/GiaDeflectionCorex/GiaDeflectionCorex.cpp	(revision 16164)
@@ -92,20 +92,20 @@
 
 	/*Recover material parameters and loading history: see GiaDeflectionCoreArgs for more details {{{*/
-	ri=arguments->ri;
-	re=arguments->re;
-	hes=arguments->hes;
-	times=arguments->times;
-	numtimes=arguments->numtimes;
-	currenttime=arguments->currenttime;
-	lithosphere_shear_modulus=arguments->lithosphere_shear_modulus;
-	lithosphere_density=arguments->lithosphere_density;
-	mantle_shear_modulus=arguments->mantle_shear_modulus;
-	mantle_viscosity=arguments->mantle_viscosity;
-	mantle_density=arguments->mantle_density;
-	lithosphere_thickness=arguments->lithosphere_thickness;
-	rho_ice=arguments->rho_ice; 
-	disk_id=arguments->idisk;
-	iedge=arguments->iedge;
-	yts=arguments->yts;
+	ri                        = arguments->ri;
+	re                        = arguments->re;
+	hes                       = arguments->hes;
+	times                     = arguments->times;
+	numtimes                  = arguments->numtimes;
+	currenttime               = arguments->currenttime;
+	lithosphere_shear_modulus = arguments->lithosphere_shear_modulus;
+	lithosphere_density       = arguments->lithosphere_density;
+	mantle_shear_modulus      = arguments->mantle_shear_modulus;
+	mantle_viscosity          = arguments->mantle_viscosity;
+	mantle_density            = arguments->mantle_density;
+	lithosphere_thickness     = arguments->lithosphere_thickness;
+	rho_ice                   = arguments->rho_ice;
+	disk_id                   = arguments->idisk;
+	iedge                     = arguments->iedge;
+	yts                       = arguments->yts;
 
 	/*}}}*/
Index: /issm/trunk-jpl/src/c/modules/GroundinglineMigrationx/GroundinglineMigrationx.cpp
===================================================================
--- /issm/trunk-jpl/src/c/modules/GroundinglineMigrationx/GroundinglineMigrationx.cpp	(revision 16163)
+++ /issm/trunk-jpl/src/c/modules/GroundinglineMigrationx/GroundinglineMigrationx.cpp	(revision 16164)
@@ -80,5 +80,5 @@
 /*FUNCTION PropagateFloatingiceToGroundedNeighbors {{{*/
 IssmDouble*    PropagateFloatingiceToGroundedNeighbors(Elements* elements,Nodes* nodes,Vertices* vertices,Parameters* parameters,IssmDouble* vertices_potentially_ungrounding){ 
-	int                 i,analysis_type,numberofvertices;
+	int                 i,analysis_type;
 	int                 nflipped,local_nflipped;
 	IssmDouble*         phi                                  = NULL;
@@ -86,10 +86,8 @@
 	Vector<IssmDouble>* vec_elements_neighboring_floatingice = NULL;
 	Vector<IssmDouble>* vec_phi                              = NULL;
-	Node*               node                                  = NULL;
 	Element*            element                               = NULL;
 
 	/*recover parameters: */
 	parameters->FindParam(&analysis_type,AnalysisTypeEnum);
-	numberofvertices=vertices->NumberOfVertices();
 
 	/*recover vec_phi*/
Index: /issm/trunk-jpl/src/c/modules/InterpFromGridToMeshx/InterpFromGridToMeshx.cpp
===================================================================
--- /issm/trunk-jpl/src/c/modules/InterpFromGridToMeshx/InterpFromGridToMeshx.cpp	(revision 16163)
+++ /issm/trunk-jpl/src/c/modules/InterpFromGridToMeshx/InterpFromGridToMeshx.cpp	(revision 16164)
@@ -134,5 +134,4 @@
 
 	bool debug = M*N>1? true:false;
-	debug = true;
 
 	/*partition loop across threads: */
Index: /issm/trunk-jpl/src/c/modules/IoModelToConstraintsx/IoModelToConstraintsx.cpp
===================================================================
--- /issm/trunk-jpl/src/c/modules/IoModelToConstraintsx/IoModelToConstraintsx.cpp	(revision 16163)
+++ /issm/trunk-jpl/src/c/modules/IoModelToConstraintsx/IoModelToConstraintsx.cpp	(revision 16164)
@@ -11,5 +11,4 @@
 
 	/*intermediary: */
-	FILE       *fid = NULL;
 	int         code,vector_layout;
 	IssmDouble *spcdata = NULL;
@@ -17,5 +16,5 @@
 
 	/*First of, find the record for the enum, and get code  of data type: */
-	fid=iomodel->SetFilePointerToData(&code, &vector_layout,vector_enum);
+	iomodel->SetFilePointerToData(&code, &vector_layout,vector_enum);
 	if(code!=7)_error_("expecting a IssmDouble vector for constraints with enum " << EnumToStringx(vector_enum));
 	if(vector_layout!=1)_error_("expecting a nodal vector for constraints with enum " << EnumToStringx(vector_enum));
Index: /issm/trunk-jpl/src/c/modules/Kml2Expx/Kml2Expx.cpp
===================================================================
--- /issm/trunk-jpl/src/c/modules/Kml2Expx/Kml2Expx.cpp	(revision 16163)
+++ /issm/trunk-jpl/src/c/modules/Kml2Expx/Kml2Expx.cpp	(revision 16164)
@@ -8,28 +8,20 @@
 #include "../KMLFileReadx/KMLFileReadx.h"
 
-int Kml2Expx(char* filkml,char* filexp,
-			 int sgn){
+int Kml2Expx(char* filkml,char* filexp,int sgn){
 
 	double  cm,sp;
-
 	Ll2xydef(&cm,&sp,sgn);
 
-	return(Kml2Expx(filkml,filexp,
-					sgn,cm,sp));
+	return(Kml2Expx(filkml,filexp,sgn,cm,sp));
 }
 
-int Kml2Expx(char* filkml,char* filexp,
-			 int sgn,double cm,double sp){
+int Kml2Expx(char* filkml,char* filexp,int sgn,double cm,double sp){
 
-	int     iret=0;
-	double  *lat=NULL,*lon=NULL;
-
-	KML_Object*  kobj=NULL;
-
-	FILE*   fidi=NULL;
-	FILE*   fido=NULL;
-
-	clock_t clock0,clock1;
-	time_t  time0, time1;
+	int         iret   = 0;
+	KML_Object *kobj   = NULL;
+	FILE       *fidi   = NULL;
+	FILE       *fido   = NULL;
+	clock_t     clock0,clock1;
+	time_t      time0 ,time1;
 
 	clock0=clock();
@@ -37,24 +29,19 @@
 	_printf0_("\nKml2Expx Module -- " << ctime(&time0));
 
-/*  read kml file  */
-
+	/*read kml file*/
 	fidi=fopen(filkml,"r");
 	if (!(kobj=KMLFileReadx(fidi)))
-		_error_("Error reading kml file.");
+	 _error_("Error reading kml file.");
 	fclose(fidi);
 
-/*  open exp file  */
-
+	/*open exp file*/
 	_printf0_("Writing exp profiles to file.\n");
 	fido=fopen(filexp,"w");
 
-/*  write the polygons and linestrings  */
-
+	/*write the polygons and linestrings  */
 	kobj->WriteExp(fido,"",sgn,cm,sp);
 
-/*  close exp file  */
-
+	/*close exp file  */
 	fclose(fido);
-
 	delete kobj;
 
Index: /issm/trunk-jpl/src/c/modules/MeshProfileIntersectionx/MeshProfileIntersectionx.cpp
===================================================================
--- /issm/trunk-jpl/src/c/modules/MeshProfileIntersectionx/MeshProfileIntersectionx.cpp	(revision 16163)
+++ /issm/trunk-jpl/src/c/modules/MeshProfileIntersectionx/MeshProfileIntersectionx.cpp	(revision 16164)
@@ -75,6 +75,5 @@
 
 	/*output: */
-	double*  segments=NULL;
-	Segment<double>* segment=NULL;
+	double* segments=NULL;
 	int     numsegs;
 
Index: /issm/trunk-jpl/src/c/modules/ModelProcessorx/CreateParameters.cpp
===================================================================
--- /issm/trunk-jpl/src/c/modules/ModelProcessorx/CreateParameters.cpp	(revision 16163)
+++ /issm/trunk-jpl/src/c/modules/ModelProcessorx/CreateParameters.cpp	(revision 16164)
@@ -188,4 +188,5 @@
 			temp_m=mdims_array[i];
 			temp_n=ndims_array[i];
+			_assert_(temp_n==5);
 
 			m=0;
Index: /issm/trunk-jpl/src/c/modules/ModelProcessorx/Stressbalance/CreateConstraintsStressbalance.cpp
===================================================================
--- /issm/trunk-jpl/src/c/modules/ModelProcessorx/Stressbalance/CreateConstraintsStressbalance.cpp	(revision 16163)
+++ /issm/trunk-jpl/src/c/modules/ModelProcessorx/Stressbalance/CreateConstraintsStressbalance.cpp	(revision 16164)
@@ -85,4 +85,7 @@
 			}
 		}
+		else{
+			_error_("model not supported yet");
+		}
 
 		IoModelToConstraintsx(constraints,iomodel,StressbalanceSpcvxEnum,StressbalanceAnalysisEnum,finiteelement,1);
Index: /issm/trunk-jpl/src/c/modules/ModelProcessorx/Stressbalance/CreateLoadsStressbalance.cpp
===================================================================
--- /issm/trunk-jpl/src/c/modules/ModelProcessorx/Stressbalance/CreateLoadsStressbalance.cpp	(revision 16163)
+++ /issm/trunk-jpl/src/c/modules/ModelProcessorx/Stressbalance/CreateLoadsStressbalance.cpp	(revision 16164)
@@ -9,7 +9,4 @@
 void	CreateLoadsStressbalance(Loads** ploads, IoModel* iomodel){
 
-	/*DataSets*/
-	Pengrid   *pengrid   = NULL;
-
 	/*Intermediary*/
 	int         segment_width;
@@ -19,13 +16,6 @@
 	int         penpair_ids[2];
 	bool        isSSA,isL1L2,isHO,isFS;
-	int         numpenalties,numberofpressureloads,numrifts,numriftsegments;
-	IssmDouble *pressureload   = NULL;
-	IssmDouble *elements_type  = NULL;
-	IssmDouble *nodeoniceshelf = NULL;
+	int         numpenalties,numrifts,numriftsegments;
 	IssmDouble *riftinfo       = NULL;
-	IssmDouble *nodeonbed      = NULL;
-	IssmDouble *nodeonFS   = NULL;
-	IssmDouble *nodeonicesheet = NULL;
-	IssmDouble *vertices_type  = NULL;
 	IssmDouble *penalties      = NULL;
 	int         assert_int;
Index: /issm/trunk-jpl/src/c/modules/ModelProcessorx/StressbalanceSIA/CreateConstraintsStressbalanceSIA.cpp
===================================================================
--- /issm/trunk-jpl/src/c/modules/ModelProcessorx/StressbalanceSIA/CreateConstraintsStressbalanceSIA.cpp	(revision 16163)
+++ /issm/trunk-jpl/src/c/modules/ModelProcessorx/StressbalanceSIA/CreateConstraintsStressbalanceSIA.cpp	(revision 16164)
@@ -17,5 +17,4 @@
 	/*Output*/
 	Constraints* constraints = NULL;
-	SpcStatic*    spcstatic  = NULL;
 
 	/*Recover pointer: */
Index: /issm/trunk-jpl/src/c/modules/NodalValuex/NodalValuex.cpp
===================================================================
--- /issm/trunk-jpl/src/c/modules/NodalValuex/NodalValuex.cpp	(revision 16163)
+++ /issm/trunk-jpl/src/c/modules/NodalValuex/NodalValuex.cpp	(revision 16164)
@@ -10,15 +10,7 @@
 void NodalValuex( IssmDouble* pnodalvalue, int natureofdataenum,Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters){
 
-	int my_rank;
-	int i;
-	int index;
-	Element* element=NULL;
 	IssmDouble value;
-	int found;
-	int sumfound;
-	int cpu_found;
-
-	/*Get my_rank:*/
-	my_rank=IssmComm::GetRank();
+	int        index;
+	int        found,sumfound,cpu_found;
 
 	/*retrieve element we are interested in: */
@@ -27,9 +19,9 @@
 	/*This is the vertex id for which we want to collect the data. Go through elements, and for each 
 	 *element, figure out  if they hold the vertex, and the data. If so, return it: */
-	for(i=0;i<elements->Size();i++){
+	for(int i=0;i<elements->Size();i++){
 		Element* element=dynamic_cast<Element*>(elements->GetObjectByOffset(i));
 		found=element->NodalValue(&value,index,natureofdataenum);
-		if (found){
-			cpu_found=my_rank;
+		if(found){
+			cpu_found=IssmComm::GetRank();
 			break;
 		}
@@ -37,5 +29,5 @@
 
 	/*Broadcast whether we found the element: */
-	ISSM_MPI_Allreduce ( &found,&sumfound,1,ISSM_MPI_INT,ISSM_MPI_SUM,IssmComm::GetComm());
+	ISSM_MPI_Allreduce(&found,&sumfound,1,ISSM_MPI_INT,ISSM_MPI_SUM,IssmComm::GetComm());
 	if(!sumfound)_error_("could not find element with vertex with id" << index << " to compute nodal value " << EnumToStringx(natureofdataenum));
 
Index: /issm/trunk-jpl/src/c/modules/PointCloudFindNeighborsx/PointCloudFindNeighborsx.cpp
===================================================================
--- /issm/trunk-jpl/src/c/modules/PointCloudFindNeighborsx/PointCloudFindNeighborsx.cpp	(revision 16163)
+++ /issm/trunk-jpl/src/c/modules/PointCloudFindNeighborsx/PointCloudFindNeighborsx.cpp	(revision 16164)
@@ -12,8 +12,9 @@
 	/*threading: */
 	PointCloudFindNeighborsThreadStruct gate;
-	int num=1;
 
 	#ifdef _MULTITHREADING_
-	num=_NUMTHREADS_;
+	int num=_NUMTHREADS_;
+	#else
+	int num=1;
 	#endif
 
Index: /issm/trunk-jpl/src/c/shared/Elements/ComputeDelta18oTemperaturePrecipitation.cpp
===================================================================
--- /issm/trunk-jpl/src/c/shared/Elements/ComputeDelta18oTemperaturePrecipitation.cpp	(revision 16163)
+++ /issm/trunk-jpl/src/c/shared/Elements/ComputeDelta18oTemperaturePrecipitation.cpp	(revision 16164)
@@ -16,11 +16,10 @@
   IssmDouble delta18oLapseRate=-6.2*pow(10.,-3);
   IssmDouble glacialindex; // used to vary present day temperature
-  int imonth=0;
 
-  glacialindex = 0;//(Delta18oTime-Delta18oPresent-delta18oLapseRate*(Delta18oSurfaceTime-Delta18oSurfacePresent))
+  glacialindex = 0.;//(Delta18oTime-Delta18oPresent-delta18oLapseRate*(Delta18oSurfaceTime-Delta18oSurfacePresent))
   //  /(Delta18oLgm-Delta18oPresent-delta18oLapseRate*(Delta18oSurfaceLgm-Delta18oSurfacePresent));
 
   for (int imonth = 0; imonth<12; imonth++){  
-    monthlytemperaturestmp[imonth] = glacialindex*TemperaturesLgm[imonth] + (1-glacialindex)*TemperaturesPresentday[imonth];
+    monthlytemperaturestmp[imonth] = glacialindex*TemperaturesLgm[imonth] + (1.-glacialindex)*TemperaturesPresentday[imonth];
     //monthlyprectmp[imonth] = 1.5*pow(2,((monthlytemperaturestmp[imonth]-273.15-0)/10)); //equation from rob's paper
     monthlyprectmp[imonth] = PrecipitationsPresentday[imonth];
