Index: /issm/trunk-jpl/src/c/objects/Elements/Penta.cpp
===================================================================
--- /issm/trunk-jpl/src/c/objects/Elements/Penta.cpp	(revision 12751)
+++ /issm/trunk-jpl/src/c/objects/Elements/Penta.cpp	(revision 12752)
@@ -688,30 +688,30 @@
 void  Penta::Delta18oParameterization(void){
 
-        IssmDouble monthlytemperatures[NUMVERTICES][12],monthlyprec[NUMVERTICES][12];
+	IssmDouble monthlytemperatures[NUMVERTICES][12],monthlyprec[NUMVERTICES][12];
 	IssmDouble Delta18oTemperaturesPresentday[NUMVERTICES][12],Delta18oTemperaturesLgm[NUMVERTICES][12];
 	IssmDouble PrecipitationsPresentday[NUMVERTICES][12];
 	IssmDouble Delta18oPresent,Delta18oLgm,Delta18oTime;
 	IssmDouble Delta18oSurfacePresent,Delta18oSurfaceLgm,Delta18oSurfaceTime;
-        IssmDouble time,yts,finaltime;
-        this->parameters->FindParam(&time,TimeEnum);
-        this->parameters->FindParam(&yts,ConstantsYtsEnum);
-        this->parameters->FindParam(&finaltime,TimesteppingFinalTimeEnum);
-
-        /*Recover present day temperature and precipitation*/
-        Input*     input=inputs->GetInput(SurfaceforcingsDelta18oTemperaturesPresentdayEnum); _assert_(input);
-        Input*     input2=inputs->GetInput(SurfaceforcingsDelta18oTemperaturesLgmEnum); _assert_(input2);
-        Input*     input3=inputs->GetInput(SurfaceforcingsPrecipitationsPresentdayEnum); _assert_(input3);
-        GaussPenta* gauss=new GaussPenta();
-        for(int month=0;month<12;month++) {
-          for(int iv=0;iv<NUMVERTICES;iv++) {
-        	gauss->GaussVertex(iv);
-        	input->GetInputValue(&Delta18oTemperaturesPresentday[iv][month],gauss,month/12.*yts);
-        	input2->GetInputValue(&Delta18oTemperaturesLgm[iv][month],gauss,month/12.*yts);
-        	input3->GetInputValue(&PrecipitationsPresentday[iv][month],gauss,month/12.*yts);
-        	monthlyprec[iv][month]=monthlyprec[iv][month]*yts; // convertion to m/yr
-          }
-        }
-        
-        /*Recover delta18o and Delta18oSurface at present day, lgm and at time t*/
+	IssmDouble time,yts,finaltime;
+	this->parameters->FindParam(&time,TimeEnum);
+	this->parameters->FindParam(&yts,ConstantsYtsEnum);
+	this->parameters->FindParam(&finaltime,TimesteppingFinalTimeEnum);
+
+	/*Recover present day temperature and precipitation*/
+	Input*     input=inputs->GetInput(SurfaceforcingsDelta18oTemperaturesPresentdayEnum); _assert_(input);
+	Input*     input2=inputs->GetInput(SurfaceforcingsDelta18oTemperaturesLgmEnum); _assert_(input2);
+	Input*     input3=inputs->GetInput(SurfaceforcingsPrecipitationsPresentdayEnum); _assert_(input3);
+	GaussPenta* gauss=new GaussPenta();
+	for(int month=0;month<12;month++) {
+		for(int iv=0;iv<NUMVERTICES;iv++) {
+			gauss->GaussVertex(iv);
+			input->GetInputValue(&Delta18oTemperaturesPresentday[iv][month],gauss,month/12.*yts);
+			input2->GetInputValue(&Delta18oTemperaturesLgm[iv][month],gauss,month/12.*yts);
+			input3->GetInputValue(&PrecipitationsPresentday[iv][month],gauss,month/12.*yts);
+			monthlyprec[iv][month]=monthlyprec[iv][month]*yts; // convertion to m/yr
+		}
+	}
+
+	/*Recover delta18o and Delta18oSurface at present day, lgm and at time t*/
 	this->parameters->FindParam(&Delta18oPresent,SurfaceforcingsDelta18oEnum,finaltime*yts);
 	this->parameters->FindParam(&Delta18oLgm,SurfaceforcingsDelta18oEnum,(finaltime-21000)*yts);
@@ -721,26 +721,29 @@
 	this->parameters->FindParam(&Delta18oSurfaceTime,SurfaceforcingsDelta18oSurfaceEnum,time*yts);
 
-        /*Compute the temperature and precipitation*/
-        for(int iv=0;iv<NUMVERTICES;iv++){
-          ComputeDelta18oTemperaturePrecipitation(Delta18oSurfacePresent, Delta18oSurfaceLgm, Delta18oSurfaceTime, 
-        				      Delta18oPresent, Delta18oLgm, Delta18oTime,
-        				      &PrecipitationsPresentday[iv][0], 
-        				      &Delta18oTemperaturesLgm[iv][0], &Delta18oTemperaturesPresentday[iv][0], 
-        				      &monthlytemperatures[iv][0], &monthlyprec[iv][0]);
-        }
-  
-        /*Update inputs*/ 
+	/*Compute the temperature and precipitation*/
+	for(int iv=0;iv<NUMVERTICES;iv++){
+		ComputeDelta18oTemperaturePrecipitation(Delta18oSurfacePresent, Delta18oSurfaceLgm, Delta18oSurfaceTime, 
+					Delta18oPresent, Delta18oLgm, Delta18oTime,
+					&PrecipitationsPresentday[iv][0], 
+					&Delta18oTemperaturesLgm[iv][0], &Delta18oTemperaturesPresentday[iv][0], 
+					&monthlytemperatures[iv][0], &monthlyprec[iv][0]);
+	}
+
+	/*Update inputs*/ 
 	TransientInput* NewTemperatureInput = new TransientInput(SurfaceforcingsMonthlytemperaturesEnum);
 	TransientInput* NewPrecipitationInput = new TransientInput(SurfaceforcingsPrecipitationEnum);
 	for (int imonth=0;imonth<12;imonth++) {
-                for(int iv=0;iv<NUMVERTICES;iv++) {
-	                PentaP1Input* newmonthinput1 = new PentaP1Input(SurfaceforcingsMonthlytemperaturesEnum,&monthlytemperatures[iv][imonth]);
-		        NewTemperatureInput->AddTimeInput(newmonthinput1,imonth/12.*yts);
-	                PentaP1Input* newmonthinput2 = new PentaP1Input(SurfaceforcingsPrecipitationEnum,&monthlyprec[iv][imonth]);
-		        NewPrecipitationInput->AddTimeInput(newmonthinput2,imonth/12.*yts);
+		for(int iv=0;iv<NUMVERTICES;iv++) {
+			PentaP1Input* newmonthinput1 = new PentaP1Input(SurfaceforcingsMonthlytemperaturesEnum,&monthlytemperatures[iv][imonth]);
+			NewTemperatureInput->AddTimeInput(newmonthinput1,imonth/12.*yts);
+			PentaP1Input* newmonthinput2 = new PentaP1Input(SurfaceforcingsPrecipitationEnum,&monthlyprec[iv][imonth]);
+			NewPrecipitationInput->AddTimeInput(newmonthinput2,imonth/12.*yts);
 		}
 	}
 	this->inputs->AddInput(NewTemperatureInput);
 	this->inputs->AddInput(NewPrecipitationInput);
+
+	/*clean-up*/
+	delete gauss;
 }
 /*}}}*/
@@ -2261,4 +2264,5 @@
 	}
 
+	delete gauss;
 	if(found)*pvalue=value;
 	return found;
@@ -2358,4 +2362,7 @@
    //this->inputs->AddInput(new PentaVertexInput(ThermalSpcTemperatureEnum,&Tsurf[0]));
    this->InputExtrude(SurfaceforcingsMassBalanceEnum,ElementEnum);
+
+	/*clean-up*/
+	delete gauss;
 }
 /*}}}*/
Index: /issm/trunk-jpl/src/c/objects/Elements/Tria.cpp
===================================================================
--- /issm/trunk-jpl/src/c/objects/Elements/Tria.cpp	(revision 12751)
+++ /issm/trunk-jpl/src/c/objects/Elements/Tria.cpp	(revision 12752)
@@ -911,30 +911,30 @@
 void  Tria::Delta18oParameterization(void){
 
-        IssmDouble monthlytemperatures[NUMVERTICES][12],monthlyprec[NUMVERTICES][12];
+	IssmDouble monthlytemperatures[NUMVERTICES][12],monthlyprec[NUMVERTICES][12];
 	IssmDouble Delta18oTemperaturesPresentday[NUMVERTICES][12],Delta18oTemperaturesLgm[NUMVERTICES][12];
 	IssmDouble PrecipitationsPresentday[NUMVERTICES][12];
 	IssmDouble Delta18oPresent,Delta18oLgm,Delta18oTime;
 	IssmDouble Delta18oSurfacePresent,Delta18oSurfaceLgm,Delta18oSurfaceTime;
-        IssmDouble time,yts,finaltime;
-        this->parameters->FindParam(&time,TimeEnum);
-        this->parameters->FindParam(&yts,ConstantsYtsEnum);
-        this->parameters->FindParam(&finaltime,TimesteppingFinalTimeEnum);
-
-        /*Recover present day temperature and precipitation*/
-        Input*     input=inputs->GetInput(SurfaceforcingsDelta18oTemperaturesPresentdayEnum); _assert_(input);
-        Input*     input2=inputs->GetInput(SurfaceforcingsDelta18oTemperaturesLgmEnum); _assert_(input2);
-        Input*     input3=inputs->GetInput(SurfaceforcingsPrecipitationsPresentdayEnum); _assert_(input3);
-        GaussTria* gauss=new GaussTria();
-        for(int month=0;month<12;month++) {
-                for(int iv=0;iv<NUMVERTICES;iv++) {
-                	gauss->GaussVertex(iv);
-                	input->GetInputValue(&Delta18oTemperaturesPresentday[iv][month],gauss,month/12.*yts);
-                	input2->GetInputValue(&Delta18oTemperaturesLgm[iv][month],gauss,month/12.*yts);
-                	input3->GetInputValue(&PrecipitationsPresentday[iv][month],gauss,month/12.*yts);
-                	monthlyprec[iv][month]=monthlyprec[iv][month]*yts; // convertion to m/yr
-                }
-        }
-
-        /*Recover delta18o and Delta18oSurface at present day, lgm and at time t*/
+	IssmDouble time,yts,finaltime;
+	this->parameters->FindParam(&time,TimeEnum);
+	this->parameters->FindParam(&yts,ConstantsYtsEnum);
+	this->parameters->FindParam(&finaltime,TimesteppingFinalTimeEnum);
+
+	/*Recover present day temperature and precipitation*/
+	Input*     input=inputs->GetInput(SurfaceforcingsDelta18oTemperaturesPresentdayEnum); _assert_(input);
+	Input*     input2=inputs->GetInput(SurfaceforcingsDelta18oTemperaturesLgmEnum); _assert_(input2);
+	Input*     input3=inputs->GetInput(SurfaceforcingsPrecipitationsPresentdayEnum); _assert_(input3);
+	GaussTria* gauss=new GaussTria();
+	for(int month=0;month<12;month++) {
+		for(int iv=0;iv<NUMVERTICES;iv++) {
+			gauss->GaussVertex(iv);
+			input->GetInputValue(&Delta18oTemperaturesPresentday[iv][month],gauss,month/12.*yts);
+			input2->GetInputValue(&Delta18oTemperaturesLgm[iv][month],gauss,month/12.*yts);
+			input3->GetInputValue(&PrecipitationsPresentday[iv][month],gauss,month/12.*yts);
+			monthlyprec[iv][month]=monthlyprec[iv][month]*yts; // convertion to m/yr
+		}
+	}
+
+	/*Recover delta18o and Delta18oSurface at present day, lgm and at time t*/
 	this->parameters->FindParam(&Delta18oPresent,SurfaceforcingsDelta18oEnum,finaltime*yts);
 	this->parameters->FindParam(&Delta18oLgm,SurfaceforcingsDelta18oEnum,(finaltime-21000)*yts);
@@ -943,27 +943,30 @@
 	this->parameters->FindParam(&Delta18oSurfaceLgm,SurfaceforcingsDelta18oSurfaceEnum,(finaltime-21000)*yts);
 	this->parameters->FindParam(&Delta18oSurfaceTime,SurfaceforcingsDelta18oSurfaceEnum,time*yts);
-   
-        /*Compute the temperature and precipitation*/
-        for(int iv=0;iv<NUMVERTICES;iv++){
-          ComputeDelta18oTemperaturePrecipitation(Delta18oSurfacePresent, Delta18oSurfaceLgm, Delta18oSurfaceTime, 
-        				      Delta18oPresent, Delta18oLgm, Delta18oTime,
-        				      &PrecipitationsPresentday[iv][0], 
-        				      &Delta18oTemperaturesLgm[iv][0], &Delta18oTemperaturesPresentday[iv][0], 
-        				      &monthlytemperatures[iv][0], &monthlyprec[iv][0]);
-        }
-  
-        /*Update inputs*/ 
+
+	/*Compute the temperature and precipitation*/
+	for(int iv=0;iv<NUMVERTICES;iv++){
+		ComputeDelta18oTemperaturePrecipitation(Delta18oSurfacePresent, Delta18oSurfaceLgm, Delta18oSurfaceTime, 
+					Delta18oPresent, Delta18oLgm, Delta18oTime,
+					&PrecipitationsPresentday[iv][0], 
+					&Delta18oTemperaturesLgm[iv][0], &Delta18oTemperaturesPresentday[iv][0], 
+					&monthlytemperatures[iv][0], &monthlyprec[iv][0]);
+	}
+
+	/*Update inputs*/ 
 	TransientInput* NewTemperatureInput = new TransientInput(SurfaceforcingsMonthlytemperaturesEnum);
 	TransientInput* NewPrecipitationInput = new TransientInput(SurfaceforcingsPrecipitationEnum);
 	for (int imonth=0;imonth<12;imonth++) {
-                for(int iv=0;iv<NUMVERTICES;iv++) {
-	                TriaP1Input* newmonthinput1 = new TriaP1Input(SurfaceforcingsMonthlytemperaturesEnum,&monthlytemperatures[iv][imonth]);
-		        NewTemperatureInput->AddTimeInput(newmonthinput1,imonth/12.*yts);
-	                TriaP1Input* newmonthinput2 = new TriaP1Input(SurfaceforcingsPrecipitationEnum,&monthlyprec[iv][imonth]);
-		        NewPrecipitationInput->AddTimeInput(newmonthinput2,imonth/12.*yts);
+		for(int iv=0;iv<NUMVERTICES;iv++) {
+			TriaP1Input* newmonthinput1 = new TriaP1Input(SurfaceforcingsMonthlytemperaturesEnum,&monthlytemperatures[iv][imonth]);
+			NewTemperatureInput->AddTimeInput(newmonthinput1,imonth/12.*yts);
+			TriaP1Input* newmonthinput2 = new TriaP1Input(SurfaceforcingsPrecipitationEnum,&monthlyprec[iv][imonth]);
+			NewPrecipitationInput->AddTimeInput(newmonthinput2,imonth/12.*yts);
 		}
 	}
 	this->inputs->AddInput(NewTemperatureInput);
 	this->inputs->AddInput(NewPrecipitationInput);
+
+	/*clean-up*/
+	delete gauss;
 }
 /*}}}*/
@@ -2039,9 +2042,8 @@
 int    Tria::NodalValue(IssmDouble* pvalue, int index, int natureofdataenum,bool process_units){
 
-	int i;
-	int found=0;
-	IssmDouble value;
-	Input* data=NULL;
-	GaussTria *gauss                            = NULL;
+	int         found = 0;
+	IssmDouble  value;
+	Input      *data  = NULL;
+	GaussTria  *gauss = NULL;
 
 	/*First, serarch the input: */
@@ -2050,5 +2052,5 @@
 	/*figure out if we have the vertex id: */
 	found=0;
-	for(i=0;i<NUMVERTICES;i++){
+	for(int i=0;i<NUMVERTICES;i++){
 		if(index==nodes[i]->GetVertexId()){
 			/*Do we have natureofdataenum in our inputs? :*/
@@ -2062,4 +2064,7 @@
 		}
 	}
+
+	/*clean-up*/
+	delete gauss;
 
 	if(found)*pvalue=value;
@@ -2188,4 +2193,7 @@
    this->inputs->AddInput(new TriaP1Input(SurfaceforcingsMassBalanceEnum,&agd[0]));
    // this->inputs->AddInput(new TriaVertexInput(ThermalSpcTemperatureEnum,&Tsurf[0]));
+
+	/*clean-up*/
+	delete gauss;
 }
 /*}}}*/
