Index: /issm/trunk-jpl/src/c/classes/Elements/Element.cpp
===================================================================
--- /issm/trunk-jpl/src/c/classes/Elements/Element.cpp	(revision 24352)
+++ /issm/trunk-jpl/src/c/classes/Elements/Element.cpp	(revision 24353)
@@ -3742,13 +3742,14 @@
 	Input2 *Tz_input            = this->GetInput2(SmbTzEnum);           _assert_(Tz_input);
 	Input2 *Vz_input            = this->GetInput2(SmbVzEnum);           _assert_(Vz_input);
-	Input *Ta_input            = this->GetInput(SmbTaEnum);            _assert_(Ta_input);
-	Input  *V_input             = this->GetInput(SmbVEnum);             _assert_(V_input);
-	Input  *Dlwr_input          = this->GetInput(SmbDlwrfEnum);         _assert_(Dlwr_input);
-	Input  *Dswr_input          = this->GetInput(SmbDswrfEnum);         _assert_(Dswr_input);
-	Input  *P_input             = this->GetInput(SmbPEnum);             _assert_(P_input);
-	Input  *eAir_input          = this->GetInput(SmbEAirEnum);          _assert_(eAir_input);
-	Input  *pAir_input          = this->GetInput(SmbPAirEnum);          _assert_(pAir_input);
 	Input2 *teValue_input       = this->GetInput2(SmbTeValueEnum);      _assert_(teValue_input);
 	Input2 *aValue_input        = this->GetInput2(SmbAValueEnum);       _assert_(aValue_input);
+
+	TransientInput2 *Ta_input   = this->inputs2->GetTransientInput(SmbTaEnum);    _assert_(Ta_input);
+	TransientInput2 *V_input    = this->inputs2->GetTransientInput(SmbVEnum);     _assert_(V_input);
+	TransientInput2 *Dlwr_input = this->inputs2->GetTransientInput(SmbDlwrfEnum); _assert_(Dlwr_input);
+	TransientInput2 *Dswr_input = this->inputs2->GetTransientInput(SmbDswrfEnum); _assert_(Dswr_input);
+	TransientInput2 *P_input    = this->inputs2->GetTransientInput(SmbPEnum);     _assert_(P_input);
+	TransientInput2 *eAir_input = this->inputs2->GetTransientInput(SmbEAirEnum);  _assert_(eAir_input);
+	TransientInput2 *pAir_input = this->inputs2->GetTransientInput(SmbPAirEnum);  _assert_(pAir_input);
 
 	/*Retrieve input values:*/
@@ -3882,7 +3883,7 @@
 	if (isclimatology){
 		//If this is a climatology, we need to repeat the forcing after the final time
-		offsetend=dynamic_cast<TransientInput*>(Ta_input)->GetTimeInputOffset(finaltime);
-		time0=dynamic_cast<TransientInput*>(Ta_input)->GetTimeByOffset(-1);
-		timeend=dynamic_cast<TransientInput*>(Ta_input)->GetTimeByOffset(offsetend);
+		offsetend = Ta_input->GetTimeInputOffset(finaltime);
+		time0     = Ta_input->GetTimeByOffset(-1);
+		timeend   = Ta_input->GetTimeByOffset(offsetend);
 		if (time>time0 & timeend>time0){
 			delta=(time-time0) - (timeend-time0)*(reCast<int,IssmDouble>((time-time0)/(timeend-time0)));
@@ -3897,12 +3898,20 @@
 		if(VerboseSmb() && this->Sid()==0 && IssmComm::GetRank()==0)_printf0_("Time: t=" << setprecision(8) << t/365.0/24.0/3600.0 << " yr/" << (time+dt)/365.0/24.0/3600.0 << " yr" << setprecision(3) << " Step: " << count << "\n");
 
+		Input2* Ta_input2  = this->GetInput2(SmbTaEnum,t-time+timeclim);    _assert_(Ta_input2);
+		Input2 *V_input2   = this->GetInput2(SmbVEnum,t-time+timeclim);     _assert_(V_input);
+		Input2 *Dlwr_input2= this->GetInput2(SmbDlwrfEnum,t-time+timeclim); _assert_(Dlwr_input);
+		Input2 *Dswr_input2= this->GetInput2(SmbDswrfEnum,t-time+timeclim); _assert_(Dswr_input);
+		Input2 *P_input2   = this->GetInput2(SmbPEnum,t-time+timeclim);     _assert_(P_input);
+		Input2 *eAir_input2= this->GetInput2(SmbEAirEnum,t-time+timeclim);  _assert_(eAir_input);
+		Input2 *pAir_input2= this->GetInput2(SmbPAirEnum,t-time+timeclim);  _assert_(pAir_input);
+
 		/*extract daily data:{{{*/
-		Ta_input->GetInputValue(&Ta,gauss,t-time+timeclim);//screen level air temperature [K]
-		V_input->GetInputValue(&V,gauss,t-time+timeclim);  //wind speed [m s-1]
-		Dlwr_input->GetInputValue(&dlw,gauss,t-time+timeclim);   //downward longwave radiation flux [W m-2]
-		Dswr_input->GetInputValue(&dsw,gauss,t-time+timeclim);   //downward shortwave radiation flux [W m-2]
-		P_input->GetInputValue(&P,gauss,t-time+timeclim);        //precipitation [kg m-2]
-		eAir_input->GetInputValue(&eAir,gauss,t-time+timeclim);  //screen level vapor pressure [Pa]
-		pAir_input->GetInputValue(&pAir,gauss,t-time+timeclim);  // screen level air pressure [Pa]
+		Ta_input2->GetInputValue(&Ta,gauss);//screen level air temperature [K]
+		V_input->GetInputValue(&V,gauss);  //wind speed [m s-1]
+		Dlwr_input->GetInputValue(&dlw,gauss);   //downward longwave radiation flux [W m-2]
+		Dswr_input->GetInputValue(&dsw,gauss);   //downward shortwave radiation flux [W m-2]
+		P_input->GetInputValue(&P,gauss);        //precipitation [kg m-2]
+		eAir_input->GetInputValue(&eAir,gauss);  //screen level vapor pressure [Pa]
+		pAir_input->GetInputValue(&pAir,gauss);  // screen level air pressure [Pa]
 		teValue_input->GetInputValue(&teValue,gauss);  // Emissivity [0-1]
 		aValue_input->GetInputValue(&aValue,gauss);  // screen level air pressure [Pa]
@@ -4021,16 +4030,16 @@
 	this->AddInput(new DoubleArrayInput(SmbWEnum,W,m));
 	this->AddInput(new DoubleArrayInput(SmbAEnum,a,m));
-	this->AddInput(new DoubleInput(SmbMassBalanceEnum,(sumP + sumEC -sumR)/dt/rho_ice));
-	this->AddInput(new DoubleInput(SmbMeltEnum,sumM/dt/rho_ice));
-	this->AddInput(new DoubleInput(SmbRunoffEnum,sumR/dt/rho_ice));
-	this->AddInput(new DoubleInput(SmbPrecipitationEnum,sumP/dt/rho_ice));
-	this->AddInput(new DoubleInput(SmbMeanULWEnum,meanULW));
-	this->AddInput(new DoubleInput(SmbNetLWEnum,netLW));
-	this->AddInput(new DoubleInput(SmbNetSWEnum,netSW));
-	this->AddInput(new DoubleInput(SmbMeanLHFEnum,meanLHF));
-	this->AddInput(new DoubleInput(SmbMeanSHFEnum,meanSHF));
-	this->AddInput(new DoubleInput(SmbDzAddEnum,sumdz_add));
-	this->AddInput(new DoubleInput(SmbMAddEnum,sumMassAdd/dt));
-	this->AddInput(new DoubleInput(SmbFACEnum,fac/1000)); // output in meters
+	this->SetElementInput(SmbMassBalanceEnum,(sumP + sumEC -sumR)/dt/rho_ice);
+	this->SetElementInput(SmbMeltEnum,sumM/dt/rho_ice);
+	this->SetElementInput(SmbRunoffEnum,sumR/dt/rho_ice);
+	this->SetElementInput(SmbPrecipitationEnum,sumP/dt/rho_ice);
+	this->SetElementInput(SmbMeanULWEnum,meanULW);
+	this->SetElementInput(SmbNetLWEnum,netLW);
+	this->SetElementInput(SmbNetSWEnum,netSW);
+	this->SetElementInput(SmbMeanLHFEnum,meanLHF);
+	this->SetElementInput(SmbMeanSHFEnum,meanSHF);
+	this->SetElementInput(SmbDzAddEnum,sumdz_add);
+	this->SetElementInput(SmbMAddEnum,sumMassAdd/dt);
+	this->SetElementInput(SmbFACEnum,fac/1000.); // output in meters
 
 	/*Free allocations:{{{*/
