Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Tria.cpp
===================================================================
--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Tria.cpp	(revision 12884)
+++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Tria.cpp	(revision 12885)
@@ -914,7 +914,7 @@
 	IssmDouble monthlytemperatures[NUMVERTICES][12],monthlyprec[NUMVERTICES][12];
 	IssmDouble TemperaturesPresentday[NUMVERTICES][12],TemperaturesLgm[NUMVERTICES][12];
 	IssmDouble PrecipitationsPresentday[NUMVERTICES][12];
-	IssmDouble temp[NUMVERTICES];
+	IssmDouble tmp[NUMVERTICES];
 	IssmDouble Delta18oPresent,Delta18oLgm,Delta18oTime;
 	IssmDouble Delta18oSurfacePresent,Delta18oSurfaceLgm,Delta18oSurfaceTime;
 	IssmDouble time,yts,finaltime;
@@ -960,14 +960,15 @@
 	TransientInput* NewTemperatureInput = new TransientInput(SurfaceforcingsMonthlytemperaturesEnum);
 	TransientInput* NewPrecipitationInput = new TransientInput(SurfaceforcingsPrecipitationEnum);
 	for (int imonth=0;imonth<12;imonth++) {
-		for(i=0;i<NUMVERTICES;i++) temp[i]=TemperaturesPresentday[i][imonth];
-		TriaP1Input* newmonthinput1 = new TriaP1Input(SurfaceforcingsMonthlytemperaturesEnum,&temp[0]);
-		//TriaP1Input* newmonthinput1 = new TriaP1Input(SurfaceforcingsMonthlytemperaturesEnum,&monthlytemperatures[0][imonth]);
+		for(i=0;i<NUMVERTICES;i++) tmp[i]=monthlytemperatures[i][imonth];
+		TriaP1Input* newmonthinput1 = new TriaP1Input(SurfaceforcingsMonthlytemperaturesEnum,&tmp[0]);
 		NewTemperatureInput->AddTimeInput(newmonthinput1,time+imonth/12.*yts);
-		for(i=0;i<NUMVERTICES;i++) temp[i]=monthlyprec[i][imonth];
-		TriaP1Input* newmonthinput2 = new TriaP1Input(SurfaceforcingsPrecipitationEnum,&temp[0]);
+
+		for(i=0;i<NUMVERTICES;i++) tmp[i]=monthlyprec[i][imonth];
+		TriaP1Input* newmonthinput2 = new TriaP1Input(SurfaceforcingsPrecipitationEnum,&tmp[0]);
 		NewPrecipitationInput->AddTimeInput(newmonthinput2,time+imonth/12.*yts);
 	}
+
 	this->inputs->AddInput(NewTemperatureInput);
 	this->inputs->AddInput(NewPrecipitationInput);
 
Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Penta.cpp
===================================================================
--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Penta.cpp	(revision 12884)
+++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/classes/objects/Elements/Penta.cpp	(revision 12885)
@@ -686,10 +686,14 @@
 /*}}}*/
 /*FUNCTION Penta::Delta18oParameterization{{{*/
 void  Penta::Delta18oParameterization(void){
+        /*Are we on the base? If not, return*/
+        if(!IsOnBed()) return;
 
+	int        i;
 	IssmDouble monthlytemperatures[NUMVERTICES][12],monthlyprec[NUMVERTICES][12];
 	IssmDouble TemperaturesPresentday[NUMVERTICES][12],TemperaturesLgm[NUMVERTICES][12];
 	IssmDouble PrecipitationsPresentday[NUMVERTICES][12];
+	IssmDouble tmp[NUMVERTICES];
 	IssmDouble Delta18oPresent,Delta18oLgm,Delta18oTime;
 	IssmDouble Delta18oSurfacePresent,Delta18oSurfaceLgm,Delta18oSurfaceTime;
 	IssmDouble time,yts,finaltime;
@@ -698,8 +702,8 @@
 	this->parameters->FindParam(&finaltime,TimesteppingFinalTimeEnum);
 
 	/*Recover present day temperature and precipitation*/
-	Input*     input=inputs->GetInput(SurfaceforcingsTemperaturesPresentdayEnum); _assert_(input);
-	Input*     input2=inputs->GetInput(SurfaceforcingsTemperaturesLgmEnum); _assert_(input2);
+	Input*     input=inputs->GetInput(SurfaceforcingsTemperaturesPresentdayEnum);    _assert_(input);
+	Input*     input2=inputs->GetInput(SurfaceforcingsTemperaturesLgmEnum);          _assert_(input2);
 	Input*     input3=inputs->GetInput(SurfaceforcingsPrecipitationsPresentdayEnum); _assert_(input3);
 	GaussPenta* gauss=new GaussPenta();
 	for(int month=0;month<12;month++) {
@@ -713,12 +717,12 @@
 	}
 
 	/*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);
-	this->parameters->FindParam(&Delta18oTime,SurfaceforcingsDelta18oEnum,time*yts);
-	this->parameters->FindParam(&Delta18oSurfacePresent,SurfaceforcingsDelta18oSurfaceEnum,finaltime*yts);
-	this->parameters->FindParam(&Delta18oSurfaceLgm,SurfaceforcingsDelta18oSurfaceEnum,(finaltime-21000)*yts);
-	this->parameters->FindParam(&Delta18oSurfaceTime,SurfaceforcingsDelta18oSurfaceEnum,time*yts);
+	this->parameters->FindParam(&Delta18oPresent,SurfaceforcingsDelta18oEnum,finaltime);
+	this->parameters->FindParam(&Delta18oLgm,SurfaceforcingsDelta18oEnum,finaltime-(21000*yts));
+	this->parameters->FindParam(&Delta18oTime,SurfaceforcingsDelta18oEnum,time);
+	this->parameters->FindParam(&Delta18oSurfacePresent,SurfaceforcingsDelta18oSurfaceEnum,finaltime);
+	this->parameters->FindParam(&Delta18oSurfaceLgm,SurfaceforcingsDelta18oSurfaceEnum,finaltime-(21000*yts));
+	this->parameters->FindParam(&Delta18oSurfaceTime,SurfaceforcingsDelta18oSurfaceEnum,time);
 
 	/*Compute the temperature and precipitation*/
 	for(int iv=0;iv<NUMVERTICES;iv++){
@@ -733,16 +737,21 @@
 	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(i=0;i<NUMVERTICES;i++) tmp[i]=monthlytemperatures[i][imonth];
+		PentaP1Input* newmonthinput1 = new PentaP1Input(SurfaceforcingsMonthlytemperaturesEnum,&tmp[0]);
+		NewTemperatureInput->AddTimeInput(newmonthinput1,time+imonth/12.*yts);
+
+		for(i=0;i<NUMVERTICES;i++) tmp[i]=monthlyprec[i][imonth];
+		PentaP1Input* newmonthinput2 = new PentaP1Input(SurfaceforcingsPrecipitationEnum,&tmp[0]);
+		NewPrecipitationInput->AddTimeInput(newmonthinput2,time+imonth/12.*yts);
 	}
+
 	this->inputs->AddInput(NewTemperatureInput);
 	this->inputs->AddInput(NewPrecipitationInput);
 
+	this->InputExtrude(SurfaceforcingsMonthlytemperaturesEnum,ElementEnum);
+	this->InputExtrude(SurfaceforcingsPrecipitationEnum,ElementEnum);
+
 	/*clean-up*/
 	delete gauss;
 }
