Changeset 22853
- Timestamp:
- 06/20/18 16:29:57 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/classes/Elements/Element.cpp
r22852 r22853 540 540 IssmDouble Delta18oTime; 541 541 IssmDouble dpermil,f; 542 IssmDouble time,yts,time_yr,month,time_clim ;542 IssmDouble time,yts,time_yr,month,time_clim,time_climt,time_climp; 543 543 bool isTemperatureScaled=true; 544 544 bool isPrecipScaled=true; … … 548 548 time_yr=floor(time/yts)*yts; 549 549 time_clim=time_yr; 550 time_climt=time_yr; 551 time_climp=time_yr; 550 552 551 553 /*Get some pdd parameters*/ … … 559 561 Input* input2=this->inputs->GetInput(SmbPrecipitationsPresentdayEnum); _assert_(input2); 560 562 Input* input3=NULL; 561 if(!isTemperatureScaled){562 input3=this->inputs->GetInput(SmbTemperaturesPresentdayEnum); _assert_(input3);563 }564 563 Input* input4=NULL; 565 if(!isPrecipScaled){566 input4=this->inputs->GetInput(SmbPrecipitationsPresentdayEnum); _assert_(input4);567 }568 564 int offset; 569 565 … … 571 567 if (fmod(offset,12.)!=1){ 572 568 time_clim=floor(dynamic_cast<TransientInput*>(input)->GetTimeByOffset(offset-fmod(offset,12.)+1)/yts)*yts; 569 } 570 571 if(!isTemperatureScaled){ 572 input3=this->inputs->GetInput(SmbTemperaturesPresentdayEnum); _assert_(input3); 573 offset=dynamic_cast<TransientInput*>(input3)->GetTimeInputOffset(time_yr); 574 if (fmod(offset,12.)!=1){ 575 time_climt=floor(dynamic_cast<TransientInput*>(input3)->GetTimeByOffset(offset-fmod(offset,12.)+1)/yts)*yts; 576 } 577 } 578 if(!isPrecipScaled){ 579 input4=this->inputs->GetInput(SmbPrecipitationsPresentdayEnum); _assert_(input4); 580 offset=dynamic_cast<TransientInput*>(input4)->GetTimeInputOffset(time_yr); 581 if (fmod(offset,12.)!=1){ 582 time_climp=floor(dynamic_cast<TransientInput*>(input4)->GetTimeByOffset(offset-fmod(offset,12.)+1)/yts)*yts; 583 } 573 584 } 574 585 … … 583 594 584 595 if(!isTemperatureScaled){ 585 input3->GetInputValue(&TemperaturesReconstructed[iv*12+month],gauss,time_clim +month/12.*yts);596 input3->GetInputValue(&TemperaturesReconstructed[iv*12+month],gauss,time_climt+month/12.*yts); 586 597 } 587 598 if(!isPrecipScaled){ 588 input4->GetInputValue(&PrecipitationsReconstructed[iv*12+month],gauss,time_clim +month/12.*yts);599 input4->GetInputValue(&PrecipitationsReconstructed[iv*12+month],gauss,time_climp+month/12.*yts); 589 600 PrecipitationsReconstructed[iv*12+month]=PrecipitationsReconstructed[iv*12+month]*yts; 590 601 }
Note:
See TracChangeset
for help on using the changeset viewer.