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;iAddTimeInput(newmonthinput1,time+imonth/12.*yts); - for(i=0;iAddTimeInput(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;ivAddTimeInput(newmonthinput1,imonth/12.*yts); - PentaP1Input* newmonthinput2 = new PentaP1Input(SurfaceforcingsPrecipitationEnum,&monthlyprec[iv][imonth]); - NewPrecipitationInput->AddTimeInput(newmonthinput2,imonth/12.*yts); - } + for(i=0;iAddTimeInput(newmonthinput1,time+imonth/12.*yts); + + for(i=0;iAddTimeInput(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; }